@salla.sa/twilight-components 2.14.598 → 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 (385) hide show
  1. package/dist/cjs/{filepond-Yrcu23Ew.js → filepond-DVmQ7csb.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DRez16xM.js → filepond-plugin-file-poster-DMSpzTqe.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-H6Ijvhk2.js → filepond-plugin-file-validate-size-D_ptbEIk.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-ozbX9Tb-.js → filepond-plugin-file-validate-type-0yFqmcfN.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-CynCgK8H.js → filepond-plugin-image-edit-E7sYYAWn.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-C18fCqoh.js → filepond-plugin-image-exif-orientation-DbrEAQoa.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-FiRPNiZp.js → filepond-plugin-image-preview-DO_tpcG1.js} +1 -1
  8. package/dist/cjs/{index-CpkvCUQ3.js → index-Bw9ZFzBG.js} +2 -2
  9. package/dist/cjs/{intlTelInput-dW1ObsSS.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 +3 -3
  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-CSaDVE6R.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-scopes/salla-scopes.css +14 -0
  125. package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
  126. package/dist/collection/components/salla-search/salla-search.js +11 -1
  127. package/dist/collection/components/salla-tabs/salla-tab-content.js +9 -2
  128. package/dist/collection/components/salla-tabs/salla-tabs.js +36 -8
  129. package/dist/collection/utils/ssr-helpers.js +105 -0
  130. package/dist/components/index.js +2 -2
  131. package/dist/components/salla-accordion-body2.js +1 -1
  132. package/dist/components/salla-accordion-head2.js +2 -2
  133. package/dist/components/salla-accordion2.js +1 -1
  134. package/dist/components/salla-alert.js +1 -1
  135. package/dist/components/salla-apps-icons.js +53 -20
  136. package/dist/components/salla-badge2.js +1 -1
  137. package/dist/components/salla-booking-field2.js +12 -3
  138. package/dist/components/salla-contacts.js +62 -30
  139. package/dist/components/salla-order-options-modal2.js +4 -4
  140. package/dist/components/salla-order-totals-card.js +50 -6
  141. package/dist/components/salla-scopes.js +2 -2
  142. package/dist/components/salla-search.js +11 -1
  143. package/dist/components/salla-tab-content2.js +8 -1
  144. package/dist/components/salla-tabs2.js +17 -7
  145. package/dist/components/ssr-helpers.js +46 -0
  146. package/dist/docs.json +255 -34
  147. package/dist/esm/{filepond-Cqatu146.js → filepond-CMtCLsIc.js} +1 -1
  148. package/dist/esm/{filepond-plugin-file-poster-DbVXhgv4.js → filepond-plugin-file-poster-OjOFU-jw.js} +1 -1
  149. package/dist/esm/{filepond-plugin-file-validate-size-BpJPambh.js → filepond-plugin-file-validate-size-BFCz_KY1.js} +1 -1
  150. package/dist/esm/{filepond-plugin-file-validate-type-3Qrskyxw.js → filepond-plugin-file-validate-type-BaPcxnrR.js} +1 -1
  151. package/dist/esm/{filepond-plugin-image-edit-Cjy7cOV1.js → filepond-plugin-image-edit-D_tfXMIg.js} +1 -1
  152. package/dist/esm/{filepond-plugin-image-exif-orientation-DYM12Yp-.js → filepond-plugin-image-exif-orientation-DS2k4xg9.js} +1 -1
  153. package/dist/esm/{filepond-plugin-image-preview-C9nMEHVX.js → filepond-plugin-image-preview-B6bJkNCH.js} +1 -1
  154. package/dist/esm/{index-noRE1pbw.js → index-C670SYee.js} +2 -2
  155. package/dist/esm/{intlTelInput-CiinYrbq.js → intlTelInput-BUOxAmWZ.js} +1 -1
  156. package/dist/esm/loader.js +3 -3
  157. package/dist/esm/salla-accordion-body_2.entry.js +4 -4
  158. package/dist/esm/salla-accordion_6.entry.js +2 -2
  159. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  160. package/dist/esm/salla-advertisement.entry.js +1 -1
  161. package/dist/esm/salla-alert_2.entry.js +2 -2
  162. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  163. package/dist/esm/salla-applied-filters.entry.js +1 -1
  164. package/dist/esm/salla-apps-icons.entry.js +50 -19
  165. package/dist/esm/salla-attachment-view_9.entry.js +22 -13
  166. package/dist/esm/salla-badge.entry.js +2 -2
  167. package/dist/esm/salla-basket-gap.entry.js +1 -1
  168. package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
  169. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  170. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  171. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  172. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  173. package/dist/esm/salla-comment-factors.entry.js +1 -1
  174. package/dist/esm/salla-comment-form_9.entry.js +1 -1
  175. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  176. package/dist/esm/salla-contacts.entry.js +60 -29
  177. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  178. package/dist/esm/salla-count-down.entry.js +1 -1
  179. package/dist/esm/salla-custom-fields.entry.js +1 -1
  180. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  181. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  182. package/dist/esm/salla-filters-widget.entry.js +1 -1
  183. package/dist/esm/salla-filters.entry.js +1 -1
  184. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  185. package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
  186. package/dist/esm/salla-gifting.entry.js +1 -1
  187. package/dist/esm/salla-hook.entry.js +1 -1
  188. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  189. package/dist/esm/salla-installment.entry.js +1 -1
  190. package/dist/esm/salla-list-tile.entry.js +1 -1
  191. package/dist/esm/salla-localization-modal.entry.js +1 -1
  192. package/dist/esm/salla-login-modal.entry.js +1 -1
  193. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  194. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  195. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  196. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  197. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  198. package/dist/esm/salla-loyalty.entry.js +1 -1
  199. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  200. package/dist/esm/salla-map_3.entry.js +1 -1
  201. package/dist/esm/salla-menu.entry.js +1 -1
  202. package/dist/esm/salla-metadata.entry.js +1 -1
  203. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  204. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  205. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  206. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  207. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  208. package/dist/esm/salla-offer-modal.entry.js +1 -1
  209. package/dist/esm/salla-offer.entry.js +1 -1
  210. package/dist/esm/salla-order-branch.entry.js +1 -1
  211. package/dist/esm/salla-order-cancel.entry.js +1 -1
  212. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  213. package/dist/esm/salla-order-details-options.entry.js +1 -1
  214. package/dist/esm/salla-order-details.entry.js +1 -1
  215. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  216. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  217. package/dist/esm/salla-order-edit.entry.js +1 -1
  218. package/dist/esm/salla-order-options-modal.entry.js +5 -5
  219. package/dist/esm/salla-order-shipments.entry.js +1 -1
  220. package/dist/esm/salla-order-summary.entry.js +1 -1
  221. package/dist/esm/salla-order-totals-card.entry.js +49 -7
  222. package/dist/esm/salla-orders.entry.js +1 -1
  223. package/dist/esm/salla-payments.entry.js +1 -1
  224. package/dist/esm/salla-placeholder.entry.js +1 -1
  225. package/dist/esm/salla-price-range.entry.js +1 -1
  226. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  227. package/dist/esm/salla-product-card.entry.js +1 -1
  228. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  229. package/dist/esm/salla-products-list.entry.js +1 -1
  230. package/dist/esm/salla-products-slider.entry.js +1 -1
  231. package/dist/esm/salla-quick-order.entry.js +1 -1
  232. package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
  233. package/dist/esm/salla-rating-modal.entry.js +1 -1
  234. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  235. package/dist/esm/salla-review-order-item.entry.js +1 -1
  236. package/dist/esm/salla-scopes.entry.js +3 -3
  237. package/dist/esm/salla-search-product-card.entry.js +1 -1
  238. package/dist/esm/salla-search.entry.js +12 -2
  239. package/dist/esm/salla-skeleton.entry.js +1 -1
  240. package/dist/esm/salla-social-share.entry.js +1 -1
  241. package/dist/esm/salla-social.entry.js +1 -1
  242. package/dist/esm/salla-tab-content_3.entry.js +24 -8
  243. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  244. package/dist/esm/salla-trust-badges.entry.js +1 -1
  245. package/dist/esm/salla-user-menu.entry.js +1 -1
  246. package/dist/esm/salla-user-profile.entry.js +1 -1
  247. package/dist/esm/salla-user-settings.entry.js +1 -1
  248. package/dist/esm/salla-verify.entry.js +1 -1
  249. package/dist/esm/salla-wallet.entry.js +1 -1
  250. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  251. package/dist/esm/salla-wishlist-summary.entry.js +1 -1
  252. package/dist/esm/ssr-helpers-BJN-DTdN.js +46 -0
  253. package/dist/esm/twilight.js +3 -3
  254. package/dist/esm/{vanilla-picker-BWBrgMJQ.js → vanilla-picker-vQxevRSA.js} +1 -1
  255. package/dist/twilight/{p-8e248aa7.entry.js → p-0116fc35.entry.js} +1 -1
  256. package/dist/twilight/{p-c589a326.entry.js → p-02946cf5.entry.js} +1 -1
  257. package/dist/twilight/{p-341a7ab8.entry.js → p-07453f6c.entry.js} +1 -1
  258. package/dist/twilight/{p-5110433d.entry.js → p-0c6290e0.entry.js} +1 -1
  259. package/dist/twilight/{p-fc717703.entry.js → p-0cb5d9c6.entry.js} +1 -1
  260. package/dist/twilight/{p-2eea4245.entry.js → p-0f68e660.entry.js} +1 -1
  261. package/dist/twilight/{p-a2de7999.entry.js → p-132d9742.entry.js} +1 -1
  262. package/dist/twilight/p-157873ee.entry.js +4 -0
  263. package/dist/twilight/{p-4d482ee4.entry.js → p-161fce7a.entry.js} +1 -1
  264. package/dist/twilight/{p-3b4f66d3.entry.js → p-167a9c58.entry.js} +1 -1
  265. package/dist/twilight/{p-f03f893c.entry.js → p-19b7fccb.entry.js} +1 -1
  266. package/dist/twilight/{p-88f650da.entry.js → p-19d9b193.entry.js} +1 -1
  267. package/dist/twilight/{p-6e53afc6.entry.js → p-1c75de1e.entry.js} +1 -1
  268. package/dist/twilight/p-1c7999c9.entry.js +4 -0
  269. package/dist/twilight/{p-a8408d51.entry.js → p-1ea04494.entry.js} +1 -1
  270. package/dist/twilight/{p-5360d082.entry.js → p-1f3d5e3e.entry.js} +1 -1
  271. package/dist/twilight/{p-03e89cb1.entry.js → p-22fc1505.entry.js} +1 -1
  272. package/dist/twilight/{p-ce120ce6.entry.js → p-27d94a42.entry.js} +1 -1
  273. package/dist/twilight/{p-be7dcc25.entry.js → p-2a865b0b.entry.js} +1 -1
  274. package/dist/twilight/{p-221e47a5.entry.js → p-2bb95112.entry.js} +1 -1
  275. package/dist/twilight/{p-7f0bdf0e.entry.js → p-2d8d9829.entry.js} +1 -1
  276. package/dist/twilight/{p-9fcc7eeb.entry.js → p-2df4e63a.entry.js} +1 -1
  277. package/dist/twilight/{p-64158678.entry.js → p-316be8a7.entry.js} +1 -1
  278. package/dist/twilight/{p-0859fe23.entry.js → p-321022f5.entry.js} +1 -1
  279. package/dist/twilight/{p-1fe92c36.entry.js → p-34ab84e2.entry.js} +1 -1
  280. package/dist/twilight/{p-454b32f0.entry.js → p-36ddb8db.entry.js} +1 -1
  281. package/dist/twilight/{p-c41c1eff.entry.js → p-3b45e21a.entry.js} +1 -1
  282. package/dist/twilight/{p-826ed1c6.entry.js → p-3eface57.entry.js} +1 -1
  283. package/dist/twilight/{p-856ed222.entry.js → p-46334bbe.entry.js} +1 -1
  284. package/dist/twilight/{p-16072449.entry.js → p-4678b6d7.entry.js} +1 -1
  285. package/dist/twilight/{p-52a7dbb7.entry.js → p-4ea3a8a1.entry.js} +1 -1
  286. package/dist/twilight/{p-cab2f22a.entry.js → p-56d064c0.entry.js} +1 -1
  287. package/dist/twilight/{p-1930b915.entry.js → p-57768c0e.entry.js} +1 -1
  288. package/dist/twilight/{p-0b54834f.entry.js → p-57ddfcfe.entry.js} +1 -1
  289. package/dist/twilight/{p-87dcc9d8.entry.js → p-60e920c6.entry.js} +1 -1
  290. package/dist/twilight/{p-3f730d01.entry.js → p-62690afe.entry.js} +1 -1
  291. package/dist/twilight/{p-6f66a0f2.entry.js → p-6339c31f.entry.js} +1 -1
  292. package/dist/twilight/{p-138d6214.entry.js → p-660271f5.entry.js} +1 -1
  293. package/dist/twilight/{p-88d64b87.entry.js → p-6b28397a.entry.js} +1 -1
  294. package/dist/twilight/{p-40c8b553.entry.js → p-6bacaa30.entry.js} +1 -1
  295. package/dist/twilight/{p-517807b2.entry.js → p-6cfb6628.entry.js} +1 -1
  296. package/dist/twilight/{p-4962d869.entry.js → p-6cffd732.entry.js} +1 -1
  297. package/dist/twilight/{p-0ca1a782.entry.js → p-6eb365f3.entry.js} +1 -1
  298. package/dist/twilight/{p-c5d4682b.entry.js → p-73125aab.entry.js} +1 -1
  299. package/dist/twilight/{p-ce981b2f.entry.js → p-73189ed2.entry.js} +1 -1
  300. package/dist/twilight/{p-5a6c4fdf.entry.js → p-744c8337.entry.js} +1 -1
  301. package/dist/twilight/{p-4d1582f8.entry.js → p-82430d31.entry.js} +1 -1
  302. package/dist/twilight/{p-2636c473.entry.js → p-8359286c.entry.js} +1 -1
  303. package/dist/twilight/{p-27712ed1.entry.js → p-84ed92e9.entry.js} +1 -1
  304. package/dist/twilight/p-84ee1884.entry.js +4 -0
  305. package/dist/twilight/{p-07dc637e.entry.js → p-87feddeb.entry.js} +1 -1
  306. package/dist/twilight/{p-d986aa18.entry.js → p-8d119291.entry.js} +1 -1
  307. package/dist/twilight/{p-5ac2e6ab.entry.js → p-8f1789f7.entry.js} +1 -1
  308. package/dist/twilight/{p-950634d1.entry.js → p-90765c65.entry.js} +1 -1
  309. package/dist/twilight/{p-d09b6b8c.entry.js → p-94f18d97.entry.js} +1 -1
  310. package/dist/twilight/p-9a7da6d0.entry.js +4 -0
  311. package/dist/twilight/{p-d13f5256.entry.js → p-9ab10a2f.entry.js} +1 -1
  312. package/dist/twilight/{p-53bf1d54.entry.js → p-9ace9fc5.entry.js} +1 -1
  313. package/dist/twilight/{p-141218a3.entry.js → p-9b9c2adf.entry.js} +1 -1
  314. package/dist/twilight/p-BJN-DTdN.js +4 -0
  315. package/dist/twilight/{p-noRE1pbw.js → p-C670SYee.js} +1 -1
  316. package/dist/twilight/{p-B867dk1j.js → p-CcijNXaY.js} +1 -1
  317. package/dist/twilight/{p-D98H4WeK.js → p-D-pGRpnm.js} +1 -1
  318. package/dist/twilight/{p-CyV163V_.js → p-D33qIToB.js} +1 -1
  319. package/dist/twilight/{p-CbJEogz0.js → p-DEtbzT0x.js} +1 -1
  320. package/dist/twilight/{p-CADeV7A-.js → p-DIJHCILO.js} +1 -1
  321. package/dist/twilight/{p-DomdkzLW.js → p-DOJsGUE-.js} +1 -1
  322. package/dist/twilight/{p-DWkNp24H.js → p-DYkb22mH.js} +1 -1
  323. package/dist/twilight/p-Kqe2HSSB.js +9 -0
  324. package/dist/twilight/{p-475d01e2.entry.js → p-af525459.entry.js} +1 -1
  325. package/dist/twilight/{p-d306b947.entry.js → p-afc17688.entry.js} +1 -1
  326. package/dist/twilight/{p-78b86647.entry.js → p-b124899c.entry.js} +1 -1
  327. package/dist/twilight/{p-18aff2d5.entry.js → p-b13efdf9.entry.js} +1 -1
  328. package/dist/twilight/{p-b1a35349.entry.js → p-b2da9ea7.entry.js} +1 -1
  329. package/dist/twilight/{p-f5f0246f.entry.js → p-b3f0b7e3.entry.js} +1 -1
  330. package/dist/twilight/{p-3c45c49f.entry.js → p-b40466ae.entry.js} +1 -1
  331. package/dist/twilight/p-b59eab4f.entry.js +4 -0
  332. package/dist/twilight/{p-c631e2cd.entry.js → p-b6674eab.entry.js} +1 -1
  333. package/dist/twilight/{p-c6af4f05.entry.js → p-b7f5a180.entry.js} +1 -1
  334. package/dist/twilight/p-bf95f806.entry.js +4 -0
  335. package/dist/twilight/{p-9ce917a6.entry.js → p-c6f677aa.entry.js} +1 -1
  336. package/dist/twilight/{p-8876efa6.entry.js → p-c7728312.entry.js} +1 -1
  337. package/dist/twilight/{p-4ce97595.entry.js → p-c840c67c.entry.js} +1 -1
  338. package/dist/twilight/{p-f6f633fc.entry.js → p-cba57487.entry.js} +1 -1
  339. package/dist/twilight/{p-919dd049.entry.js → p-ccd75cf6.entry.js} +1 -1
  340. package/dist/twilight/{p-87b3c231.entry.js → p-ce8bdea8.entry.js} +1 -1
  341. package/dist/twilight/{p-ba76a96a.entry.js → p-d2b41e2d.entry.js} +1 -1
  342. package/dist/twilight/{p-82d59bf3.entry.js → p-d897273e.entry.js} +1 -1
  343. package/dist/twilight/{p-ba9ee435.entry.js → p-d923ecda.entry.js} +1 -1
  344. package/dist/twilight/{p-9e084610.entry.js → p-da9b84ee.entry.js} +1 -1
  345. package/dist/twilight/p-de0ce00a.entry.js +4 -0
  346. package/dist/twilight/{p-76d11b5c.entry.js → p-dfcb0978.entry.js} +1 -1
  347. package/dist/twilight/{p-0c9f5232.entry.js → p-dff87ddc.entry.js} +1 -1
  348. package/dist/twilight/{p-7f882abf.entry.js → p-e1b853b2.entry.js} +1 -1
  349. package/dist/twilight/{p-16b2f58b.entry.js → p-e4ba8208.entry.js} +1 -1
  350. package/dist/twilight/{p-9ed52621.entry.js → p-e506fbee.entry.js} +1 -1
  351. package/dist/twilight/p-e80bc0ce.entry.js +4 -0
  352. package/dist/twilight/{p-4333c630.entry.js → p-e8f7ed7b.entry.js} +1 -1
  353. package/dist/twilight/{p-67ecb74a.entry.js → p-ea4e6f55.entry.js} +1 -1
  354. package/dist/twilight/{p-721819ee.entry.js → p-ea82cbb3.entry.js} +1 -1
  355. package/dist/twilight/{p-15b8fa7f.entry.js → p-ef9567bd.entry.js} +1 -1
  356. package/dist/twilight/{p-f9fbcb8d.entry.js → p-f106d1e8.entry.js} +1 -1
  357. package/dist/twilight/{p-15f5d424.entry.js → p-f37cc89b.entry.js} +1 -1
  358. package/dist/twilight/p-f52c49c8.entry.js +4 -0
  359. package/dist/twilight/{p-1cbbdcea.entry.js → p-f5f448b7.entry.js} +1 -1
  360. package/dist/twilight/{p-BT5AJCX9.js → p-r8T0WY8a.js} +1 -1
  361. package/dist/twilight/twilight.esm.js +1 -1
  362. package/dist/types/components/salla-apps-icons/salla-apps-icons.d.ts +26 -13
  363. package/dist/types/components/salla-apps-icons/salla-apps-icons.types.d.ts +4 -0
  364. package/dist/types/components/salla-booking-field/salla-booking-field.d.ts +5 -1
  365. package/dist/types/components/salla-contacts/salla-contacts.d.ts +26 -14
  366. package/dist/types/components/salla-contacts/salla-contacts.types.d.ts +7 -0
  367. package/dist/types/components/salla-order-totals-card/interfaces.d.ts +27 -0
  368. package/dist/types/components/salla-order-totals-card/salla-order-totals-card.d.ts +12 -4
  369. package/dist/types/components/salla-scopes/interfaces.d.ts +1 -0
  370. package/dist/types/components/salla-search/salla-search.d.ts +3 -1
  371. package/dist/types/components/salla-tabs/salla-tab-content.d.ts +3 -2
  372. package/dist/types/components/salla-tabs/salla-tabs.d.ts +8 -3
  373. package/dist/types/components.d.ts +90 -22
  374. package/dist/types/utils/ssr-helpers.d.ts +73 -0
  375. package/package.json +5 -5
  376. package/dist/twilight/p-0cb548be.entry.js +0 -4
  377. package/dist/twilight/p-3263103c.entry.js +0 -4
  378. package/dist/twilight/p-540a7588.entry.js +0 -4
  379. package/dist/twilight/p-DN2opqoB.js +0 -9
  380. package/dist/twilight/p-a030da8e.entry.js +0 -4
  381. package/dist/twilight/p-aabc57e3.entry.js +0 -4
  382. package/dist/twilight/p-c8d269df.entry.js +0 -4
  383. package/dist/twilight/p-e4c88bee.entry.js +0 -4
  384. package/dist/twilight/p-e7fc0d63.entry.js +0 -4
  385. package/dist/twilight/p-eef846fa.entry.js +0 -4
@@ -3,21 +3,62 @@
3
3
  */
4
4
  import { h, Host } from "@stencil/core";
5
5
  export class SallaOrderTotalsCard {
6
- handleOrderChange(newValue) {
7
- if (newValue) {
8
- this.setSummaryFromProp(newValue);
6
+ // `amounts` wins over the legacy `order` whenever both are set
7
+ refreshSummary() {
8
+ if (this.amounts) {
9
+ this.setSummaryFromAmounts(this.amounts);
10
+ }
11
+ else if (this.order) {
12
+ this.setSummaryFromOrder(this.order);
9
13
  }
10
14
  else {
11
15
  this.summary = undefined;
12
16
  }
13
17
  }
18
+ handleAmountsChange() {
19
+ this.refreshSummary();
20
+ }
21
+ handleOrderChange() {
22
+ this.refreshSummary();
23
+ }
14
24
  async componentWillLoad() {
15
25
  await Salla.onReady();
16
- if (this.order) {
17
- this.setSummaryFromProp(this.order);
26
+ this.refreshSummary();
27
+ }
28
+ normalizeAmounts(value) {
29
+ const parsed = typeof value === 'string' ? JSON.parse(value) : value;
30
+ return {
31
+ sub_total: parsed.sub_total,
32
+ total: parsed.total,
33
+ shipping_cost: parsed.shipping_cost,
34
+ cod_cost: parsed.cash_on_delivery,
35
+ paid_amount: parsed.paid_amount,
36
+ remaining_amount: parsed.remaining_amount,
37
+ refund_amount: parsed.refund_amount,
38
+ options: parsed.options,
39
+ options_total: parsed.options_total,
40
+ tax: parsed.tax
41
+ ? {
42
+ percent: typeof parsed.tax.percent === 'string' ? parseFloat(parsed.tax.percent) : parsed.tax.percent,
43
+ amount: parsed.tax.amount,
44
+ }
45
+ : undefined,
46
+ discounts: parsed.discounts?.map((d) => ({
47
+ name: d.title,
48
+ discount: typeof d.discount === 'string' ? parseFloat(d.discount) : d.discount,
49
+ })),
50
+ };
51
+ }
52
+ setSummaryFromAmounts(value) {
53
+ try {
54
+ this.summary = this.normalizeAmounts(value);
55
+ }
56
+ catch (error) {
57
+ salla.logger.error('Failed to parse amounts data', error);
58
+ this.summary = undefined;
18
59
  }
19
60
  }
20
- setSummaryFromProp(value) {
61
+ setSummaryFromOrder(value) {
21
62
  try {
22
63
  const parsedValue = typeof value === 'string' ? JSON.parse(value) : value;
23
64
  this.summary = parsedValue;
@@ -72,6 +113,31 @@ export class SallaOrderTotalsCard {
72
113
  }
73
114
  static get properties() {
74
115
  return {
116
+ "amounts": {
117
+ "type": "string",
118
+ "attribute": "amounts",
119
+ "mutable": false,
120
+ "complexType": {
121
+ "original": "string | Amounts",
122
+ "resolved": "Amounts | string",
123
+ "references": {
124
+ "Amounts": {
125
+ "location": "import",
126
+ "path": "./interfaces",
127
+ "id": "src/components/salla-order-totals-card/interfaces.ts::Amounts"
128
+ }
129
+ }
130
+ },
131
+ "required": false,
132
+ "optional": true,
133
+ "docs": {
134
+ "tags": [],
135
+ "text": "Order totals object (new schema). Accepts a JSON string or object with amounts."
136
+ },
137
+ "getter": false,
138
+ "setter": false,
139
+ "reflect": false
140
+ },
75
141
  "order": {
76
142
  "type": "string",
77
143
  "attribute": "order",
@@ -91,7 +157,7 @@ export class SallaOrderTotalsCard {
91
157
  "optional": true,
92
158
  "docs": {
93
159
  "tags": [],
94
- "text": "Order summary object. Accepts a JSON string or object containing the order totals."
160
+ "text": "Legacy order object for backward compatibility. Prefer using `amounts` instead."
95
161
  },
96
162
  "getter": false,
97
163
  "setter": false,
@@ -106,6 +172,9 @@ export class SallaOrderTotalsCard {
106
172
  }
107
173
  static get watchers() {
108
174
  return [{
175
+ "propName": "amounts",
176
+ "methodName": "handleAmountsChange"
177
+ }, {
109
178
  "propName": "order",
110
179
  "methodName": "handleOrderChange"
111
180
  }];
@@ -173,6 +173,20 @@
173
173
  .s-scopes-input:where([dir="rtl"], [dir="rtl"] *) {
174
174
  margin-left: 0.75rem;
175
175
  }
176
+ .s-scopes-icon {
177
+ display: inline-block;
178
+ height: 2rem;
179
+ width: 2rem;
180
+ border-radius: var(--s-radius, 0.25rem);
181
+ object-fit: contain;
182
+ vertical-align: middle;
183
+ }
184
+ .s-scopes-icon:where([dir="ltr"], [dir="ltr"] *) {
185
+ margin-right: 0.75rem;
186
+ }
187
+ .s-scopes-icon:where([dir="rtl"], [dir="rtl"] *) {
188
+ margin-left: 0.75rem;
189
+ }
176
190
  .s-scopes-label {
177
191
  display: flex;
178
192
  flex-grow: 1;
@@ -157,7 +157,7 @@ export class SallaScopees {
157
157
  return h("salla-placeholder", { alignment: "center", class: "s-scopes-placeholder" }, h("span", { slot: "title" }, salla.lang.get("blocks.scope.branch_looking_for_not_found")), h("span", { slot: "description" }, salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")));
158
158
  }
159
159
  defaultContent() {
160
- return [h("div", { class: "s-scopes-container s-scrollbar" }, this.scopes?.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, h("input", { id: `${this.selection} + '_scope_' + ${scope.id}`, name: "lang", type: "radio", value: scope.id, onChange: (event) => this.handleScopeSelection(event), class: "s-scopes-input", checked: !!this.current_scope && this.current_scope.id == scope.id }), h("label", { htmlFor: `${this.selection} + '_scope_' + ${scope.id}`, class: "s-scopes-label s-scopes-clickable" }, h("span", null, scope.name))))), this.footerContent()];
160
+ return [h("div", { class: "s-scopes-container s-scrollbar" }, this.scopes?.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, h("input", { id: `${this.selection} + '_scope_' + ${scope.id}`, name: "lang", type: "radio", value: scope.id, onChange: (event) => this.handleScopeSelection(event), class: "s-scopes-input", checked: !!this.current_scope && this.current_scope.id == scope.id }), h("label", { htmlFor: `${this.selection} + '_scope_' + ${scope.id}`, class: "s-scopes-label s-scopes-clickable" }, h("span", null, scope.icon && h("img", { src: scope.icon, alt: "", loading: "lazy", class: "s-scopes-icon" }), scope.name))))), this.footerContent()];
161
161
  }
162
162
  availabilityContent() {
163
163
  return h("div", { class: "s-scopes-container" }, this.scopes?.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, h("h2", { class: { "s-scopes-label": true, "s-scopes-clickable": this.mode === ModeType.DEFAULT } }, h("span", null, scope.name)), h("h2", { style: { 'color': scope?.availability?.color }, class: `s-scopes-${scope?.availability?.key}` }, scope?.availability?.label))));
@@ -69,12 +69,22 @@ export class SallaSearch {
69
69
  Helper.saveProductSource('search');
70
70
  this.commitSearchHistory(this.search_term);
71
71
  salla.event.emit('salla-search::product.clicked', [{ product, position }]);
72
+ this.modal?.close();
72
73
  },
73
74
  recommendationClick: (term, source) => {
74
75
  salla.event.emit('salla-search::recommendation.clicked', { term, source });
75
76
  },
76
77
  };
77
- salla.event.on('search::open', () => this.open());
78
+ }
79
+ connectedCallback() {
80
+ this.searchOpenListener = () => this.open();
81
+ salla.event.on('search::open', this.searchOpenListener);
82
+ }
83
+ disconnectedCallback() {
84
+ if (this.searchOpenListener) {
85
+ salla.event.off('search::open', this.searchOpenListener);
86
+ this.searchOpenListener = undefined;
87
+ }
78
88
  }
79
89
  async open() {
80
90
  if (!this.hasLoadedPopularSearches) {
@@ -19,6 +19,12 @@ export class SallaTabContent {
19
19
  name: this.name
20
20
  };
21
21
  }
22
+ componentWillLoad() {
23
+ const parent = this.host.closest('salla-tabs');
24
+ if (parent?.activeTab === this.name) {
25
+ this.isSelected = true;
26
+ }
27
+ }
22
28
  unselect() {
23
29
  this.isSelected = false;
24
30
  }
@@ -30,7 +36,7 @@ export class SallaTabContent {
30
36
  's-tabs-content': true,
31
37
  's-tabs-content-selected': this.isSelected
32
38
  };
33
- return (h("div", { key: '3107faffd358504438b464be5000682d403e1b22', class: classes }, h("slot", { key: 'e6fc9e480389b54f9e6e20a7c8ccdb880a4ee6d4' })));
39
+ return (h("div", { key: '251a33f54b1a8bb0fc4a424de86fe9e443ef6cf1', class: classes }, h("slot", { key: 'f7244cb7f510b7bde6ff34a64ef4ce043392b4fa' })));
34
40
  }
35
41
  static get is() { return "salla-tab-content"; }
36
42
  static get originalStyleUrls() {
@@ -58,7 +64,7 @@ export class SallaTabContent {
58
64
  "optional": false,
59
65
  "docs": {
60
66
  "tags": [],
61
- "text": "Set name of the tab content. Mainly used as a key to s\nynchronize the content with it's respective header."
67
+ "text": "Set name of the tab content. Mainly used as a key to synchronize the content with its respective header."
62
68
  },
63
69
  "getter": false,
64
70
  "setter": false,
@@ -92,4 +98,5 @@ export class SallaTabContent {
92
98
  }
93
99
  };
94
100
  }
101
+ static get elementRef() { return "host"; }
95
102
  }
@@ -9,18 +9,26 @@ import { h } from "@stencil/core";
9
9
  export class SallaTabs {
10
10
  constructor() {
11
11
  /**
12
- * Background color
12
+ * Background color for the tabs header section. Accepts any CSS color value.
13
13
  */
14
14
  this.backgroundColor = undefined;
15
15
  /**
16
- * Align tabs vertically.
16
+ * Whether to display tabs in a vertical layout. Default is false (horizontal layout).
17
17
  */
18
18
  this.vertical = false;
19
19
  }
20
- componentWillLoad() {
20
+ componentDidLoad() {
21
21
  this.createGroup().then(() => {
22
- const [group] = this.tabGroup;
23
- this.selectGroup(group);
22
+ if (this.activeTab) {
23
+ const group = this.tabGroup.find(g => g.header.name === this.activeTab);
24
+ if (group) {
25
+ this.selectGroup(group);
26
+ }
27
+ }
28
+ else {
29
+ const [group] = this.tabGroup;
30
+ this.selectGroup(group);
31
+ }
24
32
  });
25
33
  }
26
34
  onSelectedTab(event) {
@@ -49,8 +57,9 @@ export class SallaTabs {
49
57
  group.content.selected();
50
58
  }
51
59
  render() {
60
+ const headerStyle = this.backgroundColor ? { 'background-color': this.backgroundColor } : {};
52
61
  return [
53
- 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" })))
62
+ 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" })))
54
63
  ];
55
64
  }
56
65
  static get is() { return "salla-tabs"; }
@@ -79,7 +88,7 @@ export class SallaTabs {
79
88
  "optional": false,
80
89
  "docs": {
81
90
  "tags": [],
82
- "text": "Background color"
91
+ "text": "Background color for the tabs header section. Accepts any CSS color value."
83
92
  },
84
93
  "getter": false,
85
94
  "setter": false,
@@ -99,12 +108,31 @@ export class SallaTabs {
99
108
  "optional": false,
100
109
  "docs": {
101
110
  "tags": [],
102
- "text": "Align tabs vertically."
111
+ "text": "Whether to display tabs in a vertical layout. Default is false (horizontal layout)."
103
112
  },
104
113
  "getter": false,
105
114
  "setter": false,
106
115
  "reflect": false,
107
116
  "defaultValue": "false"
117
+ },
118
+ "activeTab": {
119
+ "type": "string",
120
+ "attribute": "active-tab",
121
+ "mutable": false,
122
+ "complexType": {
123
+ "original": "string",
124
+ "resolved": "string",
125
+ "references": {}
126
+ },
127
+ "required": false,
128
+ "optional": true,
129
+ "docs": {
130
+ "tags": [],
131
+ "text": "Initial active tab name for SSR. When provided, child components (salla-tab-header/salla-tab-content)\nwill use this value to set their initial active state. If not provided, first tab becomes active after hydration."
132
+ },
133
+ "getter": false,
134
+ "setter": false,
135
+ "reflect": false
108
136
  }
109
137
  };
110
138
  }
@@ -0,0 +1,105 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ /**
5
+ * SSR Helper Utilities
6
+ * These utilities provide a clean, reusable pattern for handling SSR-safe value resolution
7
+ * across components. The pattern: use provided prop value -> fallback to SDK when available -> use default.
8
+ */
9
+ /**
10
+ * Resolves a value using the SSR-safe pattern:
11
+ * 1. If prop value is provided, use it directly
12
+ * 2. If prop not provided and salla SDK is available, use SDK getter
13
+ * 3. If prop not provided and salla SDK not available (SSR), use fallback
14
+ *
15
+ * @param propValue - The value provided via component prop (can be undefined)
16
+ * @param sdkGetter - Function to get value from SDK when available
17
+ * @param fallback - Default value when neither prop nor SDK is available
18
+ * @returns The resolved value
19
+ *
20
+ * @example
21
+ * // Simple config value
22
+ * const color = getSdkValueOrFallback(
23
+ * this.color,
24
+ * () => salla.config.get('theme.color.primary', '#5dd5c4'),
25
+ * '#5dd5c4'
26
+ * );
27
+ *
28
+ * @example
29
+ * // With async SDK call
30
+ * const title = getSdkValueOrFallback(
31
+ * this.title,
32
+ * () => salla.lang.get('common.titles.products'),
33
+ * 'Products'
34
+ * );
35
+ */
36
+ export function getSdkValueOrFallback(propValue, sdkGetter, fallback) {
37
+ if (propValue !== undefined && propValue !== null) {
38
+ return propValue;
39
+ }
40
+ if (typeof salla !== 'undefined') {
41
+ return sdkGetter();
42
+ }
43
+ return fallback;
44
+ }
45
+ /**
46
+ * Async version for SDK calls that require onReady or async operations.
47
+ * Automatically calls salla.onReady() before executing sdkGetter.
48
+ *
49
+ * @param propValue - The value provided via component prop
50
+ * @param sdkGetter - Function to get value from SDK (onReady is called automatically)
51
+ * @param fallback - Default value when neither prop nor SDK is available
52
+ * @returns Promise resolving to the value
53
+ *
54
+ * @example
55
+ * const color = await getSdkValueOrFallbackAsync(
56
+ * this.color,
57
+ * () => salla.config.get('theme.color.primary', '#5dd5c4'),
58
+ * '#5dd5c4'
59
+ * );
60
+ */
61
+ export async function getSdkValueOrFallbackAsync(propValue, sdkGetter, fallback) {
62
+ if (propValue !== undefined && propValue !== null) {
63
+ return propValue;
64
+ }
65
+ if (typeof salla !== 'undefined') {
66
+ await salla.onReady();
67
+ return await sdkGetter();
68
+ }
69
+ return fallback;
70
+ }
71
+ /**
72
+ * SSR-safe check for salla SDK availability.
73
+ * Returns true in client-side context where salla is loaded.
74
+ *
75
+ * @returns boolean indicating if salla SDK is available
76
+ */
77
+ export function isSallaSdkAvailable() {
78
+ return typeof salla !== 'undefined';
79
+ }
80
+ /**
81
+ * Persists the active scope to both salla.storage and a cookie (same structure),
82
+ * so the scope is readable server-side. Use this everywhere the scope changes to
83
+ * keep storage and cookie in sync.
84
+ *
85
+ * @param scope - The scope object to persist (e.g. { type, id, ... })
86
+ */
87
+ export function setScope(scope) {
88
+ salla.storage.set('scope', scope);
89
+ if (typeof document !== 'undefined') {
90
+ document.cookie = `scope=${encodeURIComponent(JSON.stringify(scope))}; path=/; max-age=31536000; SameSite=Lax`;
91
+ }
92
+ }
93
+ /**
94
+ * SSR-safe document.dir access.
95
+ * Returns the document direction or fallback.
96
+ *
97
+ * @param fallback - Default direction ('rtl' or 'ltr')
98
+ * @returns The direction value
99
+ */
100
+ export function getDocumentDir(fallback = 'rtl') {
101
+ if (typeof document !== 'undefined' && document.dir) {
102
+ return document.dir;
103
+ }
104
+ return fallback;
105
+ }