@salla.sa/twilight-components 2.14.223 → 2.14.225

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 (305) hide show
  1. package/dist/cjs/{app-globals-DK9CLcS8.js → app-globals-CTD_ReSe.js} +3 -3
  2. package/dist/cjs/{app-globals-DK9CLcS8.js.map → app-globals-CTD_ReSe.js.map} +1 -1
  3. package/dist/cjs/{index-CRsfvYdD.js → index-BboPJvVk.js} +5 -5
  4. package/dist/cjs/index-BboPJvVk.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/salla-accordion-body.cjs.entry.js +1 -1
  7. package/dist/cjs/salla-accordion-head.cjs.entry.js +1 -1
  8. package/dist/cjs/salla-accordion.cjs.entry.js +1 -1
  9. package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
  10. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  11. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  39. package/dist/cjs/twilight.cjs.js +2 -2
  40. package/dist/components/index.js +3 -3
  41. package/dist/components/index.js.map +1 -1
  42. package/dist/esm/{app-globals-UWFtq1_0.js → app-globals-BpGR-kiQ.js} +3 -3
  43. package/dist/esm/{app-globals-UWFtq1_0.js.map → app-globals-BpGR-kiQ.js.map} +1 -1
  44. package/dist/esm/{index-DKSOeN-E.js → index-BuEDxKhL.js} +5 -5
  45. package/dist/esm/index-BuEDxKhL.js.map +1 -0
  46. package/dist/esm/loader.js +3 -3
  47. package/dist/esm/salla-accordion-body.entry.js +1 -1
  48. package/dist/esm/salla-accordion-head.entry.js +1 -1
  49. package/dist/esm/salla-accordion.entry.js +1 -1
  50. package/dist/esm/salla-add-product-button_51.entry.js +1 -1
  51. package/dist/esm/salla-advertisement.entry.js +1 -1
  52. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  53. package/dist/esm/salla-apps-icons.entry.js +1 -1
  54. package/dist/esm/salla-booking-field_2.entry.js +1 -1
  55. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  56. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  57. package/dist/esm/salla-contacts.entry.js +1 -1
  58. package/dist/esm/salla-filters-widget.entry.js +1 -1
  59. package/dist/esm/salla-filters.entry.js +1 -1
  60. package/dist/esm/salla-installment.entry.js +1 -1
  61. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  62. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  63. package/dist/esm/salla-metadata.entry.js +1 -1
  64. package/dist/esm/salla-notification-item.entry.js +1 -1
  65. package/dist/esm/salla-notifications.entry.js +1 -1
  66. package/dist/esm/salla-offer.entry.js +1 -1
  67. package/dist/esm/salla-order-summary.entry.js +1 -1
  68. package/dist/esm/salla-orders.entry.js +1 -1
  69. package/dist/esm/salla-payments.entry.js +1 -1
  70. package/dist/esm/salla-price-range.entry.js +1 -1
  71. package/dist/esm/salla-product-options.entry.js +1 -1
  72. package/dist/esm/salla-review-card.entry.js +1 -1
  73. package/dist/esm/salla-reviews-page.entry.js +1 -1
  74. package/dist/esm/salla-reviews.entry.js +1 -1
  75. package/dist/esm/salla-social.entry.js +1 -1
  76. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  77. package/dist/esm/salla-tooltip.entry.js +1 -1
  78. package/dist/esm/salla-verify.entry.js +1 -1
  79. package/dist/esm/salla-wallet.entry.js +1 -1
  80. package/dist/esm/twilight.js +3 -3
  81. package/dist/esm-es5/{app-globals-UWFtq1_0.js → app-globals-BpGR-kiQ.js} +2 -2
  82. package/dist/esm-es5/{app-globals-UWFtq1_0.js.map → app-globals-BpGR-kiQ.js.map} +1 -1
  83. package/dist/esm-es5/index-BuEDxKhL.js +29 -0
  84. package/dist/esm-es5/index-BuEDxKhL.js.map +1 -0
  85. package/dist/esm-es5/loader.js +1 -1
  86. package/dist/esm-es5/salla-accordion-body.entry.js +1 -1
  87. package/dist/esm-es5/salla-accordion-head.entry.js +1 -1
  88. package/dist/esm-es5/salla-accordion.entry.js +1 -1
  89. package/dist/esm-es5/salla-add-product-button_51.entry.js +1 -1
  90. package/dist/esm-es5/salla-advertisement.entry.js +1 -1
  91. package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
  92. package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
  93. package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
  94. package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
  95. package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
  96. package/dist/esm-es5/salla-contacts.entry.js +1 -1
  97. package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
  98. package/dist/esm-es5/salla-filters.entry.js +1 -1
  99. package/dist/esm-es5/salla-installment.entry.js +1 -1
  100. package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
  101. package/dist/esm-es5/salla-loyalty-program.entry.js +2 -2
  102. package/dist/esm-es5/salla-metadata.entry.js +1 -1
  103. package/dist/esm-es5/salla-notification-item.entry.js +1 -1
  104. package/dist/esm-es5/salla-notifications.entry.js +1 -1
  105. package/dist/esm-es5/salla-offer.entry.js +1 -1
  106. package/dist/esm-es5/salla-order-summary.entry.js +1 -1
  107. package/dist/esm-es5/salla-orders.entry.js +1 -1
  108. package/dist/esm-es5/salla-payments.entry.js +1 -1
  109. package/dist/esm-es5/salla-price-range.entry.js +1 -1
  110. package/dist/esm-es5/salla-product-options.entry.js +1 -1
  111. package/dist/esm-es5/salla-review-card.entry.js +1 -1
  112. package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
  113. package/dist/esm-es5/salla-reviews.entry.js +1 -1
  114. package/dist/esm-es5/salla-social.entry.js +1 -1
  115. package/dist/esm-es5/salla-tiered-offer.entry.js +1 -1
  116. package/dist/esm-es5/salla-tooltip.entry.js +1 -1
  117. package/dist/esm-es5/salla-verify.entry.js +1 -1
  118. package/dist/esm-es5/salla-wallet.entry.js +1 -1
  119. package/dist/esm-es5/twilight.js +1 -1
  120. package/dist/twilight/{p-27b89fa8.system.entry.js → p-0747bd06.system.entry.js} +2 -2
  121. package/dist/twilight/{p-5e5312db.entry.js → p-08818bf6.entry.js} +2 -2
  122. package/dist/twilight/{p-1f3d3c43.system.entry.js → p-0a7ef531.system.entry.js} +2 -2
  123. package/dist/twilight/{p-1040bec1.system.entry.js → p-1621ce48.system.entry.js} +2 -2
  124. package/dist/twilight/{p-9209109d.system.entry.js → p-1bd8a562.system.entry.js} +2 -2
  125. package/dist/twilight/{p-d36d5ea8.system.entry.js → p-1f4c5504.system.entry.js} +2 -2
  126. package/dist/twilight/{p-12553200.entry.js → p-1fa6c0ee.entry.js} +2 -2
  127. package/dist/twilight/{p-2l6RQtN6.system.js.map → p-234psyG4.system.js.map} +1 -1
  128. package/dist/twilight/{p-853687de.entry.js → p-2597d91f.entry.js} +2 -2
  129. package/dist/twilight/{p-e75ee458.system.entry.js → p-28af21d8.system.entry.js} +2 -2
  130. package/dist/twilight/{p-ecc3e797.system.entry.js → p-2c157399.system.entry.js} +2 -2
  131. package/dist/twilight/{p-a080eae5.system.entry.js → p-301356e4.system.entry.js} +2 -2
  132. package/dist/twilight/{p-3319a43c.entry.js → p-3146a7d0.entry.js} +2 -2
  133. package/dist/twilight/{p-dc35273b.system.entry.js → p-35b811d5.system.entry.js} +2 -2
  134. package/dist/twilight/{p-016cdb1f.entry.js → p-36b1f945.entry.js} +2 -2
  135. package/dist/twilight/{p-f427cd93.system.entry.js → p-3dff2f76.system.entry.js} +2 -2
  136. package/dist/twilight/{p-1fbaf4e7.entry.js → p-450e1424.entry.js} +2 -2
  137. package/dist/twilight/{p-40515252.entry.js → p-45c86f18.entry.js} +2 -2
  138. package/dist/twilight/{p-8926ef09.entry.js → p-4c418786.entry.js} +2 -2
  139. package/dist/twilight/p-4d349075.system.entry.js +5 -0
  140. package/dist/twilight/{p-33724d1b.system.entry.js → p-5841f384.system.entry.js} +2 -2
  141. package/dist/twilight/{p-c33c97a7.entry.js → p-58434030.entry.js} +2 -2
  142. package/dist/twilight/{p-b806d5db.entry.js → p-5b0cef47.entry.js} +2 -2
  143. package/dist/twilight/{p-f98e0974.entry.js → p-5b4470bf.entry.js} +2 -2
  144. package/dist/twilight/{p-d020d42a.system.entry.js → p-5c052357.system.entry.js} +2 -2
  145. package/dist/twilight/{p-9131e775.system.entry.js → p-5ed120d8.system.entry.js} +3 -3
  146. package/dist/twilight/{p-40a48703.entry.js → p-63446264.entry.js} +2 -2
  147. package/dist/twilight/{p-91c23185.system.entry.js → p-63e2d5c7.system.entry.js} +2 -2
  148. package/dist/twilight/{p-be57a879.system.entry.js → p-653e7373.system.entry.js} +2 -2
  149. package/dist/twilight/{p-90358552.system.entry.js → p-66383c6f.system.entry.js} +2 -2
  150. package/dist/twilight/{p-34ce2034.entry.js → p-67e8ce01.entry.js} +2 -2
  151. package/dist/twilight/{p-128a3f11.system.entry.js → p-7f262d03.system.entry.js} +2 -2
  152. package/dist/twilight/{p-b0657910.system.entry.js → p-7f59cd9f.system.entry.js} +2 -2
  153. package/dist/twilight/{p-a12ef008.system.entry.js → p-81ccc9b4.system.entry.js} +2 -2
  154. package/dist/twilight/{p-4273c67b.system.entry.js → p-84d97c1a.system.entry.js} +2 -2
  155. package/dist/twilight/{p-9ff129bf.system.entry.js → p-85b5bc6a.system.entry.js} +2 -2
  156. package/dist/twilight/{p-88a02a48.system.entry.js → p-874e236e.system.entry.js} +2 -2
  157. package/dist/twilight/{p-149cf4a9.system.entry.js → p-87cdfd0c.system.entry.js} +2 -2
  158. package/dist/twilight/{p-d1390ca8.system.entry.js → p-8c80c30f.system.entry.js} +2 -2
  159. package/dist/twilight/{p-e976c6ed.system.entry.js → p-8ddfc931.system.entry.js} +2 -2
  160. package/dist/twilight/{p-3b1d7f3e.entry.js → p-8f8b11d5.entry.js} +2 -2
  161. package/dist/twilight/{p-92933384.system.entry.js → p-93588cb9.system.entry.js} +2 -2
  162. package/dist/twilight/{p-75030dfc.entry.js → p-93f3da8e.entry.js} +2 -2
  163. package/dist/twilight/{p-dc86382c.system.entry.js → p-95f8ce0e.system.entry.js} +3 -3
  164. package/dist/twilight/{p-98858162.entry.js → p-9c62b55a.entry.js} +2 -2
  165. package/dist/twilight/{p-76f668c8.system.entry.js → p-9d92395a.system.entry.js} +3 -3
  166. package/dist/twilight/{p-a0e9e5a6.entry.js → p-9dc2b009.entry.js} +2 -2
  167. package/dist/twilight/{p-fa52fbb3.entry.js → p-9e8b0157.entry.js} +2 -2
  168. package/dist/twilight/{p-D7olGwdK.system.js.map → p-B7nw4ZLM.system.js.map} +1 -1
  169. package/dist/twilight/{p-DZfni_FC.system.js.map → p-B8g_PPaA.system.js.map} +1 -1
  170. package/dist/twilight/{p-QqGuofY2.system.js.map → p-BAUuwpBC.system.js.map} +1 -1
  171. package/dist/twilight/{p-C7rT-4Yq.system.js.map → p-BAlSNS7p.system.js.map} +1 -1
  172. package/dist/twilight/{p-BDwaPwi4.system.js.map → p-BBWAcIuZ.system.js.map} +1 -1
  173. package/dist/twilight/{p-DMbNSZ7O.system.js.map → p-BDEbE-jm.system.js.map} +1 -1
  174. package/dist/twilight/{p-D0nbLz7A.system.js.map → p-BH3uWoHX.system.js.map} +1 -1
  175. package/dist/twilight/{p-DMT43ZiL.system.js.map → p-BNm-GRln.system.js.map} +1 -1
  176. package/dist/twilight/{p-PRkFHrKx.system.js.map → p-B_EmtHdV.system.js.map} +1 -1
  177. package/dist/twilight/{p-B29ix0Tr.system.js.map → p-B_hCOF74.system.js.map} +1 -1
  178. package/dist/twilight/{p-DXiXh84M.system.js.map → p-BaL0Khy-.system.js.map} +1 -1
  179. package/dist/twilight/{p-DlCBDKJE.system.js.map → p-BlBBZ3CL.system.js.map} +1 -1
  180. package/dist/twilight/{p-BNrv69Dj.system.js.map → p-BmjgV4Yf.system.js.map} +1 -1
  181. package/dist/twilight/{p-BOk2zQJf.system.js.map → p-Bs55DB_F.system.js.map} +1 -1
  182. package/dist/twilight/{p-DKSOeN-E.js → p-BuEDxKhL.js} +4 -4
  183. package/dist/twilight/p-BuEDxKhL.js.map +1 -0
  184. package/dist/twilight/{p-TmR1L_Rl.system.js → p-By0rW4rq.system.js} +5 -5
  185. package/dist/twilight/p-By0rW4rq.system.js.map +1 -0
  186. package/dist/twilight/{p-CwoTCGfJ.js → p-CHv52V_M.js} +2 -2
  187. package/dist/twilight/{p-CwoTCGfJ.js.map → p-CHv52V_M.js.map} +1 -1
  188. package/dist/twilight/{p-CfEdcQh3.system.js.map → p-CrZWdz28.system.js.map} +1 -1
  189. package/dist/twilight/{p-DtnpD0es.system.js.map → p-Czhh6gjZ.system.js.map} +1 -1
  190. package/dist/twilight/{p-B2T-otdO.system.js → p-D1iGjmVx.system.js} +2 -2
  191. package/dist/twilight/{p-B2T-otdO.system.js.map → p-D1iGjmVx.system.js.map} +1 -1
  192. package/dist/twilight/{p-wVw5T7e_.system.js.map → p-D60VWJR5.system.js.map} +1 -1
  193. package/dist/twilight/{p-BD3gM3k5.system.js.map → p-D7Catdno.system.js.map} +1 -1
  194. package/dist/twilight/{p-D4SUWf2h.system.js.map → p-DDHV71gy.system.js.map} +1 -1
  195. package/dist/twilight/{p-CX04yrV7.system.js.map → p-DIwtupWl.system.js.map} +1 -1
  196. package/dist/twilight/{p-D74zxAX-.system.js.map → p-DRljzN-H.system.js.map} +1 -1
  197. package/dist/twilight/{p-9DGRmKNw.system.js.map → p-DTvwBUcM.system.js.map} +1 -1
  198. package/dist/twilight/{p-Dr2-Nt_X.system.js.map → p-DU7tMpvX.system.js.map} +1 -1
  199. package/dist/twilight/{p-B2r6BgK3.system.js.map → p-DXuq_yem.system.js.map} +1 -1
  200. package/dist/twilight/{p-Dc-eB7vE.system.js.map → p-DcqVqCF2.system.js.map} +1 -1
  201. package/dist/twilight/{p-DRJulExk.system.js.map → p-DhbfXZto.system.js.map} +1 -1
  202. package/dist/twilight/{p-C42dMIsd.system.js → p-Dm4CLY1C.system.js} +2 -2
  203. package/dist/twilight/{p-C42dMIsd.system.js.map → p-Dm4CLY1C.system.js.map} +1 -1
  204. package/dist/twilight/{p-CQlA_gP2.system.js.map → p-DpS2AZl2.system.js.map} +1 -1
  205. package/dist/twilight/{p-BpVI-6-C.system.js.map → p-DvYFUnj0.system.js.map} +1 -1
  206. package/dist/twilight/{p-PQl8TEaT.system.js.map → p-KVtMSLLa.system.js.map} +1 -1
  207. package/dist/twilight/{p-DXk6XG9J.system.js.map → p-YXLSVX9a.system.js.map} +1 -1
  208. package/dist/twilight/{p-BBFX0bS2.system.js.map → p-_mhrLpJ2.system.js.map} +1 -1
  209. package/dist/twilight/{p-dd5d372d.entry.js → p-a2935615.entry.js} +2 -2
  210. package/dist/twilight/{p-33a32879.entry.js → p-aa5a65e7.entry.js} +2 -2
  211. package/dist/twilight/{p-47a40eb4.system.entry.js → p-b25f5986.system.entry.js} +2 -2
  212. package/dist/twilight/{p-81222c06.entry.js → p-b5d9c8b5.entry.js} +2 -2
  213. package/dist/twilight/{p-8152a5ba.entry.js → p-bd43fadf.entry.js} +2 -2
  214. package/dist/twilight/{p-a92d1746.entry.js → p-c5e1d754.entry.js} +2 -2
  215. package/dist/twilight/{p-4deceef4.entry.js → p-c72bc57b.entry.js} +2 -2
  216. package/dist/twilight/{p-b52528b8.entry.js → p-c9a6cd5e.entry.js} +2 -2
  217. package/dist/twilight/{p-697af6af.entry.js → p-cb64785d.entry.js} +2 -2
  218. package/dist/twilight/{p-586bcd04.entry.js → p-cd65e281.entry.js} +2 -2
  219. package/dist/twilight/{p-210f28b2.entry.js → p-d55dc6ed.entry.js} +2 -2
  220. package/dist/twilight/{p-63e15cce.entry.js → p-d719437a.entry.js} +2 -2
  221. package/dist/twilight/{p-ec7e1c48.entry.js → p-e0208463.entry.js} +2 -2
  222. package/dist/twilight/{p-75f94c05.system.entry.js → p-e3599746.system.entry.js} +2 -2
  223. package/dist/twilight/{p-0336a961.system.entry.js → p-e42cf6fa.system.entry.js} +2 -2
  224. package/dist/twilight/{p-08937d82.entry.js → p-e80d7e2d.entry.js} +2 -2
  225. package/dist/twilight/{p-39697249.system.entry.js → p-eae01aed.system.entry.js} +2 -2
  226. package/dist/twilight/{p-DfBNwudb.system.js.map → p-fGl4YJ-E.system.js.map} +1 -1
  227. package/dist/twilight/{p-9c421136.entry.js → p-fa8949b0.entry.js} +2 -2
  228. package/dist/twilight/{p-c2d406b0.entry.js → p-fac7b966.entry.js} +2 -2
  229. package/dist/twilight/{p-DlLUUQ2C.system.js.map → p-puB6JvZi.system.js.map} +1 -1
  230. package/dist/twilight/twilight.esm.js +1 -1
  231. package/dist/twilight/twilight.js +1 -1
  232. package/package.json +5 -5
  233. package/dist/cjs/index-CRsfvYdD.js.map +0 -1
  234. package/dist/esm/index-DKSOeN-E.js.map +0 -1
  235. package/dist/esm-es5/index-DKSOeN-E.js +0 -29
  236. package/dist/esm-es5/index-DKSOeN-E.js.map +0 -1
  237. package/dist/twilight/p-DKSOeN-E.js.map +0 -1
  238. package/dist/twilight/p-TmR1L_Rl.system.js.map +0 -1
  239. package/dist/twilight/p-b2536448.system.entry.js +0 -5
  240. /package/dist/twilight/{p-27b89fa8.system.entry.js.map → p-0747bd06.system.entry.js.map} +0 -0
  241. /package/dist/twilight/{p-5e5312db.entry.js.map → p-08818bf6.entry.js.map} +0 -0
  242. /package/dist/twilight/{p-1f3d3c43.system.entry.js.map → p-0a7ef531.system.entry.js.map} +0 -0
  243. /package/dist/twilight/{p-1040bec1.system.entry.js.map → p-1621ce48.system.entry.js.map} +0 -0
  244. /package/dist/twilight/{p-9209109d.system.entry.js.map → p-1bd8a562.system.entry.js.map} +0 -0
  245. /package/dist/twilight/{p-d36d5ea8.system.entry.js.map → p-1f4c5504.system.entry.js.map} +0 -0
  246. /package/dist/twilight/{p-12553200.entry.js.map → p-1fa6c0ee.entry.js.map} +0 -0
  247. /package/dist/twilight/{p-853687de.entry.js.map → p-2597d91f.entry.js.map} +0 -0
  248. /package/dist/twilight/{p-e75ee458.system.entry.js.map → p-28af21d8.system.entry.js.map} +0 -0
  249. /package/dist/twilight/{p-ecc3e797.system.entry.js.map → p-2c157399.system.entry.js.map} +0 -0
  250. /package/dist/twilight/{p-a080eae5.system.entry.js.map → p-301356e4.system.entry.js.map} +0 -0
  251. /package/dist/twilight/{p-3319a43c.entry.js.map → p-3146a7d0.entry.js.map} +0 -0
  252. /package/dist/twilight/{p-dc35273b.system.entry.js.map → p-35b811d5.system.entry.js.map} +0 -0
  253. /package/dist/twilight/{p-016cdb1f.entry.js.map → p-36b1f945.entry.js.map} +0 -0
  254. /package/dist/twilight/{p-f427cd93.system.entry.js.map → p-3dff2f76.system.entry.js.map} +0 -0
  255. /package/dist/twilight/{p-1fbaf4e7.entry.js.map → p-450e1424.entry.js.map} +0 -0
  256. /package/dist/twilight/{p-40515252.entry.js.map → p-45c86f18.entry.js.map} +0 -0
  257. /package/dist/twilight/{p-8926ef09.entry.js.map → p-4c418786.entry.js.map} +0 -0
  258. /package/dist/twilight/{p-b2536448.system.entry.js.map → p-4d349075.system.entry.js.map} +0 -0
  259. /package/dist/twilight/{p-33724d1b.system.entry.js.map → p-5841f384.system.entry.js.map} +0 -0
  260. /package/dist/twilight/{p-c33c97a7.entry.js.map → p-58434030.entry.js.map} +0 -0
  261. /package/dist/twilight/{p-b806d5db.entry.js.map → p-5b0cef47.entry.js.map} +0 -0
  262. /package/dist/twilight/{p-f98e0974.entry.js.map → p-5b4470bf.entry.js.map} +0 -0
  263. /package/dist/twilight/{p-d020d42a.system.entry.js.map → p-5c052357.system.entry.js.map} +0 -0
  264. /package/dist/twilight/{p-9131e775.system.entry.js.map → p-5ed120d8.system.entry.js.map} +0 -0
  265. /package/dist/twilight/{p-40a48703.entry.js.map → p-63446264.entry.js.map} +0 -0
  266. /package/dist/twilight/{p-91c23185.system.entry.js.map → p-63e2d5c7.system.entry.js.map} +0 -0
  267. /package/dist/twilight/{p-be57a879.system.entry.js.map → p-653e7373.system.entry.js.map} +0 -0
  268. /package/dist/twilight/{p-90358552.system.entry.js.map → p-66383c6f.system.entry.js.map} +0 -0
  269. /package/dist/twilight/{p-34ce2034.entry.js.map → p-67e8ce01.entry.js.map} +0 -0
  270. /package/dist/twilight/{p-128a3f11.system.entry.js.map → p-7f262d03.system.entry.js.map} +0 -0
  271. /package/dist/twilight/{p-b0657910.system.entry.js.map → p-7f59cd9f.system.entry.js.map} +0 -0
  272. /package/dist/twilight/{p-a12ef008.system.entry.js.map → p-81ccc9b4.system.entry.js.map} +0 -0
  273. /package/dist/twilight/{p-4273c67b.system.entry.js.map → p-84d97c1a.system.entry.js.map} +0 -0
  274. /package/dist/twilight/{p-9ff129bf.system.entry.js.map → p-85b5bc6a.system.entry.js.map} +0 -0
  275. /package/dist/twilight/{p-88a02a48.system.entry.js.map → p-874e236e.system.entry.js.map} +0 -0
  276. /package/dist/twilight/{p-149cf4a9.system.entry.js.map → p-87cdfd0c.system.entry.js.map} +0 -0
  277. /package/dist/twilight/{p-d1390ca8.system.entry.js.map → p-8c80c30f.system.entry.js.map} +0 -0
  278. /package/dist/twilight/{p-e976c6ed.system.entry.js.map → p-8ddfc931.system.entry.js.map} +0 -0
  279. /package/dist/twilight/{p-3b1d7f3e.entry.js.map → p-8f8b11d5.entry.js.map} +0 -0
  280. /package/dist/twilight/{p-92933384.system.entry.js.map → p-93588cb9.system.entry.js.map} +0 -0
  281. /package/dist/twilight/{p-75030dfc.entry.js.map → p-93f3da8e.entry.js.map} +0 -0
  282. /package/dist/twilight/{p-dc86382c.system.entry.js.map → p-95f8ce0e.system.entry.js.map} +0 -0
  283. /package/dist/twilight/{p-98858162.entry.js.map → p-9c62b55a.entry.js.map} +0 -0
  284. /package/dist/twilight/{p-76f668c8.system.entry.js.map → p-9d92395a.system.entry.js.map} +0 -0
  285. /package/dist/twilight/{p-a0e9e5a6.entry.js.map → p-9dc2b009.entry.js.map} +0 -0
  286. /package/dist/twilight/{p-fa52fbb3.entry.js.map → p-9e8b0157.entry.js.map} +0 -0
  287. /package/dist/twilight/{p-dd5d372d.entry.js.map → p-a2935615.entry.js.map} +0 -0
  288. /package/dist/twilight/{p-33a32879.entry.js.map → p-aa5a65e7.entry.js.map} +0 -0
  289. /package/dist/twilight/{p-47a40eb4.system.entry.js.map → p-b25f5986.system.entry.js.map} +0 -0
  290. /package/dist/twilight/{p-81222c06.entry.js.map → p-b5d9c8b5.entry.js.map} +0 -0
  291. /package/dist/twilight/{p-8152a5ba.entry.js.map → p-bd43fadf.entry.js.map} +0 -0
  292. /package/dist/twilight/{p-a92d1746.entry.js.map → p-c5e1d754.entry.js.map} +0 -0
  293. /package/dist/twilight/{p-4deceef4.entry.js.map → p-c72bc57b.entry.js.map} +0 -0
  294. /package/dist/twilight/{p-b52528b8.entry.js.map → p-c9a6cd5e.entry.js.map} +0 -0
  295. /package/dist/twilight/{p-697af6af.entry.js.map → p-cb64785d.entry.js.map} +0 -0
  296. /package/dist/twilight/{p-586bcd04.entry.js.map → p-cd65e281.entry.js.map} +0 -0
  297. /package/dist/twilight/{p-210f28b2.entry.js.map → p-d55dc6ed.entry.js.map} +0 -0
  298. /package/dist/twilight/{p-63e15cce.entry.js.map → p-d719437a.entry.js.map} +0 -0
  299. /package/dist/twilight/{p-ec7e1c48.entry.js.map → p-e0208463.entry.js.map} +0 -0
  300. /package/dist/twilight/{p-75f94c05.system.entry.js.map → p-e3599746.system.entry.js.map} +0 -0
  301. /package/dist/twilight/{p-0336a961.system.entry.js.map → p-e42cf6fa.system.entry.js.map} +0 -0
  302. /package/dist/twilight/{p-08937d82.entry.js.map → p-e80d7e2d.entry.js.map} +0 -0
  303. /package/dist/twilight/{p-39697249.system.entry.js.map → p-eae01aed.system.entry.js.map} +0 -0
  304. /package/dist/twilight/{p-9c421136.entry.js.map → p-fa8949b0.entry.js.map} +0 -0
  305. /package/dist/twilight/{p-c2d406b0.entry.js.map → p-fac7b966.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"p-D7olGwdK.system.js","sources":["src/components/salla-metadata/salla-metadata.scss?tag=salla-metadata","src/components/salla-metadata/salla-metadata.tsx"],"sourcesContent":["","import { Component, Host, h, Element, Prop, State } from '@stencil/core';\nimport { Field, Specs } from './interfaces';\n\n@Component({\n tag: 'salla-metadata',\n styleUrl: 'salla-metadata.scss',\n})\nexport class SallaMetadata {\n constructor() {\n if (this.entityId) {\n try {\n this.entityId = Array.isArray(this.entityId)\n ? this.entityId\n : JSON.parse(this.entityId as string);\n return;\n } catch (e) {\n salla.log('Bad json passed via entityId prop');\n }\n }\n }\n\n @Element() host: HTMLElement;\n\n /**\n * The entity type.\n */\n @Prop() entity: string = 'product';\n\n /**\n * The id of the product/the endity to which the specs are going to be fetched for.\n */\n @Prop() entityId: number | number[] | string;\n\n @State() specs: Specs[] = [];\n @State() download: string = salla.lang.get('pages.thank_you.download');\n\n private getValue(field: Field) {\n if (field.type === 'file') {\n return `<a href=\"${field.value}\" class=\"text-primary\" target=\"_blank\"><span class=\"sicon-download\"></span> ${this.download}</a>`;\n }\n if (field.type === 'url') {\n return `<a href=\"${field.value}\" class=\"text-blue-700 underline\" target=\"_blank\">${field.value}</a>`; // classes will be moved to the utilities.json file\n }\n if (field.type === 'date') {\n const date = new Date(field.value);\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are 0-based\n const year = date.getFullYear();\n\n const formattedDate = `${day}/${month}/${year}`;\n\n return formattedDate;\n }\n return field.value;\n }\n\n async componentWillLoad() {\n await salla.onReady();\n\n if (!salla.config.get('store.features')?.includes('custom-fields')) {\n return salla.logger.error('feature custom-fields is not activated');\n }\n\n //todo:: remove `product.showNewUrls` after changing it from BE\n if (!this.entityId && (salla.url.is_page('product.single') || salla.url.is_page(\"product.showNewUrls\"))) {\n this.entityId = salla.config.get('page.id');\n }\n\n if (!this.entityId) {\n return salla.logger.error(\"can't render salla-metadata without enity-id prop!\");\n }\n\n await salla.lang.onLoaded();\n this.download = salla.lang.get('pages.thank_you.download');\n\n const response = await Salla.api.metadata.fetchValues(this.entity, this.entityId);\n this.specs = response.data[0]?.sections;\n }\n render() {\n if (!this.specs.length) {\n return;\n }\n return (\n <Host class=\"s-metadata-wrapper\">\n {this.specs.map((item: Specs) => {\n return (\n <div class=\"s-metadata-box\">\n <div class=\"s-metadata-box-header\">\n <i class=\"sicon-list\"></i>\n {item.name}\n </div>\n\n {item.fields.map((field: Field) => {\n return (\n <div class=\"s-metadata-row\">\n <p class=\"s-metadata-row-name\">{field.name}</p>\n <p class=\"s-metadata-row-value\" innerHTML={this.getValue(field) as any}></p>\n </div>\n );\n })}\n </div>\n );\n })}\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;YAAA,MAAM,gBAAgB,GAAG,EAAE;;kBCOd,aAAa,6BAAA,MAAA;YACxB,IAAA,WAAA,CAAA,OAAA,EAAA;;YAeA;;YAEG;YACK,QAAA,IAAM,CAAA,MAAA,GAAW,SAAS;YAOzB,QAAA,IAAK,CAAA,KAAA,GAAY,EAAE;oBACnB,IAAQ,CAAA,QAAA,GAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC;YAzBpE,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,YAAA,IAAI;4BACF,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ;kCACvC,IAAI,CAAC;kCACL,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAkB,CAAC;4BACvC;;wBACA,OAAO,CAAC,EAAE;YACV,gBAAA,KAAK,CAAC,GAAG,CAAC,mCAAmC,CAAC;;;YAGnD;YAiBO,IAAA,QAAQ,CAAC,KAAY,EAAA;YAC3B,QAAA,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE;wBACzB,OAAO,CAAA,SAAA,EAAY,KAAK,CAAC,KAAK,+EAA+E,IAAI,CAAC,QAAQ,CAAA,IAAA,CAAM;;YAElI,QAAA,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE;wBACxB,OAAO,CAAA,SAAA,EAAY,KAAK,CAAC,KAAK,CAAA,kDAAA,EAAqD,KAAK,CAAC,KAAK,CAAA,IAAA,CAAM,CAAC;;YAEvG,QAAA,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE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,"file":"p-B7nw4ZLM.system.js","sources":["src/components/salla-metadata/salla-metadata.scss?tag=salla-metadata","src/components/salla-metadata/salla-metadata.tsx"],"sourcesContent":["","import { Component, Host, h, Element, Prop, State } from '@stencil/core';\nimport { Field, Specs } from './interfaces';\n\n@Component({\n tag: 'salla-metadata',\n styleUrl: 'salla-metadata.scss',\n})\nexport class SallaMetadata {\n constructor() {\n if (this.entityId) {\n try {\n this.entityId = Array.isArray(this.entityId)\n ? this.entityId\n : JSON.parse(this.entityId as string);\n return;\n } catch (e) {\n salla.log('Bad json passed via entityId prop');\n }\n }\n }\n\n @Element() host: HTMLElement;\n\n /**\n * The entity type.\n */\n @Prop() entity: string = 'product';\n\n /**\n * The id of the product/the endity to which the specs are going to be fetched for.\n */\n @Prop() entityId: number | number[] | string;\n\n @State() specs: Specs[] = [];\n @State() download: string = salla.lang.get('pages.thank_you.download');\n\n private getValue(field: Field) {\n if (field.type === 'file') {\n return `<a href=\"${field.value}\" class=\"text-primary\" target=\"_blank\"><span class=\"sicon-download\"></span> ${this.download}</a>`;\n }\n if (field.type === 'url') {\n return `<a href=\"${field.value}\" class=\"text-blue-700 underline\" target=\"_blank\">${field.value}</a>`; // classes will be moved to the utilities.json file\n }\n if (field.type === 'date') {\n const date = new Date(field.value);\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are 0-based\n const year = date.getFullYear();\n\n const formattedDate = `${day}/${month}/${year}`;\n\n return formattedDate;\n }\n return field.value;\n }\n\n async componentWillLoad() {\n await salla.onReady();\n\n if (!salla.config.get('store.features')?.includes('custom-fields')) {\n return salla.logger.error('feature custom-fields is not activated');\n }\n\n //todo:: remove `product.showNewUrls` after changing it from BE\n if (!this.entityId && (salla.url.is_page('product.single') || salla.url.is_page(\"product.showNewUrls\"))) {\n this.entityId = salla.config.get('page.id');\n }\n\n if (!this.entityId) {\n return salla.logger.error(\"can't render salla-metadata without enity-id prop!\");\n }\n\n await salla.lang.onLoaded();\n this.download = salla.lang.get('pages.thank_you.download');\n\n const response = await Salla.api.metadata.fetchValues(this.entity, this.entityId);\n this.specs = response.data[0]?.sections;\n }\n render() {\n if (!this.specs.length) {\n return;\n }\n return (\n <Host class=\"s-metadata-wrapper\">\n {this.specs.map((item: Specs) => {\n return (\n <div class=\"s-metadata-box\">\n <div class=\"s-metadata-box-header\">\n <i class=\"sicon-list\"></i>\n {item.name}\n </div>\n\n {item.fields.map((field: Field) => {\n return (\n <div class=\"s-metadata-row\">\n <p class=\"s-metadata-row-name\">{field.name}</p>\n <p class=\"s-metadata-row-value\" innerHTML={this.getValue(field) as any}></p>\n </div>\n );\n })}\n </div>\n );\n })}\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;YAAA,MAAM,gBAAgB,GAAG,EAAE;;kBCOd,aAAa,6BAAA,MAAA;YACxB,IAAA,WAAA,CAAA,OAAA,EAAA;;YAeA;;YAEG;YACK,QAAA,IAAM,CAAA,MAAA,GAAW,SAAS;YAOzB,QAAA,IAAK,CAAA,KAAA,GAAY,EAAE;oBACnB,IAAQ,CAAA,QAAA,GAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC;YAzBpE,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,YAAA,IAAI;4BACF,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ;kCACvC,IAAI,CAAC;kCACL,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAkB,CAAC;4BACvC;;wBACA,OAAO,CAAC,EAAE;YACV,gBAAA,KAAK,CAAC,GAAG,CAAC,mCAAmC,CAAC;;;YAGnD;YAiBO,IAAA,QAAQ,CAAC,KAAY,EAAA;YAC3B,QAAA,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE;wBACzB,OAAO,CAAA,SAAA,EAAY,KAAK,CAAC,KAAK,+EAA+E,IAAI,CAAC,QAAQ,CAAA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AC,qBAAqB,IAAE,KAAK,CAAC,IAAI,CAAK,EAC/C,CAAA,CAAA,GAAA,EAAA,EAAG,KAAK,EAAC,sBAAsB,EAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAQ,EAAM,CAAA,CACxE;yBAET,CAAC,CACE;qBAET,CAAC,CACG;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"p-DZfni_FC.system.js","sources":["../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js","../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js","../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js","../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js","../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js","../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/throttle.js","src/Helpers/masonry-layout.ts","src/components/salla-reviews-page/salla-reviews-page.css?tag=salla-reviews-page","src/components/salla-reviews-page/salla-reviews-page.tsx"],"sourcesContent":["var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n","import throttle from \"lodash/throttle\";\n\nexport class MasonryLayout {\n\tprivate mutationObserver: MutationObserver;\n\tprivate resizeObserver: ResizeObserver;\n\n\tconstructor(private grid: Element) {\n\t\tthis.mutationObserver = new MutationObserver(this.onContainerMutation);\n\t\tthis.resizeObserver = new ResizeObserver(this.onChildrenResize);\n\n\t\tif (CSS.supports(\"grid-template-rows\", \"masonry\") === false) {\n\t\t\tthis.create();\n\t\t}\n\t}\n\n\tprivate create = () => {\n\t\tthis.mutationObserver.observe(this.grid, {\n\t\t\tchildList: true,\n\t\t});\n\n\t\tfor (const item of Array.from(this.grid.children)){\n\t\t\tthis.resizeObserver.observe(item);\n\t\t};\n\t};\n\n\tprivate onContainerMutation = (mutations: MutationRecord[]) => {\n\t\tconst removedNodes = mutations.flatMap((mutation) =>\n\t\t\tArray.from(mutation.removedNodes),\n\t\t);\n\t\tconst addedNodes = mutations.flatMap((mutation) =>\n\t\t\tArray.from(mutation.addedNodes),\n\t\t);\n\n\t\tfor (const node of removedNodes) {\n\t\t\tif (node instanceof Element) {\n\t\t\t\tthis.resizeObserver.unobserve(node);\n\t\t\t}\n\t\t}\n\n\t\tfor (const node of addedNodes) {\n\t\t\tif (node instanceof Element) {\n\t\t\t\tthis.resizeObserver.observe(node);\n\t\t\t}\n\t\t}\n\n\t\tif (removedNodes.length > 0 && addedNodes.length === 0) {\n\t\t\tthis.update();\n\t\t}\n\t};\n\n\tprivate onChildrenResize = (entries: ResizeObserverEntry[]) => {\n\t\tconst entriesToUpdate = entries.filter(\n\t\t\t(entry) => entry.target.parentElement !== null,\n\t\t);\n\n\t\tif (entriesToUpdate.length > 0) {\n\t\t\tthis.update();\n\t\t}\n\t};\n\n\tupdate = throttle(() => {\n\t\tconst computedStyle = window.getComputedStyle(this.grid);\n\n\t\tif (computedStyle.getPropertyValue(\"display\").includes(\"grid\") === false) {\n\t\t\tthis.clean();\n\t\t\treturn;\n\t\t}\n\n\t\tconst columns = parseGridTemplateColumns(this.grid);\n\n\t\tif (columns.length <= 1) {\n\t\t\tthis.clean();\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst rowGap =\n\t\t\tNumber.parseFloat(computedStyle.getPropertyValue(\"row-gap\").trim()) || 0;\n\n\t\tconst items = Array.from(this.grid.children) as HTMLElement[];\n\n\t\tfor (let columnIndex = 0; columnIndex < columns.length; columnIndex++) {\n\t\t\tconst firstItemInColumn = items[columnIndex];\n\n\t\t\tfirstItemInColumn?.style.removeProperty(\"margin-top\");\n\t\t}\n\n\t\tfor (let index = 0; index < items.length; index++) {\n\t\t\tconst prevItem = items[index - columns.length];\n\t\t\tconst nextItem = items[index];\n\n\t\t\tif (prevItem !== undefined && nextItem !== undefined) {\n\t\t\t\tconst prevBottom = prevItem.getBoundingClientRect().bottom;\n\n\t\t\t\tnextItem.style.removeProperty(\"margin-top\");\n\n\t\t\t\tconst nextTop = nextItem.getBoundingClientRect().top;\n\n\t\t\t\tif (nextTop - rowGap !== prevBottom) {\n\t\t\t\t\tconst margin =\n\t\t\t\t\t\tMath.round(\n\t\t\t\t\t\t\t(prevBottom - (nextTop - rowGap) + Number.EPSILON) * 100,\n\t\t\t\t\t\t) / 100;\n\n\t\t\t\t\tnextItem.style.setProperty(\"margin-top\", `${margin}px`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, 32);\n\n\tdestroy = () => {\n\t\tthis.resizeObserver.disconnect();\n\t\tthis.mutationObserver.disconnect();\n\t\tthis.clean();\n\t};\n\n\tprivate clean = () => {\n\t\tfor ( const item of (Array.from(this.grid.children) as HTMLElement[])){\n\t\t\titem.style.removeProperty(\"margin-top\");\n\t\t}\n\t};\n\n\t[Symbol.dispose]() {\n\t\tthis.destroy();\n\t}\n}\n\nfunction parseGridTemplateColumns(grid: Element) {\n\tconst computedStyle = window.getComputedStyle(grid);\n\n\tconst gridTemplateColumns = computedStyle.getPropertyValue(\n\t\t\"grid-template-columns\",\n\t);\n\n\treturn gridTemplateColumns\n\t\t.trim()\n\t\t.split(/\\s+(?=(?:[^()]*\\([^()]*\\))*[^()]*$)/);\n}",":host {\n display: block;\n}","import { Component, State, Element, h } from '@stencil/core';\nimport type { Review } from '../salla-review-card/interfaces';\nimport type { Pagination } from '../../interfaces/common';\nimport ShoppingBag from '../../assets/svg/shopping-bag.svg';\nimport Helper from '../../Helpers/Helper';\nimport { MasonryLayout } from '../../Helpers/masonry-layout';\n\n\n@Component({\n tag: 'salla-reviews-page',\n styleUrl: 'salla-reviews-page.css',\n})\nexport class SallaReviewsPage {\n @Element() el: HTMLElement;\n @State() reviews: Partial<Review>[] = [];\n @State() isLoading = false;\n @State() pagination: Pagination = null;\n @State() sort: \"top_rating\" | \"bottom_rating\" | \"latest\" | \"oldest\" = \"latest\";\n\n // Language variables\n private langTitlesReviews: string;\n private langRatingReviews: string;\n private langSorting: string;\n private langSortByTopRating: string;\n private langSortByMostRecent: string;\n private langSortByLeastRecent: string;\n private langSortByLeastRated: string;\n\n private langLoadMore: string;\n private placeholderText: string;\n\n private infiniteScroll: any;\n private wrapper: HTMLElement;\n\n private getUrlParams() {\n const params = new URLSearchParams(window.location.search);\n return {\n sort: params.get('sort') as typeof this.sort || null,\n page: Number.parseInt(params.get('page')) || 1\n };\n }\n\n private updateUrlParams(params: { sort?: string, page?: number }) {\n const url = new URL(window.location.href);\n for (const [key, value] of Object.entries(params)) {\n if (value) {\n url.searchParams.set(key, value.toString());\n } else {\n url.searchParams.delete(key);\n }\n };\n window.history.replaceState({}, '', url.toString());\n }\n\n private fetchReviews(sort?: typeof this.sort, page?: number) {\n const urlParams = this.getUrlParams();\n return salla.api.request('reviews', {\n params: {\n type: 'products',\n format: 'lite',\n per_page: 8,\n page: page || urlParams.page || 1,\n sort: sort || urlParams.sort || null\n }\n });\n }\n\n\n private async initializeMasonry() {\n const grid = this.el.querySelector('.s-reviews-page-grid');\n if (!grid) return;\n\n try {\n new MasonryLayout(grid);\n salla.logger.info('Masonry initialized successfully');\n } catch (error) {\n salla.logger.error('Masonry initialization failed:', error);\n }\n }\n private animateReviewCards() {\n const items = this.wrapper.querySelectorAll('salla-review-card:not(.animated)');\n Helper.animateItems(items);\n }\n\n private initiateInfiniteScroll() {\n if (!this.wrapper) {\n salla.logger.error('Wrapper is undefined. Cannot initiate infinite scroll.');\n return;\n }\n\n this.infiniteScroll = salla.infiniteScroll.initiate(this.wrapper, this.wrapper, {\n path: () => this.pagination?.links?.next || null,\n history: false,\n scrollThreshold: false,\n }, true);\n\n this.infiniteScroll?.on('request', () => {\n this.isLoading = true;\n });\n\n this.infiniteScroll?.on('load', response => {\n this.pagination = response.pagination;\n this.reviews = [...this.reviews, ...response.data]\n this.isLoading = false;\n // Update URL with the current page\n this.updateUrlParams({ page: response.pagination.current_page });\n\n });\n\n this.infiniteScroll?.on('error', (e) => {\n salla.logger.error('Error loading more reviews:', e);\n this.isLoading = false;\n });\n }\n\n\n componentDidRender() {\n setTimeout(() => {\n requestAnimationFrame(this.animateReviewCards.bind(this))\n }, 176)\n }\n\n async componentWillLoad() {\n try {\n await salla.onReady();\n\n // Initialize language variables\n this.langTitlesReviews = salla.lang.get(\"common.titles.reviews\");\n this.langSorting = salla.lang.get('pages.categories.sorting');\n this.placeholderText = salla.lang.choice(\"pages.rating.reviews\", 0)\n this.langLoadMore = salla.lang.get('common.elements.load_more');\n this.langSortByTopRating = salla.lang.get('pages.testimonials.sort_by_rating_desc');\n this.langSortByMostRecent = salla.lang.get('pages.testimonials.sort_by_date_desc');\n this.langSortByLeastRated = salla.lang.get('pages.testimonials.sort_by_rating_asc');\n this.langSortByLeastRecent = salla.lang.get('pages.testimonials.sort_by_date_asc');\n\n const urlParams = this.getUrlParams();\n const response = await this.fetchReviews(urlParams.sort);\n this.sort = urlParams.sort;\n this.reviews = response.data\n this.pagination = response.pagination;\n this.langRatingReviews = salla.lang.choice(\"pages.rating.reviews\", this.pagination?.total);\n\n\n\n } catch (error) {\n salla.logger.error('Error loading reviews:', error);\n }\n }\n\n private async handleSorting(e: Event) {\n const value = (e.target as HTMLSelectElement).value as typeof this.sort;\n this.sort = value;\n this.updateUrlParams({ sort: value, page: 1 }); // Reset to page 1 when changing sort\n const response = await this.fetchReviews(value, 1);\n this.reviews = response.data\n this.pagination = response.pagination;\n }\n\n async componentDidLoad() {\n await this.initializeMasonry();\n this.initiateInfiniteScroll();\n this.sort = this.getUrlParams().sort || \"latest\";\n this.updateUrlParams({ sort: this.sort, page: 1 });\n }\n\n disconnectedCallback() {\n if (this.infiniteScroll) {\n this.infiniteScroll.destroy();\n }\n }\n\n private renderSortingOptions() {\n const options = [\n { value: 'latest', label: this.langSortByMostRecent },\n { value: 'oldest', label: this.langSortByLeastRecent },\n { value: 'top_rating', label: this.langSortByTopRating },\n { value: 'bottom_rating', label: this.langSortByLeastRated },\n ];\n return options.map(option => (\n <option key={option.value} value={option.value} selected={option.value === this.sort}>\n {option.label}\n </option>\n ));\n }\n\n\n render() {\n return (\n <host>\n <div class=\"s-reviews-page-header-wrapper\">\n <h2 class=\"s-reviews-page-title\">{this.langTitlesReviews}<span class=\"s-reviews-page-count\">({this.langRatingReviews})</span></h2>\n <div class=\"s-reviews-page-filter-wrapper\">\n <label class=\"s-reviews-page-filter-label\"\n htmlFor=\"testimonials-filter\">{this.langSorting}</label>\n <select onChange={(e) => this.handleSorting(e)} disabled={!this.reviews.length} class=\"s-reviews-page-filter\">\n {this.renderSortingOptions()}\n </select>\n </div>\n </div>\n {this.reviews.length ? <main class=\"s-reviews-page-grid\" ref={el => {\n this.wrapper = el\n }}>\n {this.reviews.map(review => (\n <salla-review-card\n key={review.id}\n review={review}\n />\n ))}\n </main>\n : <div class=\"s-products-list-placeholder\">\n <span innerHTML={ShoppingBag} />\n <p>{this.placeholderText}</p>\n </div>\n }\n {this.pagination?.links?.next && this.reviews.length ? (\n\n <div class=\"s-reviews-page-load-more-container\">\n <salla-button class=\"s-reviews-page-load-more-btn\" loading={this.isLoading} onClick={() => this.infiniteScroll?.loadNextPage()}\n onKeyUp={() => this.infiniteScroll?.loadNextPage()}>\n {this.langLoadMore}\n </salla-button>\n </div>\n ) : null}\n </host>\n );\n }\n}"],"names":["require$$0","require$$1","require$$2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAA,IAAI,IAAI,GAAGA,YAAkB,EAAA;;MAE7B;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;OACA,IAAI,GAAG,GAAG,WAAW;MACrB,GAAE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;QACvB;;MAED,CAAA,KAAc,GAAG,GAAG;;;;;;;;;;;;OCrBpB,IAAI,YAAY,GAAG,IAAI;;MAEvB;MACA;MACA;MACA;MACA;MACA;MACA;MACA;OACA,SAAS,eAAe,CAAC,MAAM,EAAE;MACjC,GAAE,IAAI,KAAK,GAAG,MAAM,CAAC,MAAM;;MAE3B,GAAE,OAAO,KAAK,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,C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,MAAA,GAAA,EAAA,CAAE,YAAY,EAAE,CAAA,EAAA,IACjD,IAAI,CAAC,YAAY,CACL,CACX,IACJ,IAAI,CACH;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,3,4,5]}
1
+ {"version":3,"file":"p-B8g_PPaA.system.js","sources":["../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js","../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js","../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js","../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js","../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js","../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/throttle.js","src/Helpers/masonry-layout.ts","src/components/salla-reviews-page/salla-reviews-page.css?tag=salla-reviews-page","src/components/salla-reviews-page/salla-reviews-page.tsx"],"sourcesContent":["var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n","import throttle from \"lodash/throttle\";\n\nexport class MasonryLayout {\n\tprivate mutationObserver: MutationObserver;\n\tprivate resizeObserver: ResizeObserver;\n\n\tconstructor(private grid: Element) {\n\t\tthis.mutationObserver = new MutationObserver(this.onContainerMutation);\n\t\tthis.resizeObserver = new ResizeObserver(this.onChildrenResize);\n\n\t\tif (CSS.supports(\"grid-template-rows\", \"masonry\") === false) {\n\t\t\tthis.create();\n\t\t}\n\t}\n\n\tprivate create = () => {\n\t\tthis.mutationObserver.observe(this.grid, {\n\t\t\tchildList: true,\n\t\t});\n\n\t\tfor (const item of Array.from(this.grid.children)){\n\t\t\tthis.resizeObserver.observe(item);\n\t\t};\n\t};\n\n\tprivate onContainerMutation = (mutations: MutationRecord[]) => {\n\t\tconst removedNodes = mutations.flatMap((mutation) =>\n\t\t\tArray.from(mutation.removedNodes),\n\t\t);\n\t\tconst addedNodes = mutations.flatMap((mutation) =>\n\t\t\tArray.from(mutation.addedNodes),\n\t\t);\n\n\t\tfor (const node of removedNodes) {\n\t\t\tif (node instanceof Element) {\n\t\t\t\tthis.resizeObserver.unobserve(node);\n\t\t\t}\n\t\t}\n\n\t\tfor (const node of addedNodes) {\n\t\t\tif (node instanceof Element) {\n\t\t\t\tthis.resizeObserver.observe(node);\n\t\t\t}\n\t\t}\n\n\t\tif (removedNodes.length > 0 && addedNodes.length === 0) {\n\t\t\tthis.update();\n\t\t}\n\t};\n\n\tprivate onChildrenResize = (entries: ResizeObserverEntry[]) => {\n\t\tconst entriesToUpdate = entries.filter(\n\t\t\t(entry) => entry.target.parentElement !== null,\n\t\t);\n\n\t\tif (entriesToUpdate.length > 0) {\n\t\t\tthis.update();\n\t\t}\n\t};\n\n\tupdate = throttle(() => {\n\t\tconst computedStyle = window.getComputedStyle(this.grid);\n\n\t\tif (computedStyle.getPropertyValue(\"display\").includes(\"grid\") === false) {\n\t\t\tthis.clean();\n\t\t\treturn;\n\t\t}\n\n\t\tconst columns = parseGridTemplateColumns(this.grid);\n\n\t\tif (columns.length <= 1) {\n\t\t\tthis.clean();\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst rowGap =\n\t\t\tNumber.parseFloat(computedStyle.getPropertyValue(\"row-gap\").trim()) || 0;\n\n\t\tconst items = Array.from(this.grid.children) as HTMLElement[];\n\n\t\tfor (let columnIndex = 0; columnIndex < columns.length; columnIndex++) {\n\t\t\tconst firstItemInColumn = items[columnIndex];\n\n\t\t\tfirstItemInColumn?.style.removeProperty(\"margin-top\");\n\t\t}\n\n\t\tfor (let index = 0; index < items.length; index++) {\n\t\t\tconst prevItem = items[index - columns.length];\n\t\t\tconst nextItem = items[index];\n\n\t\t\tif (prevItem !== undefined && nextItem !== undefined) {\n\t\t\t\tconst prevBottom = prevItem.getBoundingClientRect().bottom;\n\n\t\t\t\tnextItem.style.removeProperty(\"margin-top\");\n\n\t\t\t\tconst nextTop = nextItem.getBoundingClientRect().top;\n\n\t\t\t\tif (nextTop - rowGap !== prevBottom) {\n\t\t\t\t\tconst margin =\n\t\t\t\t\t\tMath.round(\n\t\t\t\t\t\t\t(prevBottom - (nextTop - rowGap) + Number.EPSILON) * 100,\n\t\t\t\t\t\t) / 100;\n\n\t\t\t\t\tnextItem.style.setProperty(\"margin-top\", `${margin}px`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, 32);\n\n\tdestroy = () => {\n\t\tthis.resizeObserver.disconnect();\n\t\tthis.mutationObserver.disconnect();\n\t\tthis.clean();\n\t};\n\n\tprivate clean = () => {\n\t\tfor ( const item of (Array.from(this.grid.children) as HTMLElement[])){\n\t\t\titem.style.removeProperty(\"margin-top\");\n\t\t}\n\t};\n\n\t[Symbol.dispose]() {\n\t\tthis.destroy();\n\t}\n}\n\nfunction parseGridTemplateColumns(grid: Element) {\n\tconst computedStyle = window.getComputedStyle(grid);\n\n\tconst gridTemplateColumns = computedStyle.getPropertyValue(\n\t\t\"grid-template-columns\",\n\t);\n\n\treturn gridTemplateColumns\n\t\t.trim()\n\t\t.split(/\\s+(?=(?:[^()]*\\([^()]*\\))*[^()]*$)/);\n}",":host {\n display: block;\n}","import { Component, State, Element, h } from '@stencil/core';\nimport type { Review } from '../salla-review-card/interfaces';\nimport type { Pagination } from '../../interfaces/common';\nimport ShoppingBag from '../../assets/svg/shopping-bag.svg';\nimport Helper from '../../Helpers/Helper';\nimport { MasonryLayout } from '../../Helpers/masonry-layout';\n\n\n@Component({\n tag: 'salla-reviews-page',\n styleUrl: 'salla-reviews-page.css',\n})\nexport class SallaReviewsPage {\n @Element() el: HTMLElement;\n @State() reviews: Partial<Review>[] = [];\n @State() isLoading = false;\n @State() pagination: Pagination = null;\n @State() sort: \"top_rating\" | \"bottom_rating\" | \"latest\" | \"oldest\" = \"latest\";\n\n // Language variables\n private langTitlesReviews: string;\n private langRatingReviews: string;\n private langSorting: string;\n private langSortByTopRating: string;\n private langSortByMostRecent: string;\n private langSortByLeastRecent: string;\n private langSortByLeastRated: string;\n\n private langLoadMore: string;\n private placeholderText: string;\n\n private infiniteScroll: any;\n private wrapper: HTMLElement;\n\n private getUrlParams() {\n const params = new URLSearchParams(window.location.search);\n return {\n sort: params.get('sort') as typeof this.sort || null,\n page: Number.parseInt(params.get('page')) || 1\n };\n }\n\n private updateUrlParams(params: { sort?: string, page?: number }) {\n const url = new URL(window.location.href);\n for (const [key, value] of Object.entries(params)) {\n if (value) {\n url.searchParams.set(key, value.toString());\n } else {\n url.searchParams.delete(key);\n }\n };\n window.history.replaceState({}, '', url.toString());\n }\n\n private fetchReviews(sort?: typeof this.sort, page?: number) {\n const urlParams = this.getUrlParams();\n return salla.api.request('reviews', {\n params: {\n type: 'products',\n format: 'lite',\n per_page: 8,\n page: page || urlParams.page || 1,\n sort: sort || urlParams.sort || null\n }\n });\n }\n\n\n private async initializeMasonry() {\n const grid = this.el.querySelector('.s-reviews-page-grid');\n if (!grid) return;\n\n try {\n new MasonryLayout(grid);\n salla.logger.info('Masonry initialized successfully');\n } catch (error) {\n salla.logger.error('Masonry initialization failed:', error);\n }\n }\n private animateReviewCards() {\n const items = this.wrapper.querySelectorAll('salla-review-card:not(.animated)');\n Helper.animateItems(items);\n }\n\n private initiateInfiniteScroll() {\n if (!this.wrapper) {\n salla.logger.error('Wrapper is undefined. Cannot initiate infinite scroll.');\n return;\n }\n\n this.infiniteScroll = salla.infiniteScroll.initiate(this.wrapper, this.wrapper, {\n path: () => this.pagination?.links?.next || null,\n history: false,\n scrollThreshold: false,\n }, true);\n\n this.infiniteScroll?.on('request', () => {\n this.isLoading = true;\n });\n\n this.infiniteScroll?.on('load', response => {\n this.pagination = response.pagination;\n this.reviews = [...this.reviews, ...response.data]\n this.isLoading = false;\n // Update URL with the current page\n this.updateUrlParams({ page: response.pagination.current_page });\n\n });\n\n this.infiniteScroll?.on('error', (e) => {\n salla.logger.error('Error loading more reviews:', e);\n this.isLoading = false;\n });\n }\n\n\n componentDidRender() {\n setTimeout(() => {\n requestAnimationFrame(this.animateReviewCards.bind(this))\n }, 176)\n }\n\n async componentWillLoad() {\n try {\n await salla.onReady();\n\n // Initialize language variables\n this.langTitlesReviews = salla.lang.get(\"common.titles.reviews\");\n this.langSorting = salla.lang.get('pages.categories.sorting');\n this.placeholderText = salla.lang.choice(\"pages.rating.reviews\", 0)\n this.langLoadMore = salla.lang.get('common.elements.load_more');\n this.langSortByTopRating = salla.lang.get('pages.testimonials.sort_by_rating_desc');\n this.langSortByMostRecent = salla.lang.get('pages.testimonials.sort_by_date_desc');\n this.langSortByLeastRated = salla.lang.get('pages.testimonials.sort_by_rating_asc');\n this.langSortByLeastRecent = salla.lang.get('pages.testimonials.sort_by_date_asc');\n\n const urlParams = this.getUrlParams();\n const response = await this.fetchReviews(urlParams.sort);\n this.sort = urlParams.sort;\n this.reviews = response.data\n this.pagination = response.pagination;\n this.langRatingReviews = salla.lang.choice(\"pages.rating.reviews\", this.pagination?.total);\n\n\n\n } catch (error) {\n salla.logger.error('Error loading reviews:', error);\n }\n }\n\n private async handleSorting(e: Event) {\n const value = (e.target as HTMLSelectElement).value as typeof this.sort;\n this.sort = value;\n this.updateUrlParams({ sort: value, page: 1 }); // Reset to page 1 when changing sort\n const response = await this.fetchReviews(value, 1);\n this.reviews = response.data\n this.pagination = response.pagination;\n }\n\n async componentDidLoad() {\n await this.initializeMasonry();\n this.initiateInfiniteScroll();\n this.sort = this.getUrlParams().sort || \"latest\";\n this.updateUrlParams({ sort: this.sort, page: 1 });\n }\n\n disconnectedCallback() {\n if (this.infiniteScroll) {\n this.infiniteScroll.destroy();\n }\n }\n\n private renderSortingOptions() {\n const options = [\n { value: 'latest', label: this.langSortByMostRecent },\n { value: 'oldest', label: this.langSortByLeastRecent },\n { value: 'top_rating', label: this.langSortByTopRating },\n { value: 'bottom_rating', label: this.langSortByLeastRated },\n ];\n return options.map(option => (\n <option key={option.value} value={option.value} selected={option.value === this.sort}>\n {option.label}\n </option>\n ));\n }\n\n\n render() {\n return (\n <host>\n <div class=\"s-reviews-page-header-wrapper\">\n <h2 class=\"s-reviews-page-title\">{this.langTitlesReviews}<span class=\"s-reviews-page-count\">({this.langRatingReviews})</span></h2>\n <div class=\"s-reviews-page-filter-wrapper\">\n <label class=\"s-reviews-page-filter-label\"\n htmlFor=\"testimonials-filter\">{this.langSorting}</label>\n <select onChange={(e) => this.handleSorting(e)} disabled={!this.reviews.length} class=\"s-reviews-page-filter\">\n {this.renderSortingOptions()}\n </select>\n </div>\n </div>\n {this.reviews.length ? <main class=\"s-reviews-page-grid\" ref={el => {\n this.wrapper = el\n }}>\n {this.reviews.map(review => (\n <salla-review-card\n key={review.id}\n review={review}\n />\n ))}\n </main>\n : <div class=\"s-products-list-placeholder\">\n <span innerHTML={ShoppingBag} />\n <p>{this.placeholderText}</p>\n </div>\n }\n {this.pagination?.links?.next && this.reviews.length ? (\n\n <div class=\"s-reviews-page-load-more-container\">\n <salla-button class=\"s-reviews-page-load-more-btn\" loading={this.isLoading} onClick={() => this.infiniteScroll?.loadNextPage()}\n onKeyUp={() => this.infiniteScroll?.loadNextPage()}>\n {this.langLoadMore}\n </salla-button>\n </div>\n ) : null}\n </host>\n );\n }\n}"],"names":["require$$0","require$$1","require$$2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAA,IAAI,IAAI,GAAGA,YAAkB,EAAA;;MAE7B;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;OACA,IAAI,GAAG,GAAG,WAAW;MACrB,GAAE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;QACvB;;MAED,CAAA,KAAc,GAAG,GAAG;;;;;;;;;;;;OCrBpB,IAAI,YAAY,GAAG,IAAI;;MAEvB;MACA;MACA;MACA;MACA;MACA;MACA;MACA;OACA,SAAS,eAAe,CAAC,MAAM,EAAE;MACjC,GAAE,IAAI,KAAK,GAAG,MAAM,CAAC,MAAM;;MAE3B,GAAE,OAAO,KAAK,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;MAC7D,GAAE,OAAO,KAAK;MACd;;MAEA,CAAA,gBAAc,GAAG,eAAe;;;;;;;;;;OClBhC,I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I,CACH;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,3,4,5]}
@@ -1 +1 @@
1
- {"version":3,"file":"p-QqGuofY2.system.js","sources":["src/components/salla-conditional-offer/interfaces.ts","src/components/salla-conditional-offer/salla-conditional-offer.scss?tag=salla-conditional-offer","src/components/salla-conditional-offer/salla-conditional-offer.tsx"],"sourcesContent":["import type { Product } from \"@salla.sa/twilight/types/common\";\n\nexport enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n FREE_PRODUCT = \"free_product\",\n}\n\nexport enum OfferType {\n PRODUCT_COUNT = \"products_count\",\n PRODUCT_PURCHASE = \"order_amount\",\n}\n\nexport interface Discount {\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n max_discount?: number;\n}\n\nexport interface OfferDetails {\n based_on?: OfferType;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: OfferDetails | null;\n}\n\n\nexport interface ProductDetail {\n id?: number;\n sku?: string;\n name?: string;\n description?: string;\n url?: string;\n promotion_title?: null;\n subtitle?: null;\n type?: string;\n status?: string;\n price?: number;\n base_currency_price?: BaseCurrencyPrice;\n sale_price?: number;\n regular_price?: number;\n starting_price?: null;\n quantity?: null;\n max_quantity?: number;\n discount_ends?: null;\n is_taxable?: boolean;\n has_read_more?: boolean;\n can_add_note?: boolean;\n can_show_remained_quantity?: boolean;\n can_upload_file?: boolean;\n has_custom_form?: boolean;\n has_metadata?: boolean;\n is_on_sale?: boolean;\n is_hidden_quantity?: boolean;\n is_available?: boolean;\n is_out_of_stock?: boolean;\n is_require_shipping?: boolean;\n weight?: null;\n calories?: null;\n image?: Image;\n currency?: string;\n}\n\nexport interface BaseCurrencyPrice {\n currency?: string;\n amount?: number;\n}\n\nexport interface Image {\n url?: string;\n alt?: string;\n}\n\nexport interface UpdatedCart {\n items: Array<Product>;\n sub_total: number;\n}\n",":host {\n display: block;\n}","import { Component, Host, State, h } from \"@stencil/core\";\nimport {\n type Discount,\n DiscountType,\n type Offer,\n OfferType,\n type UpdatedCart,\n} from \"./interfaces\";\nimport type { Product } from \"@salla.sa/twilight/types/common\";\n\n@Component({\n tag: \"salla-conditional-offer\",\n styleUrl: \"salla-conditional-offer.scss\",\n})\nexport class SallaConditionalOffer {\n\n @State() offer: Offer = null;\n @State() products: Record<string, Pick<Product, 'image' | 'url'>> = {}\n @State() isLoading = false\n @State() canRender = true\n\n componentWillLoad() {\n salla.onReady().then(() => {\n if (!salla.config.get('store.features')?.includes('conditional-offer') || (salla.storage.get(\"cart\") !== '' && !salla.storage.get(\"cart\")?.summary?.count)) {\n throw new Error('feature or cart object does not existed');\n }\n })\n .then(() => salla.api.cart.offers())\n .then(({ data }: { data: Offer[] }) => {\n this.offer = data.find(offer => offer.type === \"conditional\")\n\n if (!this.offer) {\n this.canRender = false\n return;\n }\n\n this.isLoading = true\n this.offer.details.discounts.unshift(({ value: 0, min_spend: 0 }))\n return this.updateInitialOfferValue()\n }).then(() => {\n if (!this.offer) return;\n return this.getProducts()\n }).then(() => {\n if (!this.offer) return;\n salla.event.on(\"cart::updated\", (updatedCart: UpdatedCart) => this.updateOfferValues(updatedCart))\n })\n .catch(error => {\n this.canRender = false\n salla.logger.warn('salla-conditional-offer:: ', error)\n }).finally(() => {\n this.isLoading = false\n })\n\n }\n\n private getProducts() {\n const freeProductIDs = this.offer.details.discounts.filter(({ type }) => type === DiscountType.FREE_PRODUCT).map(({ value }) => value)\n if (freeProductIDs.length > 0) {\n return salla.product.fetch({ source: 'selected', source_value: freeProductIDs }).then(({ data }: { data: Array<Product> }) => {\n data.forEach(({ id, url, image }) => {\n this.products[id] = { url, image }\n })\n })\n }\n }\n\n private updateInitialOfferValue() {\n return salla.api.cart.details().then(({ data: { cart } }: { data: { cart: UpdatedCart } }) => this.updateOfferValues(cart))\n }\n\n private updateOfferValues({ items, sub_total }: UpdatedCart) {\n const current_value = this.offer.details.based_on === OfferType.PRODUCT_COUNT ? items.reduce((count: number, { quantity }) => count + quantity, 0,) : sub_total\n //we need to assign the offer object a new reference to trigger re-rendering\n this.offer = {\n ...this.offer, details: {\n ...this.offer?.details, current_value,\n }\n }\n return this.offer\n }\n\n private getCheckpointContent(discount: Discount) {\n\n if (discount.type === DiscountType.PERCENTAGE) return `${discount.value}%`\n\n if (discount.type === DiscountType.FIXED) return salla.money(discount.value)\n\n if (discount.type !== DiscountType.FREE_PRODUCT) {\n salla.logger.error(`salla-conditional-offer:: unexpected type (${discount.type})!`);\n return \"\";\n }\n\n const productItem = this.products[discount.value]\n\n if (!productItem) {\n salla.logger.error(`salla-conditional-offer:: there is no product with id (${discount.value})!`);\n return \"\";\n }\n\n return <a class=\"s-conditional-offer-product-link\" href={productItem.url} >\n <img\n class=\"s-conditional-offer-checkpoint-image-content\"\n loading=\"lazy\"\n decoding=\"async\"\n alt={productItem?.image?.alt || \"\"}\n src={productItem?.image?.url} />\n </a>\n }\n\n private getOfferType(discount: Discount): string {\n const basedOn = this.offer.details?.based_on;\n if (basedOn === OfferType.PRODUCT_COUNT) return salla.lang.choice(\"blocks.header.products_count\", discount.min_spend);\n if (basedOn === OfferType.PRODUCT_PURCHASE) return salla.money(discount.min_spend);\n\n salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${basedOn}`);\n return `${discount.min_spend}`;\n }\n\n private clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max));\n }\n\n private mapValueRanges(value: number, initialMinRange: number, initialMaxRange: number, newMinRange: number, newMaxRange: number) {\n\n const newRange = ((value - initialMinRange) * (newMaxRange - newMinRange)) / (initialMaxRange - initialMinRange) + newMinRange;\n\n if (newRange === Number.POSITIVE_INFINITY) return 100\n\n if (newRange === Number.NEGATIVE_INFINITY) return 0\n\n return this.clamp(newRange, 0, 100)\n }\n\n private getCheckPointView(discount: Discount, index: number) {\n const checkpointIndex = this.offer.details.discounts.findIndex(({ min_spend }) => min_spend === discount.min_spend);\n const previousCheckpointValue = this.offer.details.discounts[checkpointIndex - 1]?.min_spend ?? 0;\n const progressPercentage = this.mapValueRanges(this.offer.details.current_value, previousCheckpointValue, discount.min_spend, 0, 100);\n const isActive = discount.min_spend <= this.offer.details.current_value;\n\n return (\n <div class=\"s-conditional-offer-checkpoint-container\">\n {index > 0 ? [\n <div key=\"progress-line\" class=\"s-conditional-offer-progress-line-container\">\n <div class=\"s-conditional-offer-progress-line-inactive\" />\n <div class=\"s-conditional-offer-progress-line-active\" style={{ width: `${progressPercentage}%` }} />\n </div>,\n <div key=\"checkpoint\" class={`s-conditional-offer-checkpoint ${isActive ? \"s-conditional-offer-active-checkpoint\" : \"\"}`} >\n <div class={`s-conditional-offer-item-avatar-content ${isActive ? \"active\" : \"\"}`} innerHTML={this.products && this.getCheckpointContent(discount)}>\n </div>\n <div class={`s-conditional-offer-checkpoint-label ${isActive ? \"active\" : \"\"}`} innerHTML={this.getOfferType(discount)} />\n\n </div>\n ] :\n <div key=\"label\" class={{ \"s-conditional-offer-checkpoint-label\": true, \"first-checkpoint\": index === 0, active: isActive }} innerHTML={this.getOfferType(discount)} />\n }\n </div>\n );\n }\n\n private getLoadingSkeletonView() {\n return <Host class=\"s-conditional-offer-container\" >\n <div class=\"s-conditional-offer-skeleton-inner-container\">\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"30%\" />\n </div>\n\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"35%\" />\n </div>\n <div class=\"s-conditional-offer-skeleton-checkpoints-wrapper\">\n {Array(3).fill(null).map(() => (\n [<salla-skeleton key=\"checkpoint-line\" height=\"8px\" />,\n <div key=\"checkpoint\">\n <salla-skeleton height=\"60px\" width=\"60px\" type=\"circle\" />\n </div>]\n ))}\n </div>\n\n </div>\n </Host>\n }\n\n render() {\n if (!this.canRender) return null\n if (this.isLoading) return this.getLoadingSkeletonView()\n if (!this.offer) return null\n\n return <Host class=\"s-conditional-offer-container\">\n <div class=\"s-conditional-offer-title-wrapper\">\n <div class=\"s-conditional-offer-title\">{this.offer.title}</div>\n {this.offer.description ? <div class=\"s-conditional-offer-subtitle\">\n {this.offer.description} <i class=\"sicon-information\" />\n </div> : null}\n </div>\n <div class=\"s-conditional-offer-progress-container\">\n {this.offer.details.discounts.map((discount, index) => (\n <div class={{ \"flex-1\": index > 0 }} key={discount.min_spend}>\n {this.getCheckPointView(discount, index)}\n </div>\n ))}\n </div>\n </Host>\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAEA,IAAY,YAIX;YAJD,CAAA,UAAY,YAAY,EAAA;YACpB,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;YACzB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;YACf,IAAA,YAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;YACjC,CAAC,EAJW,YAAY,KAAZ,YAAY,GAIvB,EAAA,CAAA,CAAA;YAED,IAAY,SAGX;YAHD,CAAA,UAAY,SAAS,EAAA;YACjB,IAAA,SAAA,CAAA,eAAA,CAAA,GAAA,gBAAgC;YAChC,IAAA,SAAA,CAAA,kBAAA,CAAA,GAAA,cAAiC;YACrC,CAAC,EAHW,SAAS,KAAT,SAAS,GAGpB,EAAA,CAAA,CAAA;;YCXD,MAAM,wBAAwB,GAAG,sBAAsB;;kBCc1C,qBAAqB,sCAAA,MAAA;YAJlC,IAAA,WAAA,CAAA,OAAA,EAAA;;YAMa,QAAA,IAAK,CAAA,KAAA,GAAU,IAAI;YACnB,QAAA,IAAQ,CAAA,QAAA,GAAmD,EAAE;YAC7D,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;YACjB,QAAA,IAAS,CAAA,SAAA,GAAG,IAAI;YAwL5B;gBAtLG,iBAAiB,GAAA;YACb,QAAA,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAK;;wBACtB,IAAI,EAAC,CAAA,EAAA,GAA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EAAA,EAAA,KAAK,EAAC,mCAAmC,EAAA,EAC1C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,2BAA2B,EAAA,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAO,EAC9D,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,8BAA8B,EAAA,EAC9D,IAAI,CAAC,KAAK,CAAC,WAAW,OAAE,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,mBAAmB,EAAA,CAAG,CACtD,GAAG,IAAI,CACX,EACN,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,wCAAwC,EAC9C,EAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,MAC9C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EACvD,EAAA,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CACtC,CACT,CAAC,CACA,CACH;;;;;;;;;;;"}
1
+ {"version":3,"file":"p-BAUuwpBC.system.js","sources":["src/components/salla-conditional-offer/interfaces.ts","src/components/salla-conditional-offer/salla-conditional-offer.scss?tag=salla-conditional-offer","src/components/salla-conditional-offer/salla-conditional-offer.tsx"],"sourcesContent":["import type { Product } from \"@salla.sa/twilight/types/common\";\n\nexport enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n FREE_PRODUCT = \"free_product\",\n}\n\nexport enum OfferType {\n PRODUCT_COUNT = \"products_count\",\n PRODUCT_PURCHASE = \"order_amount\",\n}\n\nexport interface Discount {\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n max_discount?: number;\n}\n\nexport interface OfferDetails {\n based_on?: OfferType;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: OfferDetails | null;\n}\n\n\nexport interface ProductDetail {\n id?: number;\n sku?: string;\n name?: string;\n description?: string;\n url?: string;\n promotion_title?: null;\n subtitle?: null;\n type?: string;\n status?: string;\n price?: number;\n base_currency_price?: BaseCurrencyPrice;\n sale_price?: number;\n regular_price?: number;\n starting_price?: null;\n quantity?: null;\n max_quantity?: number;\n discount_ends?: null;\n is_taxable?: boolean;\n has_read_more?: boolean;\n can_add_note?: boolean;\n can_show_remained_quantity?: boolean;\n can_upload_file?: boolean;\n has_custom_form?: boolean;\n has_metadata?: boolean;\n is_on_sale?: boolean;\n is_hidden_quantity?: boolean;\n is_available?: boolean;\n is_out_of_stock?: boolean;\n is_require_shipping?: boolean;\n weight?: null;\n calories?: null;\n image?: Image;\n currency?: string;\n}\n\nexport interface BaseCurrencyPrice {\n currency?: string;\n amount?: number;\n}\n\nexport interface Image {\n url?: string;\n alt?: string;\n}\n\nexport interface UpdatedCart {\n items: Array<Product>;\n sub_total: number;\n}\n",":host {\n display: block;\n}","import { Component, Host, State, h } from \"@stencil/core\";\nimport {\n type Discount,\n DiscountType,\n type Offer,\n OfferType,\n type UpdatedCart,\n} from \"./interfaces\";\nimport type { Product } from \"@salla.sa/twilight/types/common\";\n\n@Component({\n tag: \"salla-conditional-offer\",\n styleUrl: \"salla-conditional-offer.scss\",\n})\nexport class SallaConditionalOffer {\n\n @State() offer: Offer = null;\n @State() products: Record<string, Pick<Product, 'image' | 'url'>> = {}\n @State() isLoading = false\n @State() canRender = true\n\n componentWillLoad() {\n salla.onReady().then(() => {\n if (!salla.config.get('store.features')?.includes('conditional-offer') || (salla.storage.get(\"cart\") !== '' && !salla.storage.get(\"cart\")?.summary?.count)) {\n throw new Error('feature or cart object does not existed');\n }\n })\n .then(() => salla.api.cart.offers())\n .then(({ data }: { data: Offer[] }) => {\n this.offer = data.find(offer => offer.type === \"conditional\")\n\n if (!this.offer) {\n this.canRender = false\n return;\n }\n\n this.isLoading = true\n this.offer.details.discounts.unshift(({ value: 0, min_spend: 0 }))\n return this.updateInitialOfferValue()\n }).then(() => {\n if (!this.offer) return;\n return this.getProducts()\n }).then(() => {\n if (!this.offer) return;\n salla.event.on(\"cart::updated\", (updatedCart: UpdatedCart) => this.updateOfferValues(updatedCart))\n })\n .catch(error => {\n this.canRender = false\n salla.logger.warn('salla-conditional-offer:: ', error)\n }).finally(() => {\n this.isLoading = false\n })\n\n }\n\n private getProducts() {\n const freeProductIDs = this.offer.details.discounts.filter(({ type }) => type === DiscountType.FREE_PRODUCT).map(({ value }) => value)\n if (freeProductIDs.length > 0) {\n return salla.product.fetch({ source: 'selected', source_value: freeProductIDs }).then(({ data }: { data: Array<Product> }) => {\n data.forEach(({ id, url, image }) => {\n this.products[id] = { url, image }\n })\n })\n }\n }\n\n private updateInitialOfferValue() {\n return salla.api.cart.details().then(({ data: { cart } }: { data: { cart: UpdatedCart } }) => this.updateOfferValues(cart))\n }\n\n private updateOfferValues({ items, sub_total }: UpdatedCart) {\n const current_value = this.offer.details.based_on === OfferType.PRODUCT_COUNT ? items.reduce((count: number, { quantity }) => count + quantity, 0,) : sub_total\n //we need to assign the offer object a new reference to trigger re-rendering\n this.offer = {\n ...this.offer, details: {\n ...this.offer?.details, current_value,\n }\n }\n return this.offer\n }\n\n private getCheckpointContent(discount: Discount) {\n\n if (discount.type === DiscountType.PERCENTAGE) return `${discount.value}%`\n\n if (discount.type === DiscountType.FIXED) return salla.money(discount.value)\n\n if (discount.type !== DiscountType.FREE_PRODUCT) {\n salla.logger.error(`salla-conditional-offer:: unexpected type (${discount.type})!`);\n return \"\";\n }\n\n const productItem = this.products[discount.value]\n\n if (!productItem) {\n salla.logger.error(`salla-conditional-offer:: there is no product with id (${discount.value})!`);\n return \"\";\n }\n\n return <a class=\"s-conditional-offer-product-link\" href={productItem.url} >\n <img\n class=\"s-conditional-offer-checkpoint-image-content\"\n loading=\"lazy\"\n decoding=\"async\"\n alt={productItem?.image?.alt || \"\"}\n src={productItem?.image?.url} />\n </a>\n }\n\n private getOfferType(discount: Discount): string {\n const basedOn = this.offer.details?.based_on;\n if (basedOn === OfferType.PRODUCT_COUNT) return salla.lang.choice(\"blocks.header.products_count\", discount.min_spend);\n if (basedOn === OfferType.PRODUCT_PURCHASE) return salla.money(discount.min_spend);\n\n salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${basedOn}`);\n return `${discount.min_spend}`;\n }\n\n private clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max));\n }\n\n private mapValueRanges(value: number, initialMinRange: number, initialMaxRange: number, newMinRange: number, newMaxRange: number) {\n\n const newRange = ((value - initialMinRange) * (newMaxRange - newMinRange)) / (initialMaxRange - initialMinRange) + newMinRange;\n\n if (newRange === Number.POSITIVE_INFINITY) return 100\n\n if (newRange === Number.NEGATIVE_INFINITY) return 0\n\n return this.clamp(newRange, 0, 100)\n }\n\n private getCheckPointView(discount: Discount, index: number) {\n const checkpointIndex = this.offer.details.discounts.findIndex(({ min_spend }) => min_spend === discount.min_spend);\n const previousCheckpointValue = this.offer.details.discounts[checkpointIndex - 1]?.min_spend ?? 0;\n const progressPercentage = this.mapValueRanges(this.offer.details.current_value, previousCheckpointValue, discount.min_spend, 0, 100);\n const isActive = discount.min_spend <= this.offer.details.current_value;\n\n return (\n <div class=\"s-conditional-offer-checkpoint-container\">\n {index > 0 ? [\n <div key=\"progress-line\" class=\"s-conditional-offer-progress-line-container\">\n <div class=\"s-conditional-offer-progress-line-inactive\" />\n <div class=\"s-conditional-offer-progress-line-active\" style={{ width: `${progressPercentage}%` }} />\n </div>,\n <div key=\"checkpoint\" class={`s-conditional-offer-checkpoint ${isActive ? \"s-conditional-offer-active-checkpoint\" : \"\"}`} >\n <div class={`s-conditional-offer-item-avatar-content ${isActive ? \"active\" : \"\"}`} innerHTML={this.products && this.getCheckpointContent(discount)}>\n </div>\n <div class={`s-conditional-offer-checkpoint-label ${isActive ? \"active\" : \"\"}`} innerHTML={this.getOfferType(discount)} />\n\n </div>\n ] :\n <div key=\"label\" class={{ \"s-conditional-offer-checkpoint-label\": true, \"first-checkpoint\": index === 0, active: isActive }} innerHTML={this.getOfferType(discount)} />\n }\n </div>\n );\n }\n\n private getLoadingSkeletonView() {\n return <Host class=\"s-conditional-offer-container\" >\n <div class=\"s-conditional-offer-skeleton-inner-container\">\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"30%\" />\n </div>\n\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"35%\" />\n </div>\n <div class=\"s-conditional-offer-skeleton-checkpoints-wrapper\">\n {Array(3).fill(null).map(() => (\n [<salla-skeleton key=\"checkpoint-line\" height=\"8px\" />,\n <div key=\"checkpoint\">\n <salla-skeleton height=\"60px\" width=\"60px\" type=\"circle\" />\n </div>]\n ))}\n </div>\n\n </div>\n </Host>\n }\n\n render() {\n if (!this.canRender) return null\n if (this.isLoading) return this.getLoadingSkeletonView()\n if (!this.offer) return null\n\n return <Host class=\"s-conditional-offer-container\">\n <div class=\"s-conditional-offer-title-wrapper\">\n <div class=\"s-conditional-offer-title\">{this.offer.title}</div>\n {this.offer.description ? <div class=\"s-conditional-offer-subtitle\">\n {this.offer.description} <i class=\"sicon-information\" />\n </div> : null}\n </div>\n <div class=\"s-conditional-offer-progress-container\">\n {this.offer.details.discounts.map((discount, index) => (\n <div class={{ \"flex-1\": index > 0 }} key={discount.min_spend}>\n {this.getCheckPointView(discount, index)}\n </div>\n ))}\n </div>\n </Host>\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAEA,IAAY,YAIX;YAJD,CAAA,UAAY,YAAY,EAAA;YACpB,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;YACzB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;YACf,IAAA,YAAA,CAAA,cA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,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EACvD,EAAA,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CACtC,CACT,CAAC,CACA,CACH;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"p-C7rT-4Yq.system.js","sources":["src/components/salla-offer/interfaces.ts","src/components/salla-offer/salla-offer.scss?tag=salla-offer","src/components/salla-offer/salla-offer.tsx"],"sourcesContent":["export enum PageType {\n ProductDetail = \"product.single\",\n Cart = \"cart\"\n}\n\nexport enum OfferType {\n Conditional = \"conditional\",\n PercentageOrFixed = \"fixed\",\n DiscountsTable = \"discounts_table\",\n Bank = \"bank\",\n BuyXGetY = \"buy_x_get_y\",\n SpecialPrice = \"special_price\",\n}\n\n\nexport interface DiscountDetailFixed {\n discount_type: \"fixed\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailFreeProduct {\n discount_type: \"free_product\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailConditional extends Array<DiscountDetailFixed | DiscountDetailFreeProduct> {}\n\nexport interface DiscountDetailPercentageFixed {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\";\n targets: Array<string | number>;\n ends_at: number;\n min_spend: number;\n discount_value: number;\n}\n\nexport interface Discount {\n discounted_amount: any;\n quantity: number;\n percentage: number;\n}\n\nexport interface DiscountDetailTable {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\" | \"order\";\n discount_value: number;\n ends_at: string;\n min_items: number;\n min_spend: number;\n show_price_after_discount: boolean;\n discounts: Discount[];\n}\n\nexport interface BankOffer {\n logo: string;\n discount_value: number;\n discount_type: string;\n minimum_spend: number;\n payments: string[];\n}\n\nexport interface SpecialPriceDetail {\n apply_to: \"product\" | \"category\";\n discount_value: number;\n ends_at: number;\n min_items: number; \n min_spend: number;\n targets: Array<string | number>;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n\n}\n\nexport interface BuyXGetYDetail {\n ends_at: number;\n buy: {\n source: \"product\" | \"category\";\n source_value: number[];\n quantity: number;\n };\n get: {\n source: \"products\" | \"category\";\n source_value: number[];\n type: \"free_product\" | \"percentage\" | \"fixed\";\n value: number;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n };\n}\n\nexport interface Offer {\n id: number;\n title: string;\n description: string;\n type: OfferType | \"conditional\" | \"fixed\" | \"discounts_table\" | \"bank\" | \"buy_x_get_y\";\n details: DiscountDetailConditional | DiscountDetailPercentageFixed | DiscountDetailTable | BankOffer | BuyXGetYDetail | SpecialPriceDetail;\n}\n\nexport interface Product {\n id: number;\n type: string;\n status: string;\n is_available: boolean;\n sku: string;\n name: string;\n price: { amount: number; currency: string; };\n promotion: { title: string; sub_title: string; };\n sale_price: { amount: number; currency: string; };\n regular_price: { amount: number; currency: string; };\n currency: string;\n url: string;\n thumbnail: string;\n has_special_price: boolean;\n favorite?: any;\n}\n\nexport interface Category {\n id?: string;\n id_?: number;\n name?: string;\n url?: string;\n icon?: string;\n sub_categories?: Category[];\n items?: any[] | null;\n}\n\nexport interface Currency {\n code: string | 'SAR';\n name: string;\n symbol: string;\n amount?: number;\n country_code?: string;\n}\n",".s-offer-wrapper .s-slider-block__title {\n h2 {\n font-size: 1.125rem;\n line-height: 1.75rem;\n color: #f87171;\n\n &::before {\n font-family: \"sallaicons\";\n content: \"\\ee30\" !important;\n position: absolute;\n top: 1rem;\n font-size: 3rem;\n font-weight: 400;\n line-height: 1;\n color: #fef2f2;\n }\n }\n}\n\n.s-offer-bank-wrapper-sinlge-item{\n display: flex;\n align-items: center !important;\n gap: 14px;\n}\n\n.s-offer-bank-wrapper {\n display: flex !important;\n width: 100% !important;\n}\n\n// .s-offer-bank-wrapper {\n // \n// }","import { Component, Element, Prop, State, h } from '@stencil/core';\nimport { Offer, Category, Product, Discount, Currency, BuyXGetYDetail, PageType, OfferType, BankOffer,SpecialPriceDetail, DiscountDetailTable } from './interfaces';\n\n\n/**\n * `salla-offer` is a StencilJS component that displays offers, categories, products, banks, and discount information.\n * It uses the `salla-slider` component for carousel functionality.\n *\n * @slot category - The slot for customizing the category entry layout.\n *\n * @csspart custom - Custom CSS part to target specific elements in the component.\n *\n * @example\n * <salla-offer product-id=\"123\"></salla-offer>\n */\n@Component({\n tag: 'salla-offer',\n styleUrl: 'salla-offer.scss',\n})\nexport class SallaOffer {\n\n constructor() {\n // Language\n salla.lang.onLoaded(() => {\n this.offer_with_price_text = salla.lang.get('pages.offer.with_price');\n this.with_discount_text = salla.lang.get('pages.products.with_a_discount');\n this.product_discount_text = salla.lang.get('pages.products.discount');\n this.special_offer_text = salla.lang.get('pages.products.special_offer');\n this.multipleBankOfferTitleText = salla.lang.get('pages.offer.multiple_bank_offers_title');\n this.multipleBankOfferTitleDescription = salla.lang.get('pages.offer.multiple_bank_offers_message');\n this.buy_quantity_text(0);\n })\n\n salla.onReady(() => {\n this.currentPage = salla.config.get('page.slug')\n this.userCurrency = salla.config.get('currencies')[salla.config.get('user.currency_code')].symbol\n });\n\n this.categorySlot = this.host.querySelector('[slot=\"category\"]')?.innerHTML || '<a href={url} class=\"s-offer-slide-cat-entry\"><i class={icon}></i><h4>{name}</h4></a>';\n }\n\n /**\n * Custom Card Component for the Salla Products List.\n *\n * This component allows you to customize the appearance of individual product cards within a Salla Products List.\n *\n * @example\n * <salla-products-list product-card-component=\"my-custom-card-style1\" ...\n * <salla-products-list product-card-component=\"my-custom-card-style2\" ...\n */\n @Prop() productCardComponent: string = 'custom-salla-product-card';\n\n // Declare component state variables\n @State() offersList: Offer[] = [];\n @State() userCurrency: Currency;\n @State() isMultipleBank: boolean = false;\n @State() title?: string;\n @State() currentPage: string;\n @State() hasCustomComponent: boolean;\n\n @State() isBankOffer: boolean = false;\n @State() canRender: boolean = false;\n @State() showOffer: boolean = salla.config.get('store.settings.product.show_special_offers');\n\n // Default translated texts\n @State() offer_with_price_text: string = salla.lang.get('pages.offer.with_price', { price: '' });\n @State() with_discount_text: string = salla.lang.get('pages.products.with_a_discount')\n @State() product_discount_text: string = salla.lang.get('pages.products.discount')\n @State() special_offer_text: string = salla.lang.get('pages.products.special_offer')\n @State() multipleBankOfferTitleText: string = salla.lang.get('pages.offer.multiple_bank_offers_title')\n @State() multipleBankOfferTitleDescription: string = salla.lang.get('pages.offer.multiple_bank_offers_message')\n @State() buy_quantity_text: (quantity: number) => string = (quantity) => salla.lang.get('pages.offer.buy_quantity', { quantity })\n\n // Reference to the host element\n @Element() host: HTMLElement;\n\n private categorySlot: string;\n\n private async getEndpointByPageName(): Promise<string> {\n if (this.currentPage == PageType.Cart) {\n const cartId = await Salla.cart.getCurrentCartId();\n return `offers/cart/${cartId}`;\n }\n\n if (this.currentPage == PageType.ProductDetail) {\n return `offers/product/${salla.config.get('page.id')}`;\n }\n\n return \"offers\";\n }\n\n /**\n * Emits a promotion viewed event for analytics tracking\n */\n private emitPromotionViewed(): void {\n if(!(this.offersList.length && this.canRender && this.showOffer)) return;\n \n // Transform offer data to match analytics expectations\n const promotionData = {\n id: this.offersList[0].id,\n name: this.offersList[0].title,\n creative: this.offersList[0].description || '',\n position: 1 \n };\n \n salla.event.emit('promotion::viewed', [promotionData]);\n }\n /**\n * Emits a promotion clicked event\n */\n private emitPromotionClicked(position: number = 1): void {\n if(!(this.offersList.length && this.canRender && this.showOffer)) return;\n \n // Transform offer data to match analytics expectations\n const promotionData = {\n id: this.offersList[0].id,\n name: this.offersList[0].title,\n creative: this.offersList[0].description || '',\n position: position\n };\n \n salla.event.emit('promotion::clicked', [promotionData]);\n }\n\n componentWillLoad() {\n this.hasCustomComponent = !!customElements.get(this.productCardComponent);\n // let offers = this.getOffersFromStorage();\n // if (offers) {\n // return offers.then(offersFromStorage => this.offersList = offersFromStorage);\n // }\n\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => {\n this.showOffer = !salla.url.is_page('product.single') || salla.config.get('store.settings.product.show_special_offers')\n if (this.showOffer) {\n return;\n }\n throw new Error(\"Merchant disabled showing the offers on product page\");\n }\n )\n .then(async () => salla.api.request(await this.getEndpointByPageName()))\n .then((res) => {\n if (!(this.offersList = res.data).length) {\n throw new Error('salla-offers:: There is no offers!');\n }\n //we support these offers only\n const offer = this.offersList.find(offer => [OfferType.SpecialPrice,OfferType.Bank, OfferType.BuyXGetY, OfferType.DiscountsTable].includes(offer.type as any));\n if (!offer) {\n throw new Error('salla-offers:: Offer type not supported yet!');\n }\n //because there is no need for special handling for discounts table, just skip the other cases\n if (offer.type === OfferType.DiscountsTable) {\n return this.offersList = [offer];\n }\n\n //if it's banks offer, we need to include the other banks overs\n if ((this.isBankOffer = offer.type === OfferType.Bank)) {\n this.offersList = this.offersList.filter(offer => offer.type === OfferType.Bank);\n this.isMultipleBank = this.offersList.length > 1;\n return this.offersList;\n }\n\n //if it's special price offer\n if (offer.type === OfferType.SpecialPrice) {\n const details = offer.details as SpecialPriceDetail;\n\n return details.apply_to === 'product'\n // Avoid additional requests; use `salla-products-slider` and pass the custom card\n ? salla.product.api.fetch({ source: \"selected\", source_value: details.targets})\n .then((response: any) => {\n (offer.details as any).products = response.data; // Set the fetched products\n return this.offersList = [offer];\n })\n : salla.product.api.categories() // Fetch all categories in one query\n .then((res) => {\n const categoriesToRender = this.findCategories(res.data, details.targets); // Extract only the selected categories\n (offer.details as any).categories = categoriesToRender;\n return this.offersList = [offer];\n });\n }\n\n //BuyXGetY offers\n const getY = (offer.details as BuyXGetYDetail).get;\n return getY.source === 'products'\n //todo:: avoid this request, and the handling for the products, just use `salla-products-slider` and don't forget to pass the customcard\n ? salla.product.api.fetch({ source: \"selected\", source_value: getY.source_value })\n .then((response: any) => {\n getY.products = response.data;\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n })//set the products\n : salla.product.api.categories()//get all categories in one query, then extract only the selected one, instead of sending multi requests\n .then((res) => {\n getY.categories = this.findCategories(res.data, getY.source_value);\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n });\n })\n .then((offers: Offer[]) => {\n salla.storage.set(this.getStorageKey(), { offers, stored_at: new Date().getTime() });\n this.canRender = true;\n })\n .catch((error) => {\n salla.logger.warn(error)\n });\n }\n\n componentDidLoad() {\n let nav = this.host.querySelector('.s-slider-block__title-nav');\n nav?.classList.add(\"s-offer-bank-payment-nav\")\n this.emitPromotionViewed();\n }\n\n \n\n\n findCategories(categories: Category[], ids: any[]): Category[] {\n let found: Category[] = [];\n for (const category of categories) {\n if (ids.includes(category.id_ || category.id)) { //here we are using || because we are planning to drop `id_`\n found.push(category);\n }\n if (category.sub_categories?.length > 0) {\n found = found.concat(this.findCategories(category.sub_categories, ids));\n }\n }\n\n return found;\n }\n\n //todo::add to the key params, to make sure it will support multi offers in the same page if it's wanted\n getStorageKey(): string {\n try {\n const pageSlug = salla.config.get('page.slug').replace('.', '_');\n const locale = salla.lang.getLocale();\n const currencyCode = salla.config.currency().code;\n\n if (!pageSlug || !locale || !currencyCode) {\n throw new Error('Unable to get the storage key.');\n }\n\n return `s-offers-${pageSlug}-${salla.config.get('page.id')}-${locale}-${currencyCode}`;\n } catch (error) {\n return '';\n }\n }\n\n //@ts-ignore\n getOffersFromStorage(): null | Promise<Offer[]> {\n let storageOffers = salla.storage.get(this.getStorageKey());\n //if the offers not existed, or it has been stored before 10 minutes from now, ignore it;\n if (!storageOffers || storageOffers.stored_at < (new Date().getTime() - 10 * 60 * 1000)) {\n salla.storage.remove(this.getStorageKey());\n return null;\n }\n this.canRender = true;\n\n //return it as resolve to support .then\n return Promise.resolve(storageOffers.offers);\n }\n\n render() {\n // Check if the offers list is empty or if the component is not ready to render\n if (!this.offersList.length || !this.canRender || !this.showOffer) return null;\n const offer: Offer = this.offersList[0];\n\n const blockTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleText : null) : offer.title;\n const blockSubTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleDescription : null) : offer.description;\n\n const titles = {\n 'block-title': blockTitle,\n 'block-subTitle': blockSubTitle,\n 'show-controls': this.isMultipleBank\n };\n\n return (\n <div class=\"s-offer-wrapper\" onClick={() => this.emitPromotionClicked()}>\n {<p class=\"s-offer-corner-badge\">{this.special_offer_text}</p>}\n {/* discounts table is not a slider, it's a table🤔 */}\n {/* single bank offer is not a slider, it's a dom without slider🤔 */}\n <salla-slider type=\"carousel\" id=\"offer-slider\" {...titles}>\n <div slot='items'>\n {this.renderSectionForOfferType(offer.type)}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n private renderSectionForOfferType(offerType: OfferType | string) {\n if (this.isBankOffer) {\n return this.renderBankSection();\n }\n if (offerType == OfferType.SpecialPrice) {\n return this.renderSpecialPriceSection();\n }\n if (offerType == OfferType.BuyXGetY) {\n return this.renderBuyXGetYSection();\n }\n\n return this.renderDiscountTableSection();\n }\n\n /**\n * Generates content for the categories section.\n *\n * @param offeredCategories - An array of Category objects.\n * @returns An array of HTML elements representing categories.\n */\n private getCategoriesSection(category: Category) {\n return <div class=\"s-offer-slide-one-sixth swiper-slide\" innerHTML={this.categorySlot\n .replace(/\\{url\\}/g, category.url)\n .replace(/\\{icon\\}/g, category.icon || \"sicon-store\")\n .replace(/\\{name\\}/g, category.name)}></div>\n }\n\n private renderBuyXGetYSection() {\n const details = (this.offersList[0].details as BuyXGetYDetail)\n return [\n details.get.products?.map((product: Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n details.get.categories?.map((category: Category) => this.getCategoriesSection(category))\n ];\n }\n\n /**\n * Generates content for the bank section.\n *\n * @param offeredBank - An array of Bank objects.\n * @param name - The title of the current offer.\n * @param description - The description of the current offer.\n * @returns An array of HTML elements representing banks.\n *\n * TODO: loop over the list and filter bank types and pass it to this function\n */\n private renderBankSection() {\n return this.offersList.map((bankOffer: Offer) => {\n return <div class={{ \"s-offer-slide-one-sixth\": this.isMultipleBank, \"s-offer-bank-wrapper-sinlge-item\": !this.isMultipleBank }}>\n <div class={{ \"s-offer-bank-wrapper\": true, \"s-offer-slide-one-sixth\": !this.isMultipleBank, \"s-offer-bank-wrapper-multi-spacer\": this.isMultipleBank }}>\n <div class=\"s-offer-bank-logo\">\n <img src={(bankOffer.details as BankOffer).logo || salla.url.cdn('images/s-empty.png')} data-src={(bankOffer.details as BankOffer).logo} alt={bankOffer.title + \" offer\"} />\n </div>\n <ul class=\"s-offer-bank-payment-wrapper\">\n {(bankOffer.details as BankOffer).payments.map((payment: string) => {\n return <li class=\"s-offer-bank-payment-single\">\n <img\n src={salla.url.cdn('images/payment/' + payment + '.png') || salla.url.cdn('images/s-empty.png')}\n data-src={salla.url.cdn('images/payment/' + payment + '.png')}\n alt=\"payment\" />\n </li>\n })}\n </ul>\n {this.isMultipleBank ?\n <p class=\"s-offer-bank-payment-discount-percent\">\n {`${this.product_discount_text} ${(bankOffer.details as BankOffer).discount_value}${(bankOffer.details as BankOffer).discount_type === \"percentage\" && '%'}`}\n </p>\n : \"\"}\n </div>\n {!this.isMultipleBank ?\n <div class=\"s-offer-bank-message s-offer-slide-one-fourth\">\n <h2>{this.offersList[0].title}</h2>\n <p innerHTML={this.generateBankDescription(this.offersList[0].description, (bankOffer.details as BankOffer).discount_value)}></p>\n </div>\n : \"\"}\n </div>\n })\n }\n\n private generateBankDescription(desc: string, value): string {\n return desc.replace(new RegExp(`${value} %`), `<span class=\"s-offer-bank-message-amount\">${value} %</span>`)\n }\n\n /**\n * Generates content for the discount table section.\n *\n * @param discountTable - An array of Discount objects.\n * @returns An array of HTML elements representing discounts_table.\n */\n private renderDiscountTableSection() {\n const offer: Offer = this.offersList[0];\n let show_discounted_price = (offer.details as DiscountDetailTable).show_price_after_discount;\n return (this.offersList[0].details as DiscountDetailTable).discounts?.map((discount: Discount) => <div class=\"s-offer-slide-one-fourth\">\n <div class=\"s-offer-slide-offer-entry\">\n <div class=\"s-offer-slide-offer-entry-price-quantity-container\">\n <p class=\"s-offer-slide-offer-entry-quantity\">{this.buy_quantity_text(discount.quantity)}</p>\n {show_discounted_price ?\n <div class=\"s-offer-slide-offer-entry-price\">\n <span>{this.offer_with_price_text}</span>\n <span class=\"s-offer-slide-offer-entry-price-amount\">{discount.discounted_amount}</span> <span>{this.userCurrency}</span>\n </div> : \"\"}\n </div>\n <p class=\"s-offer-slide-offer-entry-price-amount-percent\">{this.with_discount_text}\n (<span>{discount.percentage}{!!discount.percentage && '%'}</span>)</p>\n </div>\n </div>\n )\n }\n\n private renderSpecialPriceSection() {\n const details = this.offersList[0].details as SpecialPriceDetail;\n\n return [\n // Render products if `apply_to` is \"product\"\n details.apply_to === \"product\" &&\n details.products?.map((product:Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n\n // Render categories if `apply_to` is \"category\"\n details.apply_to === \"category\" &&\n details.categories?.map((category: Category) => this.getCategoriesSection(category)),\n ];\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAAA,IAAY,QAGX;YAHD,CAAA,UAAY,QAAQ,EAAA;YAClB,IAAA,QAAA,CAAA,eAAA,CAAA,GAAA,gBAAgC;YAChC,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa;YACf,CAAC,EAHW,QAAQ,KAAR,QAAQ,GAGnB,EAAA,CAAA,CAAA;YAED,IAAY,SAOX;YAPD,CAAA,UAAY,SAAS,EAAA;YACnB,IAAA,SAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;YAC3B,IAAA,SAAA,CAAA,mBAAA,CAAA,GAAA,OAA2B;YAC3B,IAAA,SAAA,CAAA,gBAAA,CAAA,GAAA,iBAAkC;YAClC,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;YACb,IAAA,SAAA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CACrH,GAAG,EAAE,CACT,EACN,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,gDAAgD,EAAA,EAAE,IAAI,CAAC,kBAAkB,OAC/E,CAAA,CAAA,MAAA,EAAA,IAAA,EAAO,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAQ,MAAK,CACpE,CACF,CACL;;gBAGK,yBAAyB,GAAA;;oBAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAA6B;oBAEhE,OAAO;;wBAEL,OAAO,CAAC,QAAQ,KAAK,SAAS;6BAC9B,CAAA,EAAA,GAAA,OAAO,CAAC,QAAQ,0CAAE,GAAG,CAAC,CAAC,OAAe,MACpC,WAAK,KAAK,EAAC,0BAA0B,EAClC,EAAA,IAAI,CAAC;YACJ,sBAAE,EAAC,IAAI,CAAC,oBAAoB,EAAC,EAAA,OAAO,EAAE,OAAO,EAA8B;YAC3E,sBAAE,mDAAoC,OAAO,EAAE,OAAO,EAAuB,CAAA,CAC3E,CACP,CAAC,CAAA;;wBAGF,OAAO,CAAC,QAAQ,KAAK,UAAU;YAC/B,iBAAA,CAAA,EAAA,GAAA,OAAO,CAAC,UAAU,0CAAE,GAAG,CAAC,CAAC,QAAkB,KAAK,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAA;qBACrF;;;;;;;;;;;;"}
1
+ {"version":3,"file":"p-BAlSNS7p.system.js","sources":["src/components/salla-offer/interfaces.ts","src/components/salla-offer/salla-offer.scss?tag=salla-offer","src/components/salla-offer/salla-offer.tsx"],"sourcesContent":["export enum PageType {\n ProductDetail = \"product.single\",\n Cart = \"cart\"\n}\n\nexport enum OfferType {\n Conditional = \"conditional\",\n PercentageOrFixed = \"fixed\",\n DiscountsTable = \"discounts_table\",\n Bank = \"bank\",\n BuyXGetY = \"buy_x_get_y\",\n SpecialPrice = \"special_price\",\n}\n\n\nexport interface DiscountDetailFixed {\n discount_type: \"fixed\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailFreeProduct {\n discount_type: \"free_product\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailConditional extends Array<DiscountDetailFixed | DiscountDetailFreeProduct> {}\n\nexport interface DiscountDetailPercentageFixed {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\";\n targets: Array<string | number>;\n ends_at: number;\n min_spend: number;\n discount_value: number;\n}\n\nexport interface Discount {\n discounted_amount: any;\n quantity: number;\n percentage: number;\n}\n\nexport interface DiscountDetailTable {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\" | \"order\";\n discount_value: number;\n ends_at: string;\n min_items: number;\n min_spend: number;\n show_price_after_discount: boolean;\n discounts: Discount[];\n}\n\nexport interface BankOffer {\n logo: string;\n discount_value: number;\n discount_type: string;\n minimum_spend: number;\n payments: string[];\n}\n\nexport interface SpecialPriceDetail {\n apply_to: \"product\" | \"category\";\n discount_value: number;\n ends_at: number;\n min_items: number; \n min_spend: number;\n targets: Array<string | number>;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n\n}\n\nexport interface BuyXGetYDetail {\n ends_at: number;\n buy: {\n source: \"product\" | \"category\";\n source_value: number[];\n quantity: number;\n };\n get: {\n source: \"products\" | \"category\";\n source_value: number[];\n type: \"free_product\" | \"percentage\" | \"fixed\";\n value: number;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n };\n}\n\nexport interface Offer {\n id: number;\n title: string;\n description: string;\n type: OfferType | \"conditional\" | \"fixed\" | \"discounts_table\" | \"bank\" | \"buy_x_get_y\";\n details: DiscountDetailConditional | DiscountDetailPercentageFixed | DiscountDetailTable | BankOffer | BuyXGetYDetail | SpecialPriceDetail;\n}\n\nexport interface Product {\n id: number;\n type: string;\n status: string;\n is_available: boolean;\n sku: string;\n name: string;\n price: { amount: number; currency: string; };\n promotion: { title: string; sub_title: string; };\n sale_price: { amount: number; currency: string; };\n regular_price: { amount: number; currency: string; };\n currency: string;\n url: string;\n thumbnail: string;\n has_special_price: boolean;\n favorite?: any;\n}\n\nexport interface Category {\n id?: string;\n id_?: number;\n name?: string;\n url?: string;\n icon?: string;\n sub_categories?: Category[];\n items?: any[] | null;\n}\n\nexport interface Currency {\n code: string | 'SAR';\n name: string;\n symbol: string;\n amount?: number;\n country_code?: string;\n}\n",".s-offer-wrapper .s-slider-block__title {\n h2 {\n font-size: 1.125rem;\n line-height: 1.75rem;\n color: #f87171;\n\n &::before {\n font-family: \"sallaicons\";\n content: \"\\ee30\" !important;\n position: absolute;\n top: 1rem;\n font-size: 3rem;\n font-weight: 400;\n line-height: 1;\n color: #fef2f2;\n }\n }\n}\n\n.s-offer-bank-wrapper-sinlge-item{\n display: flex;\n align-items: center !important;\n gap: 14px;\n}\n\n.s-offer-bank-wrapper {\n display: flex !important;\n width: 100% !important;\n}\n\n// .s-offer-bank-wrapper {\n // \n// }","import { Component, Element, Prop, State, h } from '@stencil/core';\nimport { Offer, Category, Product, Discount, Currency, BuyXGetYDetail, PageType, OfferType, BankOffer,SpecialPriceDetail, DiscountDetailTable } from './interfaces';\n\n\n/**\n * `salla-offer` is a StencilJS component that displays offers, categories, products, banks, and discount information.\n * It uses the `salla-slider` component for carousel functionality.\n *\n * @slot category - The slot for customizing the category entry layout.\n *\n * @csspart custom - Custom CSS part to target specific elements in the component.\n *\n * @example\n * <salla-offer product-id=\"123\"></salla-offer>\n */\n@Component({\n tag: 'salla-offer',\n styleUrl: 'salla-offer.scss',\n})\nexport class SallaOffer {\n\n constructor() {\n // Language\n salla.lang.onLoaded(() => {\n this.offer_with_price_text = salla.lang.get('pages.offer.with_price');\n this.with_discount_text = salla.lang.get('pages.products.with_a_discount');\n this.product_discount_text = salla.lang.get('pages.products.discount');\n this.special_offer_text = salla.lang.get('pages.products.special_offer');\n this.multipleBankOfferTitleText = salla.lang.get('pages.offer.multiple_bank_offers_title');\n this.multipleBankOfferTitleDescription = salla.lang.get('pages.offer.multiple_bank_offers_message');\n this.buy_quantity_text(0);\n })\n\n salla.onReady(() => {\n this.currentPage = salla.config.get('page.slug')\n this.userCurrency = salla.config.get('currencies')[salla.config.get('user.currency_code')].symbol\n });\n\n this.categorySlot = this.host.querySelector('[slot=\"category\"]')?.innerHTML || '<a href={url} class=\"s-offer-slide-cat-entry\"><i class={icon}></i><h4>{name}</h4></a>';\n }\n\n /**\n * Custom Card Component for the Salla Products List.\n *\n * This component allows you to customize the appearance of individual product cards within a Salla Products List.\n *\n * @example\n * <salla-products-list product-card-component=\"my-custom-card-style1\" ...\n * <salla-products-list product-card-component=\"my-custom-card-style2\" ...\n */\n @Prop() productCardComponent: string = 'custom-salla-product-card';\n\n // Declare component state variables\n @State() offersList: Offer[] = [];\n @State() userCurrency: Currency;\n @State() isMultipleBank: boolean = false;\n @State() title?: string;\n @State() currentPage: string;\n @State() hasCustomComponent: boolean;\n\n @State() isBankOffer: boolean = false;\n @State() canRender: boolean = false;\n @State() showOffer: boolean = salla.config.get('store.settings.product.show_special_offers');\n\n // Default translated texts\n @State() offer_with_price_text: string = salla.lang.get('pages.offer.with_price', { price: '' });\n @State() with_discount_text: string = salla.lang.get('pages.products.with_a_discount')\n @State() product_discount_text: string = salla.lang.get('pages.products.discount')\n @State() special_offer_text: string = salla.lang.get('pages.products.special_offer')\n @State() multipleBankOfferTitleText: string = salla.lang.get('pages.offer.multiple_bank_offers_title')\n @State() multipleBankOfferTitleDescription: string = salla.lang.get('pages.offer.multiple_bank_offers_message')\n @State() buy_quantity_text: (quantity: number) => string = (quantity) => salla.lang.get('pages.offer.buy_quantity', { quantity })\n\n // Reference to the host element\n @Element() host: HTMLElement;\n\n private categorySlot: string;\n\n private async getEndpointByPageName(): Promise<string> {\n if (this.currentPage == PageType.Cart) {\n const cartId = await Salla.cart.getCurrentCartId();\n return `offers/cart/${cartId}`;\n }\n\n if (this.currentPage == PageType.ProductDetail) {\n return `offers/product/${salla.config.get('page.id')}`;\n }\n\n return \"offers\";\n }\n\n /**\n * Emits a promotion viewed event for analytics tracking\n */\n private emitPromotionViewed(): void {\n if(!(this.offersList.length && this.canRender && this.showOffer)) return;\n \n // Transform offer data to match analytics expectations\n const promotionData = {\n id: this.offersList[0].id,\n name: this.offersList[0].title,\n creative: this.offersList[0].description || '',\n position: 1 \n };\n \n salla.event.emit('promotion::viewed', [promotionData]);\n }\n /**\n * Emits a promotion clicked event\n */\n private emitPromotionClicked(position: number = 1): void {\n if(!(this.offersList.length && this.canRender && this.showOffer)) return;\n \n // Transform offer data to match analytics expectations\n const promotionData = {\n id: this.offersList[0].id,\n name: this.offersList[0].title,\n creative: this.offersList[0].description || '',\n position: position\n };\n \n salla.event.emit('promotion::clicked', [promotionData]);\n }\n\n componentWillLoad() {\n this.hasCustomComponent = !!customElements.get(this.productCardComponent);\n // let offers = this.getOffersFromStorage();\n // if (offers) {\n // return offers.then(offersFromStorage => this.offersList = offersFromStorage);\n // }\n\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => {\n this.showOffer = !salla.url.is_page('product.single') || salla.config.get('store.settings.product.show_special_offers')\n if (this.showOffer) {\n return;\n }\n throw new Error(\"Merchant disabled showing the offers on product page\");\n }\n )\n .then(async () => salla.api.request(await this.getEndpointByPageName()))\n .then((res) => {\n if (!(this.offersList = res.data).length) {\n throw new Error('salla-offers:: There is no offers!');\n }\n //we support these offers only\n const offer = this.offersList.find(offer => [OfferType.SpecialPrice,OfferType.Bank, OfferType.BuyXGetY, OfferType.DiscountsTable].includes(offer.type as any));\n if (!offer) {\n throw new Error('salla-offers:: Offer type not supported yet!');\n }\n //because there is no need for special handling for discounts table, just skip the other cases\n if (offer.type === OfferType.DiscountsTable) {\n return this.offersList = [offer];\n }\n\n //if it's banks offer, we need to include the other banks overs\n if ((this.isBankOffer = offer.type === OfferType.Bank)) {\n this.offersList = this.offersList.filter(offer => offer.type === OfferType.Bank);\n this.isMultipleBank = this.offersList.length > 1;\n return this.offersList;\n }\n\n //if it's special price offer\n if (offer.type === OfferType.SpecialPrice) {\n const details = offer.details as SpecialPriceDetail;\n\n return details.apply_to === 'product'\n // Avoid additional requests; use `salla-products-slider` and pass the custom card\n ? salla.product.api.fetch({ source: \"selected\", source_value: details.targets})\n .then((response: any) => {\n (offer.details as any).products = response.data; // Set the fetched products\n return this.offersList = [offer];\n })\n : salla.product.api.categories() // Fetch all categories in one query\n .then((res) => {\n const categoriesToRender = this.findCategories(res.data, details.targets); // Extract only the selected categories\n (offer.details as any).categories = categoriesToRender;\n return this.offersList = [offer];\n });\n }\n\n //BuyXGetY offers\n const getY = (offer.details as BuyXGetYDetail).get;\n return getY.source === 'products'\n //todo:: avoid this request, and the handling for the products, just use `salla-products-slider` and don't forget to pass the customcard\n ? salla.product.api.fetch({ source: \"selected\", source_value: getY.source_value })\n .then((response: any) => {\n getY.products = response.data;\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n })//set the products\n : salla.product.api.categories()//get all categories in one query, then extract only the selected one, instead of sending multi requests\n .then((res) => {\n getY.categories = this.findCategories(res.data, getY.source_value);\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n });\n })\n .then((offers: Offer[]) => {\n salla.storage.set(this.getStorageKey(), { offers, stored_at: new Date().getTime() });\n this.canRender = true;\n })\n .catch((error) => {\n salla.logger.warn(error)\n });\n }\n\n componentDidLoad() {\n let nav = this.host.querySelector('.s-slider-block__title-nav');\n nav?.classList.add(\"s-offer-bank-payment-nav\")\n this.emitPromotionViewed();\n }\n\n \n\n\n findCategories(categories: Category[], ids: any[]): Category[] {\n let found: Category[] = [];\n for (const category of categories) {\n if (ids.includes(category.id_ || category.id)) { //here we are using || because we are planning to drop `id_`\n found.push(category);\n }\n if (category.sub_categories?.length > 0) {\n found = found.concat(this.findCategories(category.sub_categories, ids));\n }\n }\n\n return found;\n }\n\n //todo::add to the key params, to make sure it will support multi offers in the same page if it's wanted\n getStorageKey(): string {\n try {\n const pageSlug = salla.config.get('page.slug').replace('.', '_');\n const locale = salla.lang.getLocale();\n const currencyCode = salla.config.currency().code;\n\n if (!pageSlug || !locale || !currencyCode) {\n throw new Error('Unable to get the storage key.');\n }\n\n return `s-offers-${pageSlug}-${salla.config.get('page.id')}-${locale}-${currencyCode}`;\n } catch (error) {\n return '';\n }\n }\n\n //@ts-ignore\n getOffersFromStorage(): null | Promise<Offer[]> {\n let storageOffers = salla.storage.get(this.getStorageKey());\n //if the offers not existed, or it has been stored before 10 minutes from now, ignore it;\n if (!storageOffers || storageOffers.stored_at < (new Date().getTime() - 10 * 60 * 1000)) {\n salla.storage.remove(this.getStorageKey());\n return null;\n }\n this.canRender = true;\n\n //return it as resolve to support .then\n return Promise.resolve(storageOffers.offers);\n }\n\n render() {\n // Check if the offers list is empty or if the component is not ready to render\n if (!this.offersList.length || !this.canRender || !this.showOffer) return null;\n const offer: Offer = this.offersList[0];\n\n const blockTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleText : null) : offer.title;\n const blockSubTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleDescription : null) : offer.description;\n\n const titles = {\n 'block-title': blockTitle,\n 'block-subTitle': blockSubTitle,\n 'show-controls': this.isMultipleBank\n };\n\n return (\n <div class=\"s-offer-wrapper\" onClick={() => this.emitPromotionClicked()}>\n {<p class=\"s-offer-corner-badge\">{this.special_offer_text}</p>}\n {/* discounts table is not a slider, it's a table🤔 */}\n {/* single bank offer is not a slider, it's a dom without slider🤔 */}\n <salla-slider type=\"carousel\" id=\"offer-slider\" {...titles}>\n <div slot='items'>\n {this.renderSectionForOfferType(offer.type)}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n private renderSectionForOfferType(offerType: OfferType | string) {\n if (this.isBankOffer) {\n return this.renderBankSection();\n }\n if (offerType == OfferType.SpecialPrice) {\n return this.renderSpecialPriceSection();\n }\n if (offerType == OfferType.BuyXGetY) {\n return this.renderBuyXGetYSection();\n }\n\n return this.renderDiscountTableSection();\n }\n\n /**\n * Generates content for the categories section.\n *\n * @param offeredCategories - An array of Category objects.\n * @returns An array of HTML elements representing categories.\n */\n private getCategoriesSection(category: Category) {\n return <div class=\"s-offer-slide-one-sixth swiper-slide\" innerHTML={this.categorySlot\n .replace(/\\{url\\}/g, category.url)\n .replace(/\\{icon\\}/g, category.icon || \"sicon-store\")\n .replace(/\\{name\\}/g, category.name)}></div>\n }\n\n private renderBuyXGetYSection() {\n const details = (this.offersList[0].details as BuyXGetYDetail)\n return [\n details.get.products?.map((product: Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n details.get.categories?.map((category: Category) => this.getCategoriesSection(category))\n ];\n }\n\n /**\n * Generates content for the bank section.\n *\n * @param offeredBank - An array of Bank objects.\n * @param name - The title of the current offer.\n * @param description - The description of the current offer.\n * @returns An array of HTML elements representing banks.\n *\n * TODO: loop over the list and filter bank types and pass it to this function\n */\n private renderBankSection() {\n return this.offersList.map((bankOffer: Offer) => {\n return <div class={{ \"s-offer-slide-one-sixth\": this.isMultipleBank, \"s-offer-bank-wrapper-sinlge-item\": !this.isMultipleBank }}>\n <div class={{ \"s-offer-bank-wrapper\": true, \"s-offer-slide-one-sixth\": !this.isMultipleBank, \"s-offer-bank-wrapper-multi-spacer\": this.isMultipleBank }}>\n <div class=\"s-offer-bank-logo\">\n <img src={(bankOffer.details as BankOffer).logo || salla.url.cdn('images/s-empty.png')} data-src={(bankOffer.details as BankOffer).logo} alt={bankOffer.title + \" offer\"} />\n </div>\n <ul class=\"s-offer-bank-payment-wrapper\">\n {(bankOffer.details as BankOffer).payments.map((payment: string) => {\n return <li class=\"s-offer-bank-payment-single\">\n <img\n src={salla.url.cdn('images/payment/' + payment + '.png') || salla.url.cdn('images/s-empty.png')}\n data-src={salla.url.cdn('images/payment/' + payment + '.png')}\n alt=\"payment\" />\n </li>\n })}\n </ul>\n {this.isMultipleBank ?\n <p class=\"s-offer-bank-payment-discount-percent\">\n {`${this.product_discount_text} ${(bankOffer.details as BankOffer).discount_value}${(bankOffer.details as BankOffer).discount_type === \"percentage\" && '%'}`}\n </p>\n : \"\"}\n </div>\n {!this.isMultipleBank ?\n <div class=\"s-offer-bank-message s-offer-slide-one-fourth\">\n <h2>{this.offersList[0].title}</h2>\n <p innerHTML={this.generateBankDescription(this.offersList[0].description, (bankOffer.details as BankOffer).discount_value)}></p>\n </div>\n : \"\"}\n </div>\n })\n }\n\n private generateBankDescription(desc: string, value): string {\n return desc.replace(new RegExp(`${value} %`), `<span class=\"s-offer-bank-message-amount\">${value} %</span>`)\n }\n\n /**\n * Generates content for the discount table section.\n *\n * @param discountTable - An array of Discount objects.\n * @returns An array of HTML elements representing discounts_table.\n */\n private renderDiscountTableSection() {\n const offer: Offer = this.offersList[0];\n let show_discounted_price = (offer.details as DiscountDetailTable).show_price_after_discount;\n return (this.offersList[0].details as DiscountDetailTable).discounts?.map((discount: Discount) => <div class=\"s-offer-slide-one-fourth\">\n <div class=\"s-offer-slide-offer-entry\">\n <div class=\"s-offer-slide-offer-entry-price-quantity-container\">\n <p class=\"s-offer-slide-offer-entry-quantity\">{this.buy_quantity_text(discount.quantity)}</p>\n {show_discounted_price ?\n <div class=\"s-offer-slide-offer-entry-price\">\n <span>{this.offer_with_price_text}</span>\n <span class=\"s-offer-slide-offer-entry-price-amount\">{discount.discounted_amount}</span> <span>{this.userCurrency}</span>\n </div> : \"\"}\n </div>\n <p class=\"s-offer-slide-offer-entry-price-amount-percent\">{this.with_discount_text}\n (<span>{discount.percentage}{!!discount.percentage && '%'}</span>)</p>\n </div>\n </div>\n )\n }\n\n private renderSpecialPriceSection() {\n const details = this.offersList[0].details as SpecialPriceDetail;\n\n return [\n // Render products if `apply_to` is \"product\"\n details.apply_to === \"product\" &&\n details.products?.map((product:Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n\n // Render categories if `apply_to` is \"category\"\n details.apply_to === \"category\" &&\n details.categories?.map((category: Category) => this.getCategoriesSection(category)),\n ];\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAAA,IAAY,QAGX;YAHD,CAAA,UAAY,QAAQ,EAAA;YAClB,IAAA,QAAA,CAAA,eAAA,CAAA,GAAA,gBAAgC;YAChC,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa;YACf,CAAC,EAHW,QAAQ,KAAR,QAAQ,GAGnB,EAAA,CAAA,CAAA;YAED,IAAY,SAOX;YAPD,CAAA,UAAY,SAAS,EAAA;YACnB,IAAA,SAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;YAC3B,IAAA,SAAA,CAAA,mBAAA,CAAA,GAAA,OAA2B;YAC3B,IAAA,SAAA,CAAA,gBAAA,CAAA,GAAA,iBAAkC;YAClC,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;YACb,IAAA,SAAA,CAAA,UAAA,CAAA,GAAA,aAAwB;YACxB,IAAA,SAAA,CAAA,cAAA,CAAA,GAAA,eAA8B;YAChC,CAAC,EAPW,SAAS,KAAT,SAAS,GAOpB,EAAA,CAAA,CAAA;;YCZD,MAAM,aAAa,GAAG,khBAAkhB;;kBCmB3hB,UAAU,0BAAA,MAAA;YAErB,IAAA,WAAA,CAAA,OAAA,EAAA;;;YAoBA;;;;;;;;YAQG;YACK,QAAA,IAAoB,CAAA,oBAAA,GAAW,2BAA2B;;YAGzD,QAAA,IAAU,CAAA,UAAA,GAAY,EAAE;YAExB,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;YAK/B,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;YAC5B,QAAA,IAAS,CAAA,SAAA,GAAY,KAAK;oBAC1B,IAAS,CAAA,SAAA,GAAY,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,4CAA4C,CAAC;;YAGn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,EAAC,EAAA,OAAO,EAAE,OAAO,EAA8B;YAC3E,sBAAE,mDAAoC,OAAO,EAAE,OAAO,EAAuB,CAAA,CAC3E,CACP,CAAC,CAAA;;wBAGF,OAAO,CAAC,QAAQ,KAAK,UAAU;YAC/B,iBAAA,CAAA,EAAA,GAAA,OAAO,CAAC,UAAU,0CAAE,GAAG,CAAC,CAAC,QAAkB,KAAK,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAA;qBACrF;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"p-BDwaPwi4.system.js","sources":["src/components/salla-order-summary/salla-order-summary.scss?tag=salla-order-summary","src/components/salla-order-summary/salla-order-summary.tsx"],"sourcesContent":[":host {\n display: block;\n}","import { Component, State, h, Prop } from '@stencil/core';\nimport { orderItem } from './interfaces';\n\nimport iconFileArchive from '../../assets/svg/file-archive.svg'\nimport iconDownload from '../../assets/svg/download.svg'\nimport iconCopy from '../../assets/svg/swap-stroke.svg'\nimport iconCheck from '../../assets/svg/check.svg'\nimport iconCreditCard from '../../assets/svg/debit-card-back.svg'\n\n@Component({\n tag: 'salla-order-summary',\n styleUrl: 'salla-order-summary.scss',\n})\nexport class SallaOrderSummary {\n\n copyCodeButtonTimeout: NodeJS.Timeout\n\n /**\n * The order ID to fetch items from\n */\n @Prop({ reflect: true }) orderId?: number;\n\n @State() codeCopied: string | null = null\n @State() noItemFound: boolean = true\n @State() order_items: orderItem[] = []\n\n private codes_text: string\n private copy_text: string\n private files_text: string\n private download_text: string\n\n private isDigitalCard = (item: orderItem) => item.product.type === 'codes'\n private isDigitalProduct = (item: orderItem) => item.product.type === 'digital'\n\n async componentWillLoad() {\n salla.lang.onLoaded(() => {\n this.codes_text = salla.lang.get('pages.thank_you.codes')\n this.copy_text = salla.lang.get('common.elements.copy')\n this.files_text = salla.lang.get('pages.thank_you.files')\n this.download_text = salla.lang.get('pages.thank_you.download')\n })\n return await this.getOrderItems()\n \n }\n\n private copyToClipboardHandler(code: string) {\n if (navigator && 'clipboard' in navigator) {\n try {\n navigator.clipboard.writeText(code).then(() => {\n this.codeCopied = code\n\n this.copyCodeButtonTimeout = setTimeout(() => {\n this.codeCopied = null\n }, 3000)\n\n })\n } catch (error) {\n salla.loggers.error('copy functionality is not supported by the browser')\n }\n }\n }\n\n private async getOrderItems() {\n\n const orderId = this.orderId || salla.config.get('page.id')\n const errorMessage = \"Failed to fetch order items\"\n\n if (!orderId) {\n salla.logger.error(errorMessage)\n throw new Error(errorMessage)\n }\n\n try {\n const { data: { items = [] } } = await salla.api.request(`orders/${orderId}`)\n\n const validItems = items.some((item) => (this.isDigitalCard(item) || this.isDigitalProduct(item)))\n\n if (validItems) {\n this.order_items = items\n this.noItemFound = false\n }\n } catch (error) {\n salla.logger.error(errorMessage)\n }\n }\n\n disconnectedCallback() {\n this.copyCodeButtonTimeout && clearTimeout(this.copyCodeButtonTimeout)\n }\n\n render() {\n return (\n\n <ul class=\"s-order-summary-wrapper\">\n {this.noItemFound ? <salla-placeholder alignment=\"center\">\n <span slot=\"title\" />\n </salla-placeholder> :\n this.order_items.map((item) => (\n this.isDigitalCard(item) ? (\n <li key={item.product.id} class=\"s-order-summary-item\">\n <h2 class=\"s-order-summary-item-title\">\n {this.codes_text} ({item.name})\n </h2>\n {item.codes.map((code) => (\n <div key={code.code} class=\"s-order-summary-code-item-wrapper\">\n <p>\n <span innerHTML={iconCreditCard} />\n <span>{code.code}</span>\n </p>\n <salla-button class={`s-order-summary-item-copy-button ${this.codeCopied === code.code ? 'copied' : ''}`} onClick={() => this.copyToClipboardHandler(code.code)} shape=\"link\">\n <span innerHTML={this.codeCopied === code.code ? iconCheck : iconCopy} />\n <span >{this.copy_text}</span>\n </salla-button >\n </div>\n ))}\n </li>\n ) :\n this.isDigitalProduct(item) ? (\n <li key={item.product.id} class=\"s-order-summary-item\">\n <h2 class=\"s-order-summary-item-title\">\n {this.files_text} ({item.name})\n </h2>\n <ul>\n {item.files.map((file) => (\n <li class=\"s-order-summary-digital-item-wrapper\">\n <div>\n <span innerHTML={iconFileArchive} />\n <span>{file.name}</span>\n </div>\n <a href={file.url} target=\"_blank\" class=\"s-order-summary-item-download\">\n <span innerHTML={iconDownload} />\n <span>{this.download_text}</span>\n </a>\n </li>\n ))}\n </ul>\n </li>\n ) : null\n ))\n }\n </ul>\n );\n }\n\n}\n\n\n"],"names":["iconCheck"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAA,MAAM,oBAAoB,GAAG,sBAAsB;;YCatC,iBAAiB,kCAAA,MAAA;MAJ9B,IAAA,WAAA,CAAA,OAAA,EAAA;;MAaW,QAAA,IAAU,CAAA,UAAA,GAAkB,IAAI;MAChC,QAAA,IAAW,CAAA,WAAA,GAAY,IAAI;MAC3B,QAAA,IAAW,CAAA,WAAA,GAAgB,EAAE;MAO9B,QAAA,IAAA,CAAA,aAAa,GAAG,CAAC,IAAe,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO;MAClE,QAAA,IAAA,CAAA,gBAAgB,GAAG,CAAC,IAAe,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS;MAgHhF;MA9GC,IAAA,MAAM,iBAAiB,GAAA;MACrB,QAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAK;kBACvB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC;kBACzD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC;kBACvD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC;kBACzD,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC;MACjE,SAAC,CAAC;MACF,QAAA,OAAO,MAAM,IAAI,CAAC,aAAa,EAAE;;MAI3B,IA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AQ,CAC/B,CACD,CACN,CAAC,CACC,CACF,IACH,IAAI,CACX,CAAC,CAED;;;;;;;;;;;"}
1
+ {"version":3,"file":"p-BBWAcIuZ.system.js","sources":["src/components/salla-order-summary/salla-order-summary.scss?tag=salla-order-summary","src/components/salla-order-summary/salla-order-summary.tsx"],"sourcesContent":[":host {\n display: block;\n}","import { Component, State, h, Prop } from '@stencil/core';\nimport { orderItem } from './interfaces';\n\nimport iconFileArchive from '../../assets/svg/file-archive.svg'\nimport iconDownload from '../../assets/svg/download.svg'\nimport iconCopy from '../../assets/svg/swap-stroke.svg'\nimport iconCheck from '../../assets/svg/check.svg'\nimport iconCreditCard from '../../assets/svg/debit-card-back.svg'\n\n@Component({\n tag: 'salla-order-summary',\n styleUrl: 'salla-order-summary.scss',\n})\nexport class SallaOrderSummary {\n\n copyCodeButtonTimeout: NodeJS.Timeout\n\n /**\n * The order ID to fetch items from\n */\n @Prop({ reflect: true }) orderId?: number;\n\n @State() codeCopied: string | null = null\n @State() noItemFound: boolean = true\n @State() order_items: orderItem[] = []\n\n private codes_text: string\n private copy_text: string\n private files_text: string\n private download_text: string\n\n private isDigitalCard = (item: orderItem) => item.product.type === 'codes'\n private isDigitalProduct = (item: orderItem) => item.product.type === 'digital'\n\n async componentWillLoad() {\n salla.lang.onLoaded(() => {\n this.codes_text = salla.lang.get('pages.thank_you.codes')\n this.copy_text = salla.lang.get('common.elements.copy')\n this.files_text = salla.lang.get('pages.thank_you.files')\n this.download_text = salla.lang.get('pages.thank_you.download')\n })\n return await this.getOrderItems()\n \n }\n\n private copyToClipboardHandler(code: string) {\n if (navigator && 'clipboard' in navigator) {\n try {\n navigator.clipboard.writeText(code).then(() => {\n this.codeCopied = code\n\n this.copyCodeButtonTimeout = setTimeout(() => {\n this.codeCopied = null\n }, 3000)\n\n })\n } catch (error) {\n salla.loggers.error('copy functionality is not supported by the browser')\n }\n }\n }\n\n private async getOrderItems() {\n\n const orderId = this.orderId || salla.config.get('page.id')\n const errorMessage = \"Failed to fetch order items\"\n\n if (!orderId) {\n salla.logger.error(errorMessage)\n throw new Error(errorMessage)\n }\n\n try {\n const { data: { items = [] } } = await salla.api.request(`orders/${orderId}`)\n\n const validItems = items.some((item) => (this.isDigitalCard(item) || this.isDigitalProduct(item)))\n\n if (validItems) {\n this.order_items = items\n this.noItemFound = false\n }\n } catch (error) {\n salla.logger.error(errorMessage)\n }\n }\n\n disconnectedCallback() {\n this.copyCodeButtonTimeout && clearTimeout(this.copyCodeButtonTimeout)\n }\n\n render() {\n return (\n\n <ul class=\"s-order-summary-wrapper\">\n {this.noItemFound ? <salla-placeholder alignment=\"center\">\n <span slot=\"title\" />\n </salla-placeholder> :\n this.order_items.map((item) => (\n this.isDigitalCard(item) ? (\n <li key={item.product.id} class=\"s-order-summary-item\">\n <h2 class=\"s-order-summary-item-title\">\n {this.codes_text} ({item.name})\n </h2>\n {item.codes.map((code) => (\n <div key={code.code} class=\"s-order-summary-code-item-wrapper\">\n <p>\n <span innerHTML={iconCreditCard} />\n <span>{code.code}</span>\n </p>\n <salla-button class={`s-order-summary-item-copy-button ${this.codeCopied === code.code ? 'copied' : ''}`} onClick={() => this.copyToClipboardHandler(code.code)} shape=\"link\">\n <span innerHTML={this.codeCopied === code.code ? iconCheck : iconCopy} />\n <span >{this.copy_text}</span>\n </salla-button >\n </div>\n ))}\n </li>\n ) :\n this.isDigitalProduct(item) ? (\n <li key={item.product.id} class=\"s-order-summary-item\">\n <h2 class=\"s-order-summary-item-title\">\n {this.files_text} ({item.name})\n </h2>\n <ul>\n {item.files.map((file) => (\n <li class=\"s-order-summary-digital-item-wrapper\">\n <div>\n <span innerHTML={iconFileArchive} />\n <span>{file.name}</span>\n </div>\n <a href={file.url} target=\"_blank\" class=\"s-order-summary-item-download\">\n <span innerHTML={iconDownload} />\n <span>{this.download_text}</span>\n </a>\n </li>\n ))}\n </ul>\n </li>\n ) : null\n ))\n }\n </ul>\n );\n }\n\n}\n\n\n"],"names":["iconCheck"],"mappings":";;;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