@salla.sa/twilight-components 2.14.366 → 2.14.368

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 (251) hide show
  1. package/dist/cjs/{filepond-iKAI8_Ua.js → filepond-BFZbLcs9.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DBOuyuqE.js → filepond-plugin-file-poster-j5N_wxed.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-3OjivJWc.js → filepond-plugin-file-validate-size-C4fE0LiJ.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-C4wPNa1h.js → filepond-plugin-file-validate-type-K4KCyB8B.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-D06RnDWS.js → filepond-plugin-image-edit-BPQKyMc5.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-CbwYrnuw.js → filepond-plugin-image-exif-orientation-Bqc0A8tM.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-mOmpKkFJ.js → filepond-plugin-image-preview-CWUeJfUC.js} +1 -1
  8. package/dist/cjs/{index-TmWujwmX.js → index-57tdmUta.js} +1 -1
  9. package/dist/cjs/{index-DL9nqubd.js → index-BbnigMiZ.js} +2 -2
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/salla-accordion-body_3.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-add-product-button_4.cjs.entry.js +5 -3
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  19. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cookies-bar.cjs.entry.js +2 -2
  24. package/dist/cjs/salla-count-down_2.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-products-list.cjs.entry.js +1 -6
  59. package/dist/cjs/salla-products-slider.cjs.entry.js +3 -9
  60. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  78. package/dist/cjs/twilight.cjs.js +1 -1
  79. package/dist/cjs/{vanilla-picker-DPu_Z0gW.js → vanilla-picker-DVyFh2bj.js} +1 -1
  80. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +4 -1
  81. package/dist/collection/components/salla-cookies-bar/salla-cookies-bar.js +1 -1
  82. package/dist/collection/components/salla-products-list/salla-products-list.js +0 -5
  83. package/dist/collection/components/salla-products-slider/salla-products-slider.js +2 -8
  84. package/dist/components/index.js +2 -2
  85. package/dist/components/salla-add-product-button2.js +4 -1
  86. package/dist/components/salla-cookies-bar.js +1 -1
  87. package/dist/components/salla-products-list2.js +0 -5
  88. package/dist/components/salla-products-slider2.js +2 -8
  89. package/dist/esm/{filepond-OIAu6i0O.js → filepond-13fnFppb.js} +1 -1
  90. package/dist/esm/{filepond-plugin-file-poster-BMvjO1cc.js → filepond-plugin-file-poster-BpvS4tvR.js} +1 -1
  91. package/dist/esm/{filepond-plugin-file-validate-size-CMCs88HU.js → filepond-plugin-file-validate-size-D5_uYEwO.js} +1 -1
  92. package/dist/esm/{filepond-plugin-file-validate-type-Bjpeuqen.js → filepond-plugin-file-validate-type-BL4ft-S-.js} +1 -1
  93. package/dist/esm/{filepond-plugin-image-edit-Fpoh6xBj.js → filepond-plugin-image-edit-B1N2m-gK.js} +1 -1
  94. package/dist/esm/{filepond-plugin-image-exif-orientation-CPChwYPW.js → filepond-plugin-image-exif-orientation-3XnkO1Od.js} +1 -1
  95. package/dist/esm/{filepond-plugin-image-preview-pLwEytag.js → filepond-plugin-image-preview-B5KuY0qu.js} +1 -1
  96. package/dist/esm/{index-Cs4XvAmW.js → index-Cb4vp5Dk.js} +1 -1
  97. package/dist/esm/{index-CV1rqKQz.js → index-Y6CiunLU.js} +2 -2
  98. package/dist/esm/loader.js +2 -2
  99. package/dist/esm/salla-accordion-body_3.entry.js +1 -1
  100. package/dist/esm/salla-accordion_6.entry.js +1 -1
  101. package/dist/esm/salla-add-product-button_4.entry.js +5 -3
  102. package/dist/esm/salla-advertisement.entry.js +1 -1
  103. package/dist/esm/salla-alert_2.entry.js +1 -1
  104. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  105. package/dist/esm/salla-apps-icons.entry.js +1 -1
  106. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  107. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  108. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  109. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  110. package/dist/esm/salla-contacts.entry.js +1 -1
  111. package/dist/esm/salla-cookies-bar.entry.js +2 -2
  112. package/dist/esm/salla-count-down_2.entry.js +1 -1
  113. package/dist/esm/salla-custom-fields.entry.js +1 -1
  114. package/dist/esm/salla-filters-widget.entry.js +1 -1
  115. package/dist/esm/salla-filters.entry.js +1 -1
  116. package/dist/esm/salla-gifting.entry.js +1 -1
  117. package/dist/esm/salla-hook.entry.js +1 -1
  118. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  119. package/dist/esm/salla-installment.entry.js +1 -1
  120. package/dist/esm/salla-list-tile.entry.js +1 -1
  121. package/dist/esm/salla-localization-modal.entry.js +1 -1
  122. package/dist/esm/salla-login-modal.entry.js +1 -1
  123. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  124. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  125. package/dist/esm/salla-loyalty.entry.js +1 -1
  126. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  127. package/dist/esm/salla-menu.entry.js +1 -1
  128. package/dist/esm/salla-metadata.entry.js +1 -1
  129. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  130. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  131. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  132. package/dist/esm/salla-notification-item.entry.js +1 -1
  133. package/dist/esm/salla-notifications.entry.js +1 -1
  134. package/dist/esm/salla-offer-modal.entry.js +1 -1
  135. package/dist/esm/salla-offer.entry.js +1 -1
  136. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  137. package/dist/esm/salla-order-details-options.entry.js +1 -1
  138. package/dist/esm/salla-order-details.entry.js +1 -1
  139. package/dist/esm/salla-order-summary.entry.js +1 -1
  140. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  141. package/dist/esm/salla-orders.entry.js +1 -1
  142. package/dist/esm/salla-payments.entry.js +1 -1
  143. package/dist/esm/salla-placeholder.entry.js +1 -1
  144. package/dist/esm/salla-price-range.entry.js +1 -1
  145. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  146. package/dist/esm/salla-products-list.entry.js +1 -6
  147. package/dist/esm/salla-products-slider.entry.js +3 -9
  148. package/dist/esm/salla-progress-bar.entry.js +1 -1
  149. package/dist/esm/salla-quick-order.entry.js +1 -1
  150. package/dist/esm/salla-rating-modal.entry.js +1 -1
  151. package/dist/esm/salla-scopes.entry.js +1 -1
  152. package/dist/esm/salla-search.entry.js +1 -1
  153. package/dist/esm/salla-skeleton.entry.js +1 -1
  154. package/dist/esm/salla-slider.entry.js +1 -1
  155. package/dist/esm/salla-social-share.entry.js +1 -1
  156. package/dist/esm/salla-social.entry.js +1 -1
  157. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  158. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  159. package/dist/esm/salla-tooltip.entry.js +1 -1
  160. package/dist/esm/salla-trust-badges.entry.js +1 -1
  161. package/dist/esm/salla-user-menu.entry.js +1 -1
  162. package/dist/esm/salla-user-profile.entry.js +1 -1
  163. package/dist/esm/salla-user-settings.entry.js +1 -1
  164. package/dist/esm/salla-verify.entry.js +1 -1
  165. package/dist/esm/salla-wallet.entry.js +1 -1
  166. package/dist/esm/twilight.js +2 -2
  167. package/dist/esm/{vanilla-picker-BASTfXcg.js → vanilla-picker-B7piONfC.js} +1 -1
  168. package/dist/twilight/{p-2405c0f7.entry.js → p-00265d7c.entry.js} +1 -1
  169. package/dist/twilight/{p-75ab49a3.entry.js → p-072f71c3.entry.js} +1 -1
  170. package/dist/twilight/{p-1f6ead7d.entry.js → p-0862caad.entry.js} +1 -1
  171. package/dist/twilight/{p-bb0585cc.entry.js → p-0a074662.entry.js} +1 -1
  172. package/dist/twilight/{p-0f1d7449.entry.js → p-0a9a6df5.entry.js} +1 -1
  173. package/dist/twilight/{p-04664fcb.entry.js → p-0d4b87c7.entry.js} +1 -1
  174. package/dist/twilight/{p-3c418ff7.entry.js → p-133743ba.entry.js} +1 -1
  175. package/dist/twilight/p-13ad1a43.entry.js +4 -0
  176. package/dist/twilight/{p-af3d4d0d.entry.js → p-17011d71.entry.js} +1 -1
  177. package/dist/twilight/{p-907b40cd.entry.js → p-1e59d6df.entry.js} +1 -1
  178. package/dist/twilight/{p-2c787ba0.entry.js → p-2038c995.entry.js} +1 -1
  179. package/dist/twilight/{p-5485978c.entry.js → p-25daa921.entry.js} +1 -1
  180. package/dist/twilight/{p-4d35a32b.entry.js → p-274b59eb.entry.js} +1 -1
  181. package/dist/twilight/{p-8c2b148a.entry.js → p-29fd4524.entry.js} +1 -1
  182. package/dist/twilight/{p-965fe2b3.entry.js → p-2a26fb24.entry.js} +1 -1
  183. package/dist/twilight/{p-3f8b06b3.entry.js → p-2f6f0743.entry.js} +1 -1
  184. package/dist/twilight/{p-6f09b53e.entry.js → p-33d68882.entry.js} +1 -1
  185. package/dist/twilight/{p-f1be81ba.entry.js → p-38fcc532.entry.js} +1 -1
  186. package/dist/twilight/{p-215ed586.entry.js → p-3e24955a.entry.js} +1 -1
  187. package/dist/twilight/{p-f8fb3130.entry.js → p-46a1466d.entry.js} +1 -1
  188. package/dist/twilight/{p-e2c6ed54.entry.js → p-4dc533c9.entry.js} +1 -1
  189. package/dist/twilight/{p-db4f5b38.entry.js → p-4f36d6a1.entry.js} +1 -1
  190. package/dist/twilight/{p-6dbcd99e.entry.js → p-5073fed9.entry.js} +1 -1
  191. package/dist/twilight/{p-e0e61f73.entry.js → p-50ec770f.entry.js} +1 -1
  192. package/dist/twilight/{p-6b6e2a52.entry.js → p-51679569.entry.js} +1 -1
  193. package/dist/twilight/{p-233b89ad.entry.js → p-52f4eb31.entry.js} +1 -1
  194. package/dist/twilight/{p-50f5e38d.entry.js → p-540f44e1.entry.js} +1 -1
  195. package/dist/twilight/{p-9797a552.entry.js → p-56b5e580.entry.js} +1 -1
  196. package/dist/twilight/{p-64ac4c0c.entry.js → p-59677d68.entry.js} +1 -1
  197. package/dist/twilight/{p-594d219c.entry.js → p-5ba1da41.entry.js} +1 -1
  198. package/dist/twilight/{p-c0ab0fc6.entry.js → p-5bb6b939.entry.js} +1 -1
  199. package/dist/twilight/{p-c3f515ae.entry.js → p-5fa668d1.entry.js} +1 -1
  200. package/dist/twilight/{p-22b1bd15.entry.js → p-6066a33d.entry.js} +1 -1
  201. package/dist/twilight/{p-0ede455c.entry.js → p-69884c12.entry.js} +1 -1
  202. package/dist/twilight/{p-cf64bb24.entry.js → p-6eb3185b.entry.js} +1 -1
  203. package/dist/twilight/{p-9d937a82.entry.js → p-72c6ea67.entry.js} +1 -1
  204. package/dist/twilight/{p-f1156ab8.entry.js → p-7389553b.entry.js} +1 -1
  205. package/dist/twilight/{p-90eea1a9.entry.js → p-7a197371.entry.js} +1 -1
  206. package/dist/twilight/{p-fc6ddedc.entry.js → p-85229513.entry.js} +1 -1
  207. package/dist/twilight/{p-a5df57f9.entry.js → p-87756e85.entry.js} +1 -1
  208. package/dist/twilight/{p-d64027b9.entry.js → p-8a287dfe.entry.js} +1 -1
  209. package/dist/twilight/{p-f9fcf183.entry.js → p-8cd21001.entry.js} +1 -1
  210. package/dist/twilight/p-9272011d.entry.js +4 -0
  211. package/dist/twilight/{p-ac7f094e.entry.js → p-9b8ab958.entry.js} +1 -1
  212. package/dist/twilight/{p-D5AsuzfF.js → p-BCiXbXPf.js} +1 -1
  213. package/dist/twilight/{p-5mQqqwMU.js → p-BET_97_b.js} +1 -1
  214. package/dist/twilight/{p-f2v0udIe.js → p-Bcx5sYnZ.js} +1 -1
  215. package/dist/twilight/{p-BLbGjdAU.js → p-C0K8EiG4.js} +1 -1
  216. package/dist/twilight/{p-BGB1zYFQ.js → p-DcT7j_au.js} +1 -1
  217. package/dist/twilight/{p-CofhuO2Z.js → p-Dwd0nl0N.js} +1 -1
  218. package/dist/twilight/p-E4Drg2mm.js +9 -0
  219. package/dist/twilight/{p-CV1rqKQz.js → p-Y6CiunLU.js} +1 -1
  220. package/dist/twilight/{p-0c385d73.entry.js → p-a396686e.entry.js} +1 -1
  221. package/dist/twilight/{p-134c9d22.entry.js → p-a5341e29.entry.js} +1 -1
  222. package/dist/twilight/{p-dfc75ce2.entry.js → p-a5ed9268.entry.js} +1 -1
  223. package/dist/twilight/{p-15242c87.entry.js → p-a767c83d.entry.js} +1 -1
  224. package/dist/twilight/{p-a0a6a255.entry.js → p-af6d37b9.entry.js} +1 -1
  225. package/dist/twilight/{p-40ec7a33.entry.js → p-b10a5dc1.entry.js} +1 -1
  226. package/dist/twilight/{p-6aecc925.entry.js → p-b1cd84e9.entry.js} +1 -1
  227. package/dist/twilight/p-b323bd9c.entry.js +4 -0
  228. package/dist/twilight/p-b5aecb9b.entry.js +4 -0
  229. package/dist/twilight/{p-c7719ce9.entry.js → p-ba808f52.entry.js} +1 -1
  230. package/dist/twilight/{p-95db0124.entry.js → p-badcbdcf.entry.js} +1 -1
  231. package/dist/twilight/{p-1aead6d3.entry.js → p-cfa0b892.entry.js} +1 -1
  232. package/dist/twilight/{p-721bb258.entry.js → p-d1fe1003.entry.js} +1 -1
  233. package/dist/twilight/{p-a08f5eae.entry.js → p-da81ede0.entry.js} +1 -1
  234. package/dist/twilight/{p-58f562df.entry.js → p-db9eaba1.entry.js} +1 -1
  235. package/dist/twilight/{p-c90a6440.entry.js → p-e7ceddca.entry.js} +1 -1
  236. package/dist/twilight/{p-e1bf6d23.entry.js → p-ea031fc5.entry.js} +1 -1
  237. package/dist/twilight/{p-585a349f.entry.js → p-ecdc4cd6.entry.js} +1 -1
  238. package/dist/twilight/{p-DbzHZVd1.js → p-edeim4q7.js} +1 -1
  239. package/dist/twilight/{p-3c09b198.entry.js → p-ee25eb47.entry.js} +1 -1
  240. package/dist/twilight/{p-e0ce2c0d.entry.js → p-f1964ad5.entry.js} +1 -1
  241. package/dist/twilight/{p-7bfb9d71.entry.js → p-f49e71c7.entry.js} +1 -1
  242. package/dist/twilight/{p-2dd98664.entry.js → p-f75d4e9b.entry.js} +1 -1
  243. package/dist/twilight/{p-3c6f9112.entry.js → p-fc6cf914.entry.js} +1 -1
  244. package/dist/twilight/{p-CvLPGpFQ.js → p-zW4iqu6h.js} +1 -1
  245. package/dist/twilight/twilight.esm.js +1 -1
  246. package/package.json +5 -5
  247. package/dist/twilight/p-6daa8bd8.entry.js +0 -4
  248. package/dist/twilight/p-7c8c6c47.entry.js +0 -4
  249. package/dist/twilight/p-a386b02a.entry.js +0 -4
  250. package/dist/twilight/p-de42ef8c.entry.js +0 -4
  251. package/dist/twilight/p-tacIS_Xg.js +0 -9
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as e,H as s,a as l,F as o}from"./p-CV1rqKQz.js";const d=class{constructor(e){t(this,e),this.sections=[],this.itemNumber=""}deleteItem(t,e){const s=this.host.closest("form");if(s){const l=s.getAttribute("id");if(l&&"string"==typeof l){const s=l.match(/item-(\d+)/)?.[1];this.itemNumber=s||"";const o=this.host.querySelector(`#accordion-${e.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${e.id}&section_id=${t}`).then((()=>o?.remove()))}}}renderRemoveButton(t,s,l=!1){return e("salla-button",{type:"button",shape:l?"btn":"icon",fill:l?"outline":"solid",size:"small",color:"danger","aria-label":"Remove from the cart",onClick:()=>this.deleteItem(t,s)},l?salla.lang.get("common.elements.delete"):e("i",{class:"sicon-cancel"}))}renderAccordionHeader(t,s){const l=s?.options&&s?.options?.length>0;return e("div",{slot:"html",class:"s-multiple-bundle-product-cart-header-wrapper"},e("div",{class:"s-multiple-bundle-product-cart-header "+(l?"":"s-multiple-bundle-product-cart-header-no-options")},e("div",{class:"s-multiple-bundle-product-cart-header-content"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-image-wrapper"},e("img",{src:s?.image?.url,alt:s?.image?.alt||s?.name,class:"s-multiple-bundle-product-cart-header-image"})),e("div",{class:"s-multiple-bundle-product-cart-header-content-details"},e("h2",{class:"s-multiple-bundle-product-cart-header-content-details-title"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-content-details-title-link"},s?.name)),e("div",{class:"s-multiple-bundle-product-cart-header-content-details-price"},e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-regular"},e("span",{innerHTML:s?.price?salla.money(s?.price):""})),s?.sale_price>0&&e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-sale"},e("span",{innerHTML:salla.money(s?.sale_price)}))),s?.quantity_in_group>0&&0!==s?.quantity&&e("p",{class:"s-multiple-bundle-product-cart-header-content-details-quantity"},e("span",null,salla.lang.get("pages.products.number_of_pieces")),e("span",null,s?.quantity_in_group)))),!l&&e("div",{class:"s-multiple-bundle-product-cart-header-remove-button"},this.renderRemoveButton(t,s,!1))))}render(){return e(s,{key:"34b9ae8c08eccee16d15f5ebff73b1d27f636e79",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"2f8d0bf68e67aa3bc21206d7282113fbfa67560b",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>t.products.map((l=>{const o={sectionId:t.id,sectionIndex:s,productId:l.id};return e("salla-accordion",{key:l.id,collapsed:!1,bordered:!0,collapsible:!!(l.options&&l.options.length>0),size:"sm",id:`accordion-${l.id}`},e("salla-accordion-head",null,this.renderAccordionHeader(String(t.id),l)),l.options&&l.options.length>0&&e("salla-accordion-body",null,e("salla-product-options",{options:JSON.stringify(l.options),key:`${l.id}-persistent`,"product-id":l.id,"bundle-context":JSON.stringify(o)}),e("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),l,!0))))}))))))}get host(){return l(this)}};d.style="";const a=class{constructor(e){t(this,e),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id,l=this.selectedProducts[t].has(s);l?(this.selectedProducts[t].delete(s),this.clearProductFormData(s,t),this.clearProductModalOptions(s,t)):this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options,wasSelected:l,isSelected:!l})},this.ensureProductSelected=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id;this.selectedProducts[t].has(s)||(this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options}))},this.onSelectProductOptions=(t,e)=>{const s=this.sections.findIndex((t=>t.id==e)),l=this.sections.find((t=>t.id==e)),o=l?.products?.findIndex((e=>e.id==t.id))??0;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:e,sectionIndex:s,productIndex:o})},this.handleBundleSliderProductSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProduct(s,e)},this.handleBundleSliderProductOptionsSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProductOptions(e,s)}}clearProductFormData(t,e){const s=this.host.closest("form");if(e){const l=`bundle[${e}][`;Array.from(s.querySelectorAll("input")).filter((e=>e.getAttribute("data-product-id")===String(t)&&e.name&&e.name.startsWith(l))).forEach((t=>t.remove()))}else s.querySelectorAll(`[data-product-id="${t}"]`).forEach((t=>t.remove()))}clearProductModalOptions(t,e){let s=null,l=null;if(null!=e&&(s=this.sections.findIndex((t=>t.id==e)),s>-1)){const e=this.sections[s];if(e){const s=e.products?.findIndex((e=>e.id==t));l="number"==typeof s&&s>-1?s:null}}salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t,sectionId:e,sectionIndex:s,productIndex:l})}renderAccordionHeader(t,s){return e(o,null,e("h2",{slot:"title"},t?.name),t?.obligatory_products?e("span",{slot:"note"},salla.lang.get("pages.products.obligatory_products",{count:t?.obligatory_products||0})):"",e("span",{slot:"progress"},s,"/",t?.products?.length||0))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:e,sectionId:s,product:l,fromModal:o}=t.detail;o?this.ensureProductSelected(s,l||{id:e}):this.onSelectProduct(s,l||{id:e})},t.addEventListener("productSelected",this.productSelectedHandler))}disconnectedCallback(){if(this.productSelectedHandler){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&t.removeEventListener("productSelected",this.productSelectedHandler),this.productSelectedHandler=null}}render(){return e(s,{key:"2a7a27e8bfc7325575fec782139828333590eb9f",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"affcb43ee67e329a9a87d6234bb91b5494a69a35",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>e("salla-accordion",{key:t.id,collapsed:0!==s},e("salla-accordion-head",null,this.renderAccordionHeader(t,this.selectedProducts[t.id]?.size||0)),e("salla-accordion-body",null,e("salla-multiple-bundle-product-slider",{section:t,sectionIndex:s,selectedProducts:this.selectedProducts,onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),e("salla-multiple-bundle-product-options-modal",{key:"6b9065e8f7872da72166979fc9ce61efaad21c0a"}))}get host(){return l(this)}};a.style="";export{d as salla_multiple_bundle_product_cart,a as salla_multiple_bundle_product_details}
4
+ import{r as t,h as e,H as s,a as l,F as o}from"./p-Y6CiunLU.js";const d=class{constructor(e){t(this,e),this.sections=[],this.itemNumber=""}deleteItem(t,e){const s=this.host.closest("form");if(s){const l=s.getAttribute("id");if(l&&"string"==typeof l){const s=l.match(/item-(\d+)/)?.[1];this.itemNumber=s||"";const o=this.host.querySelector(`#accordion-${e.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${e.id}&section_id=${t}`).then((()=>o?.remove()))}}}renderRemoveButton(t,s,l=!1){return e("salla-button",{type:"button",shape:l?"btn":"icon",fill:l?"outline":"solid",size:"small",color:"danger","aria-label":"Remove from the cart",onClick:()=>this.deleteItem(t,s)},l?salla.lang.get("common.elements.delete"):e("i",{class:"sicon-cancel"}))}renderAccordionHeader(t,s){const l=s?.options&&s?.options?.length>0;return e("div",{slot:"html",class:"s-multiple-bundle-product-cart-header-wrapper"},e("div",{class:"s-multiple-bundle-product-cart-header "+(l?"":"s-multiple-bundle-product-cart-header-no-options")},e("div",{class:"s-multiple-bundle-product-cart-header-content"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-image-wrapper"},e("img",{src:s?.image?.url,alt:s?.image?.alt||s?.name,class:"s-multiple-bundle-product-cart-header-image"})),e("div",{class:"s-multiple-bundle-product-cart-header-content-details"},e("h2",{class:"s-multiple-bundle-product-cart-header-content-details-title"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-content-details-title-link"},s?.name)),e("div",{class:"s-multiple-bundle-product-cart-header-content-details-price"},e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-regular"},e("span",{innerHTML:s?.price?salla.money(s?.price):""})),s?.sale_price>0&&e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-sale"},e("span",{innerHTML:salla.money(s?.sale_price)}))),s?.quantity_in_group>0&&0!==s?.quantity&&e("p",{class:"s-multiple-bundle-product-cart-header-content-details-quantity"},e("span",null,salla.lang.get("pages.products.number_of_pieces")),e("span",null,s?.quantity_in_group)))),!l&&e("div",{class:"s-multiple-bundle-product-cart-header-remove-button"},this.renderRemoveButton(t,s,!1))))}render(){return e(s,{key:"34b9ae8c08eccee16d15f5ebff73b1d27f636e79",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"2f8d0bf68e67aa3bc21206d7282113fbfa67560b",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>t.products.map((l=>{const o={sectionId:t.id,sectionIndex:s,productId:l.id};return e("salla-accordion",{key:l.id,collapsed:!1,bordered:!0,collapsible:!!(l.options&&l.options.length>0),size:"sm",id:`accordion-${l.id}`},e("salla-accordion-head",null,this.renderAccordionHeader(String(t.id),l)),l.options&&l.options.length>0&&e("salla-accordion-body",null,e("salla-product-options",{options:JSON.stringify(l.options),key:`${l.id}-persistent`,"product-id":l.id,"bundle-context":JSON.stringify(o)}),e("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),l,!0))))}))))))}get host(){return l(this)}};d.style="";const a=class{constructor(e){t(this,e),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id,l=this.selectedProducts[t].has(s);l?(this.selectedProducts[t].delete(s),this.clearProductFormData(s,t),this.clearProductModalOptions(s,t)):this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options,wasSelected:l,isSelected:!l})},this.ensureProductSelected=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id;this.selectedProducts[t].has(s)||(this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options}))},this.onSelectProductOptions=(t,e)=>{const s=this.sections.findIndex((t=>t.id==e)),l=this.sections.find((t=>t.id==e)),o=l?.products?.findIndex((e=>e.id==t.id))??0;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:e,sectionIndex:s,productIndex:o})},this.handleBundleSliderProductSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProduct(s,e)},this.handleBundleSliderProductOptionsSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProductOptions(e,s)}}clearProductFormData(t,e){const s=this.host.closest("form");if(e){const l=`bundle[${e}][`;Array.from(s.querySelectorAll("input")).filter((e=>e.getAttribute("data-product-id")===String(t)&&e.name&&e.name.startsWith(l))).forEach((t=>t.remove()))}else s.querySelectorAll(`[data-product-id="${t}"]`).forEach((t=>t.remove()))}clearProductModalOptions(t,e){let s=null,l=null;if(null!=e&&(s=this.sections.findIndex((t=>t.id==e)),s>-1)){const e=this.sections[s];if(e){const s=e.products?.findIndex((e=>e.id==t));l="number"==typeof s&&s>-1?s:null}}salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t,sectionId:e,sectionIndex:s,productIndex:l})}renderAccordionHeader(t,s){return e(o,null,e("h2",{slot:"title"},t?.name),t?.obligatory_products?e("span",{slot:"note"},salla.lang.get("pages.products.obligatory_products",{count:t?.obligatory_products||0})):"",e("span",{slot:"progress"},s,"/",t?.products?.length||0))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:e,sectionId:s,product:l,fromModal:o}=t.detail;o?this.ensureProductSelected(s,l||{id:e}):this.onSelectProduct(s,l||{id:e})},t.addEventListener("productSelected",this.productSelectedHandler))}disconnectedCallback(){if(this.productSelectedHandler){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&t.removeEventListener("productSelected",this.productSelectedHandler),this.productSelectedHandler=null}}render(){return e(s,{key:"2a7a27e8bfc7325575fec782139828333590eb9f",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"affcb43ee67e329a9a87d6234bb91b5494a69a35",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>e("salla-accordion",{key:t.id,collapsed:0!==s},e("salla-accordion-head",null,this.renderAccordionHeader(t,this.selectedProducts[t.id]?.size||0)),e("salla-accordion-body",null,e("salla-multiple-bundle-product-slider",{section:t,sectionIndex:s,selectedProducts:this.selectedProducts,onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),e("salla-multiple-bundle-product-options-modal",{key:"6b9065e8f7872da72166979fc9ce61efaad21c0a"}))}get host(){return l(this)}};a.style="";export{d as salla_multiple_bundle_product_cart,a as salla_multiple_bundle_product_details}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t}from"./p-CV1rqKQz.js";import{a as i}from"./p-CgtvEd63.js";import{a as e}from"./p-BedNk7k1.js";import{C as a}from"./p-BsLF_HK7.js";var l='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>gift-sharing</title>\n<path d="M5 32h-4c-0.552 0-1-0.448-1-1v0-14c0-0.552 0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 14c0 0.552-0.448 1-1 1v0zM2 30h2v-12h-2zM19.32 30h-14.32v-2h14.32c0.693-0.005 1.329-0.242 1.837-0.637l-0.007 0.005 8.45-6.568c0.216-0.16 0.365-0.402 0.399-0.679l0-0.005c0.005-0.036 0.007-0.077 0.007-0.119 0-0.226-0.078-0.434-0.209-0.599l0.002 0.002c-0.16-0.216-0.401-0.364-0.677-0.399l-0.005-0.001c-0.034-0.004-0.073-0.007-0.113-0.007-0.227 0-0.436 0.078-0.601 0.208l0.002-0.002-7.126 5.526c-1.003 0.793-2.285 1.273-3.68 1.274h-6.6v-2h6.6c0.926-0.001 1.777-0.32 2.45-0.852l-0.008 0.006 7.126-5.526c0.492-0.39 1.122-0.625 1.807-0.625 0.135 0 0.268 0.009 0.398 0.027l-0.015-0.002c0.824 0.102 1.534 0.524 2.011 1.137l0.005 0.007c0.39 0.494 0.625 1.127 0.625 1.814 0 0.136-0.009 0.27-0.027 0.402l0.002-0.015c-0.106 0.819-0.529 1.523-1.141 1.995l-0.007 0.005-8.458 6.578c-0.834 0.649-1.894 1.043-3.047 1.050h-0.002zM11 26c-0.552 0-1-0.448-1-1s0.448-1 1-1v0c2.406-0.004 4.415-1.703 4.894-3.967l0.006-0.033h-10.9c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h12c0.552 0 1 0.448 1 1v0c0 3.866-3.134 7-7 7v0zM24 12h-16c-1.105 0-2-0.895-2-2v0-2c0-1.105 0.895-2 2-2v0h16c1.105 0 2 0.895 2 2v0 2c0 1.105-0.895 2-2 2v0zM24 10v0zM8 8v2h16v-2zM23 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM9 16c-0.552 0-1-0.448-1-1v0-4c0-0.552 0.448-1 1-1s1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM16 16c-0.552 0-1-0.448-1-1v0-8c0-0.552 0.448-1 1-1s1 0.448 1 1v0 8c0 0.552-0.448 1-1 1v0zM16 8c-0.552-0-1-0.448-1-1 0-0.077 0.009-0.151 0.025-0.223l-0.001 0.007c0.314-1.849 0.963-3.5 1.887-4.961l-0.033 0.055c0.539-0.521 1.274-0.842 2.084-0.842 1.657 0 3 1.343 3 3 0 0.81-0.321 1.545-0.843 2.085l0.001-0.001c-1.405 0.891-3.056 1.541-4.824 1.845l-0.080 0.011c-0.065 0.015-0.139 0.024-0.216 0.024h-0zM19 3c-0.001 0-0.001 0-0.002 0-0.276 0-0.525 0.112-0.706 0.292l0-0c-0.391 0.669-0.703 1.444-0.897 2.264l-0.011 0.058c0.878-0.205 1.653-0.517 2.363-0.93l-0.041 0.022c0.18-0.181 0.292-0.43 0.292-0.706 0-0.551-0.446-0.999-0.998-1h-0zM16 8c-0.077-0-0.151-0.009-0.223-0.025l0.007 0.001c-1.848-0.315-3.499-0.965-4.959-1.888l0.055 0.032c-0.521-0.539-0.842-1.274-0.842-2.084 0-1.657 1.343-3 3-3 0.81 0 1.545 0.321 2.085 0.843l-0.001-0.001c0.891 1.405 1.541 3.056 1.845 4.824l0.011 0.080c0.015 0.066 0.024 0.141 0.024 0.218 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0zM13 3c-0.001 0-0.001 0-0.002 0-0.552 0-1 0.448-1 1 0 0.277 0.112 0.527 0.294 0.708l0 0c0.669 0.391 1.444 0.703 2.264 0.897l0.058 0.011c-0.205-0.878-0.517-1.653-0.93-2.363l0.022 0.041c-0.181-0.181-0.43-0.293-0.706-0.294h-0z"></path>\n</svg>\n';const o=class{constructor(t){s(this,t),this.defaultEvent="gifting:open",this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.selectedCountryId=void 0,this.selectedCountryCode=void 0,this.loadingCities=!1,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,this.hostId=`salla-gifting-${Math.random().toString(36).slice(2,10)}`,this.formSelector="form.product-form, form.form--product-options",salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverCountryFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_country"),this.ksa=salla.lang.get("pages.checkout.ksa"),this.selectCity=salla.lang.get("pages.checkout.select_city"),this.selectCountry=salla.lang.get("pages.checkout.select_country"),this.selectCityInfo=salla.lang.get("blocks.buy_as_gift.city_info"),this.receiverCityFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_city"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale})),salla.event.on(this.defaultEvent,(()=>{this.open()}))}componentDidLoad(){salla.event.product.onPriceUpdated((()=>{const s=document.querySelector(".s-quantity-input-input");this.quantity=s?.value}))}getFormDataFromForm(){if(!this.formSelector)return null;const s=document.querySelector(this.formSelector);return s?new FormData(s):null}mergeObjectToFormData(s,t,i){for(let e in s){if(!s.hasOwnProperty(e)||null==s[e])continue;const a=i?`${i}[${e}]`:e;"object"!=typeof s[e]||null===s[e]||s[e]instanceof File?t.set(a,s[e]):this.mergeObjectToFormData(s[e],t,a)}return t}async open(){if(salla.config.isGuest())return salla.api.auth.setAfterLoginEvent(this.defaultEvent),void salla.event.dispatch("login::open",{withoutReload:!0});await this.modal.open();const s=this.productId?()=>salla.product.getGiftProductDetails(this.productId):()=>salla.cart.getGiftCartDetails();return await salla.api.withoutNotifier(s).then((s=>{this.gift=s.data,this.senderName=this.gift.sender_name})).catch((s=>{this.hasError=!0,this.errorMessage=s.response?.data?.error?.message||s.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}async setWrapperHeight(s=1,t=250,i=0,e=0){let a=document.querySelector(`#${this.hostId} .gift-step-${s}`);setTimeout((()=>{this.stepsWrapper.style.height=e?`${e}px`:a.offsetHeight+i+"px"}),t)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(s){this.textSelect?.classList.remove("s-form-has-error");let t=s.target.children[s.target.selectedIndex].getAttribute("data-id"),i="custom"==t;this.showGiftText=i,t?(this.selectedGiftTextOption=t,this.selectedText=i?void 0:s.target.value,this.setWrapperHeight(1,150,5)):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0,this.setWrapperHeight(1,150,-15))}async goToStep2(){return this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect.classList.remove("s-form-has-error"),this.customTextArea.classList.remove("s-form-has-error"),this.setWrapperHeight(2,600,0),(new i.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:i.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[-50,0],delay:i.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((s=>{s.classList.remove("opacity-0"),s.removeAttribute("style")}))}},"-=1200"),this.currentStep=2,void(this.parentClass=`is-current-step-${this.currentStep}`)):(this.textSelect.classList.remove("s-form-has-error"),void this.customTextArea.classList.add("s-form-has-error")):(this.textSelect.classList.add("s-form-has-error"),void this.customTextArea.classList.remove("s-form-has-error"))}goToStep1(s){s.preventDefault();let t=new i.timeline({autoplay:!1});t.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:i.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[50,0],delay:i.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((s=>{s.classList.remove("opacity-0"),s.removeAttribute("style")}))}},"-=1200"),t.play(),this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass=`is-current-step-${this.currentStep}`}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload?this.selectImageOrUpload:""}</p></div>`}setPreview(s){this.uploader?.classList.add("has-bg");var t=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");t.classList.add("filepond-bg"),t.classList.remove("s-hidden"),t.style.backgroundImage="url('"+s.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(t),this.uploadedImage=s.url,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let s=document.querySelector(`#${this.hostId} .filepond-bg`);s.removeAttribute("style"),s.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(s){this.selectedText=s.target.value,this.customTextArea.classList.remove("s-form-has-error")}handleSenderName(s){this.senderName=s.target.value}handleReceiverName(s){this.receiverName=s.target.value}handleReceiverCity(s){this.receiverCity=s.target.value}async handleCountryChange(s){const t=s.target.value;this.selectedCountryId=t;const i=this.gift?.countries?.find((s=>s.id==t));if(this.selectedCountryCode=i?.country_code,!t||0===this.gift?.countries?.length)return this.gift={...this.gift,cities:[]},this.receiverCity=void 0,void(this.selectedCountryCode=void 0);this.loadingCities=!0,this.gift={...this.gift,cities:[]},this.receiverCity=void 0;try{const s=await salla.api.request(`shipping/cities?for_branch=0&country_id=${t}`);s&&s.data&&(this.gift={...this.gift,cities:s.data})}catch(s){console.error("Error fetching cities:",s)}finally{this.loadingCities=!1}}handleUploadImage(s){this.uploadedImage=s,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(s){let t=s.detail;this.receiverMobile=t.number,this.receiverCountryCode=t.country_code}handleDateTimePicker(s){this.deliveryDate=s.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){const s=document.querySelector("#donating-amount")?.value;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");if(this.physicalProducts&&!this.selectedCountryId)return this.errors||(this.errors={}),this.errors["receiver.country"]=salla.lang.get("common.messages.required_field"),void this.setWrapperHeight(2,150,0);const t={text:this.selectedText,sender_name:this.senderName,quantity:this.quantity,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:this.uploadedImage??this.selectedImage,donation_amount:s||null,receiver:{name:this.receiverName,country_code:this.selectedCountryCode&&this.physicalProducts?this.selectedCountryCode:this.receiverCountryCode,mobile:this.receiverMobile,...this.receiverCity&&this.physicalProducts?{city_id:this.receiverCity}:{}},has_apple_pay:salla.helpers.hasApplePay()};let i;this.productId&&this.formSelector&&(i=this.getFormDataFromForm()||new FormData,i=this.mergeObjectToFormData(t,i));const e=this.productId?()=>salla.product.addProductGiftToCart(this.productId,i,!0):()=>salla.cart.addCartGiftToCart(t,!0);return await e().then((()=>this.modal.close())).catch((s=>{s.response&&422==s.response.status?this.errors=s.response.data.error.fields:console.log(s),this.setWrapperHeight(2,150,0)}))}generateClass(){return{"s-gifting-widget":!0,"s-gifting-widget-vertical":!!this.vertical,"s-gifting-widget-horizontal":!this.vertical}}async handleGiftButtonClick(){if(this.productId&&this.formSelector){const s=document.querySelector(this.formSelector);if(!s)return void console.error("SallaGifting:: Form not found in the document!");if(!(s instanceof HTMLFormElement))return void console.error("SallaGifting:: The specified selector does not correspond to a form tag!");if(!s.reportValidity())return console.error("SallaGifting:: Form is not valid!"),void salla.error(salla.lang.get("common.messages.required_fields"))}const s=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);!s||await s.reportValidity()?this.open():salla.error(salla.lang.get("common.messages.required_fields"))}render(){return[t("div",{key:"69f449221a2abf8e4d9264b46ab023eb7baca314"},t("salla-list-tile",{key:"0072bab6171c9b11e54f0c6655c408b12d554e24",class:this.generateClass()},t("div",{key:"38aa5f8decf6d9c97253c3c16b80a478d623985e",slot:"title"},this.vertical?t("span",{innerHTML:l}):"",t("h3",{key:"37fddbe7a80f38b3acca42220028208cab52ba15"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),t("div",{key:"b3bf6bff40b60a3fbace637ed69f6aa72853c04b",slot:"subtitle"},t("div",{key:"46643b7cd897524ca42c41da24e657401f85ab28"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),t("div",{key:"5129acfd67425ccfad68b3770843f11c9fa55b18",slot:"action"},t("salla-button",{key:"0e93efc647444a26198e4631614b8590f75f122e",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},t("slot",{key:"b88d95a25308cebc29b796bb2b0c25e4fa230406",name:"widget-btn-content"},t("div",{key:"4cdbaaeb2bc67f056ea348755ffbdfbc831a1a5b",class:"s-gifting-widget-action-content"},t("span",{key:"7dfec389970416df9be46c8ae5f0904dd64e17ad",innerHTML:l}),"  ",t("span",{key:"768f3621011bc3c984dce13ce83b3fb6cceb0171"},this.sectionBtnText)))))),t("salla-modal",{key:"b3c94ef80f955b42baecd963f5550f17a80c6fb4",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:s=>this.modal=s},t("div",{key:"c09e12eabff63ba1a781c8980b449f854affc164",slot:"loading"},t("div",{key:"dbafa39345c573eae0d045a7d23e346f7068ec0b",class:"s-gifting-skeleton"},t("div",{key:"ff247ea5c79b87ca1c76e6035813d7ecb2caeff2",class:"s-gifting-modal-header"},t("salla-skeleton",{key:"1e67bea2f1f957744c4f6f0af83ded347799916e",type:"circle",height:"5rem",width:"5rem"}),t("h2",{key:"6486434a702624358211c22e7a6b48be16d96c42",class:"s-gifting-modal-title"},t("div",{key:"688854d37e5ca46fcaa7957d3e72a52d7c706f8d",class:"s-gifting-modal-badge-wrapper"},t("salla-skeleton",{key:"9fcbb2086aa25b02effdc873bbfd45087e673de6",height:"15px",width:"150px"})))),t("div",{key:"1b9bf709a01b20e87d68f92f3cb93600214460cd",class:"s-gifting-skeleton-content"},t("salla-skeleton",{key:"ba6b0c87442412398c360da1f6e8b5094812900f",height:"10px",width:"150px"}),t("salla-skeleton",{key:"6583783ace4e2668705c47c4bcac2a33b346a72b",height:"230px"}),t("salla-skeleton",{key:"c76b038f100072d56a7cedd0438eeacc98bf7b42",height:"10px",width:"150px"}),t("salla-skeleton",{key:"1d331e7be7cd88ea5c108f331626dddc74699ed2",height:"30px"}),t("salla-skeleton",{key:"5cc3d1b8d67b7bf199219099af909591b8a8a869",height:"40px"})))),t("slot",{key:"9dc4c6f3a717e16e3527f9651b05a74ca1a6212c",name:"header"}),this.hasError?t("salla-placeholder",{alignment:"center"},t("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),t("span",{slot:"description"}," ")):[t("div",{class:"s-gifting-modal-header"},t("span",{class:"s-gifting-modal-icon"},t("span",{innerHTML:l})),t("h2",{class:"s-gifting-modal-title"},t("div",{class:"s-gifting-modal-badge-wrapper"},t("div",{class:"s-gifting-modal-badge"},t("span",null,t("span",null,this.currentStep),"/2")),t("span",null,this.giftDetails)))),t("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:s=>this.stepsWrapper=s},t("div",{class:"s-gifting-step-one gift-step-1",ref:s=>this.step1Elems=s},t("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),t("div",{class:"s-gifting-modal-uploader anime-item",ref:s=>this.uploader=s},t("span",{class:"s-gifting-remove-preview",onClick:()=>this.removePreview(),innerHTML:a}),this.selectImageOrUpload&&t("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:s=>this.handleUploadImage(s.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),t("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?t("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},t("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((s=>t("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(s)},t("img",{style:{width:"120px"},src:s.url,alt:`${s.id}`})))):"")):""),t("div",{class:"anime-item"},t("div",{class:"s-form-group s-gifting-selectText",ref:s=>this.textSelect=s},t("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:s=>this.toggleGiftText(s)},t("option",{"data-id":null,selected:!0},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((s=>t("option",{"data-id":s.id,value:s.text,key:s.id},s.text))):"",t("option",{"data-id":"custom"},this.giftCustomText))),t("div",{class:this.showGiftText?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:s=>this.customTextArea=s},t("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),t("div",{class:"mt-1"},t("textarea",{onInput:s=>this.handleTextAreaChange(s),rows:4,ref:s=>this.textArea=s,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))),t("div",{class:"anime-item"},t("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2()},t("span",null,this.nextStep)))),t("div",{class:"s-gifting-step-two gift-step-2",ref:s=>this.step2Elems=s},t("div",{class:this.errors&&this.errors.sender_name?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},t("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),t("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:s=>this.handleSenderName(s),placeholder:""}),this.errors&&this.errors.sender_name?t("span",{class:"s-gifting-error"},this.errors.sender_name):""),t("div",{class:this.errors&&this.errors["receiver.name"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},t("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),t("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:s=>this.handleReceiverName(s),placeholder:""}),this.errors&&this.errors["receiver.name"]?t("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),t("div",{class:this.errors&&this.errors["receiver.mobile"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},t("label",{class:"s-form-label"},this.receiverMobileFieldLabel),t("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.selectedCountryCode||this.receiverCountryCode,key:`tel-input-${this.selectedCountryCode||this.receiverCountryCode||"default"}`,onPhoneEntered:s=>this.handlePhoneInputChange(s)}),this.errors&&this.errors["receiver.mobile"]?t("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.physicalProducts&&t("div",null,t("div",{class:this.errors&&this.errors["receiver.country"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},t("label",{class:"s-form-label"},this.receiverCountryFieldLabel),t("select",{name:"country",class:"s-form-control",onChange:s=>this.handleCountryChange(s),required:!0},t("option",{value:""},this.selectCountry),this.gift?.countries?.map((s=>t("option",{value:s.id},s.name)))),this.errors&&this.errors["receiver.country"]?t("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),t("div",{class:this.errors&&this.errors["receiver.city_id"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},t("label",{class:"s-form-label"},this.receiverCityFieldLabel),t("select",{name:"city","aria-label":salla.lang.get("blocks.buy_as_gift.select_city"),class:"s-form-control",onChange:s=>this.handleReceiverCity(s),disabled:this.loadingCities},t("option",{value:"",selected:!0},this.loadingCities?salla.lang.get("common.elements.loading"):this.selectCity),this.gift?.cities?.map((s=>t("option",{value:s.id},s.name)))),this.errors&&this.errors["receiver.city_id"]?t("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),t("div",{class:"s-gifting-info anime-item opacity-0"},t("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>alert</title>\n<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>\n</svg>\n'}),t("span",null,this.selectCityInfo))),!this.physicalProducts&&t("div",{class:"anime-item opacity-0"},t("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:`schedule-${this.hostId}`},t("input",{type:"checkbox",name:"schedule",id:`schedule-${this.hostId}`,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),t("span",{class:"s-form-label"}," ",this.sendLater," "))),t("div",{class:this.getCalendarClasses(),ref:s=>this.calendarFormGroup=s},t("label",{class:"s-form-label"},this.selectSendDateAndTime),t("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:s=>this.handleDateTimePicker(s)}),t("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),t("div",{class:"s-gifting-step-two-footer anime-item opacity-0"},t("a",{href:"#!",innerHTML:e,onClick:s=>this.goToStep1(s)}),t("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},t("span",null,this.sendGift)))))],t("slot",{key:"2ca6746edd5e72c996633b6d0b3ccdc5009198c4",name:"footer"})))]}};o.style=".s-gifting-steps-wrapper{transition:0.2s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}";export{o as salla_gifting}
4
+ import{r as s,h as t}from"./p-Y6CiunLU.js";import{a as i}from"./p-CgtvEd63.js";import{a as e}from"./p-BedNk7k1.js";import{C as a}from"./p-BsLF_HK7.js";var l='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>gift-sharing</title>\n<path d="M5 32h-4c-0.552 0-1-0.448-1-1v0-14c0-0.552 0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 14c0 0.552-0.448 1-1 1v0zM2 30h2v-12h-2zM19.32 30h-14.32v-2h14.32c0.693-0.005 1.329-0.242 1.837-0.637l-0.007 0.005 8.45-6.568c0.216-0.16 0.365-0.402 0.399-0.679l0-0.005c0.005-0.036 0.007-0.077 0.007-0.119 0-0.226-0.078-0.434-0.209-0.599l0.002 0.002c-0.16-0.216-0.401-0.364-0.677-0.399l-0.005-0.001c-0.034-0.004-0.073-0.007-0.113-0.007-0.227 0-0.436 0.078-0.601 0.208l0.002-0.002-7.126 5.526c-1.003 0.793-2.285 1.273-3.68 1.274h-6.6v-2h6.6c0.926-0.001 1.777-0.32 2.45-0.852l-0.008 0.006 7.126-5.526c0.492-0.39 1.122-0.625 1.807-0.625 0.135 0 0.268 0.009 0.398 0.027l-0.015-0.002c0.824 0.102 1.534 0.524 2.011 1.137l0.005 0.007c0.39 0.494 0.625 1.127 0.625 1.814 0 0.136-0.009 0.27-0.027 0.402l0.002-0.015c-0.106 0.819-0.529 1.523-1.141 1.995l-0.007 0.005-8.458 6.578c-0.834 0.649-1.894 1.043-3.047 1.050h-0.002zM11 26c-0.552 0-1-0.448-1-1s0.448-1 1-1v0c2.406-0.004 4.415-1.703 4.894-3.967l0.006-0.033h-10.9c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h12c0.552 0 1 0.448 1 1v0c0 3.866-3.134 7-7 7v0zM24 12h-16c-1.105 0-2-0.895-2-2v0-2c0-1.105 0.895-2 2-2v0h16c1.105 0 2 0.895 2 2v0 2c0 1.105-0.895 2-2 2v0zM24 10v0zM8 8v2h16v-2zM23 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM9 16c-0.552 0-1-0.448-1-1v0-4c0-0.552 0.448-1 1-1s1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM16 16c-0.552 0-1-0.448-1-1v0-8c0-0.552 0.448-1 1-1s1 0.448 1 1v0 8c0 0.552-0.448 1-1 1v0zM16 8c-0.552-0-1-0.448-1-1 0-0.077 0.009-0.151 0.025-0.223l-0.001 0.007c0.314-1.849 0.963-3.5 1.887-4.961l-0.033 0.055c0.539-0.521 1.274-0.842 2.084-0.842 1.657 0 3 1.343 3 3 0 0.81-0.321 1.545-0.843 2.085l0.001-0.001c-1.405 0.891-3.056 1.541-4.824 1.845l-0.080 0.011c-0.065 0.015-0.139 0.024-0.216 0.024h-0zM19 3c-0.001 0-0.001 0-0.002 0-0.276 0-0.525 0.112-0.706 0.292l0-0c-0.391 0.669-0.703 1.444-0.897 2.264l-0.011 0.058c0.878-0.205 1.653-0.517 2.363-0.93l-0.041 0.022c0.18-0.181 0.292-0.43 0.292-0.706 0-0.551-0.446-0.999-0.998-1h-0zM16 8c-0.077-0-0.151-0.009-0.223-0.025l0.007 0.001c-1.848-0.315-3.499-0.965-4.959-1.888l0.055 0.032c-0.521-0.539-0.842-1.274-0.842-2.084 0-1.657 1.343-3 3-3 0.81 0 1.545 0.321 2.085 0.843l-0.001-0.001c0.891 1.405 1.541 3.056 1.845 4.824l0.011 0.080c0.015 0.066 0.024 0.141 0.024 0.218 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0zM13 3c-0.001 0-0.001 0-0.002 0-0.552 0-1 0.448-1 1 0 0.277 0.112 0.527 0.294 0.708l0 0c0.669 0.391 1.444 0.703 2.264 0.897l0.058 0.011c-0.205-0.878-0.517-1.653-0.93-2.363l0.022 0.041c-0.181-0.181-0.43-0.293-0.706-0.294h-0z"></path>\n</svg>\n';const o=class{constructor(t){s(this,t),this.defaultEvent="gifting:open",this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.selectedCountryId=void 0,this.selectedCountryCode=void 0,this.loadingCities=!1,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,this.hostId=`salla-gifting-${Math.random().toString(36).slice(2,10)}`,this.formSelector="form.product-form, form.form--product-options",salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverCountryFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_country"),this.ksa=salla.lang.get("pages.checkout.ksa"),this.selectCity=salla.lang.get("pages.checkout.select_city"),this.selectCountry=salla.lang.get("pages.checkout.select_country"),this.selectCityInfo=salla.lang.get("blocks.buy_as_gift.city_info"),this.receiverCityFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_city"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale})),salla.event.on(this.defaultEvent,(()=>{this.open()}))}componentDidLoad(){salla.event.product.onPriceUpdated((()=>{const s=document.querySelector(".s-quantity-input-input");this.quantity=s?.value}))}getFormDataFromForm(){if(!this.formSelector)return null;const s=document.querySelector(this.formSelector);return s?new FormData(s):null}mergeObjectToFormData(s,t,i){for(let e in s){if(!s.hasOwnProperty(e)||null==s[e])continue;const a=i?`${i}[${e}]`:e;"object"!=typeof s[e]||null===s[e]||s[e]instanceof File?t.set(a,s[e]):this.mergeObjectToFormData(s[e],t,a)}return t}async open(){if(salla.config.isGuest())return salla.api.auth.setAfterLoginEvent(this.defaultEvent),void salla.event.dispatch("login::open",{withoutReload:!0});await this.modal.open();const s=this.productId?()=>salla.product.getGiftProductDetails(this.productId):()=>salla.cart.getGiftCartDetails();return await salla.api.withoutNotifier(s).then((s=>{this.gift=s.data,this.senderName=this.gift.sender_name})).catch((s=>{this.hasError=!0,this.errorMessage=s.response?.data?.error?.message||s.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}async setWrapperHeight(s=1,t=250,i=0,e=0){let a=document.querySelector(`#${this.hostId} .gift-step-${s}`);setTimeout((()=>{this.stepsWrapper.style.height=e?`${e}px`:a.offsetHeight+i+"px"}),t)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(s){this.textSelect?.classList.remove("s-form-has-error");let t=s.target.children[s.target.selectedIndex].getAttribute("data-id"),i="custom"==t;this.showGiftText=i,t?(this.selectedGiftTextOption=t,this.selectedText=i?void 0:s.target.value,this.setWrapperHeight(1,150,5)):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0,this.setWrapperHeight(1,150,-15))}async goToStep2(){return this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect.classList.remove("s-form-has-error"),this.customTextArea.classList.remove("s-form-has-error"),this.setWrapperHeight(2,600,0),(new i.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:i.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[-50,0],delay:i.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((s=>{s.classList.remove("opacity-0"),s.removeAttribute("style")}))}},"-=1200"),this.currentStep=2,void(this.parentClass=`is-current-step-${this.currentStep}`)):(this.textSelect.classList.remove("s-form-has-error"),void this.customTextArea.classList.add("s-form-has-error")):(this.textSelect.classList.add("s-form-has-error"),void this.customTextArea.classList.remove("s-form-has-error"))}goToStep1(s){s.preventDefault();let t=new i.timeline({autoplay:!1});t.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:i.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[50,0],delay:i.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((s=>{s.classList.remove("opacity-0"),s.removeAttribute("style")}))}},"-=1200"),t.play(),this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass=`is-current-step-${this.currentStep}`}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload?this.selectImageOrUpload:""}</p></div>`}setPreview(s){this.uploader?.classList.add("has-bg");var t=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");t.classList.add("filepond-bg"),t.classList.remove("s-hidden"),t.style.backgroundImage="url('"+s.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(t),this.uploadedImage=s.url,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let s=document.querySelector(`#${this.hostId} .filepond-bg`);s.removeAttribute("style"),s.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(s){this.selectedText=s.target.value,this.customTextArea.classList.remove("s-form-has-error")}handleSenderName(s){this.senderName=s.target.value}handleReceiverName(s){this.receiverName=s.target.value}handleReceiverCity(s){this.receiverCity=s.target.value}async handleCountryChange(s){const t=s.target.value;this.selectedCountryId=t;const i=this.gift?.countries?.find((s=>s.id==t));if(this.selectedCountryCode=i?.country_code,!t||0===this.gift?.countries?.length)return this.gift={...this.gift,cities:[]},this.receiverCity=void 0,void(this.selectedCountryCode=void 0);this.loadingCities=!0,this.gift={...this.gift,cities:[]},this.receiverCity=void 0;try{const s=await salla.api.request(`shipping/cities?for_branch=0&country_id=${t}`);s&&s.data&&(this.gift={...this.gift,cities:s.data})}catch(s){console.error("Error fetching cities:",s)}finally{this.loadingCities=!1}}handleUploadImage(s){this.uploadedImage=s,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(s){let t=s.detail;this.receiverMobile=t.number,this.receiverCountryCode=t.country_code}handleDateTimePicker(s){this.deliveryDate=s.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){const s=document.querySelector("#donating-amount")?.value;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");if(this.physicalProducts&&!this.selectedCountryId)return this.errors||(this.errors={}),this.errors["receiver.country"]=salla.lang.get("common.messages.required_field"),void this.setWrapperHeight(2,150,0);const t={text:this.selectedText,sender_name:this.senderName,quantity:this.quantity,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:this.uploadedImage??this.selectedImage,donation_amount:s||null,receiver:{name:this.receiverName,country_code:this.selectedCountryCode&&this.physicalProducts?this.selectedCountryCode:this.receiverCountryCode,mobile:this.receiverMobile,...this.receiverCity&&this.physicalProducts?{city_id:this.receiverCity}:{}},has_apple_pay:salla.helpers.hasApplePay()};let i;this.productId&&this.formSelector&&(i=this.getFormDataFromForm()||new FormData,i=this.mergeObjectToFormData(t,i));const e=this.productId?()=>salla.product.addProductGiftToCart(this.productId,i,!0):()=>salla.cart.addCartGiftToCart(t,!0);return await e().then((()=>this.modal.close())).catch((s=>{s.response&&422==s.response.status?this.errors=s.response.data.error.fields:console.log(s),this.setWrapperHeight(2,150,0)}))}generateClass(){return{"s-gifting-widget":!0,"s-gifting-widget-vertical":!!this.vertical,"s-gifting-widget-horizontal":!this.vertical}}async handleGiftButtonClick(){if(this.productId&&this.formSelector){const s=document.querySelector(this.formSelector);if(!s)return void console.error("SallaGifting:: Form not found in the document!");if(!(s instanceof HTMLFormElement))return void console.error("SallaGifting:: The specified selector does not correspond to a form tag!");if(!s.reportValidity())return console.error("SallaGifting:: Form is not valid!"),void salla.error(salla.lang.get("common.messages.required_fields"))}const s=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);!s||await s.reportValidity()?this.open():salla.error(salla.lang.get("common.messages.required_fields"))}render(){return[t("div",{key:"69f449221a2abf8e4d9264b46ab023eb7baca314"},t("salla-list-tile",{key:"0072bab6171c9b11e54f0c6655c408b12d554e24",class:this.generateClass()},t("div",{key:"38aa5f8decf6d9c97253c3c16b80a478d623985e",slot:"title"},this.vertical?t("span",{innerHTML:l}):"",t("h3",{key:"37fddbe7a80f38b3acca42220028208cab52ba15"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),t("div",{key:"b3bf6bff40b60a3fbace637ed69f6aa72853c04b",slot:"subtitle"},t("div",{key:"46643b7cd897524ca42c41da24e657401f85ab28"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),t("div",{key:"5129acfd67425ccfad68b3770843f11c9fa55b18",slot:"action"},t("salla-button",{key:"0e93efc647444a26198e4631614b8590f75f122e",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},t("slot",{key:"b88d95a25308cebc29b796bb2b0c25e4fa230406",name:"widget-btn-content"},t("div",{key:"4cdbaaeb2bc67f056ea348755ffbdfbc831a1a5b",class:"s-gifting-widget-action-content"},t("span",{key:"7dfec389970416df9be46c8ae5f0904dd64e17ad",innerHTML:l}),"  ",t("span",{key:"768f3621011bc3c984dce13ce83b3fb6cceb0171"},this.sectionBtnText)))))),t("salla-modal",{key:"b3c94ef80f955b42baecd963f5550f17a80c6fb4",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:s=>this.modal=s},t("div",{key:"c09e12eabff63ba1a781c8980b449f854affc164",slot:"loading"},t("div",{key:"dbafa39345c573eae0d045a7d23e346f7068ec0b",class:"s-gifting-skeleton"},t("div",{key:"ff247ea5c79b87ca1c76e6035813d7ecb2caeff2",class:"s-gifting-modal-header"},t("salla-skeleton",{key:"1e67bea2f1f957744c4f6f0af83ded347799916e",type:"circle",height:"5rem",width:"5rem"}),t("h2",{key:"6486434a702624358211c22e7a6b48be16d96c42",class:"s-gifting-modal-title"},t("div",{key:"688854d37e5ca46fcaa7957d3e72a52d7c706f8d",class:"s-gifting-modal-badge-wrapper"},t("salla-skeleton",{key:"9fcbb2086aa25b02effdc873bbfd45087e673de6",height:"15px",width:"150px"})))),t("div",{key:"1b9bf709a01b20e87d68f92f3cb93600214460cd",class:"s-gifting-skeleton-content"},t("salla-skeleton",{key:"ba6b0c87442412398c360da1f6e8b5094812900f",height:"10px",width:"150px"}),t("salla-skeleton",{key:"6583783ace4e2668705c47c4bcac2a33b346a72b",height:"230px"}),t("salla-skeleton",{key:"c76b038f100072d56a7cedd0438eeacc98bf7b42",height:"10px",width:"150px"}),t("salla-skeleton",{key:"1d331e7be7cd88ea5c108f331626dddc74699ed2",height:"30px"}),t("salla-skeleton",{key:"5cc3d1b8d67b7bf199219099af909591b8a8a869",height:"40px"})))),t("slot",{key:"9dc4c6f3a717e16e3527f9651b05a74ca1a6212c",name:"header"}),this.hasError?t("salla-placeholder",{alignment:"center"},t("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),t("span",{slot:"description"}," ")):[t("div",{class:"s-gifting-modal-header"},t("span",{class:"s-gifting-modal-icon"},t("span",{innerHTML:l})),t("h2",{class:"s-gifting-modal-title"},t("div",{class:"s-gifting-modal-badge-wrapper"},t("div",{class:"s-gifting-modal-badge"},t("span",null,t("span",null,this.currentStep),"/2")),t("span",null,this.giftDetails)))),t("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:s=>this.stepsWrapper=s},t("div",{class:"s-gifting-step-one gift-step-1",ref:s=>this.step1Elems=s},t("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),t("div",{class:"s-gifting-modal-uploader anime-item",ref:s=>this.uploader=s},t("span",{class:"s-gifting-remove-preview",onClick:()=>this.removePreview(),innerHTML:a}),this.selectImageOrUpload&&t("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:s=>this.handleUploadImage(s.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),t("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?t("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},t("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((s=>t("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(s)},t("img",{style:{width:"120px"},src:s.url,alt:`${s.id}`})))):"")):""),t("div",{class:"anime-item"},t("div",{class:"s-form-group s-gifting-selectText",ref:s=>this.textSelect=s},t("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:s=>this.toggleGiftText(s)},t("option",{"data-id":null,selected:!0},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((s=>t("option",{"data-id":s.id,value:s.text,key:s.id},s.text))):"",t("option",{"data-id":"custom"},this.giftCustomText))),t("div",{class:this.showGiftText?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:s=>this.customTextArea=s},t("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),t("div",{class:"mt-1"},t("textarea",{onInput:s=>this.handleTextAreaChange(s),rows:4,ref:s=>this.textArea=s,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))),t("div",{class:"anime-item"},t("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2()},t("span",null,this.nextStep)))),t("div",{class:"s-gifting-step-two gift-step-2",ref:s=>this.step2Elems=s},t("div",{class:this.errors&&this.errors.sender_name?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},t("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),t("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:s=>this.handleSenderName(s),placeholder:""}),this.errors&&this.errors.sender_name?t("span",{class:"s-gifting-error"},this.errors.sender_name):""),t("div",{class:this.errors&&this.errors["receiver.name"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},t("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),t("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:s=>this.handleReceiverName(s),placeholder:""}),this.errors&&this.errors["receiver.name"]?t("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),t("div",{class:this.errors&&this.errors["receiver.mobile"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},t("label",{class:"s-form-label"},this.receiverMobileFieldLabel),t("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.selectedCountryCode||this.receiverCountryCode,key:`tel-input-${this.selectedCountryCode||this.receiverCountryCode||"default"}`,onPhoneEntered:s=>this.handlePhoneInputChange(s)}),this.errors&&this.errors["receiver.mobile"]?t("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.physicalProducts&&t("div",null,t("div",{class:this.errors&&this.errors["receiver.country"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},t("label",{class:"s-form-label"},this.receiverCountryFieldLabel),t("select",{name:"country",class:"s-form-control",onChange:s=>this.handleCountryChange(s),required:!0},t("option",{value:""},this.selectCountry),this.gift?.countries?.map((s=>t("option",{value:s.id},s.name)))),this.errors&&this.errors["receiver.country"]?t("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),t("div",{class:this.errors&&this.errors["receiver.city_id"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},t("label",{class:"s-form-label"},this.receiverCityFieldLabel),t("select",{name:"city","aria-label":salla.lang.get("blocks.buy_as_gift.select_city"),class:"s-form-control",onChange:s=>this.handleReceiverCity(s),disabled:this.loadingCities},t("option",{value:"",selected:!0},this.loadingCities?salla.lang.get("common.elements.loading"):this.selectCity),this.gift?.cities?.map((s=>t("option",{value:s.id},s.name)))),this.errors&&this.errors["receiver.city_id"]?t("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),t("div",{class:"s-gifting-info anime-item opacity-0"},t("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>alert</title>\n<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>\n</svg>\n'}),t("span",null,this.selectCityInfo))),!this.physicalProducts&&t("div",{class:"anime-item opacity-0"},t("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:`schedule-${this.hostId}`},t("input",{type:"checkbox",name:"schedule",id:`schedule-${this.hostId}`,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),t("span",{class:"s-form-label"}," ",this.sendLater," "))),t("div",{class:this.getCalendarClasses(),ref:s=>this.calendarFormGroup=s},t("label",{class:"s-form-label"},this.selectSendDateAndTime),t("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:s=>this.handleDateTimePicker(s)}),t("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),t("div",{class:"s-gifting-step-two-footer anime-item opacity-0"},t("a",{href:"#!",innerHTML:e,onClick:s=>this.goToStep1(s)}),t("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},t("span",null,this.sendGift)))))],t("slot",{key:"2ca6746edd5e72c996633b6d0b3ccdc5009198c4",name:"footer"})))]}};o.style=".s-gifting-steps-wrapper{transition:0.2s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}";export{o as salla_gifting}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as s,a as t}from"./p-CV1rqKQz.js";import{S as a}from"./p-Ctkfc4K-.js";const l=class{constructor(s){e(this,s),this.offer=null,this.hasError=!1,this.translationLoaded=!1,this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),salla.event.on("offer-modal::open",(e=>this.open(e))),salla.lang.onLoaded((()=>{this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),this.translationLoaded=!0})),this.categorySlot=this.host.querySelector('[slot="category"]')?.innerHTML||'<span class="s-offer-modal-badge-icon">{tagIcon}</span><span class="s-offer-modal-badge-text">{name}</span>',salla.event.on("offer-modal::open",(e=>this.open(e))),salla.product.event.onOfferExisted((e=>{salla.storage.get("remember-offer-"+e.id)?salla.log("User selected to don't show this offer again."):this.open(e.product_id)}))}emitPromotionViewed(e){e&&salla.event.emit("promotion::viewed",[{id:e.id?.toString(),creative:e.message,name:e.name,position:`${this.offer_type}_offer_modal`}])}emitPromotionClicked(e){e&&salla.event.emit("promotion::clicked",[{id:e.id?.toString(),creative:e.message,name:e.name,position:`${this.offer_type}_offer_modal`}])}async open(e){return this.productID=e,this.hasError=!1,this.modal.loading(),await salla.api.withoutNotifier((()=>salla.product.offers(e))).then((e=>{e.data&&e.data.length&&(this.modal.open(),this.showOffer(e.data[0]))})).catch((e=>{this.hasError=!0,this.errorMessage=e.response?.data?.error?.message||e.response?.data,this.modal.open()})).finally((()=>{this.modal.visible&&setTimeout((()=>this.modal.stopLoading()),1e3)}))}async showOffer(e){this.offer=e,this.offer_name=e.name,this.offer_message=e.message,this.offer.get.discounts_table?this.offer_type="discounts-table":this.offer.get.products?.length?this.offer_type="products":this.offer.get.categories?.length&&(this.offer_type="categories"),this.modal.setTitle(this.offer_name),this.emitPromotionViewed(this.offer)}rememberMe(e){salla.storage.set("remember-offer-"+this.offer.id,e.target.checked)}addToCart(e){this.emitPromotionClicked(this.offer),salla.api.withoutNotifier((()=>salla.cart.quickAdd(this.productID,e,this.offer_type))).then((()=>this.modal.close()))}getOfferContent(){if(this.offer.get.discounts_table)return s("div",{class:"s-offer-modal-discount-table"},s("table",null,s("tbody",null,this.offer.get.discounts_table?.map((e=>s("tr",null,s("td",null,e.text),s("td",{class:"s-offer-modal-discount-table-cell"},s("salla-button",{fill:"outline",shape:"btn",color:"primary",size:"medium",width:"normal",onClick:()=>this.addToCart(e.quantity)},this.addToCartLabel))))))));if(this.offer.get.products?.length){const e=this.offer.get.products?.length||0,t={slidesPerView:"auto",spaceBetween:16,breakpoints:{768:{slidesPerView:Math.min(2,e),spaceBetween:16},1024:{slidesPerView:Math.min(3,e),spaceBetween:16}}};return s("salla-products-slider",{key:(this.offer.get.products?.map((e=>e.id))||[]).join(","),source:"selected","source-value":`[${(this.offer.get.products?.map((e=>e.id))||[]).join(",")}]`,"slider-config":JSON.stringify(t)})}return this.offer.get.categories?.length?s("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.categories?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.categories?.length<=2?"false":"true"},s("div",{slot:"items"},this.offer.get.categories.map((e=>s("a",{href:e.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item",innerHTML:this.categorySlot.replace(/\{tagIcon\}/g,'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tag</title>\n<path d="M28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n').replace(/\{name\}/g,e.name).replace(/\{url\}/g,e.urls.customer)}))))):void 0}render(){return s("salla-modal",{key:"630ede1c6ac0df4aa55bd36597eb846df901d94e","has-skeleton":!0,"sub-title":this.offer_message,ref:e=>this.modal=e,isLoading:!0,class:`s-offer-modal-type-${this.offer_type?this.offer_type:""}`},s("div",{key:"d467615c5aaefc38cec4e40e4e5a7282466937d3",slot:"loading"},s("div",{key:"ff17d657a94dcfe8d744e1317d8f73cab6063d11",class:"s-offer-modal-skeleton"},s("div",{key:"81bf28f2785c0beb1ef1d4997ce064983e2211ec",class:"s-offer-modal-skeleton-header"},s("salla-skeleton",{key:"acd8aa8be556821b4039d1b5fb6e46ef4155ac67",type:"circle",height:"80px",width:"80px"}),s("salla-skeleton",{key:"0c6855f5423a5e5bf1caf54da4f608b95b7d3f08",height:"15px",width:"50%"}),s("salla-skeleton",{key:"e313bac8052684ede353852821a51befb73f52b7",height:"10px",width:"30%"})),s("div",{key:"4c6a675e9c07e8e2986debd8dbecc346890ce0ca",class:"s-offer-modal-skeleton-items"},[...Array(3)].map((()=>s("div",{class:"s-offer-modal-skeleton-item"},s("salla-skeleton",{height:"9rem"}),s("div",{class:"s-offer-modal-skeleton-item-title"},s("salla-skeleton",{height:"15px",width:"100%"})),s("div",{class:"s-offer-modal-skeleton-item-subtitle"},s("salla-skeleton",{height:"9px",width:"50%"}),s("div",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>cart2</title>\n<path d="M6.845 5.333l-1.905-5.333h-3.607c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333v0h1.727l5.72 16.012c0.569 1.56 2.039 2.654 3.765 2.655h12.133c0.001 0 0.002 0 0.003 0 1.825 0 3.364-1.222 3.845-2.892l0.007-0.028 3.161-13.080zM25.96 17.716c-0.167 0.554-0.672 0.951-1.27 0.951-0.002 0-0.005 0-0.007-0h-12.133c-0.575-0-1.065-0.364-1.252-0.875l-0.003-0.009-3.497-9.783h20.508zM13.333 24c-2.209 0-4 1.791-4 4s1.791 4 4 4c2.209 0 4-1.791 4-4v0c0-2.209-1.791-4-4-4v0zM13.333 29.333c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333c0.736 0 1.333 0.597 1.333 1.333v0c0 0.736-0.597 1.333-1.333 1.333v0zM24 24c-2.209 0-4 1.791-4 4s1.791 4 4 4c2.209 0 4-1.791 4-4v0c0-2.209-1.791-4-4-4v0zM24 29.333c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333c0.736 0 1.333 0.597 1.333 1.333v0c0 0.736-0.597 1.333-1.333 1.333v0z"></path>\n</svg>\n'})))))),s("div",{key:"226951e15be9aede559c4d24ba6f6690fac80e13",class:"s-offer-modal-skeleton-footer"},s("salla-skeleton",{key:"86ae2c54c01b3e58fd31729bc6d263dfa078f7ba",height:"15px",width:"50%"}),s("salla-skeleton",{key:"32f30f4f5bb11405901359267ab6311604f352ed",height:"15px",width:"30%"})))),this.hasError||null===this.offer?s("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?s("span",{slot:"description"},this.errorMessage):""):[s("span",{slot:"icon",class:"s-offer-modal-header-icon",innerHTML:a}),this.getOfferContent(),s("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?s("p",{class:"s-offer-modal-expiry"},salla.lang.get("pages.products.offer_expires_in")," ",this.offer.formatted_date):"",s("label",{class:"s-offer-modal-remember-label"},s("input",{type:"checkbox",onChange:e=>this.rememberMe(e),class:"s-offer-modal-remember-input"}),"  ",salla.lang.get("common.elements.remember_my_choice")))])}get host(){return t(this)}};l.style=".s-offer-modal-type-products .s-modal-body{min-height:690px;position:relative}";export{l as salla_offer_modal}
4
+ import{r as e,h as s,a as t}from"./p-Y6CiunLU.js";import{S as a}from"./p-Ctkfc4K-.js";const l=class{constructor(s){e(this,s),this.offer=null,this.hasError=!1,this.translationLoaded=!1,this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),salla.event.on("offer-modal::open",(e=>this.open(e))),salla.lang.onLoaded((()=>{this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),this.translationLoaded=!0})),this.categorySlot=this.host.querySelector('[slot="category"]')?.innerHTML||'<span class="s-offer-modal-badge-icon">{tagIcon}</span><span class="s-offer-modal-badge-text">{name}</span>',salla.event.on("offer-modal::open",(e=>this.open(e))),salla.product.event.onOfferExisted((e=>{salla.storage.get("remember-offer-"+e.id)?salla.log("User selected to don't show this offer again."):this.open(e.product_id)}))}emitPromotionViewed(e){e&&salla.event.emit("promotion::viewed",[{id:e.id?.toString(),creative:e.message,name:e.name,position:`${this.offer_type}_offer_modal`}])}emitPromotionClicked(e){e&&salla.event.emit("promotion::clicked",[{id:e.id?.toString(),creative:e.message,name:e.name,position:`${this.offer_type}_offer_modal`}])}async open(e){return this.productID=e,this.hasError=!1,this.modal.loading(),await salla.api.withoutNotifier((()=>salla.product.offers(e))).then((e=>{e.data&&e.data.length&&(this.modal.open(),this.showOffer(e.data[0]))})).catch((e=>{this.hasError=!0,this.errorMessage=e.response?.data?.error?.message||e.response?.data,this.modal.open()})).finally((()=>{this.modal.visible&&setTimeout((()=>this.modal.stopLoading()),1e3)}))}async showOffer(e){this.offer=e,this.offer_name=e.name,this.offer_message=e.message,this.offer.get.discounts_table?this.offer_type="discounts-table":this.offer.get.products?.length?this.offer_type="products":this.offer.get.categories?.length&&(this.offer_type="categories"),this.modal.setTitle(this.offer_name),this.emitPromotionViewed(this.offer)}rememberMe(e){salla.storage.set("remember-offer-"+this.offer.id,e.target.checked)}addToCart(e){this.emitPromotionClicked(this.offer),salla.api.withoutNotifier((()=>salla.cart.quickAdd(this.productID,e,this.offer_type))).then((()=>this.modal.close()))}getOfferContent(){if(this.offer.get.discounts_table)return s("div",{class:"s-offer-modal-discount-table"},s("table",null,s("tbody",null,this.offer.get.discounts_table?.map((e=>s("tr",null,s("td",null,e.text),s("td",{class:"s-offer-modal-discount-table-cell"},s("salla-button",{fill:"outline",shape:"btn",color:"primary",size:"medium",width:"normal",onClick:()=>this.addToCart(e.quantity)},this.addToCartLabel))))))));if(this.offer.get.products?.length){const e=this.offer.get.products?.length||0,t={slidesPerView:"auto",spaceBetween:16,breakpoints:{768:{slidesPerView:Math.min(2,e),spaceBetween:16},1024:{slidesPerView:Math.min(3,e),spaceBetween:16}}};return s("salla-products-slider",{key:(this.offer.get.products?.map((e=>e.id))||[]).join(","),source:"selected","source-value":`[${(this.offer.get.products?.map((e=>e.id))||[]).join(",")}]`,"slider-config":JSON.stringify(t)})}return this.offer.get.categories?.length?s("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.categories?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.categories?.length<=2?"false":"true"},s("div",{slot:"items"},this.offer.get.categories.map((e=>s("a",{href:e.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item",innerHTML:this.categorySlot.replace(/\{tagIcon\}/g,'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tag</title>\n<path d="M28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n').replace(/\{name\}/g,e.name).replace(/\{url\}/g,e.urls.customer)}))))):void 0}render(){return s("salla-modal",{key:"630ede1c6ac0df4aa55bd36597eb846df901d94e","has-skeleton":!0,"sub-title":this.offer_message,ref:e=>this.modal=e,isLoading:!0,class:`s-offer-modal-type-${this.offer_type?this.offer_type:""}`},s("div",{key:"d467615c5aaefc38cec4e40e4e5a7282466937d3",slot:"loading"},s("div",{key:"ff17d657a94dcfe8d744e1317d8f73cab6063d11",class:"s-offer-modal-skeleton"},s("div",{key:"81bf28f2785c0beb1ef1d4997ce064983e2211ec",class:"s-offer-modal-skeleton-header"},s("salla-skeleton",{key:"acd8aa8be556821b4039d1b5fb6e46ef4155ac67",type:"circle",height:"80px",width:"80px"}),s("salla-skeleton",{key:"0c6855f5423a5e5bf1caf54da4f608b95b7d3f08",height:"15px",width:"50%"}),s("salla-skeleton",{key:"e313bac8052684ede353852821a51befb73f52b7",height:"10px",width:"30%"})),s("div",{key:"4c6a675e9c07e8e2986debd8dbecc346890ce0ca",class:"s-offer-modal-skeleton-items"},[...Array(3)].map((()=>s("div",{class:"s-offer-modal-skeleton-item"},s("salla-skeleton",{height:"9rem"}),s("div",{class:"s-offer-modal-skeleton-item-title"},s("salla-skeleton",{height:"15px",width:"100%"})),s("div",{class:"s-offer-modal-skeleton-item-subtitle"},s("salla-skeleton",{height:"9px",width:"50%"}),s("div",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>cart2</title>\n<path d="M6.845 5.333l-1.905-5.333h-3.607c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333v0h1.727l5.72 16.012c0.569 1.56 2.039 2.654 3.765 2.655h12.133c0.001 0 0.002 0 0.003 0 1.825 0 3.364-1.222 3.845-2.892l0.007-0.028 3.161-13.080zM25.96 17.716c-0.167 0.554-0.672 0.951-1.27 0.951-0.002 0-0.005 0-0.007-0h-12.133c-0.575-0-1.065-0.364-1.252-0.875l-0.003-0.009-3.497-9.783h20.508zM13.333 24c-2.209 0-4 1.791-4 4s1.791 4 4 4c2.209 0 4-1.791 4-4v0c0-2.209-1.791-4-4-4v0zM13.333 29.333c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333c0.736 0 1.333 0.597 1.333 1.333v0c0 0.736-0.597 1.333-1.333 1.333v0zM24 24c-2.209 0-4 1.791-4 4s1.791 4 4 4c2.209 0 4-1.791 4-4v0c0-2.209-1.791-4-4-4v0zM24 29.333c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333c0.736 0 1.333 0.597 1.333 1.333v0c0 0.736-0.597 1.333-1.333 1.333v0z"></path>\n</svg>\n'})))))),s("div",{key:"226951e15be9aede559c4d24ba6f6690fac80e13",class:"s-offer-modal-skeleton-footer"},s("salla-skeleton",{key:"86ae2c54c01b3e58fd31729bc6d263dfa078f7ba",height:"15px",width:"50%"}),s("salla-skeleton",{key:"32f30f4f5bb11405901359267ab6311604f352ed",height:"15px",width:"30%"})))),this.hasError||null===this.offer?s("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?s("span",{slot:"description"},this.errorMessage):""):[s("span",{slot:"icon",class:"s-offer-modal-header-icon",innerHTML:a}),this.getOfferContent(),s("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?s("p",{class:"s-offer-modal-expiry"},salla.lang.get("pages.products.offer_expires_in")," ",this.offer.formatted_date):"",s("label",{class:"s-offer-modal-remember-label"},s("input",{type:"checkbox",onChange:e=>this.rememberMe(e),class:"s-offer-modal-remember-input"}),"  ",salla.lang.get("common.elements.remember_my_choice")))])}get host(){return t(this)}};l.style=".s-offer-modal-type-products .s-modal-body{min-height:690px;position:relative}";export{l as salla_offer_modal}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as i,a as n}from"./p-CV1rqKQz.js";import{H as l}from"./p-CHf8XdiS.js";import"./p-CgtvEd63.js";const e=class{constructor(t){s(this,t),this.nextPage="",this.autoload=!1,this.container="salla-infinite-scroll",this.item="salla-infinite-scroll > *",this.status=document.createElement("div"),this.status.className="s-infinite-scroll-wrapper",this.status.innerHTML=`<div class="s-infinite-scroll-status" style="display:none">\n <p class="s-infinite-scroll-last infinite-scroll-last"></p>\n <p class="s-infinite-scroll-error infinite-scroll-error"></p>\n </div>\n <a href="${this.nextPage}" class="s-infinite-scroll-btn s-button-btn s-button-primary">\n <span class="s-button-text s-infinite-scroll-btn-text">${this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")}</span>\n <span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" style="display: none"></span>\n </a>`,this.btnLoader=this.status.querySelector(".s-button-loader"),salla.lang.onLoaded((()=>{this.status.querySelector(".s-button-text").innerHTML=this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more"),this.status.querySelector(".s-infinite-scroll-last").innerHTML=salla.lang.get("common.elements.end_of_content"),this.status.querySelector(".s-infinite-scroll-error").innerHTML=salla.lang.get("common.elements.failed_to_load_more")}))}loading(s=!0){let t=this.status.querySelector(".s-button-text");l.toggleElementClassIf(t,"s-button-hide","s-button-show",(()=>s)),this.btnLoader.style.display=s?"inherit":"none"}render(){return this.nextPage.length>1?t(i,{class:"s-infinite-scroll-container"},t("slot",null)):""}componentDidLoad(){if(0===this.nextPage.length)return;this.host.insertAdjacentElement("afterend",this.status);let s=this,t=salla.infiniteScroll.initiate(this.container,{history:!!this.autoload&&"push",scrollThreshold:!!this.autoload&&400,nextPage:this.nextPage,checkLastPage:'salla-infinite-scroll[next-page*=":"],salla-infinite-scroll[next-page*="."]',status:".s-infinite-scroll-status",button:this.status.querySelector(".s-button-btn"),append:this.item,path:function(){return s.nextPage.replace(/page\=(\d)/g,"page="+(this.loadCount+2))}}).on("request",(()=>this.loading())).on("load",(()=>{this.loading(!1),2==t.pageIndex&&t.option({loadOnScroll:!1}),3==t.pageIndex&&t.option({loadOnScroll:!0})})).on("error",(()=>this.loading(!1)))}get host(){return n(this)}};e.style="";export{e as salla_infinite_scroll}
4
+ import{r as s,h as t,H as i,a as n}from"./p-Y6CiunLU.js";import{H as l}from"./p-CHf8XdiS.js";import"./p-CgtvEd63.js";const e=class{constructor(t){s(this,t),this.nextPage="",this.autoload=!1,this.container="salla-infinite-scroll",this.item="salla-infinite-scroll > *",this.status=document.createElement("div"),this.status.className="s-infinite-scroll-wrapper",this.status.innerHTML=`<div class="s-infinite-scroll-status" style="display:none">\n <p class="s-infinite-scroll-last infinite-scroll-last"></p>\n <p class="s-infinite-scroll-error infinite-scroll-error"></p>\n </div>\n <a href="${this.nextPage}" class="s-infinite-scroll-btn s-button-btn s-button-primary">\n <span class="s-button-text s-infinite-scroll-btn-text">${this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")}</span>\n <span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" style="display: none"></span>\n </a>`,this.btnLoader=this.status.querySelector(".s-button-loader"),salla.lang.onLoaded((()=>{this.status.querySelector(".s-button-text").innerHTML=this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more"),this.status.querySelector(".s-infinite-scroll-last").innerHTML=salla.lang.get("common.elements.end_of_content"),this.status.querySelector(".s-infinite-scroll-error").innerHTML=salla.lang.get("common.elements.failed_to_load_more")}))}loading(s=!0){let t=this.status.querySelector(".s-button-text");l.toggleElementClassIf(t,"s-button-hide","s-button-show",(()=>s)),this.btnLoader.style.display=s?"inherit":"none"}render(){return this.nextPage.length>1?t(i,{class:"s-infinite-scroll-container"},t("slot",null)):""}componentDidLoad(){if(0===this.nextPage.length)return;this.host.insertAdjacentElement("afterend",this.status);let s=this,t=salla.infiniteScroll.initiate(this.container,{history:!!this.autoload&&"push",scrollThreshold:!!this.autoload&&400,nextPage:this.nextPage,checkLastPage:'salla-infinite-scroll[next-page*=":"],salla-infinite-scroll[next-page*="."]',status:".s-infinite-scroll-status",button:this.status.querySelector(".s-button-btn"),append:this.item,path:function(){return s.nextPage.replace(/page\=(\d)/g,"page="+(this.loadCount+2))}}).on("request",(()=>this.loading())).on("load",(()=>{this.loading(!1),2==t.pageIndex&&t.option({loadOnScroll:!1}),3==t.pageIndex&&t.option({loadOnScroll:!0})})).on("error",(()=>this.loading(!1)))}get host(){return n(this)}};e.style="";export{e as salla_infinite_scroll}