@salla.sa/twilight-components 2.14.599 → 2.14.600

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 (379) hide show
  1. package/dist/cjs/{filepond-Dk1cJoJp.js → filepond-DVmQ7csb.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-Bg4PCTUm.js → filepond-plugin-file-poster-DMSpzTqe.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DmqmRxXK.js → filepond-plugin-file-validate-size-D_ptbEIk.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-BKd2QnuC.js → filepond-plugin-file-validate-type-0yFqmcfN.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BIPbEbnk.js → filepond-plugin-image-edit-E7sYYAWn.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-eQvkwjqa.js → filepond-plugin-image-exif-orientation-DbrEAQoa.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-Ba8K6ft0.js → filepond-plugin-image-preview-DO_tpcG1.js} +1 -1
  8. package/dist/cjs/{index-Bm1Ew-5K.js → index-Bw9ZFzBG.js} +2 -2
  9. package/dist/cjs/{intlTelInput-MWwwr9Td.js → intlTelInput-DxYQu3W_.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +4 -4
  12. package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
  13. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-alert_2.cjs.entry.js +2 -2
  16. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +50 -19
  19. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +22 -13
  20. package/dist/cjs/salla-badge.cjs.entry.js +2 -2
  21. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-form_9.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-contacts.cjs.entry.js +60 -29
  31. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-options-modal.cjs.entry.js +5 -5
  73. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-totals-card.cjs.entry.js +49 -7
  76. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-search.cjs.entry.js +12 -2
  93. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tab-content_3.cjs.entry.js +24 -8
  97. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +1 -1
  106. package/dist/cjs/ssr-helpers-BjD2_F8m.js +48 -0
  107. package/dist/cjs/twilight.cjs.js +2 -2
  108. package/dist/cjs/{vanilla-picker-BpuzEJnJ.js → vanilla-picker-CcRVM0uV.js} +1 -1
  109. package/dist/collection/collection-manifest.json +1 -1
  110. package/dist/collection/components/salla-accordion/salla-accordion-body.js +1 -1
  111. package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
  112. package/dist/collection/components/salla-accordion/salla-accordion.js +1 -1
  113. package/dist/collection/components/salla-alert/salla-alert.js +1 -1
  114. package/dist/collection/components/salla-apps-icons/salla-apps-icons.css +3 -0
  115. package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +108 -32
  116. package/dist/collection/components/salla-apps-icons/salla-apps-icons.types.js +1 -0
  117. package/dist/collection/components/salla-badge/salla-badge.js +1 -1
  118. package/dist/collection/components/salla-booking-field/salla-booking-field.js +21 -6
  119. package/dist/collection/components/salla-contacts/salla-contacts.js +114 -37
  120. package/dist/collection/components/salla-contacts/salla-contacts.types.js +1 -0
  121. package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
  122. package/dist/collection/components/salla-order-options-modal/salla-order-options-modal.js +4 -4
  123. package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +76 -7
  124. package/dist/collection/components/salla-search/salla-search.js +11 -1
  125. package/dist/collection/components/salla-tabs/salla-tab-content.js +9 -2
  126. package/dist/collection/components/salla-tabs/salla-tabs.js +36 -8
  127. package/dist/collection/utils/ssr-helpers.js +105 -0
  128. package/dist/components/index.js +2 -2
  129. package/dist/components/salla-accordion-body2.js +1 -1
  130. package/dist/components/salla-accordion-head2.js +2 -2
  131. package/dist/components/salla-accordion2.js +1 -1
  132. package/dist/components/salla-alert.js +1 -1
  133. package/dist/components/salla-apps-icons.js +53 -20
  134. package/dist/components/salla-badge2.js +1 -1
  135. package/dist/components/salla-booking-field2.js +12 -3
  136. package/dist/components/salla-contacts.js +62 -30
  137. package/dist/components/salla-order-options-modal2.js +4 -4
  138. package/dist/components/salla-order-totals-card.js +50 -6
  139. package/dist/components/salla-search.js +11 -1
  140. package/dist/components/salla-tab-content2.js +8 -1
  141. package/dist/components/salla-tabs2.js +17 -7
  142. package/dist/components/ssr-helpers.js +46 -0
  143. package/dist/docs.json +255 -34
  144. package/dist/esm/{filepond-3PnWp9w_.js → filepond-CMtCLsIc.js} +1 -1
  145. package/dist/esm/{filepond-plugin-file-poster-DmoyhYlz.js → filepond-plugin-file-poster-OjOFU-jw.js} +1 -1
  146. package/dist/esm/{filepond-plugin-file-validate-size-CFkn2RRt.js → filepond-plugin-file-validate-size-BFCz_KY1.js} +1 -1
  147. package/dist/esm/{filepond-plugin-file-validate-type-pyAPn10a.js → filepond-plugin-file-validate-type-BaPcxnrR.js} +1 -1
  148. package/dist/esm/{filepond-plugin-image-edit-B5Rfgqvi.js → filepond-plugin-image-edit-D_tfXMIg.js} +1 -1
  149. package/dist/esm/{filepond-plugin-image-exif-orientation-DK15iBED.js → filepond-plugin-image-exif-orientation-DS2k4xg9.js} +1 -1
  150. package/dist/esm/{filepond-plugin-image-preview-BIW0XW_M.js → filepond-plugin-image-preview-B6bJkNCH.js} +1 -1
  151. package/dist/esm/{index-CwwxD-7C.js → index-C670SYee.js} +2 -2
  152. package/dist/esm/{intlTelInput-DYJOvh3V.js → intlTelInput-BUOxAmWZ.js} +1 -1
  153. package/dist/esm/loader.js +3 -3
  154. package/dist/esm/salla-accordion-body_2.entry.js +4 -4
  155. package/dist/esm/salla-accordion_6.entry.js +2 -2
  156. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  157. package/dist/esm/salla-advertisement.entry.js +1 -1
  158. package/dist/esm/salla-alert_2.entry.js +2 -2
  159. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  160. package/dist/esm/salla-applied-filters.entry.js +1 -1
  161. package/dist/esm/salla-apps-icons.entry.js +50 -19
  162. package/dist/esm/salla-attachment-view_9.entry.js +22 -13
  163. package/dist/esm/salla-badge.entry.js +2 -2
  164. package/dist/esm/salla-basket-gap.entry.js +1 -1
  165. package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
  166. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  167. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  168. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  169. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  170. package/dist/esm/salla-comment-factors.entry.js +1 -1
  171. package/dist/esm/salla-comment-form_9.entry.js +1 -1
  172. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  173. package/dist/esm/salla-contacts.entry.js +60 -29
  174. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  175. package/dist/esm/salla-count-down.entry.js +1 -1
  176. package/dist/esm/salla-custom-fields.entry.js +1 -1
  177. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  178. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  179. package/dist/esm/salla-filters-widget.entry.js +1 -1
  180. package/dist/esm/salla-filters.entry.js +1 -1
  181. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  182. package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
  183. package/dist/esm/salla-gifting.entry.js +1 -1
  184. package/dist/esm/salla-hook.entry.js +1 -1
  185. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  186. package/dist/esm/salla-installment.entry.js +1 -1
  187. package/dist/esm/salla-list-tile.entry.js +1 -1
  188. package/dist/esm/salla-localization-modal.entry.js +1 -1
  189. package/dist/esm/salla-login-modal.entry.js +1 -1
  190. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  191. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  192. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  193. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  194. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  195. package/dist/esm/salla-loyalty.entry.js +1 -1
  196. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  197. package/dist/esm/salla-map_3.entry.js +1 -1
  198. package/dist/esm/salla-menu.entry.js +1 -1
  199. package/dist/esm/salla-metadata.entry.js +1 -1
  200. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  201. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  202. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  203. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  204. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  205. package/dist/esm/salla-offer-modal.entry.js +1 -1
  206. package/dist/esm/salla-offer.entry.js +1 -1
  207. package/dist/esm/salla-order-branch.entry.js +1 -1
  208. package/dist/esm/salla-order-cancel.entry.js +1 -1
  209. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  210. package/dist/esm/salla-order-details-options.entry.js +1 -1
  211. package/dist/esm/salla-order-details.entry.js +1 -1
  212. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  213. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  214. package/dist/esm/salla-order-edit.entry.js +1 -1
  215. package/dist/esm/salla-order-options-modal.entry.js +5 -5
  216. package/dist/esm/salla-order-shipments.entry.js +1 -1
  217. package/dist/esm/salla-order-summary.entry.js +1 -1
  218. package/dist/esm/salla-order-totals-card.entry.js +49 -7
  219. package/dist/esm/salla-orders.entry.js +1 -1
  220. package/dist/esm/salla-payments.entry.js +1 -1
  221. package/dist/esm/salla-placeholder.entry.js +1 -1
  222. package/dist/esm/salla-price-range.entry.js +1 -1
  223. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  224. package/dist/esm/salla-product-card.entry.js +1 -1
  225. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  226. package/dist/esm/salla-products-list.entry.js +1 -1
  227. package/dist/esm/salla-products-slider.entry.js +1 -1
  228. package/dist/esm/salla-quick-order.entry.js +1 -1
  229. package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
  230. package/dist/esm/salla-rating-modal.entry.js +1 -1
  231. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  232. package/dist/esm/salla-review-order-item.entry.js +1 -1
  233. package/dist/esm/salla-scopes.entry.js +1 -1
  234. package/dist/esm/salla-search-product-card.entry.js +1 -1
  235. package/dist/esm/salla-search.entry.js +12 -2
  236. package/dist/esm/salla-skeleton.entry.js +1 -1
  237. package/dist/esm/salla-social-share.entry.js +1 -1
  238. package/dist/esm/salla-social.entry.js +1 -1
  239. package/dist/esm/salla-tab-content_3.entry.js +24 -8
  240. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  241. package/dist/esm/salla-trust-badges.entry.js +1 -1
  242. package/dist/esm/salla-user-menu.entry.js +1 -1
  243. package/dist/esm/salla-user-profile.entry.js +1 -1
  244. package/dist/esm/salla-user-settings.entry.js +1 -1
  245. package/dist/esm/salla-verify.entry.js +1 -1
  246. package/dist/esm/salla-wallet.entry.js +1 -1
  247. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  248. package/dist/esm/salla-wishlist-summary.entry.js +1 -1
  249. package/dist/esm/ssr-helpers-BJN-DTdN.js +46 -0
  250. package/dist/esm/twilight.js +3 -3
  251. package/dist/esm/{vanilla-picker-BzVn0xEV.js → vanilla-picker-vQxevRSA.js} +1 -1
  252. package/dist/twilight/{p-114e4228.entry.js → p-0116fc35.entry.js} +1 -1
  253. package/dist/twilight/{p-db1e0bc6.entry.js → p-02946cf5.entry.js} +1 -1
  254. package/dist/twilight/{p-0ba03206.entry.js → p-07453f6c.entry.js} +1 -1
  255. package/dist/twilight/{p-2b5242cb.entry.js → p-0c6290e0.entry.js} +1 -1
  256. package/dist/twilight/{p-6d61d93c.entry.js → p-0cb5d9c6.entry.js} +1 -1
  257. package/dist/twilight/{p-1b25ea2a.entry.js → p-0f68e660.entry.js} +1 -1
  258. package/dist/twilight/{p-c98d1097.entry.js → p-132d9742.entry.js} +1 -1
  259. package/dist/twilight/p-157873ee.entry.js +4 -0
  260. package/dist/twilight/{p-dda47e56.entry.js → p-161fce7a.entry.js} +1 -1
  261. package/dist/twilight/{p-3243ab6e.entry.js → p-167a9c58.entry.js} +1 -1
  262. package/dist/twilight/{p-76ca3445.entry.js → p-19b7fccb.entry.js} +1 -1
  263. package/dist/twilight/{p-7148dbad.entry.js → p-19d9b193.entry.js} +1 -1
  264. package/dist/twilight/{p-065f2937.entry.js → p-1c75de1e.entry.js} +1 -1
  265. package/dist/twilight/p-1c7999c9.entry.js +4 -0
  266. package/dist/twilight/{p-fe7751a8.entry.js → p-1ea04494.entry.js} +1 -1
  267. package/dist/twilight/{p-62dc337d.entry.js → p-1f3d5e3e.entry.js} +1 -1
  268. package/dist/twilight/{p-20f98a45.entry.js → p-22fc1505.entry.js} +1 -1
  269. package/dist/twilight/{p-07817ae8.entry.js → p-27d94a42.entry.js} +1 -1
  270. package/dist/twilight/{p-49bba37d.entry.js → p-2a865b0b.entry.js} +1 -1
  271. package/dist/twilight/{p-925ba8ce.entry.js → p-2bb95112.entry.js} +1 -1
  272. package/dist/twilight/{p-d6886b07.entry.js → p-2d8d9829.entry.js} +1 -1
  273. package/dist/twilight/{p-c282869e.entry.js → p-2df4e63a.entry.js} +1 -1
  274. package/dist/twilight/{p-b2ff66ed.entry.js → p-316be8a7.entry.js} +1 -1
  275. package/dist/twilight/{p-f310c72e.entry.js → p-321022f5.entry.js} +1 -1
  276. package/dist/twilight/{p-93d284c4.entry.js → p-34ab84e2.entry.js} +1 -1
  277. package/dist/twilight/{p-c892e962.entry.js → p-36ddb8db.entry.js} +1 -1
  278. package/dist/twilight/{p-25fb1508.entry.js → p-3b45e21a.entry.js} +1 -1
  279. package/dist/twilight/{p-f5693509.entry.js → p-3eface57.entry.js} +1 -1
  280. package/dist/twilight/{p-1fd1c0a3.entry.js → p-46334bbe.entry.js} +1 -1
  281. package/dist/twilight/{p-18e75544.entry.js → p-4678b6d7.entry.js} +1 -1
  282. package/dist/twilight/{p-62c985bc.entry.js → p-4ea3a8a1.entry.js} +1 -1
  283. package/dist/twilight/{p-a6594c68.entry.js → p-56d064c0.entry.js} +1 -1
  284. package/dist/twilight/{p-f51e9549.entry.js → p-57768c0e.entry.js} +1 -1
  285. package/dist/twilight/{p-651db82c.entry.js → p-57ddfcfe.entry.js} +1 -1
  286. package/dist/twilight/{p-6e7433f2.entry.js → p-60e920c6.entry.js} +1 -1
  287. package/dist/twilight/{p-bc5b70e9.entry.js → p-62690afe.entry.js} +1 -1
  288. package/dist/twilight/{p-8d99e9d1.entry.js → p-6339c31f.entry.js} +1 -1
  289. package/dist/twilight/{p-62373e96.entry.js → p-660271f5.entry.js} +1 -1
  290. package/dist/twilight/{p-14b1b664.entry.js → p-6b28397a.entry.js} +1 -1
  291. package/dist/twilight/{p-067ad44c.entry.js → p-6bacaa30.entry.js} +1 -1
  292. package/dist/twilight/{p-0b0c9ecb.entry.js → p-6cfb6628.entry.js} +1 -1
  293. package/dist/twilight/{p-56c77026.entry.js → p-6cffd732.entry.js} +1 -1
  294. package/dist/twilight/{p-b7dfb1f1.entry.js → p-6eb365f3.entry.js} +1 -1
  295. package/dist/twilight/{p-0253bf71.entry.js → p-73125aab.entry.js} +1 -1
  296. package/dist/twilight/{p-f5026adf.entry.js → p-73189ed2.entry.js} +1 -1
  297. package/dist/twilight/{p-8aa29666.entry.js → p-744c8337.entry.js} +1 -1
  298. package/dist/twilight/{p-2db00d46.entry.js → p-82430d31.entry.js} +1 -1
  299. package/dist/twilight/{p-d8cf239a.entry.js → p-8359286c.entry.js} +1 -1
  300. package/dist/twilight/{p-4ca3b245.entry.js → p-84ed92e9.entry.js} +1 -1
  301. package/dist/twilight/p-84ee1884.entry.js +4 -0
  302. package/dist/twilight/{p-bcbb4a03.entry.js → p-87feddeb.entry.js} +1 -1
  303. package/dist/twilight/{p-afd47a18.entry.js → p-8d119291.entry.js} +1 -1
  304. package/dist/twilight/{p-96154a67.entry.js → p-8f1789f7.entry.js} +1 -1
  305. package/dist/twilight/{p-d01c4ba8.entry.js → p-90765c65.entry.js} +1 -1
  306. package/dist/twilight/{p-46c8b068.entry.js → p-94f18d97.entry.js} +1 -1
  307. package/dist/twilight/p-9a7da6d0.entry.js +4 -0
  308. package/dist/twilight/{p-84912a5a.entry.js → p-9ab10a2f.entry.js} +1 -1
  309. package/dist/twilight/{p-c84e619a.entry.js → p-9ace9fc5.entry.js} +1 -1
  310. package/dist/twilight/{p-79ce9e95.entry.js → p-9b9c2adf.entry.js} +1 -1
  311. package/dist/twilight/p-BJN-DTdN.js +4 -0
  312. package/dist/twilight/{p-CwwxD-7C.js → p-C670SYee.js} +1 -1
  313. package/dist/twilight/{p-CntnRJCa.js → p-CcijNXaY.js} +1 -1
  314. package/dist/twilight/{p-CYeysHdt.js → p-D-pGRpnm.js} +1 -1
  315. package/dist/twilight/{p-DzBc32wK.js → p-D33qIToB.js} +1 -1
  316. package/dist/twilight/{p-B8yyit_i.js → p-DEtbzT0x.js} +1 -1
  317. package/dist/twilight/{p-CaabLwI1.js → p-DIJHCILO.js} +1 -1
  318. package/dist/twilight/{p-Bb9AkvT4.js → p-DOJsGUE-.js} +1 -1
  319. package/dist/twilight/{p-DHXSZjVo.js → p-DYkb22mH.js} +1 -1
  320. package/dist/twilight/{p-FcjN5vEx.js → p-Kqe2HSSB.js} +1 -1
  321. package/dist/twilight/{p-e1fb95cb.entry.js → p-af525459.entry.js} +1 -1
  322. package/dist/twilight/{p-f38d6c1b.entry.js → p-afc17688.entry.js} +1 -1
  323. package/dist/twilight/{p-8e91da09.entry.js → p-b124899c.entry.js} +1 -1
  324. package/dist/twilight/{p-dc090987.entry.js → p-b13efdf9.entry.js} +1 -1
  325. package/dist/twilight/{p-ac8a7743.entry.js → p-b2da9ea7.entry.js} +1 -1
  326. package/dist/twilight/{p-0889368b.entry.js → p-b3f0b7e3.entry.js} +1 -1
  327. package/dist/twilight/{p-659e00b7.entry.js → p-b40466ae.entry.js} +1 -1
  328. package/dist/twilight/p-b59eab4f.entry.js +4 -0
  329. package/dist/twilight/{p-0bff8609.entry.js → p-b6674eab.entry.js} +1 -1
  330. package/dist/twilight/{p-261aff22.entry.js → p-b7f5a180.entry.js} +1 -1
  331. package/dist/twilight/p-bf95f806.entry.js +4 -0
  332. package/dist/twilight/{p-b7c815f7.entry.js → p-c6f677aa.entry.js} +1 -1
  333. package/dist/twilight/{p-4ebee06a.entry.js → p-c7728312.entry.js} +1 -1
  334. package/dist/twilight/{p-aaac2388.entry.js → p-c840c67c.entry.js} +1 -1
  335. package/dist/twilight/{p-509b04c7.entry.js → p-cba57487.entry.js} +1 -1
  336. package/dist/twilight/{p-ee2a5db7.entry.js → p-ccd75cf6.entry.js} +1 -1
  337. package/dist/twilight/{p-7f653481.entry.js → p-ce8bdea8.entry.js} +1 -1
  338. package/dist/twilight/{p-e248f0d0.entry.js → p-d2b41e2d.entry.js} +1 -1
  339. package/dist/twilight/{p-c4f92bae.entry.js → p-d897273e.entry.js} +1 -1
  340. package/dist/twilight/{p-83e1c586.entry.js → p-d923ecda.entry.js} +1 -1
  341. package/dist/twilight/{p-f1d5ebf4.entry.js → p-da9b84ee.entry.js} +1 -1
  342. package/dist/twilight/p-de0ce00a.entry.js +4 -0
  343. package/dist/twilight/{p-cce07c4c.entry.js → p-dfcb0978.entry.js} +1 -1
  344. package/dist/twilight/{p-6fa1498b.entry.js → p-dff87ddc.entry.js} +1 -1
  345. package/dist/twilight/{p-55399fed.entry.js → p-e1b853b2.entry.js} +1 -1
  346. package/dist/twilight/{p-1c191c15.entry.js → p-e4ba8208.entry.js} +1 -1
  347. package/dist/twilight/{p-f4d52f9b.entry.js → p-e506fbee.entry.js} +1 -1
  348. package/dist/twilight/{p-f580d024.entry.js → p-e80bc0ce.entry.js} +1 -1
  349. package/dist/twilight/{p-10418cc0.entry.js → p-e8f7ed7b.entry.js} +1 -1
  350. package/dist/twilight/{p-6d47b269.entry.js → p-ea4e6f55.entry.js} +1 -1
  351. package/dist/twilight/{p-6b2f6957.entry.js → p-ea82cbb3.entry.js} +1 -1
  352. package/dist/twilight/{p-2213f6eb.entry.js → p-ef9567bd.entry.js} +1 -1
  353. package/dist/twilight/{p-e4ed760b.entry.js → p-f106d1e8.entry.js} +1 -1
  354. package/dist/twilight/{p-c7a491ef.entry.js → p-f37cc89b.entry.js} +1 -1
  355. package/dist/twilight/p-f52c49c8.entry.js +4 -0
  356. package/dist/twilight/{p-89bba634.entry.js → p-f5f448b7.entry.js} +1 -1
  357. package/dist/twilight/{p-DFj0n9Nh.js → p-r8T0WY8a.js} +1 -1
  358. package/dist/twilight/twilight.esm.js +1 -1
  359. package/dist/types/components/salla-apps-icons/salla-apps-icons.d.ts +26 -13
  360. package/dist/types/components/salla-apps-icons/salla-apps-icons.types.d.ts +4 -0
  361. package/dist/types/components/salla-booking-field/salla-booking-field.d.ts +5 -1
  362. package/dist/types/components/salla-contacts/salla-contacts.d.ts +26 -14
  363. package/dist/types/components/salla-contacts/salla-contacts.types.d.ts +7 -0
  364. package/dist/types/components/salla-order-totals-card/interfaces.d.ts +27 -0
  365. package/dist/types/components/salla-order-totals-card/salla-order-totals-card.d.ts +12 -4
  366. package/dist/types/components/salla-search/salla-search.d.ts +3 -1
  367. package/dist/types/components/salla-tabs/salla-tab-content.d.ts +3 -2
  368. package/dist/types/components/salla-tabs/salla-tabs.d.ts +8 -3
  369. package/dist/types/components.d.ts +90 -22
  370. package/dist/types/utils/ssr-helpers.d.ts +73 -0
  371. package/package.json +5 -5
  372. package/dist/twilight/p-1f561241.entry.js +0 -4
  373. package/dist/twilight/p-27df0290.entry.js +0 -4
  374. package/dist/twilight/p-2f04343f.entry.js +0 -4
  375. package/dist/twilight/p-3de0b3ae.entry.js +0 -4
  376. package/dist/twilight/p-89fddf1e.entry.js +0 -4
  377. package/dist/twilight/p-a743a10a.entry.js +0 -4
  378. package/dist/twilight/p-f345a77d.entry.js +0 -4
  379. package/dist/twilight/p-f8b428cb.entry.js +0 -4
@@ -11,7 +11,7 @@ const SallaAccordionBody = /*@__PURE__*/ proxyCustomElement(class SallaAccordion
11
11
  this.__registerHost();
12
12
  }
13
13
  render() {
14
- return (h(Host, { key: 'cc83d228977d0e4049466fb8aa38b9709fbcf9e5', class: "s-accordion-body-wrapper" }, h("slot", { key: 'c8ca6d7d1512f8e32bbb7ef0785949d655ff3619' })));
14
+ return (h(Host, { key: 'e0752ba7819b03c9183d457c52e31bb65844eaf8', class: "s-accordion-body-wrapper" }, h("slot", { key: '668d1bd4985dd44d07eaf850dc9ad56683be167f' })));
15
15
  }
16
16
  static get style() { return sallaAccordionBodyCss; }
17
17
  }, [4, "salla-accordion-body"]);
@@ -34,13 +34,13 @@ const SallaAccordionHead = /*@__PURE__*/ proxyCustomElement(class SallaAccordion
34
34
  this.emitCollapsePanel();
35
35
  }
36
36
  render() {
37
- return (h(Host, { key: '066294cd654d22b5cbe483dc34932b8132dda4c4', "data-collapsed": this.collapsed.toString(), onClick: () => this.toggleCollapse(), class: "s-accordion-head-wrapper" }, h("div", { key: 'f235f06aa9bdb59d500148acf4477445bf2f1673', class: "s-accordion-head-wrapper-start" }, h("slot", { key: '25797156b79f88ae61f53397b71b35a79ca62908', name: "title" }), h("slot", { key: '76a66a77b082b5fc18c3ac844a294e2fde113151', name: "progress" }), h("slot", { key: 'd20c4aacfe72c0f15dd8034c43d2bb4e8e0921df', name: "html" })), (this.collapsible || this.host.querySelector('[slot="note"]')) && (h("div", { key: '1a6ae8bebe03ad6c02d69a3c3b3dab425dbec0ea', class: "s-accordion-head-wrapper-end" }, h("slot", { key: 'db284dd1fb40cd1520c225e0c7416b2ea71b8c33', name: "note" }), this.collapsible && (h("button", { key: '378c70a472ed11df058aa32e42ab94de68f214b9', type: 'button', class: {
37
+ return (h(Host, { key: '71394d6d0786f39e70b1ef33ad86d4e0e0c38666', "data-collapsed": this.collapsed.toString(), onClick: () => this.toggleCollapse(), class: "s-accordion-head-wrapper" }, h("div", { key: '95ccb46518936ce2290534268060dff5458752c6', class: "s-accordion-head-wrapper-start" }, h("slot", { key: '37efcfadaacb3acff86501d8c97b954f0c95f6bc', name: "title" }), h("slot", { key: '5f02b2a9692e4714780a337fa04b5516e0a4e9c8', name: "progress" }), h("slot", { key: '57edacda97012754df3709e37bb8259386c51c0a', name: "html" })), (this.collapsible || this.host.querySelector('[slot="note"]')) && (h("div", { key: '8d56232063aa29fcad4593217778d05c989f7cc5', class: "s-accordion-head-wrapper-end" }, h("slot", { key: '226aa26ad7263db0ca130e01580c80d5862add41', name: "note" }), this.collapsible && (h("button", { key: 'd69093c8823575dc7bc1e17fed364121b5e9db90', type: 'button', class: {
38
38
  's-accordion-head-wrapper-toggle': true,
39
39
  active: !this.collapsed,
40
40
  }, onClick: e => {
41
41
  e.stopPropagation();
42
42
  this.toggleCollapse();
43
- } }, h("span", { key: '1b4a583b66ed1f332d01ebd15c0c77a231e4e197', class: "s-accordion-head-wrapper-toggle-icon", innerHTML: this.collapsed ? Add : Minus })))))));
43
+ } }, h("span", { key: '36a0c5e1996f797e61519844f1be808b6119918c', class: "s-accordion-head-wrapper-toggle-icon", innerHTML: this.collapsed ? Add : Minus })))))));
44
44
  }
45
45
  get host() { return this; }
46
46
  static get style() { return sallaAccordionHeadCss; }
@@ -42,7 +42,7 @@ const SallaAccordion = /*@__PURE__*/ proxyCustomElement(class SallaAccordion ext
42
42
  }
43
43
  }
44
44
  render() {
45
- return (h(Host, { key: '06f5ef106dbc1fd779a757918cb4b424ac1adff6', class: `s-accordion-wrapper ${this.dir} ${this.bordered ? 's-accordion-wrapper-bordered' : ''} ${this.size ? `size-${this.size}` : ''}`, "data-collapsed": this.collapsed.toString() }, h("slot", { key: '3f51bced9c33774081f603b3dbf9a3dd153f2d47' })));
45
+ return (h(Host, { key: 'f00e8204cd26d8f5f754fccea219bd7a81a67fbe', class: `s-accordion-wrapper ${this.dir} ${this.bordered ? 's-accordion-wrapper-bordered' : ''} ${this.size ? `size-${this.size}` : ''}`, "data-collapsed": this.collapsed.toString() }, h("slot", { key: 'bcb1e384cec9b5faf3fd27544485542b3e8ef2c5' })));
46
46
  }
47
47
  get host() { return this; }
48
48
  static get style() { return sallaAccordionCss; }
@@ -33,7 +33,7 @@ const SallaAlert$1 = /*@__PURE__*/ proxyCustomElement(class SallaAlert extends H
33
33
  }
34
34
  }
35
35
  render() {
36
- return (h(Host, { key: 'c1a1e9575ed9aab90960ad3a54ada18d8e3ee240', class: `s-alert-wrapper s-alert-${this.variant}` }, h("span", { key: '7fb08789ad8355cc4bd441a5869e95d2337685a5', class: "s-alert-icon" }, this.renderIcon()), h("span", { key: 'ed3c4fcb5450f21caedeeca28a9a177b151333ec', class: "s-alert-text" }, this.message, h("slot", { key: '6818451171f85fd6ad63f07c69871082d3fcba4e' }))));
36
+ return (h(Host, { key: 'c530a6bfc1e9927e30d1bed3c28ed16282155d1c', class: `s-alert-wrapper s-alert-${this.variant}` }, h("span", { key: '42daa9c657b992f9594a71460050dbb0e59314d2', class: "s-alert-icon" }, this.renderIcon()), h("span", { key: '1c157391e9091d858f3478cc542e3fa0cf895938', class: "s-alert-text" }, this.message, h("slot", { key: '20f5f31390e74bbeea9ab57103f3a61a1bc9ad5e' }))));
37
37
  }
38
38
  static get style() { return sallaAlertCss; }
39
39
  }, [4, "salla-alert", {
@@ -2,53 +2,86 @@
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
4
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
5
+ import { i as isSallaSdkAvailable } from './ssr-helpers.js';
5
6
 
6
- const sallaAppsIconsCss = "/*!twlt*/:host{display:block}.s-apps-icons-list{display:flex;gap:1rem}.s-apps-icons-list.vertical{flex-direction:column}.s-apps-icons-item{line-height:1}.s-apps-icons-item:hover{color:var(--color-primary)}";
7
+ const sallaAppsIconsCss = "/*!twlt*/:host{display:block}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-apps-icons-list{display:flex;gap:1rem}.s-apps-icons-list.vertical{flex-direction:column}.s-apps-icons-item{line-height:1}.s-apps-icons-item:hover{color:var(--color-primary)}";
7
8
 
8
9
  const SallaAppsIcons$1 = /*@__PURE__*/ proxyCustomElement(class SallaAppsIcons extends HTMLElement {
9
10
  constructor() {
10
11
  super();
11
12
  this.__registerHost();
12
- this.apps = salla.config.get('store.apps');
13
- this.appSlot = this.host.querySelector('[slot="app"]')?.innerHTML || `<img alt="{name}" src="{icon}" width="135" height="40" decoding="async" loading="lazy" />`;
14
- salla.onReady(() => {
15
- this.apps = salla.config.get('store.apps');
16
- });
13
+ /**
14
+ * Flag to hide the title.
15
+ */
16
+ this.hideTitle = false;
17
+ /**
18
+ * Display icons vertically instead of horizontally.
19
+ */
20
+ this.vertical = false;
21
+ this.sdkApps = null;
22
+ }
23
+ getDefaultSlot() {
24
+ return `<img alt="{name}" src="{icon}" width="135" height="40" decoding="async" loading="lazy" />`;
17
25
  }
18
26
  connectedCallback() {
19
- this.langUnsubscribe = salla.lang.subscribe(() => {
20
- this.appsTitle = salla.lang.get('blocks.footer.download_apps');
27
+ if (isSallaSdkAvailable()) {
28
+ this.langUnsubscribe = salla.lang.subscribe(() => {
29
+ if (!this.appsTitle || this.appsTitle === this.langTitle) {
30
+ this.appsTitle = this.langTitle = salla.lang.get('blocks.footer.download_apps');
31
+ }
32
+ });
33
+ }
34
+ // capture once: componentDidRender removes the slot element, so a reconnect could no longer read it
35
+ if (!this.appSlot) {
36
+ const slotElement = this.slotTemplate ? null : this.host.querySelector('[slot="app"]');
37
+ this.appSlot = slotElement ? slotElement.innerHTML : (this.slotTemplate || this.getDefaultSlot());
38
+ }
39
+ if (!isSallaSdkAvailable())
40
+ return;
41
+ // load the store's apps even when `apps` is passed, so clearing the prop falls back to them
42
+ salla.onReady(() => {
43
+ this.sdkApps = salla.config.get('store.apps');
21
44
  });
22
45
  }
23
46
  disconnectedCallback() {
24
47
  this.langUnsubscribe?.();
25
48
  }
26
49
  getAppsArray() {
27
- return Object.entries(this.apps)
28
- .map(([name, value]) => ({ name, value }));
50
+ const apps = this.apps || this.sdkApps;
51
+ if (!apps) {
52
+ return [];
53
+ }
54
+ return Object.entries(apps)
55
+ .filter(([, value]) => value && typeof value === 'string')
56
+ .map(([name, value]) => ({ name, value: value }));
29
57
  }
30
- componentWillLoad() {
31
- return new Promise(resolve => salla.onReady(resolve));
58
+ getCdnUrl(iconName) {
59
+ if (isSallaSdkAvailable()) {
60
+ return salla.url.cdn(`images/${iconName}.png`);
61
+ }
62
+ return `https://cdn.salla.net/images/${iconName}.png`;
63
+ }
64
+ componentDidRender() {
65
+ this.host.querySelector('[slot="app"]')?.remove();
32
66
  }
33
67
  render() {
34
68
  const appsArray = this.getAppsArray();
35
- if (Array.isArray(appsArray) && !appsArray.length) {
69
+ if (appsArray.length === 0) {
36
70
  return;
37
71
  }
38
- return (h(Host, { class: "s-apps-icons" }, !this.hideTitle && h("h3", null, this.appsTitle), h("div", { class: { "s-apps-icons-list": true, "vertical": this.vertical } }, appsArray.map((app, index) => (h("a", { key: index, href: app.value, rel: "noreferrer", target: "_blank", class: "s-apps-icons-item", id: "app-slot", innerHTML: this.appSlot
39
- .replace(/\{icon\}/g, salla.url.cdn(`images/${app.name}.png`))
72
+ return (h(Host, { class: "s-apps-icons" }, !this.hideTitle && this.appsTitle && h("h3", null, this.appsTitle), h("div", { class: { "s-apps-icons-list": true, "vertical": this.vertical } }, appsArray.map((app) => (h("a", { key: app.name, href: app.value, rel: "noreferrer", target: "_blank", class: "s-apps-icons-item", innerHTML: this.appSlot
73
+ .replace(/\{icon\}/g, this.getCdnUrl(app.name))
40
74
  .replace(/\{name\}/g, app.name) }))))));
41
75
  }
42
- componentDidRender() {
43
- this.host.querySelector('[slot="app"]')?.remove();
44
- }
45
76
  get host() { return this; }
46
77
  static get style() { return sallaAppsIconsCss; }
47
78
  }, [0, "salla-apps-icons", {
79
+ "apps": [16],
80
+ "appsTitle": [1025, "apps-title"],
48
81
  "hideTitle": [4, "hide-title"],
49
- "appsTitle": [1, "apps-title"],
50
82
  "vertical": [4],
51
- "apps": [32]
83
+ "slotTemplate": [1, "slot-template"],
84
+ "sdkApps": [32]
52
85
  }]);
53
86
  function defineCustomElement$1() {
54
87
  if (typeof customElements === "undefined") {
@@ -86,7 +86,7 @@ const SallaBadge = /*@__PURE__*/ proxyCustomElement(class SallaBadge extends HTM
86
86
  this.bg = 'light';
87
87
  }
88
88
  render() {
89
- return (h("div", { key: '7c7196d49621a58192820725ab40d906344983d1', class: badge({ size: this.size, bg: this.bg, color: this.color }) }, h("slot", { key: '7a39f5d916e80809f795b5cc880f1d31238fa7c5' })));
89
+ return (h("div", { key: '7a78bf8120879a06ce40d6e63d7fcd8444fff727', class: badge({ size: this.size, bg: this.bg, color: this.color }) }, h("slot", { key: '1ea89bc586b06a0e498d972d5efc5eaaffaf5a63' })));
90
90
  }
91
91
  static get style() { return sallaBadgeCss; }
92
92
  }, [4, "salla-badge", {
@@ -40,7 +40,6 @@ const SallaBookingField = /*@__PURE__*/ proxyCustomElement(class SallaBookingFie
40
40
  Salla.event.on('booking::open', (data) => this.handleBookingOpen(data));
41
41
  }
42
42
  connectedCallback() {
43
- // Load translations
44
43
  this.langUnsubscribe = salla.lang.subscribe(() => this.setTranslations());
45
44
  }
46
45
  disconnectedCallback() {
@@ -90,6 +89,11 @@ const SallaBookingField = /*@__PURE__*/ proxyCustomElement(class SallaBookingFie
90
89
  handleBookingOpen(data) {
91
90
  if (data.id !== this.productId)
92
91
  return;
92
+ // Opt-in native override: inside the SPA webview the bridge forwards this same event to native
93
+ // as `mobile::booking.open` { url, id }, and the native shell owns the booking screen — skip the
94
+ // web iframe modal so both don't show. On web / apps without the flag, the modal opens as usual.
95
+ if (salla.mobile?.isSpaWebview?.())
96
+ return;
93
97
  this.bookingUrl = salla.url.addParamToUrl('product_id', data.id, data.url);
94
98
  this.iframeReady = true;
95
99
  setTimeout(() => {
@@ -119,7 +123,12 @@ const SallaBookingField = /*@__PURE__*/ proxyCustomElement(class SallaBookingFie
119
123
  window.addEventListener('booking::open-after-reload', (event) => this.openBookingModal(event, true));
120
124
  this.emitAfterReloadEvent();
121
125
  window.addEventListener('message', this.handleMessageEvent.bind(this));
122
- this.reservationsInput.addEventListener('invalid', e => this.invalidInput.emit(e));
126
+ this.reservationsInput.addEventListener('invalid', e => {
127
+ this.invalidInput.emit({
128
+ target: e.target,
129
+ validity: e.target.validity
130
+ });
131
+ });
123
132
  this.reservationsInput.addEventListener('input', () => {
124
133
  this.reservationsInput.setCustomValidity('');
125
134
  this.reservationsInput.reportValidity();
@@ -175,7 +184,7 @@ const SallaBookingField = /*@__PURE__*/ proxyCustomElement(class SallaBookingFie
175
184
  return (h("span", { class: "s-booking-field-reservations-time" }, h("i", { class: "s-booking-field-reservations-icon", innerHTML: TimeIcon }), h("span", null, reservation.from_timestamp, " - ", reservation.to_timestamp)));
176
185
  }
177
186
  render() {
178
- return (h(Host, { key: '58a42c3f74c835039e3eeab63b3fdb8b1ab3f3d7' }, h("div", { key: '3e700a1f5de967167a1a5014ee6a39ae99ce53e7', class: "s-booking-field-main" }, this.option.required || this.reservations.length > 0 ? h("div", { class: "s-booking-field-price" }, h("span", { innerHTML: salla.money(this.option.price) })) : '', h("salla-button", { key: '7f86d43a5a5100869f249b690545269e218a1799', class: "s-booking-field-book-now", size: "small", loaderPosition: "center", fill: "outline", onClick: event => this.openBookingModal(event, false) }, h("span", { key: '9a8b446c2d59ffe0b2800d48de1911c2b94a9078', class: "s-booking-field-book-now-content" }, h("span", { key: '678a8be040e17bdd6234c05d79a29fb45286156d', innerHTML: BookingTime }), this.reservations.length ? this.editLabel : this.bookNowLabel))), this.reservations.length > 0 && (h("div", { key: 'c1271b41d4584887a2c4e07b90c4d3b7ef285447', class: "s-booking-field-reservations" }, this.reservations.map((reservation, index) => (h("div", { key: index, class: "s-booking-field-reservations-item" }, this.renderReservationDate(reservation), this.renderReservationTime(reservation)))))), h("input", { key: 'b4f42ddb7adee25ef281805491bd4e5effc73ab9', class: "s-hidden", name: this.option.name, required: this.option.required, value: JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations), ref: reservations => this.reservationsInput = reservations }), this.iframeReady && this.bookingModal()));
187
+ return (h(Host, { key: '867baeadef44a292fb91610fa37543b13f106791' }, h("div", { key: '3a6b64b5ca81a71665954d48059c3f7991b074d5', class: "s-booking-field-main" }, this.option.required || this.reservations.length > 0 ? h("div", { class: "s-booking-field-price" }, h("span", { innerHTML: salla.money(this.option.price) })) : '', h("salla-button", { key: 'a274a931a7c2f3817774196c2150cf6b36365028', class: "s-booking-field-book-now", size: "small", loaderPosition: "center", fill: "outline", onClick: event => this.openBookingModal(event, false) }, h("span", { key: '52da7cac22d69527c92844bc907610593521c115', class: "s-booking-field-book-now-content" }, h("span", { key: '9aaece05a99d335158b5bbc110cbf4e7febba06d', innerHTML: BookingTime }), this.reservations.length ? this.editLabel : this.bookNowLabel))), this.reservations.length > 0 && (h("div", { key: '320151bc171976c0f2962fa30fa7efb923830cd0', class: "s-booking-field-reservations" }, this.reservations.map((reservation, index) => (h("div", { key: index, class: "s-booking-field-reservations-item" }, this.renderReservationDate(reservation), this.renderReservationTime(reservation)))))), h("input", { key: 'ecea033a152115533a80ec2ae33b415c11b19c42', class: "s-hidden", name: this.option.name, required: this.option.required, value: JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations), ref: reservations => this.reservationsInput = reservations }), this.iframeReady && this.bookingModal()));
179
188
  }
180
189
  get host() { return this; }
181
190
  static get style() { return sallaBookingFieldCss; }
@@ -2,6 +2,7 @@
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
4
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
5
+ import { i as isSallaSdkAvailable } from './ssr-helpers.js';
5
6
  import { W as WhatsappIcon } from './whatsapp2.js';
6
7
  import { M as MailIcon } from './mail.js';
7
8
 
@@ -32,64 +33,98 @@ const SallaContacts$1 = /*@__PURE__*/ proxyCustomElement(class SallaContacts ext
32
33
  constructor() {
33
34
  super();
34
35
  this.__registerHost();
35
- this.contacts = salla.config.get('store.contacts');
36
+ /**
37
+ * Flag to toggle title visibility.
38
+ */
39
+ this.hideTitle = false;
40
+ /**
41
+ * Conditional flag to check whether the content is header or not.
42
+ */
43
+ this.isHeader = false;
44
+ /**
45
+ * Flag to toggle list of contents whether vertical or horizontal.
46
+ */
47
+ this.horizontal = false;
48
+ /**
49
+ * Flag condition to show icon only or icon with label.
50
+ */
51
+ this.iconsOnly = false;
52
+ this.sdkContacts = null;
36
53
  this.iconsList = { mobile, whatsapp: WhatsappIcon, phone, telegram, email: MailIcon };
37
- this.contactSlot = this.host.querySelector('[slot="contact"]')?.innerHTML || `<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>${!this.iconsOnly && "<span class='unicode'>{value}</span>"}</a>`;
38
- salla.onReady(() => {
39
- this.contacts = salla.config.get('store.contacts');
40
- });
54
+ }
55
+ getDefaultSlot() {
56
+ const valueMarkup = this.iconsOnly ? '' : "<span class='unicode'>{value}</span>";
57
+ return '<a href="{link}" class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>' + valueMarkup + '</a>';
41
58
  }
42
59
  connectedCallback() {
43
- this.langUnsubscribe = salla.lang.subscribe(() => {
44
- if (!this.contactsTitle || this.contactsTitle === this.langTitle) {
45
- this.contactsTitle = this.langTitle = salla.lang.get('blocks.footer.social');
46
- }
60
+ if (isSallaSdkAvailable()) {
61
+ this.langUnsubscribe = salla.lang.subscribe(() => {
62
+ if (!this.contactsTitle || this.contactsTitle === this.langTitle) {
63
+ this.contactsTitle = this.langTitle = salla.lang.get('blocks.footer.social');
64
+ }
65
+ });
66
+ }
67
+ // capture once: componentDidRender removes the slot element, so a reconnect could no longer read it
68
+ if (!this.contactSlot) {
69
+ const slotElement = this.slotTemplate ? null : this.host.querySelector('[slot="contact"]');
70
+ this.contactSlot = slotElement ? slotElement.innerHTML : (this.slotTemplate || this.getDefaultSlot());
71
+ }
72
+ if (!isSallaSdkAvailable())
73
+ return;
74
+ // load the store's contacts even when `contacts` is passed, so clearing the prop falls back to them
75
+ salla.onReady(() => {
76
+ this.sdkContacts = salla.config.get('store.contacts');
47
77
  });
48
78
  }
49
79
  disconnectedCallback() {
50
80
  this.langUnsubscribe?.();
51
81
  }
82
+ getContactsData() {
83
+ return this.contacts || this.sdkContacts || {};
84
+ }
52
85
  getContactsArray() {
53
- return Object.entries(this.contacts)
54
- .filter(([_key, value]) => value !== '')
55
- .map(([type, value]) => ({ type, value }));
86
+ const contactsData = this.getContactsData();
87
+ return Object.entries(contactsData)
88
+ .filter(([, value]) => value && value !== '')
89
+ .map(([type, value]) => ({ type, value: value }));
56
90
  }
57
- getContactLink(type) {
58
- const contactValue = this.contacts[type];
91
+ getContactLink(type, contactValue) {
59
92
  switch (type) {
60
93
  case 'phone':
61
94
  case 'mobile':
62
95
  return `tel:${contactValue}`;
63
96
  case 'whatsapp':
64
- const whatsAppNumber = (contactValue || '').toString().replace(/[^\d]/g, '');
65
- return whatsAppNumber ? `https://wa.me/${whatsAppNumber}` : salla.url.get('whatsapp/send');
97
+ const whatsAppNumber = contactValue.toString().replace(/[^\d]/g, '');
98
+ return whatsAppNumber ? `https://wa.me/${whatsAppNumber}` :
99
+ (isSallaSdkAvailable() ? salla.url.get('whatsapp/send') : '');
66
100
  case 'email':
67
101
  return `mailto:${contactValue}`;
68
102
  case 'telegram':
69
- // Check if the contact is already a full URL
70
103
  return contactValue.startsWith('https://t.me/') ? contactValue : `https://t.me/${contactValue}`;
71
104
  default:
72
105
  return contactValue;
73
106
  }
74
107
  }
75
108
  getContactIcon(type) {
76
- return this.iconsList[type];
109
+ return this.iconsList[type] || '';
77
110
  }
78
- componentWillLoad() {
79
- return new Promise(resolve => salla.onReady(resolve));
111
+ componentDidRender() {
112
+ this.host.querySelector('[slot="contact"]')?.remove();
80
113
  }
81
114
  render() {
82
115
  const contactsArray = this.getContactsArray();
83
- if (!contactsArray || contactsArray.length == 0) {
116
+ if (!contactsArray || contactsArray.length === 0) {
84
117
  return;
85
118
  }
86
119
  if (this.isHeader) {
87
- return (h(Host, { class: "s-contacts s-contacts-header" }, contactsArray.filter((contact) => contact.type == 'phone' || contact.type == 'email').map((contact, index) => (h("a", { href: this.getContactLink(contact.type), key: index, class: "s-contacts-topnav-link" }, contact.type === 'email' ? (contact.value) : ([
120
+ return (h(Host, { class: "s-contacts s-contacts-header" }, contactsArray
121
+ .filter(contact => contact.type === 'phone' || contact.type === 'email')
122
+ .map((contact, index) => (h("a", { href: this.getContactLink(contact.type, contact.value), key: index, class: "s-contacts-topnav-link" }, contact.type === 'email' ? (contact.value) : ([
88
123
  h("span", null, this.contactsTitle, ": "),
89
124
  h("span", { class: "unicode" }, contact.value)
90
125
  ]))))));
91
126
  }
92
- return (h(Host, { class: "s-contacts" }, !this.hideTitle && h("h3", { class: "s-contacts-title" }, this.contactsTitle), h("div", { class: {
127
+ return (h(Host, { class: "s-contacts" }, !this.hideTitle && this.contactsTitle && h("h3", { class: "s-contacts-title" }, this.contactsTitle), h("div", { class: {
93
128
  's-contacts-list': true,
94
129
  's-contacts-list-horizontal': this.horizontal,
95
130
  's-contacts-list-vertical': !this.horizontal,
@@ -97,22 +132,19 @@ const SallaContacts$1 = /*@__PURE__*/ proxyCustomElement(class SallaContacts ext
97
132
  } }, contactsArray.map((contact, index) => (h("div", { key: index, id: "contact-slot", innerHTML: this.contactSlot
98
133
  .replace(/\{icon\}/g, this.getContactIcon(contact.type))
99
134
  .replace(/\{value\}/g, contact.value.toString())
100
- .replace(/\{link\}/g, this.getContactLink(contact.type)) }))))));
101
- }
102
- componentDidRender() {
103
- // this.host.querySelectorAll('#contact-slot').forEach(el => el.replaceWith(el.firstChild));
104
- this.host.querySelector('[slot="contact"]')?.remove();
135
+ .replace(/\{link\}/g, this.getContactLink(contact.type, contact.value)) }))))));
105
136
  }
106
137
  get host() { return this; }
107
138
  static get style() { return sallaContactsCss; }
108
139
  }, [0, "salla-contacts", {
140
+ "contacts": [16],
109
141
  "contactsTitle": [1025, "contacts-title"],
110
142
  "hideTitle": [4, "hide-title"],
111
143
  "isHeader": [4, "is-header"],
112
144
  "horizontal": [4],
113
145
  "iconsOnly": [4, "icons-only"],
114
- "contacts": [32],
115
- "iconsList": [32]
146
+ "slotTemplate": [1, "slot-template"],
147
+ "sdkContacts": [32]
116
148
  }]);
117
149
  function defineCustomElement$1() {
118
150
  if (typeof customElements === "undefined") {
@@ -388,18 +388,18 @@ const SallaOrderOptionsModal = /*@__PURE__*/ proxyCustomElement(class SallaOrder
388
388
  // header-inner container; the empty title div is hidden via .s-oom-wizard-modal CSS.
389
389
  // In single-step mode the header shows the relevant title text directly.
390
390
  const modalTitle = this._isWizard ? ' ' : (isStep1 ? this.freeProductTitle : this.title);
391
- return (h("salla-modal", { key: '60e626bb49f8592c952182c182e6d73ddcaadeed', ref: el => (this.modal = el), class: `s-order-options-modal-host${this._isWizard ? ' s-oom-wizard-modal' : ''}`, width: "md", "modal-title": modalTitle, onModalVisibilityChanged: (e) => {
391
+ return (h("salla-modal", { key: '42c7d7d765d42b6fc25ec86eb824dc2bf7a0b1bd', ref: el => (this.modal = el), class: `s-order-options-modal-host${this._isWizard ? ' s-oom-wizard-modal' : ''}`, width: "md", "modal-title": modalTitle, onModalVisibilityChanged: (e) => {
392
392
  if (!e.detail)
393
393
  this.handleClose();
394
- } }, this._isWizard && (h("div", { key: 'a842b5d1566c8bb0bd68d5986fb092c14f8a01d6', slot: "icon", class: "s-oom-steps" }, stepLabels.map((label, index) => [
394
+ } }, this._isWizard && (h("div", { key: '6e8e57a4f8d49d06cd70ae00b01d47b9ad66448e', slot: "icon", class: "s-oom-steps" }, stepLabels.map((label, index) => [
395
395
  index > 0 && h("div", { class: "s-oom-connector" }),
396
396
  h("div", { class: `s-oom-step ${index === current ? 'active' : (index < current ? 'done' : '')}` }, h("span", { class: "s-oom-step-num" }, index + 1), h("span", { class: "s-oom-step-label" }, label)),
397
- ]))), h("div", { key: '1f61a756dcf824bf4d8be71ccbd9a0c2742851d2', class: "s-order-options-modal-body" }, isStep1 && this.freeProduct && (h("div", { key: '667841475dff0deda06d8d04e0a2841f33ec54b6', class: "s-oom-free-product-card" }, this.freeProduct.thumbnail && (h("img", { key: '129b99226216f0c1ca59fccbc0ba35d5af8cdee7', class: "s-oom-free-product-thumb", src: this.freeProduct.thumbnail, alt: this.freeProduct.name })), h("div", { key: 'ae385e2d4fb967144743d67eadd50f31c23332ec', class: "s-oom-free-product-info" }, h("span", { key: '4f48a3fd0af91435060a0d303a6d0f77f5afd1bc', class: "s-oom-free-product-name" }, this.freeProduct.name), h("div", { key: 'de62961aba2246c1d52d411461d6a45aed620eab', class: "s-oom-free-product-tags" }, h("span", { key: 'db1af48cc1a7583a7f2d026159ff01f03ad216bf', class: "s-oom-free-badge" }, this.t('common.elements.free', 'مجاني')), this.freeProduct.offer_name && (h("span", { key: 'ce595bccd755e908deb1c566758ca3629171962b', class: "s-oom-free-offer-name" }, this.freeProduct.offer_name)))))), h("p", { key: '161740bddbf25369392f362f9613f2e9c6a94fc1', class: "s-order-options-modal-subtitle" }, isStep1 ? this.freeProductSubtitle : this.subtitle), h("div", { key: '20d3f92f0f3782d599ec5ce923c2dad93f7c7608', class: "s-order-options-modal-fields" }, this.orderOptions.length > 0 && (h("salla-product-options", { key: this.sessionId, ref: el => {
397
+ ]))), h("div", { key: '748c8bdd31860f1f2b512940ea0e4aea27737e88', class: "s-order-options-modal-body" }, isStep1 && this.freeProduct && (h("div", { key: '85cd3903f2ba210b973eef66750ecee5a6d77a4b', class: "s-oom-free-product-card" }, this.freeProduct.thumbnail && (h("img", { key: '809cf47e06f640c438373823cb90801097274653', class: "s-oom-free-product-thumb", src: this.freeProduct.thumbnail, alt: this.freeProduct.name })), h("div", { key: 'bd7abf27cdb0256b9a00ae085be07b8e655ea33a', class: "s-oom-free-product-info" }, h("span", { key: '0324efe7d547a168eb51c4a398aef6cc097f1867', class: "s-oom-free-product-name" }, this.freeProduct.name), h("div", { key: '9eb2ab65e83e294796b910d77a2d1f7207824dad', class: "s-oom-free-product-tags" }, h("span", { key: '921d3487595380b3accc074655c445060595e6bc', class: "s-oom-free-badge" }, this.t('common.elements.free', 'مجاني')), this.freeProduct.offer_name && (h("span", { key: '0bf1142a8078b8faf67af0d623ab41fcbeba2414', class: "s-oom-free-offer-name" }, this.freeProduct.offer_name)))))), h("p", { key: '372fe80cd605b6b5b9d9fd1976f40878f67a1830', class: "s-order-options-modal-subtitle" }, isStep1 ? this.freeProductSubtitle : this.subtitle), h("div", { key: '179205569c7cadf8326fb202936a08775bc62b4c', class: "s-order-options-modal-fields" }, this.orderOptions.length > 0 && (h("salla-product-options", { key: this.sessionId, ref: el => {
398
398
  if (!el)
399
399
  return;
400
400
  this.optionsRefs.set(uniqueKey, el);
401
401
  el.seedSelectedOptions?.();
402
- }, "product-id": productIdAttr, "unique-key": uniqueKey, options: JSON.stringify(this.orderOptions), "hide-out-label": "1", "no-padding": true })))), h("div", { key: 'c80a0c1f1b32e5396483171196879bc43713c2f4', slot: "footer", class: "s-order-options-modal-footer" }, showApplePay ? (h("div", { class: "s-order-options-modal-apple-pay-wrap" }, h("div", { class: "s-order-options-modal-apple-pay-total" }, h("span", { class: "s-order-options-modal-apple-pay-label" }, this.totalLabel), h("span", { class: "s-order-options-modal-apple-pay-amount", innerHTML: totalHtml })), h("apple-pay-button", { locale: salla?.config?.get?.('user.language_code') || 'ar', buttonstyle: "black", type: "buy", class: "s-order-options-modal-apple-pay", onClick: () => this.handleSubmit() }))) : (h("salla-button", { type: "button", color: "primary", fill: "solid", width: "wide", loading: this.isSubmitting, onClick: () => this.handleSubmit() }, h("span", { class: "s-order-options-modal-cta-content" }, h("span", { class: "s-order-options-modal-cta-text" }, isStep1 ? this.freeProductContinueLabel : this.submitLabel), isStep1
402
+ }, "product-id": productIdAttr, "unique-key": uniqueKey, options: JSON.stringify(this.orderOptions), "hide-out-label": "1", "no-padding": true })))), h("div", { key: '4abd512d2592800f2797897ee1cff61f3276ad2c', slot: "footer", class: "s-order-options-modal-footer" }, showApplePay ? (h("div", { class: "s-order-options-modal-apple-pay-wrap" }, h("div", { class: "s-order-options-modal-apple-pay-total" }, h("span", { class: "s-order-options-modal-apple-pay-label" }, this.totalLabel), h("span", { class: "s-order-options-modal-apple-pay-amount", innerHTML: totalHtml })), h("apple-pay-button", { locale: salla?.config?.get?.('user.language_code') || 'ar', buttonstyle: "black", type: "buy", class: "s-order-options-modal-apple-pay", onClick: () => this.handleSubmit() }))) : (h("salla-button", { type: "button", color: "primary", fill: "solid", width: "wide", loading: this.isSubmitting, onClick: () => this.handleSubmit() }, h("span", { class: "s-order-options-modal-cta-content" }, h("span", { class: "s-order-options-modal-cta-text" }, isStep1 ? this.freeProductContinueLabel : this.submitLabel), isStep1
403
403
  ? h("i", { class: {
404
404
  's-oom-cta-arrow': true,
405
405
  // "Forward" is left in RTL and right in LTR; hardcoding arrow-left made
@@ -10,21 +10,62 @@ const SallaOrderTotalsCard$1 = /*@__PURE__*/ proxyCustomElement(class SallaOrder
10
10
  super();
11
11
  this.__registerHost();
12
12
  }
13
- handleOrderChange(newValue) {
14
- if (newValue) {
15
- this.setSummaryFromProp(newValue);
13
+ // `amounts` wins over the legacy `order` whenever both are set
14
+ refreshSummary() {
15
+ if (this.amounts) {
16
+ this.setSummaryFromAmounts(this.amounts);
17
+ }
18
+ else if (this.order) {
19
+ this.setSummaryFromOrder(this.order);
16
20
  }
17
21
  else {
18
22
  this.summary = undefined;
19
23
  }
20
24
  }
25
+ handleAmountsChange() {
26
+ this.refreshSummary();
27
+ }
28
+ handleOrderChange() {
29
+ this.refreshSummary();
30
+ }
21
31
  async componentWillLoad() {
22
32
  await Salla.onReady();
23
- if (this.order) {
24
- this.setSummaryFromProp(this.order);
33
+ this.refreshSummary();
34
+ }
35
+ normalizeAmounts(value) {
36
+ const parsed = typeof value === 'string' ? JSON.parse(value) : value;
37
+ return {
38
+ sub_total: parsed.sub_total,
39
+ total: parsed.total,
40
+ shipping_cost: parsed.shipping_cost,
41
+ cod_cost: parsed.cash_on_delivery,
42
+ paid_amount: parsed.paid_amount,
43
+ remaining_amount: parsed.remaining_amount,
44
+ refund_amount: parsed.refund_amount,
45
+ options: parsed.options,
46
+ options_total: parsed.options_total,
47
+ tax: parsed.tax
48
+ ? {
49
+ percent: typeof parsed.tax.percent === 'string' ? parseFloat(parsed.tax.percent) : parsed.tax.percent,
50
+ amount: parsed.tax.amount,
51
+ }
52
+ : undefined,
53
+ discounts: parsed.discounts?.map((d) => ({
54
+ name: d.title,
55
+ discount: typeof d.discount === 'string' ? parseFloat(d.discount) : d.discount,
56
+ })),
57
+ };
58
+ }
59
+ setSummaryFromAmounts(value) {
60
+ try {
61
+ this.summary = this.normalizeAmounts(value);
62
+ }
63
+ catch (error) {
64
+ salla.logger.error('Failed to parse amounts data', error);
65
+ this.summary = undefined;
25
66
  }
26
67
  }
27
- setSummaryFromProp(value) {
68
+ setSummaryFromOrder(value) {
28
69
  try {
29
70
  const parsedValue = typeof value === 'string' ? JSON.parse(value) : value;
30
71
  this.summary = parsedValue;
@@ -67,13 +108,16 @@ const SallaOrderTotalsCard$1 = /*@__PURE__*/ proxyCustomElement(class SallaOrder
67
108
  : null, h("div", { class: "s-order-totals-card-total" }, this.renderTotalRow(salla.lang.get('pages.orders.final_total'), summary.total, 's-order-totals-card-total-label', 's-order-totals-card-total-value', true)), refundAmount > 0 ? (h("div", { class: "s-order-totals-card-refund" }, this.renderRefundRow(summary.refund_amount))) : null)))));
68
109
  }
69
110
  static get watchers() { return {
111
+ "amounts": ["handleAmountsChange"],
70
112
  "order": ["handleOrderChange"]
71
113
  }; }
72
114
  static get style() { return sallaOrderTotalsCardCss; }
73
115
  }, [0, "salla-order-totals-card", {
116
+ "amounts": [1],
74
117
  "order": [1],
75
118
  "summary": [32]
76
119
  }, undefined, {
120
+ "amounts": ["handleAmountsChange"],
77
121
  "order": ["handleOrderChange"]
78
122
  }]);
79
123
  function defineCustomElement$1() {
@@ -234,12 +234,22 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
234
234
  Helper.saveProductSource('search');
235
235
  this.commitSearchHistory(this.search_term);
236
236
  salla.event.emit('salla-search::product.clicked', [{ product, position }]);
237
+ this.modal?.close();
237
238
  },
238
239
  recommendationClick: (term, source) => {
239
240
  salla.event.emit('salla-search::recommendation.clicked', { term, source });
240
241
  },
241
242
  };
242
- salla.event.on('search::open', () => this.open());
243
+ }
244
+ connectedCallback() {
245
+ this.searchOpenListener = () => this.open();
246
+ salla.event.on('search::open', this.searchOpenListener);
247
+ }
248
+ disconnectedCallback() {
249
+ if (this.searchOpenListener) {
250
+ salla.event.off('search::open', this.searchOpenListener);
251
+ this.searchOpenListener = undefined;
252
+ }
243
253
  }
244
254
  async open() {
245
255
  if (!this.hasLoadedPopularSearches) {
@@ -21,6 +21,12 @@ const SallaTabContent = /*@__PURE__*/ proxyCustomElement(class SallaTabContent e
21
21
  name: this.name
22
22
  };
23
23
  }
24
+ componentWillLoad() {
25
+ const parent = this.host.closest('salla-tabs');
26
+ if (parent?.activeTab === this.name) {
27
+ this.isSelected = true;
28
+ }
29
+ }
24
30
  unselect() {
25
31
  this.isSelected = false;
26
32
  }
@@ -32,8 +38,9 @@ const SallaTabContent = /*@__PURE__*/ proxyCustomElement(class SallaTabContent e
32
38
  's-tabs-content': true,
33
39
  's-tabs-content-selected': this.isSelected
34
40
  };
35
- return (h("div", { key: '3107faffd358504438b464be5000682d403e1b22', class: classes }, h("slot", { key: 'e6fc9e480389b54f9e6e20a7c8ccdb880a4ee6d4' })));
41
+ return (h("div", { key: '251a33f54b1a8bb0fc4a424de86fe9e443ef6cf1', class: classes }, h("slot", { key: 'f7244cb7f510b7bde6ff34a64ef4ce043392b4fa' })));
36
42
  }
43
+ get host() { return this; }
37
44
  static get style() { return sallaTabContentCss; }
38
45
  }, [4, "salla-tab-content", {
39
46
  "name": [1],
@@ -10,18 +10,26 @@ const SallaTabs = /*@__PURE__*/ proxyCustomElement(class SallaTabs extends HTMLE
10
10
  super();
11
11
  this.__registerHost();
12
12
  /**
13
- * Background color
13
+ * Background color for the tabs header section. Accepts any CSS color value.
14
14
  */
15
15
  this.backgroundColor = undefined;
16
16
  /**
17
- * Align tabs vertically.
17
+ * Whether to display tabs in a vertical layout. Default is false (horizontal layout).
18
18
  */
19
19
  this.vertical = false;
20
20
  }
21
- componentWillLoad() {
21
+ componentDidLoad() {
22
22
  this.createGroup().then(() => {
23
- const [group] = this.tabGroup;
24
- this.selectGroup(group);
23
+ if (this.activeTab) {
24
+ const group = this.tabGroup.find(g => g.header.name === this.activeTab);
25
+ if (group) {
26
+ this.selectGroup(group);
27
+ }
28
+ }
29
+ else {
30
+ const [group] = this.tabGroup;
31
+ this.selectGroup(group);
32
+ }
25
33
  });
26
34
  }
27
35
  onSelectedTab(event) {
@@ -50,15 +58,17 @@ const SallaTabs = /*@__PURE__*/ proxyCustomElement(class SallaTabs extends HTMLE
50
58
  group.content.selected();
51
59
  }
52
60
  render() {
61
+ const headerStyle = this.backgroundColor ? { 'background-color': this.backgroundColor } : {};
53
62
  return [
54
- h("div", { key: 'de6455b0d68cb3e174771ad7be1bc95141d61df1', class: "s-tabs" }, h("div", { key: '57c21f00a709723fa0be789f388b3defb391bcb2', class: "s-tabs-header" }, h("slot", { key: 'b5107fab289f9d7c661ddd7c4cfea4795eb7bb19', name: "header" })), h("div", { key: '344d142adc8f6adbc70baf4009e2d594fdbaea06', class: "s-tabs-content-wrapper" }, h("slot", { key: 'acd41f2ebb7120a2c043d17740e5fd4d2db95276', name: "content" })))
63
+ h("div", { key: 'd6f4e42f48cc3275f210718af56ff2fbbdb3e4a2', class: "s-tabs" }, h("div", { key: 'cdc798c1408536a3d56797b9bba071b246c01bbe', class: "s-tabs-header", style: headerStyle }, h("slot", { key: '7ba75a8985d78246faeef7c491452a5b82dbfa21', name: "header" })), h("div", { key: '0672eb44f6664cc3926a9780718f818f3b1ff507', class: "s-tabs-content-wrapper" }, h("slot", { key: '761a54a862372d9546763c814cc96ccb802f9b64', name: "content" })))
55
64
  ];
56
65
  }
57
66
  get host() { return this; }
58
67
  static get style() { return sallaTabsCss; }
59
68
  }, [4, "salla-tabs", {
60
69
  "backgroundColor": [1, "background-color"],
61
- "vertical": [4]
70
+ "vertical": [4],
71
+ "activeTab": [1, "active-tab"]
62
72
  }, [[0, "tabSelected", "onSelectedTab"]]]);
63
73
  function defineCustomElement() {
64
74
  if (typeof customElements === "undefined") {