@salla.sa/twilight-components 2.14.353 → 2.14.354

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 (311) hide show
  1. package/dist/cjs/bell-ring-BfKPinNo.js +13 -0
  2. package/dist/cjs/{interfaces-CX9-6aLf.js → camera-DytepEoK.js} +0 -11
  3. package/dist/cjs/cancel-De6vslRA.js +13 -0
  4. package/dist/cjs/cart-s-x1Fshk.js +13 -0
  5. package/dist/cjs/check-circle2-BDvlT4_n.js +13 -0
  6. package/dist/cjs/{check-CLRvuniI.js → check-x3w3-gpj.js} +2 -2
  7. package/dist/cjs/{filepond-7SxqaoXb.js → filepond-CuKErtOy.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-file-poster-DwIv84hN.js → filepond-plugin-file-poster-d-8BSuST.js} +1 -1
  9. package/dist/cjs/{filepond-plugin-file-validate-size-NUNnIo4Q.js → filepond-plugin-file-validate-size-zgI_JcqY.js} +1 -1
  10. package/dist/cjs/{filepond-plugin-file-validate-type-CXI-hfww.js → filepond-plugin-file-validate-type-Cy8IgG2P.js} +1 -1
  11. package/dist/cjs/{filepond-plugin-image-edit-fBeBGIBb.js → filepond-plugin-image-edit-9ZAUzCvh.js} +1 -1
  12. package/dist/cjs/{filepond-plugin-image-exif-orientation-BmLTdQ6d.js → filepond-plugin-image-exif-orientation-DzNe_tY2.js} +1 -1
  13. package/dist/cjs/{filepond-plugin-image-preview-CssKRM6n.js → filepond-plugin-image-preview-Cfna6xTB.js} +1 -1
  14. package/dist/{esm/gift-C0JNGIpa.js → cjs/gift-CJ-3Yw_x.js} +4 -2
  15. package/dist/cjs/image-BoZ6Hums.js +13 -0
  16. package/dist/cjs/{index-B5soIVRX.js → index-Ce40E8tZ.js} +136 -12
  17. package/dist/cjs/{index-B9TEdQDE.js → index-ff-xJfhj.js} +1 -1
  18. package/dist/cjs/interfaces-CRqrf5RX.js +15 -0
  19. package/dist/cjs/keyboard_arrow_down-DHJ3FFZq.js +13 -0
  20. package/dist/cjs/keyboard_arrow_right-BayM_Il2.js +21 -0
  21. package/dist/cjs/loader.cjs.js +2 -2
  22. package/dist/cjs/minus-CCryh1qf.js +21 -0
  23. package/dist/cjs/salla-accordion-body_3.cjs.entry.js +775 -0
  24. package/dist/cjs/salla-accordion_6.cjs.entry.js +768 -0
  25. package/dist/cjs/salla-add-product-button_4.cjs.entry.js +2389 -0
  26. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-alert_2.cjs.entry.js +194 -0
  28. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-booking-field_7.cjs.entry.js +1565 -0
  31. package/dist/cjs/{salla-cart-item-offers.cjs.entry.js → salla-cart-item-offers_2.cjs.entry.js} +104 -5
  32. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1661 -0
  33. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
  35. package/dist/cjs/salla-count-down_2.cjs.entry.js +302 -0
  36. package/dist/cjs/salla-custom-fields.cjs.entry.js +4 -3
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-gifting.cjs.entry.js +488 -0
  40. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +91 -0
  42. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-list-tile.cjs.entry.js +34 -0
  44. package/dist/cjs/salla-localization-modal.cjs.entry.js +137 -0
  45. package/dist/cjs/salla-login-modal.cjs.entry.js +320 -0
  46. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  48. package/dist/cjs/salla-loyalty.cjs.entry.js +211 -0
  49. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +40 -0
  50. package/dist/cjs/salla-menu.cjs.entry.js +139 -0
  51. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +220 -0
  53. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +598 -0
  54. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +69 -0
  55. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-offer-modal.cjs.entry.js +206 -0
  58. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-order-summary.cjs.entry.js +3 -3
  63. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-placeholder.cjs.entry.js +51 -0
  67. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-product-size-guide.cjs.entry.js +66 -0
  69. package/dist/cjs/salla-products-list.cjs.entry.js +762 -0
  70. package/dist/cjs/salla-products-slider.cjs.entry.js +115 -0
  71. package/dist/cjs/salla-progress-bar.cjs.entry.js +73 -0
  72. package/dist/cjs/salla-quick-order.cjs.entry.js +239 -0
  73. package/dist/cjs/salla-rating-modal.cjs.entry.js +453 -0
  74. package/dist/cjs/salla-scopes.cjs.entry.js +180 -0
  75. package/dist/cjs/salla-search.cjs.entry.js +153 -0
  76. package/dist/cjs/salla-skeleton.cjs.entry.js +36 -0
  77. package/dist/cjs/salla-slider.cjs.entry.js +10389 -0
  78. package/dist/cjs/salla-social-share.cjs.entry.js +165 -0
  79. package/dist/cjs/salla-social.cjs.entry.js +3 -3
  80. package/dist/cjs/salla-tab-content_3.cjs.entry.js +157 -0
  81. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-user-menu.cjs.entry.js +275 -0
  85. package/dist/cjs/salla-user-profile.cjs.entry.js +145 -0
  86. package/dist/cjs/salla-user-settings.cjs.entry.js +88 -0
  87. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  89. package/dist/cjs/search-c7Aa7lM9.js +13 -0
  90. package/dist/cjs/{special-discount-OVG_9Kf9.js → special-discount-DC2oXurL.js} +0 -8
  91. package/dist/cjs/star-DGcH7Yso.js +13 -0
  92. package/dist/cjs/star2-R146a27p.js +13 -0
  93. package/dist/cjs/twilight.cjs.js +2 -2
  94. package/dist/cjs/{vanilla-picker-C6fk8_TR.js → vanilla-picker-zQsXQIff.js} +1 -1
  95. package/dist/cjs/{whatsapp2-D7Sbg8Ey.js → whatsapp2-BdMd5Gx1.js} +2 -2
  96. package/dist/collection/collection-manifest.json +55 -1
  97. package/dist/collection/components/salla-product-options/salla-product-options.js +36 -3
  98. package/dist/components/index.js +2 -2
  99. package/dist/components/salla-product-options2.js +19 -2
  100. package/dist/esm/bell-ring-D3mWkc-3.js +11 -0
  101. package/dist/esm/{interfaces-CBT_Nxny.js → camera-C6jIkM-X.js} +1 -12
  102. package/dist/esm/cancel-BsLF_HK7.js +11 -0
  103. package/dist/esm/cart-DY4LZmNP.js +11 -0
  104. package/dist/esm/{check-uTyAzPSy.js → check-BsXh13x8.js} +2 -2
  105. package/dist/esm/check-circle2-BV4kqbdL.js +11 -0
  106. package/dist/esm/{filepond-Cuqyleyy.js → filepond-DEzyRrdH.js} +1 -1
  107. package/dist/esm/{filepond-plugin-file-poster-C6Wara8q.js → filepond-plugin-file-poster-DyLcCcHM.js} +1 -1
  108. package/dist/esm/{filepond-plugin-file-validate-size-D-M3KSxo.js → filepond-plugin-file-validate-size-Cxp5Yzea.js} +1 -1
  109. package/dist/esm/{filepond-plugin-file-validate-type-DzAl1VI8.js → filepond-plugin-file-validate-type-D2qNOQP4.js} +1 -1
  110. package/dist/esm/{filepond-plugin-image-edit-flutfc9I.js → filepond-plugin-image-edit-DndTlA7m.js} +1 -1
  111. package/dist/esm/{filepond-plugin-image-exif-orientation-B2UkG6iE.js → filepond-plugin-image-exif-orientation-CiT1CQoK.js} +1 -1
  112. package/dist/esm/{filepond-plugin-image-preview-B4u8N2nE.js → filepond-plugin-image-preview-DBG7keFZ.js} +1 -1
  113. package/dist/{cjs/gift-BPDUPIY_.js → esm/gift-BChI23pG.js} +2 -4
  114. package/dist/esm/image-C-tzSDxw.js +11 -0
  115. package/dist/esm/{index-6mr785rH.js → index-B74h9G6a.js} +137 -13
  116. package/dist/esm/{index-xWIb6INF.js → index-BLw7mdtM.js} +1 -1
  117. package/dist/esm/interfaces-OF8QcbMM.js +15 -0
  118. package/dist/esm/keyboard_arrow_down-DCZbpt2a.js +11 -0
  119. package/dist/esm/keyboard_arrow_right-Vqpj4CWE.js +18 -0
  120. package/dist/esm/loader.js +3 -3
  121. package/dist/esm/minus-DfeagqF1.js +18 -0
  122. package/dist/esm/salla-accordion-body_3.entry.js +771 -0
  123. package/dist/esm/salla-accordion_6.entry.js +761 -0
  124. package/dist/esm/salla-add-product-button_4.entry.js +2384 -0
  125. package/dist/esm/salla-advertisement.entry.js +1 -1
  126. package/dist/esm/salla-alert_2.entry.js +191 -0
  127. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  128. package/dist/esm/salla-apps-icons.entry.js +1 -1
  129. package/dist/esm/salla-booking-field_7.entry.js +1539 -0
  130. package/dist/esm/{salla-cart-item-offers.entry.js → salla-cart-item-offers_2.entry.js} +104 -6
  131. package/dist/esm/salla-comment-form_8.entry.js +1652 -0
  132. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  133. package/dist/esm/salla-contacts.entry.js +3 -3
  134. package/dist/esm/salla-count-down_2.entry.js +299 -0
  135. package/dist/esm/salla-custom-fields.entry.js +3 -2
  136. package/dist/esm/salla-filters-widget.entry.js +1 -1
  137. package/dist/esm/salla-filters.entry.js +1 -1
  138. package/dist/esm/salla-gifting.entry.js +486 -0
  139. package/dist/esm/salla-hook.entry.js +1 -1
  140. package/dist/esm/salla-infinite-scroll.entry.js +89 -0
  141. package/dist/esm/salla-installment.entry.js +1 -1
  142. package/dist/esm/salla-list-tile.entry.js +32 -0
  143. package/dist/esm/salla-localization-modal.entry.js +135 -0
  144. package/dist/esm/salla-login-modal.entry.js +318 -0
  145. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  146. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  147. package/dist/esm/salla-loyalty.entry.js +209 -0
  148. package/dist/esm/salla-maintenance-alert.entry.js +38 -0
  149. package/dist/esm/salla-menu.entry.js +137 -0
  150. package/dist/esm/salla-metadata.entry.js +1 -1
  151. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +217 -0
  152. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +595 -0
  153. package/dist/esm/salla-multiple-bundle-product.entry.js +67 -0
  154. package/dist/esm/salla-notification-item.entry.js +1 -1
  155. package/dist/esm/salla-notifications.entry.js +1 -1
  156. package/dist/esm/salla-offer-modal.entry.js +204 -0
  157. package/dist/esm/salla-offer.entry.js +1 -1
  158. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  159. package/dist/esm/salla-order-details-options.entry.js +1 -1
  160. package/dist/esm/salla-order-details.entry.js +1 -1
  161. package/dist/esm/salla-order-summary.entry.js +3 -3
  162. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  163. package/dist/esm/salla-orders.entry.js +1 -1
  164. package/dist/esm/salla-payments.entry.js +1 -1
  165. package/dist/esm/salla-placeholder.entry.js +49 -0
  166. package/dist/esm/salla-price-range.entry.js +1 -1
  167. package/dist/esm/salla-product-size-guide.entry.js +64 -0
  168. package/dist/esm/salla-products-list.entry.js +760 -0
  169. package/dist/esm/salla-products-slider.entry.js +113 -0
  170. package/dist/esm/salla-progress-bar.entry.js +71 -0
  171. package/dist/esm/salla-quick-order.entry.js +237 -0
  172. package/dist/esm/salla-rating-modal.entry.js +451 -0
  173. package/dist/esm/salla-scopes.entry.js +178 -0
  174. package/dist/esm/salla-search.entry.js +151 -0
  175. package/dist/esm/salla-skeleton.entry.js +34 -0
  176. package/dist/esm/salla-slider.entry.js +10387 -0
  177. package/dist/esm/salla-social-share.entry.js +163 -0
  178. package/dist/esm/salla-social.entry.js +2 -2
  179. package/dist/esm/salla-tab-content_3.entry.js +153 -0
  180. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  181. package/dist/esm/salla-tooltip.entry.js +1 -1
  182. package/dist/esm/salla-trust-badges.entry.js +1 -1
  183. package/dist/esm/salla-user-menu.entry.js +273 -0
  184. package/dist/esm/salla-user-profile.entry.js +143 -0
  185. package/dist/esm/salla-user-settings.entry.js +86 -0
  186. package/dist/esm/salla-verify.entry.js +1 -1
  187. package/dist/esm/salla-wallet.entry.js +1 -1
  188. package/dist/esm/search-BscTeWDc.js +11 -0
  189. package/dist/esm/{special-discount-yRO-ZESF.js → special-discount-Ctkfc4K-.js} +1 -8
  190. package/dist/esm/star-ZT7ehBBk.js +11 -0
  191. package/dist/esm/star2-D4oPi1Ov.js +11 -0
  192. package/dist/esm/twilight.js +3 -3
  193. package/dist/esm/{vanilla-picker-B4PKRAhm.js → vanilla-picker-CtwkXTap.js} +1 -1
  194. package/dist/esm/{whatsapp2-DWksgowB.js → whatsapp2-CgR-T_ZS.js} +2 -2
  195. package/dist/twilight/{p-2a26c1d6.entry.js → p-0134b4fd.entry.js} +1 -1
  196. package/dist/twilight/{p-d4aaeef4.entry.js → p-01daaaa6.entry.js} +1 -1
  197. package/dist/twilight/p-07da7390.entry.js +4 -0
  198. package/dist/twilight/{p-81702ecb.entry.js → p-08badc32.entry.js} +1 -1
  199. package/dist/twilight/{p-4bc98557.entry.js → p-0aa5a12a.entry.js} +1 -1
  200. package/dist/twilight/{p-6f576591.entry.js → p-10dcd981.entry.js} +1 -1
  201. package/dist/twilight/{p-5067322a.entry.js → p-212a0710.entry.js} +1 -1
  202. package/dist/twilight/p-229275db.entry.js +4 -0
  203. package/dist/twilight/{p-dde21f4b.entry.js → p-232185ec.entry.js} +1 -1
  204. package/dist/twilight/{p-12e49031.entry.js → p-2a927eac.entry.js} +1 -1
  205. package/dist/twilight/p-2d880232.entry.js +4 -0
  206. package/dist/twilight/p-2de9df64.entry.js +4 -0
  207. package/dist/twilight/p-309a0ba4.entry.js +4 -0
  208. package/dist/twilight/{p-e909d28b.entry.js → p-32732ca7.entry.js} +1 -1
  209. package/dist/twilight/{p-19e07b9e.entry.js → p-32ca34ec.entry.js} +1 -1
  210. package/dist/twilight/{p-9946fa76.entry.js → p-33093880.entry.js} +1 -1
  211. package/dist/twilight/p-3cffa4c9.entry.js +4 -0
  212. package/dist/twilight/p-3d0bb451.entry.js +4 -0
  213. package/dist/twilight/p-3e0d814c.entry.js +4 -0
  214. package/dist/twilight/p-4036d5dc.entry.js +4 -0
  215. package/dist/twilight/p-40fe4b01.entry.js +4 -0
  216. package/dist/twilight/p-47ac0ca5.entry.js +4 -0
  217. package/dist/twilight/{p-5bf05092.entry.js → p-4cd9da44.entry.js} +1 -1
  218. package/dist/twilight/p-5c9281d3.entry.js +4 -0
  219. package/dist/twilight/p-5d044466.entry.js +4 -0
  220. package/dist/twilight/p-5d21334a.entry.js +4 -0
  221. package/dist/twilight/{p-c096e336.entry.js → p-654429df.entry.js} +1 -1
  222. package/dist/twilight/p-6b8453be.entry.js +4 -0
  223. package/dist/twilight/p-6be7bbb0.entry.js +4 -0
  224. package/dist/twilight/{p-4253fc44.entry.js → p-6c8f5c94.entry.js} +1 -1
  225. package/dist/twilight/{p-6f5d02c6.entry.js → p-6fa02770.entry.js} +1 -1
  226. package/dist/twilight/p-7040ea33.entry.js +4 -0
  227. package/dist/twilight/p-8c189d76.entry.js +4 -0
  228. package/dist/twilight/p-8f1f052c.entry.js +4 -0
  229. package/dist/twilight/{p-ac6fc286.entry.js → p-9051a540.entry.js} +1 -1
  230. package/dist/twilight/p-9f1c561f.entry.js +4 -0
  231. package/dist/twilight/{p-B2SkkGH8.js → p-B69XOH6h.js} +1 -1
  232. package/dist/twilight/{p-6mr785rH.js → p-B74h9G6a.js} +2 -2
  233. package/dist/twilight/{p-C0JNGIpa.js → p-BChI23pG.js} +1 -1
  234. package/dist/twilight/{p-C_h1JDCU.js → p-BCxm-ISm.js} +1 -1
  235. package/dist/twilight/{p-Bp_xKTyn.js → p-BPqZ249Z.js} +1 -1
  236. package/dist/twilight/p-BV4kqbdL.js +4 -0
  237. package/dist/twilight/p-BsLF_HK7.js +4 -0
  238. package/dist/twilight/{p-uTyAzPSy.js → p-BsXh13x8.js} +1 -1
  239. package/dist/twilight/p-BscTeWDc.js +4 -0
  240. package/dist/twilight/p-C-tzSDxw.js +4 -0
  241. package/dist/twilight/p-C6jIkM-X.js +4 -0
  242. package/dist/twilight/p-CO-PeZ27.js +4 -0
  243. package/dist/twilight/{p-ChfiVIJv.js → p-CQq81yb5.js} +1 -1
  244. package/dist/twilight/{p-DWksgowB.js → p-CgR-T_ZS.js} +1 -1
  245. package/dist/twilight/p-Ctkfc4K-.js +4 -0
  246. package/dist/twilight/p-D3mWkc-3.js +4 -0
  247. package/dist/twilight/p-D4oPi1Ov.js +4 -0
  248. package/dist/twilight/p-DCZbpt2a.js +4 -0
  249. package/dist/twilight/p-DY4LZmNP.js +4 -0
  250. package/dist/twilight/p-DfeagqF1.js +4 -0
  251. package/dist/twilight/{p-Cuxsz9f-.js → p-DpsbV3x1.js} +1 -1
  252. package/dist/twilight/p-OF8QcbMM.js +4 -0
  253. package/dist/twilight/p-Vqpj4CWE.js +4 -0
  254. package/dist/twilight/p-ZT7ehBBk.js +4 -0
  255. package/dist/twilight/{p-tFBCbVoG.js → p-_-aXm0Wb.js} +1 -1
  256. package/dist/twilight/p-a100bd38.entry.js +4 -0
  257. package/dist/twilight/{p-0c87ef6c.entry.js → p-a2756650.entry.js} +1 -1
  258. package/dist/twilight/{p-8b018d82.entry.js → p-aab45a16.entry.js} +1 -1
  259. package/dist/twilight/p-aae761ff.entry.js +4 -0
  260. package/dist/twilight/p-afd61e47.entry.js +4 -0
  261. package/dist/twilight/p-b1fc6dfc.entry.js +4 -0
  262. package/dist/twilight/p-b206a0a1.entry.js +4 -0
  263. package/dist/twilight/p-b2332516.entry.js +4 -0
  264. package/dist/twilight/{p-18ebec2c.entry.js → p-b588ef46.entry.js} +1 -1
  265. package/dist/twilight/p-b71fc1b5.entry.js +4 -0
  266. package/dist/twilight/{p-zHj-W7EE.js → p-bVqtOl1F.js} +1 -1
  267. package/dist/twilight/{p-300624bb.entry.js → p-bf65b263.entry.js} +1 -1
  268. package/dist/twilight/{p-33ea3141.entry.js → p-c56a47b0.entry.js} +1 -1
  269. package/dist/twilight/p-c73189e3.entry.js +4 -0
  270. package/dist/twilight/p-d1203242.entry.js +4 -0
  271. package/dist/twilight/p-d4edfed4.entry.js +4 -0
  272. package/dist/twilight/{p-6472200c.entry.js → p-d86ce978.entry.js} +1 -1
  273. package/dist/twilight/{p-fa585081.entry.js → p-d9e7973d.entry.js} +1 -1
  274. package/dist/twilight/p-e3e33238.entry.js +4 -0
  275. package/dist/twilight/p-e6bb7362.entry.js +4 -0
  276. package/dist/twilight/{p-28900b2e.entry.js → p-e7813c80.entry.js} +1 -1
  277. package/dist/twilight/p-ec2fd37e.entry.js +4 -0
  278. package/dist/twilight/{p-b60db6c8.entry.js → p-ec77c523.entry.js} +1 -1
  279. package/dist/twilight/{p-8c7b7712.entry.js → p-efc18ce6.entry.js} +1 -1
  280. package/dist/twilight/p-f4039c40.entry.js +4 -0
  281. package/dist/twilight/p-f47b130c.entry.js +4 -0
  282. package/dist/twilight/{p-7e39343d.entry.js → p-f57ca123.entry.js} +1 -1
  283. package/dist/twilight/{p-2d209f96.entry.js → p-f5ad6572.entry.js} +1 -1
  284. package/dist/twilight/p-fc65084f.entry.js +4 -0
  285. package/dist/twilight/p-fd81a311.entry.js +4 -0
  286. package/dist/twilight/{p-16b8d78c.entry.js → p-fe983809.entry.js} +1 -1
  287. package/dist/twilight/{p-BijadG7g.js → p-i5J7XGS6.js} +1 -1
  288. package/dist/twilight/{p-DnELO4MH.js → p-shFpk0H3.js} +1 -1
  289. package/dist/twilight/twilight.esm.js +1 -1
  290. package/dist/types/components/salla-product-options/salla-product-options.d.ts +8 -1
  291. package/dist/types/components.d.ts +4 -0
  292. package/package.json +5 -5
  293. package/dist/cjs/salla-accordion_62.cjs.entry.js +0 -22470
  294. package/dist/cjs/salla-review-card.cjs.entry.js +0 -183
  295. package/dist/cjs/salla-reviews-page.cjs.entry.js +0 -695
  296. package/dist/cjs/salla-reviews.cjs.entry.js +0 -106
  297. package/dist/esm/salla-accordion_62.entry.js +0 -22389
  298. package/dist/esm/salla-review-card.entry.js +0 -181
  299. package/dist/esm/salla-reviews-page.entry.js +0 -693
  300. package/dist/esm/salla-reviews.entry.js +0 -104
  301. package/dist/twilight/p-67830f2a.entry.js +0 -4
  302. package/dist/twilight/p-751dddd4.entry.js +0 -4
  303. package/dist/twilight/p-9b22a7eb.entry.js +0 -4
  304. package/dist/twilight/p-CBT_Nxny.js +0 -4
  305. package/dist/twilight/p-Dz7o69vX.js +0 -4
  306. package/dist/twilight/p-a515a8cc.entry.js +0 -4
  307. package/dist/twilight/p-c4821f8b.entry.js +0 -4
  308. package/dist/twilight/p-de807340.entry.js +0 -4
  309. package/dist/twilight/p-yRO-ZESF.js +0 -4
  310. package/dist/cjs/{twitter-pOrUNjXi.js → facebook-DbXua6B9.js} +2 -2
  311. package/dist/esm/{twitter-Dz7o69vX.js → facebook-CO-PeZ27.js} +2 -2
@@ -0,0 +1,598 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ 'use strict';
5
+
6
+ var index = require('./index-Ce40E8tZ.js');
7
+ var keyboard_arrow_right = require('./keyboard_arrow_right-BayM_Il2.js');
8
+
9
+ const sallaMultipleBundleProductOptionsModalCss = ":host{display:block}";
10
+
11
+ const SallaMultipleBundleProductOptionsModal = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ this.optionsSaved = index.createEvent(this, "optionsSaved");
15
+ this.productSelected = index.createEvent(this, "productSelected");
16
+ this.product = null;
17
+ this.sectionId = null;
18
+ this.sectionIndex = 0;
19
+ this.productIndex = 0;
20
+ this.selectedOptions = {};
21
+ this.optionsResetTokens = {};
22
+ this.isLoading = false;
23
+ this.hasUnsavedChanges = false;
24
+ this.validationErrors = [];
25
+ }
26
+ /**
27
+ * Generate a unique cache key for selected options using section ID, product index, and product ID
28
+ */
29
+ generateCacheKey(sectionId, productIndex, productId) {
30
+ return `${sectionId || 'unknown'}-${productIndex || 0}-${productId || 'unknown'}`;
31
+ }
32
+ handleProductChange(newValue) {
33
+ // Use setTimeout to ensure modal is ready
34
+ setTimeout(() => {
35
+ if (this.modal && newValue) {
36
+ const title = newValue.name || '';
37
+ this.modal.setTitle(title);
38
+ }
39
+ }, 100);
40
+ // Reset validation errors when product changes
41
+ this.validationErrors = [];
42
+ this.hasUnsavedChanges = false;
43
+ }
44
+ async open() {
45
+ if (!this.modal) {
46
+ requestAnimationFrame(() => this.open());
47
+ return;
48
+ }
49
+ this.isLoading = true;
50
+ // Set the title before opening
51
+ if (this.product?.name) {
52
+ this.modal.setTitle(this.product.name);
53
+ }
54
+ this.modal.open();
55
+ // Initialize selectedOptions with current selections from the component
56
+ setTimeout(async () => {
57
+ if (this.product?.id) {
58
+ await this.initializeSelectedOptions();
59
+ }
60
+ // Set title again after modal is fully loaded
61
+ if (this.product?.name) {
62
+ this.modal.setTitle(this.product.name);
63
+ }
64
+ this.modal.stopLoading();
65
+ this.isLoading = false;
66
+ }, 300);
67
+ }
68
+ async close() {
69
+ if (this.modal) {
70
+ this.modal.close();
71
+ }
72
+ }
73
+ async refreshOptionsState() {
74
+ // Force re-render by updating the component state
75
+ this.selectedOptions = { ...this.selectedOptions };
76
+ }
77
+ componentDidLoad() {
78
+ this.modalOpenListener = (data) => {
79
+ this.product = data.product;
80
+ this.sectionId = data.sectionId || null;
81
+ this.sectionIndex = data.sectionIndex || 0;
82
+ this.productIndex = data.productIndex || 0;
83
+ this.open();
84
+ };
85
+ salla.event.on('multiple-bundle-product-modal::open', this.modalOpenListener);
86
+ // Listen for clear-options event when a product is deselected
87
+ this.clearOptionsListener = (data) => {
88
+ if (!data || !data.productId)
89
+ return;
90
+ this.clearProductOptions(data.productId, data.sectionId, data.productIndex);
91
+ };
92
+ salla.event.on('multiple-bundle-product-modal::clear-options', this.clearOptionsListener);
93
+ // Create and store the option change listener for proper cleanup
94
+ this.optionChangeListener = (e) => {
95
+ const data = e.detail || e;
96
+ const { option, detail } = data;
97
+ // If data is a detail object (has option_id), find the option from product
98
+ const actualOption = option || (data.option_id && this.product?.options?.find(opt => opt.id === data.option_id || String(opt.id) === String(data.option_id)));
99
+ const actualDetail = detail || (data.id ? data : null);
100
+ if (this.product?.id && actualOption) {
101
+ this.handleOptionChange(Number(this.product.id), actualOption, actualDetail);
102
+ }
103
+ };
104
+ salla.event.on('product-options::change', this.optionChangeListener);
105
+ // Create and store the checkbox change listener for proper cleanup
106
+ this.checkboxChangeListener = (e) => {
107
+ const target = e.target;
108
+ // Check if this is a product selection checkbox
109
+ if (target && target.type === 'checkbox' && target.name && target.name.includes('bundle[') && target.name.includes('][id]')) {
110
+ // Extract section info from the checkbox name: bundle[sectionId][productIndex][id]
111
+ const nameMatch = target.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);
112
+ if (nameMatch && !target.checked) {
113
+ const [, sectionId, productIndex] = nameMatch;
114
+ const productId = target.value;
115
+ const form = this.host.closest('form');
116
+ this.cleanupProductDeselection({
117
+ sectionId,
118
+ productIndex: parseInt(productIndex, 10),
119
+ productId,
120
+ form,
121
+ uncheckedInput: target,
122
+ });
123
+ }
124
+ }
125
+ };
126
+ // Listen for product checkbox changes to reset options when product is deselected
127
+ document.addEventListener('change', this.checkboxChangeListener);
128
+ }
129
+ disconnectedCallback() {
130
+ // Clean up event listeners to prevent memory leaks
131
+ if (this.checkboxChangeListener) {
132
+ document.removeEventListener('change', this.checkboxChangeListener);
133
+ }
134
+ if (this.optionChangeListener) {
135
+ salla.event.off('product-options::change', this.optionChangeListener);
136
+ }
137
+ if (this.modalOpenListener) {
138
+ salla.event.off('multiple-bundle-product-modal::open', this.modalOpenListener);
139
+ }
140
+ if (this.clearOptionsListener) {
141
+ salla.event.off('multiple-bundle-product-modal::clear-options', this.clearOptionsListener);
142
+ }
143
+ }
144
+ cleanupProductDeselection(params) {
145
+ const { sectionId, productIndex, productId, form, uncheckedInput } = params;
146
+ this.clearProductOptions(productId, sectionId, productIndex);
147
+ if (form) {
148
+ const productInputPattern = `bundle[${sectionId}][${productIndex}]`;
149
+ Array.from(form.querySelectorAll(`input[name^="${productInputPattern}"]`)).forEach(input => {
150
+ if (input === uncheckedInput) {
151
+ return;
152
+ }
153
+ const shouldRemoveHidden = input.type === 'hidden';
154
+ const shouldRemoveByDataset = input.getAttribute('data-product-id') === String(productId) &&
155
+ input.name?.startsWith(productInputPattern);
156
+ if (shouldRemoveHidden || shouldRemoveByDataset) {
157
+ input.remove();
158
+ }
159
+ });
160
+ requestAnimationFrame(() => {
161
+ const changeEvent = new window.Event('change', { bubbles: true });
162
+ form.dispatchEvent(changeEvent);
163
+ });
164
+ }
165
+ }
166
+ generateFormInputName(sectionId, productIndex, optionParentId) {
167
+ return `bundle[${sectionId}][${productIndex}][options][${optionParentId}]`;
168
+ }
169
+ async initializeSelectedOptions() {
170
+ if (!this.product?.id)
171
+ return;
172
+ const productId = this.product.id;
173
+ const cacheKey = this.generateCacheKey(this.sectionId, this.productIndex, productId);
174
+ const optionsEl = document.querySelector(`salla-product-options[product-id="${productId}"]`);
175
+ if (optionsEl) {
176
+ try {
177
+ const selectedOptions = await optionsEl.getSelectedOptions();
178
+ if (selectedOptions && selectedOptions.length > 0) {
179
+ this.selectedOptions = {
180
+ ...this.selectedOptions,
181
+ [cacheKey]: selectedOptions,
182
+ };
183
+ }
184
+ }
185
+ catch (e) {
186
+ console.warn('Could not initialize selected options:', e);
187
+ }
188
+ }
189
+ }
190
+ // Clear options state for a specific product
191
+ clearProductOptions(productId, sectionId, productIndex) {
192
+ const updatedSelectedOptions = { ...this.selectedOptions };
193
+ if (sectionId != null && productIndex != null && !Number.isNaN(productIndex)) {
194
+ const cacheKey = this.generateCacheKey(sectionId, productIndex, productId);
195
+ delete updatedSelectedOptions[cacheKey];
196
+ this.bumpOptionsResetToken(cacheKey);
197
+ }
198
+ else {
199
+ const productSuffix = `-${String(productId)}`;
200
+ const affectedKeys = [];
201
+ Object.keys(updatedSelectedOptions).forEach(key => {
202
+ if (key.endsWith(productSuffix)) {
203
+ delete updatedSelectedOptions[key];
204
+ affectedKeys.push(key);
205
+ }
206
+ });
207
+ affectedKeys.forEach(key => this.bumpOptionsResetToken(key));
208
+ }
209
+ this.selectedOptions = updatedSelectedOptions;
210
+ // Reset validation errors and unsaved changes
211
+ this.validationErrors = [];
212
+ this.hasUnsavedChanges = false;
213
+ }
214
+ bumpOptionsResetToken(cacheKey) {
215
+ if (!cacheKey)
216
+ return;
217
+ this.optionsResetTokens = {
218
+ ...this.optionsResetTokens,
219
+ [cacheKey]: (this.optionsResetTokens[cacheKey] || 0) + 1,
220
+ };
221
+ }
222
+ async handleOptionChange(productId, option, detail) {
223
+ const cacheKey = this.generateCacheKey(this.sectionId, this.productIndex, productId);
224
+ // Get the current state from the component to ensure we have the latest selections
225
+ const optionsEl = document.querySelector(`salla-product-options[product-id="${productId}"]`);
226
+ let currentComponentSelections = [];
227
+ if (optionsEl) {
228
+ try {
229
+ currentComponentSelections = (await optionsEl.getSelectedOptions()) || [];
230
+ }
231
+ catch (e) {
232
+ console.warn('Could not get current selections from component:', e);
233
+ }
234
+ }
235
+ // If component returns data, use it; otherwise, fall back to manual tracking
236
+ if (currentComponentSelections.length > 0) {
237
+ // Component returned data, use it
238
+ this.selectedOptions = {
239
+ ...this.selectedOptions,
240
+ [cacheKey]: currentComponentSelections,
241
+ };
242
+ }
243
+ else {
244
+ // If we have existing selections in internal state and component returns empty,
245
+ // it might be a deselection, so we should use manual tracking
246
+ if (this.selectedOptions[cacheKey] && this.selectedOptions[cacheKey].length > 0) {
247
+ // Component didn't return data, use manual tracking
248
+ const currentSelected = this.selectedOptions[cacheKey] || [];
249
+ const updatedSelected = [...currentSelected];
250
+ // Find existing selection for this specific option (by option_id)
251
+ const existingIndex = updatedSelected.findIndex(opt => opt.option_id === option.id);
252
+ if (existingIndex > -1) {
253
+ // Check if this is a deselection (detail might be null or undefined)
254
+ if (!detail || detail.id === null || detail.id === undefined) {
255
+ // Remove the option (deselection)
256
+ updatedSelected.splice(existingIndex, 1);
257
+ }
258
+ else {
259
+ // Replace existing selection for this option
260
+ updatedSelected[existingIndex] = { ...detail, option_id: option.id };
261
+ }
262
+ }
263
+ else {
264
+ // Only add if detail exists (not a deselection)
265
+ if (detail && detail.id !== null && detail.id !== undefined) {
266
+ updatedSelected.push({ ...detail, option_id: option.id });
267
+ }
268
+ }
269
+ this.selectedOptions = {
270
+ ...this.selectedOptions,
271
+ [cacheKey]: updatedSelected,
272
+ };
273
+ }
274
+ else {
275
+ // No existing selections, component returned empty, and we're trying to add
276
+ // This might be the first selection, so add it manually
277
+ if (detail && detail.id !== null && detail.id !== undefined) {
278
+ this.selectedOptions = {
279
+ ...this.selectedOptions,
280
+ [cacheKey]: [{ ...detail, option_id: option.id }],
281
+ };
282
+ }
283
+ }
284
+ }
285
+ this.hasUnsavedChanges = true;
286
+ this.validationErrors = []; // Clear validation errors when user makes changes
287
+ }
288
+ async validateOptions() {
289
+ if (!this.product?.options)
290
+ return true;
291
+ const errors = [];
292
+ const productId = this.product.id;
293
+ const cacheKey = this.generateCacheKey(this.sectionId, this.productIndex, productId);
294
+ // Get the actual selected options from the component
295
+ const optionsEl = document.querySelector(`salla-product-options[product-id="${productId}"]`);
296
+ let currentSelected = [];
297
+ if (optionsEl) {
298
+ try {
299
+ currentSelected = (await optionsEl.getSelectedOptions()) || [];
300
+ // Also check our internal state as fallback
301
+ const internalSelected = this.selectedOptions[cacheKey] || [];
302
+ // Use whichever has more selections, or if component returns empty but internal has data, use internal
303
+ if (internalSelected.length > currentSelected.length ||
304
+ (currentSelected.length === 0 && internalSelected.length > 0)) {
305
+ currentSelected = internalSelected;
306
+ }
307
+ }
308
+ catch (e) {
309
+ // Fallback to internal state
310
+ currentSelected = this.selectedOptions[cacheKey] || [];
311
+ }
312
+ }
313
+ else {
314
+ // Fallback to internal state
315
+ currentSelected = this.selectedOptions[cacheKey] || [];
316
+ }
317
+ // Check if any options are selected at all
318
+ if (currentSelected.length === 0) {
319
+ errors.push(salla.lang.get('pages.products.no_options_selected'));
320
+ }
321
+ // Check required options
322
+ this.product.options.forEach(option => {
323
+ if (option.required) {
324
+ const hasSelection = currentSelected.some(selected => {
325
+ return selected.option_id == option.id; // Use == instead of === for type flexibility
326
+ });
327
+ if (!hasSelection) {
328
+ errors.push(salla.lang.get('pages.products.required_option_missing', {
329
+ option: option.name,
330
+ }));
331
+ }
332
+ }
333
+ });
334
+ this.validationErrors = errors;
335
+ return errors.length === 0;
336
+ }
337
+ async onSave(e) {
338
+ e.preventDefault();
339
+ const productId = this.product?.id;
340
+ if (!productId)
341
+ return;
342
+ const cacheKey = this.generateCacheKey(this.sectionId, this.productIndex, productId);
343
+ // Small delay to ensure component state is updated
344
+ await new Promise(resolve => setTimeout(resolve, 100));
345
+ // Validate options before saving
346
+ const isValid = await this.validateOptions();
347
+ if (!isValid) {
348
+ salla.notify.error(this.validationErrors.join(', '));
349
+ return;
350
+ }
351
+ this.isLoading = true;
352
+ try {
353
+ // please don't change this with this.host.querySelector it will return null
354
+ const optionsEl = document.querySelector(`salla-product-options[product-id="${productId}"]`);
355
+ let selectedOptions = await optionsEl?.getSelectedOptions();
356
+ // If component returns empty but we have internal state, use internal state
357
+ if ((!selectedOptions || selectedOptions.length === 0) &&
358
+ this.selectedOptions[cacheKey]?.length > 0) {
359
+ selectedOptions = this.selectedOptions[cacheKey];
360
+ }
361
+ if (!selectedOptions || selectedOptions.length === 0) {
362
+ this.isLoading = false;
363
+ return;
364
+ }
365
+ // Store the selected options for this product using cache key
366
+ this.selectedOptions = {
367
+ ...this.selectedOptions,
368
+ [cacheKey]: selectedOptions,
369
+ };
370
+ const form = this.host.closest('form');
371
+ if (!form) {
372
+ this.isLoading = false;
373
+ return;
374
+ }
375
+ // remove old inputs for this specific product in this specific section/index only
376
+ const productInputPattern = `bundle[${this.sectionId}][${this.productIndex}]`;
377
+ // Remove only hidden inputs and inputs with data-product-id, but preserve visible checkboxes
378
+ Array.from(form.querySelectorAll(`input[name^="${productInputPattern}"][type="hidden"]`)).forEach(el => el.remove());
379
+ // Also remove any inputs with data-product-id that match this specific pattern
380
+ Array.from(form.querySelectorAll(`[data-product-id="${productId}"][name^="${productInputPattern}"]`)).forEach(el => el.remove());
381
+ // Ensure the actual checkbox in the UI is checked to reflect the selection visually
382
+ const checkboxId = `bundle[${this.sectionId}][${this.productIndex}][id]`;
383
+ const checkbox = document.getElementById(checkboxId);
384
+ if (checkbox) {
385
+ checkbox.checked = true;
386
+ // Don't dispatch change event here to avoid double API calls
387
+ }
388
+ else {
389
+ // If checkbox doesn't exist, create a hidden input as fallback
390
+ const productSelectionInput = document.createElement('input');
391
+ productSelectionInput.type = 'hidden';
392
+ productSelectionInput.name = `bundle[${this.sectionId}][${this.productIndex}][id]`;
393
+ productSelectionInput.value = String(productId);
394
+ productSelectionInput.dataset.productId = String(productId);
395
+ form.appendChild(productSelectionInput);
396
+ }
397
+ // append new hidden inputs for options
398
+ selectedOptions.forEach((option) => {
399
+ // how to get option parent id?
400
+ const optionParentId = option.option_id;
401
+ const hidden = document.createElement('input');
402
+ hidden.type = 'hidden';
403
+ // Use productIndex for the form input name
404
+ hidden.name = this.generateFormInputName(this.sectionId, this.productIndex ?? 0, optionParentId);
405
+ hidden.value = String(option.id);
406
+ hidden.dataset.productId = String(productId);
407
+ form.appendChild(hidden);
408
+ });
409
+ // Trigger single form change event with all updates (product selection + options)
410
+ const changeEvent = new window.Event('change', { bubbles: true });
411
+ form.dispatchEvent(changeEvent);
412
+ // Emit custom event
413
+ this.optionsSaved.emit({
414
+ productId: Number(productId),
415
+ selectedOptions,
416
+ sectionId: this.sectionId,
417
+ productIndex: this.productIndex,
418
+ });
419
+ // Emit product selected event to check the card
420
+ if (this.sectionId) {
421
+ this.productSelected.emit({
422
+ productId: Number(productId),
423
+ sectionId: this.sectionId,
424
+ product: this.product,
425
+ fromModal: true,
426
+ });
427
+ }
428
+ // Show success message
429
+ salla.notify.success(salla.lang.get('pages.products.options_saved'));
430
+ this.hasUnsavedChanges = false;
431
+ this.validationErrors = [];
432
+ // close modal
433
+ this.modal.close();
434
+ }
435
+ catch (error) {
436
+ salla.notify.error(salla.lang.get('pages.products.options_save_error'));
437
+ }
438
+ finally {
439
+ this.isLoading = false;
440
+ }
441
+ }
442
+ // Method to get options with selected state preserved
443
+ getOptionsWithSelectedState() {
444
+ if (!this.product?.options)
445
+ return [];
446
+ const cacheKey = this.generateCacheKey(this.sectionId, this.productIndex, this.product.id);
447
+ const savedOptions = this.selectedOptions[cacheKey] || [];
448
+ return this.product.options.map(option => ({
449
+ ...option,
450
+ details: option.details.map(detail => {
451
+ const isSelected = savedOptions.some(saved => {
452
+ return saved.id === detail.id;
453
+ });
454
+ return {
455
+ ...detail,
456
+ is_selected: isSelected,
457
+ };
458
+ }),
459
+ }));
460
+ }
461
+ render() {
462
+ const productId = this.product?.id;
463
+ const optionsWithSelectedState = this.getOptionsWithSelectedState();
464
+ const cacheKey = this.generateCacheKey(this.sectionId, this.productIndex, productId);
465
+ const resetToken = this.optionsResetTokens[cacheKey] || 0;
466
+ const isDisabled = this.isLoading || optionsWithSelectedState.some(opt => opt.details.some(d => d.is_selected && d.is_out === true));
467
+ return (index.h(index.Host, { key: '28786c060499c9bfbacf025b75f21d0e8a2d6ab1' }, index.h("salla-modal", { key: '6322c0542ca2769f50ed6fc616c6d5c72d456c9c', isLoading: this.isLoading, ref: el => (this.modal = el), width: "md", centered: false, id: `s-multiple-bundle-product-options-modal-options-${productId}`, class: "s-multiple-bundle-product-options-modal-wrapper" }, index.h("div", { key: '812707c4108b5bdefa97e1ff7537998083e2403b', slot: "loading" }, index.h("salla-skeleton", { key: 'e82b875495873b66414ee4a75d845823373b4914', height: "100%", width: "100%" })), this.product?.images && this.product?.images.length > 0 && (index.h("salla-slider", { key: 'f1f3545637b182257f9107972a819ae9819de137', id: `details-slider-${this.product?.id}`, type: "thumbs", loop: false, "auto-height": true, "listen-to-thumbnails-option": true, showThumbsControls: false, controlsOuter: false, showControls: false, class: "s-multiple-bundle-product-options-modal-slider", verticalThumbs: true, thumbsConfig: {
468
+ centeredSlides: true,
469
+ centeredSlidesBounds: true,
470
+ slidesPerView: Math.min(5, Math.max(1, this.product?.images.length)),
471
+ watchOverflow: true,
472
+ watchSlidesProgress: true,
473
+ direction: 'vertical',
474
+ spaceBetween: 10,
475
+ } }, index.h("div", { key: '97b50195903a01376e057bc99ddb353fd3dfdb2b', slot: "items" }, this.product?.images &&
476
+ this.product?.images.map((image, index$1) => (index.h("div", { key: index$1, class: "swiper-slide" }, index.h("img", { src: image.url, alt: image.alt || `${this.product?.name} - Image ${index$1 + 1}`, loading: "lazy", onError: e => {
477
+ e.target.style.display = 'none';
478
+ } }))))), this.product?.images && this.product?.images.length > 1 && (index.h("div", { key: 'ff943c9c8f175ff1c0374a13153b33889c468dda', slot: "thumbs" }, this.product?.images &&
479
+ this.product?.images.map((image, index$1) => (index.h("div", { key: index$1, "data-caption": `${this.product?.name} - Image ${index$1 + 1}` }, index.h("img", { src: image.url, loading: "eager", class: "s-multiple-bundle-product-options-modal-slider-thumb", title: `${this.product?.name} - ${index$1 + 1}`, alt: image.alt || `${this.product?.name} - ${index$1 + 1}`, onError: e => {
480
+ e.target.style.display = 'none';
481
+ } })))))))), index.h("salla-product-options", { options: JSON.stringify(optionsWithSelectedState), key: `${cacheKey}-reset-${resetToken}`, "product-id": productId, "unique-key": `${cacheKey}-reset-${resetToken}` }), index.h("div", { key: '7555836d26018f6405bc54a1cd735b4030d4bdf1', slot: "footer" }, index.h("div", { key: 'a7ee5f19a4c11a1c61e4dc026fa8673e0ab74c3f', class: "s-multiple-bundle-product-options-modal-footer" }, index.h("salla-button", { key: '1da19964053766f3a1339ea0e77ab7aaa4d8a003', onClick: e => this.onSave(e), loading: this.isLoading, disabled: isDisabled }, this.isLoading
482
+ ? salla.lang.get('common.elements.saving')
483
+ : salla.lang.get('common.elements.save')))))));
484
+ }
485
+ get host() { return index.getElement(this); }
486
+ static get watchers() { return {
487
+ "product": ["handleProductChange"]
488
+ }; }
489
+ };
490
+ SallaMultipleBundleProductOptionsModal.style = sallaMultipleBundleProductOptionsModalCss;
491
+
492
+ const sallaMultipleBundleProductSliderCss = "";
493
+
494
+ const SallaMultipleBundleProductSlider = class {
495
+ constructor(hostRef) {
496
+ index.registerInstance(this, hostRef);
497
+ this.productSelected = index.createEvent(this, "productSelected");
498
+ this.productOptionsSelected = index.createEvent(this, "productOptionsSelected");
499
+ this.selectedProducts = {};
500
+ this.savedOptionsByInstance = {};
501
+ this.handleProductClick = (product, productIndex) => {
502
+ // Find the checkbox input for this product
503
+ const checkboxId = this.generateEventName(this.section.id, productIndex);
504
+ const checkbox = document.getElementById(checkboxId);
505
+ if (!checkbox)
506
+ return;
507
+ if (checkbox) {
508
+ const willBeChecked = !checkbox.checked;
509
+ if (!willBeChecked) {
510
+ this.dispatchClearOptionsEvent(product, productIndex);
511
+ this.clearSavedOptionsState(this.section.id, productIndex);
512
+ }
513
+ // Toggle the checkbox state
514
+ checkbox.checked = willBeChecked;
515
+ // Dispatch a change event to trigger form validation/submission
516
+ requestAnimationFrame(() => {
517
+ const changeEvent = new window.Event('change', { bubbles: true });
518
+ checkbox.dispatchEvent(changeEvent);
519
+ });
520
+ }
521
+ this.productSelected.emit({
522
+ product,
523
+ sectionId: this.section.id,
524
+ });
525
+ };
526
+ this.handleOptionsClick = (product) => {
527
+ this.productOptionsSelected.emit({
528
+ product,
529
+ sectionId: this.section.id,
530
+ });
531
+ };
532
+ }
533
+ getProductInstanceKey(sectionId, productIndex) {
534
+ return `${sectionId}::${productIndex}`;
535
+ }
536
+ dispatchClearOptionsEvent(product, productIndex) {
537
+ salla.event.dispatch('multiple-bundle-product-modal::clear-options', {
538
+ productId: product.id,
539
+ sectionId: this.section.id,
540
+ sectionIndex: this.sectionIndex,
541
+ productIndex,
542
+ });
543
+ }
544
+ handleOptionsSaved(event) {
545
+ const detail = event.detail;
546
+ if (!detail)
547
+ return;
548
+ const { sectionId, productIndex, selectedOptions } = detail;
549
+ if (sectionId == null || sectionId !== this.section?.id)
550
+ return;
551
+ if (productIndex == null || Number.isNaN(productIndex))
552
+ return;
553
+ const key = this.getProductInstanceKey(sectionId, productIndex);
554
+ const hasOptions = !!selectedOptions?.length;
555
+ if (hasOptions) {
556
+ this.savedOptionsByInstance = {
557
+ ...this.savedOptionsByInstance,
558
+ [key]: true,
559
+ };
560
+ }
561
+ else if (this.savedOptionsByInstance[key]) {
562
+ const updatedState = { ...this.savedOptionsByInstance };
563
+ delete updatedState[key];
564
+ this.savedOptionsByInstance = updatedState;
565
+ }
566
+ }
567
+ clearSavedOptionsState(sectionId, productIndex) {
568
+ const key = this.getProductInstanceKey(sectionId, productIndex);
569
+ if (!this.savedOptionsByInstance[key])
570
+ return;
571
+ const updatedState = { ...this.savedOptionsByInstance };
572
+ delete updatedState[key];
573
+ this.savedOptionsByInstance = updatedState;
574
+ }
575
+ generateEventName(sectionId, productIndex) {
576
+ return `bundle[${sectionId}][${productIndex}][id]`;
577
+ }
578
+ render() {
579
+ return (index.h(index.Host, { key: 'a1e7d56d8a50d1c31ba102d3246b0251516e0a73' }, index.h("salla-slider", { key: '8308576a46ec71f557a3d686d59cd0109d5bef0f', type: "carousel", controlsOuter: false, showControls: false, id: `accordion-multiple-bundle-product-${this.section.id}`, pagination: true, class: "s-multiple-bundle-product-wrapper-slider", sliderConfig: { spaceBetween: 0 } }, index.h("div", { key: '3ea742119ab77f129b8c60bbcc0f8c0f7bd3e97d', slot: "items" }, this?.section?.products?.map((product, productIndex) => {
580
+ const isChecked = this.selectedProducts[this.section.id]?.has(product.id) || false;
581
+ const hasSavedOptions = this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id, productIndex)];
582
+ const optionsButtonLabel = hasSavedOptions
583
+ ? salla.lang.getWithDefault('pages.products.edit_selected_options', 'تعديل الخيارات')
584
+ : salla.lang.get('pages.products.choose_from_options');
585
+ let optionsArrowIcon = salla.config.get('theme.is_rtl', true)
586
+ ? keyboard_arrow_right.ArrowLeftIcon
587
+ : keyboard_arrow_right.ArrowRightIcon;
588
+ return (index.h("div", { class: `s-multiple-bundle-product-slide-one-third ${product.quantity == 0
589
+ ? 's-multiple-bundle-product-slide-one-third-disabled'
590
+ : ''}`, key: product.id }, index.h("div", { class: "s-multiple-bundle-product-card" }, index.h("div", { class: "s-multiple-bundle-product-image-wrapper", onClick: () => this.handleProductClick(product, productIndex) }, index.h("input", { id: this.generateEventName(this.section.id, productIndex), type: "checkbox", class: "s-multiple-bundle-product-checkbox", checked: isChecked, name: this.generateEventName(this.section.id, productIndex), value: product.id }), index.h("img", { src: product.image.url || salla.url.cdn('images/s-empty.png'), loading: "lazy", alt: product.image.alt || product.name, class: "s-multiple-bundle-product-image" })), index.h("div", { class: "s-multiple-bundle-product-content-wrapper" }, index.h("div", { class: "s-multiple-bundle-product-content" }, index.h("div", { class: "s-multiple-bundle-product-details" }, index.h("div", { class: "s-multiple-bundle-product-title-wrapper" }, index.h("h2", { class: "s-multiple-bundle-product-title" }, index.h("a", { href: product?.url || '#', target: "_blank", rel: "noopener noreferrer" }, product.name))), index.h("div", { class: "s-multiple-bundle-product-price-wrapper" }, index.h("span", { class: "s-multiple-bundle-product-price" }, index.h("span", { innerHTML: salla.money(product.price) })), product.sale_price > 0 && (index.h("span", { class: "s-multiple-bundle-product-price-discount" }, index.h("span", { innerHTML: salla.money(product.regular_price) }))))), product.quantity_in_group > 0 && product.quantity !== 0 && (index.h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.pieces'), index.h("span", null, product.quantity_in_group))), product.quantity === 0 && (index.h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.quantity_in_group_finished')))), product.options?.length > 0 && (index.h("button", { class: "s-multiple-bundle-product-button", onClick: () => this.handleOptionsClick(product), type: "button" }, optionsButtonLabel, index.h("span", { class: "s-multiple-bundle-product-button-icon", innerHTML: optionsArrowIcon })))))));
591
+ })))));
592
+ }
593
+ get host() { return index.getElement(this); }
594
+ };
595
+ SallaMultipleBundleProductSlider.style = sallaMultipleBundleProductSliderCss;
596
+
597
+ exports.salla_multiple_bundle_product_options_modal = SallaMultipleBundleProductOptionsModal;
598
+ exports.salla_multiple_bundle_product_slider = SallaMultipleBundleProductSlider;
@@ -0,0 +1,69 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ 'use strict';
5
+
6
+ var index = require('./index-Ce40E8tZ.js');
7
+
8
+ const sallaMultipleBundleProductCss = ":host{display:block}";
9
+
10
+ const SallaMultipleBundleProduct = class {
11
+ constructor(hostRef) {
12
+ index.registerInstance(this, hostRef);
13
+ this.parsedSections = [];
14
+ }
15
+ parseProducts(newValue) {
16
+ let sections = [];
17
+ if (typeof newValue === 'string') {
18
+ try {
19
+ const parsed = JSON.parse(newValue);
20
+ sections = this.extractSections(parsed);
21
+ }
22
+ catch (e) {
23
+ console.error('Invalid JSON passed to bundleSections prop:', newValue);
24
+ sections = [];
25
+ }
26
+ }
27
+ else if (newValue) {
28
+ sections = this.extractSections(newValue);
29
+ }
30
+ this.parsedSections = sections;
31
+ }
32
+ extractSections(data) {
33
+ // Handle new nested structure: data.bundle.sections
34
+ if (data.bundle && data.bundle.sections && Array.isArray(data.bundle.sections)) {
35
+ return data.bundle.sections;
36
+ }
37
+ // Handle old flat structure: data is directly an array of sections
38
+ if (Array.isArray(data)) {
39
+ return data;
40
+ }
41
+ // Handle case where data.sections exists at root level
42
+ if (data.sections && Array.isArray(data.sections)) {
43
+ return data.sections;
44
+ }
45
+ console.warn('No valid sections found in data:', data);
46
+ return [];
47
+ }
48
+ isCartPage() {
49
+ return salla.url.is_page('cart');
50
+ }
51
+ renderCartPage() {
52
+ return index.h("salla-multiple-bundle-product-cart", { sections: this.parsedSections });
53
+ }
54
+ renderDetailsPage() {
55
+ return index.h("salla-multiple-bundle-product-details", { sections: this.parsedSections });
56
+ }
57
+ componentWillLoad() {
58
+ this.parseProducts(this.bundleSections);
59
+ }
60
+ render() {
61
+ return (index.h(index.Host, { key: '91666a9a9d0302d7f93f001b39d06160f2dc6960', class: "s-multiple-bundle-product-wrapper" }, this.isCartPage() ? this.renderCartPage() : this.renderDetailsPage()));
62
+ }
63
+ static get watchers() { return {
64
+ "bundleSections": ["parseProducts"]
65
+ }; }
66
+ };
67
+ SallaMultipleBundleProduct.style = sallaMultipleBundleProductCss;
68
+
69
+ exports.salla_multiple_bundle_product = SallaMultipleBundleProduct;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-B5soIVRX.js');
6
+ var index = require('./index-Ce40E8tZ.js');
7
7
 
8
8
  const sallaNotificationsCss = "";
9
9