@salla.sa/twilight-components 2.14.313 → 2.14.339

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 (255) hide show
  1. package/dist/cjs/{filepond-Cb19kTbw.js → filepond-hpLROc_m.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DVc66rcg.js → filepond-plugin-file-poster-C8gskRGl.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-BC6y9Sv3.js → filepond-plugin-file-validate-size-CaO6qVs6.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-npctEnon.js → filepond-plugin-file-validate-type-mUUtcgCs.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-CJrWzKcr.js → filepond-plugin-image-edit-rptDhPuc.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-CEZiujht.js → filepond-plugin-image-exif-orientation-B6L8W0Qe.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-Bk5_ED_I.js → filepond-plugin-image-preview-BoqOfOki.js} +1 -1
  8. package/dist/cjs/{index-DCJLMRDw.js → index-2liYDuhx.js} +583 -420
  9. package/dist/cjs/{index-CeCbuoue.js → index-ChHHnqio.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion_62.cjs.entry.js +164 -93
  12. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-apps-icons.cjs.entry.js +2 -2
  15. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-filters-widget.cjs.entry.js +60 -12
  20. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-hook.cjs.entry.js +2 -2
  22. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
  24. package/dist/cjs/salla-loyalty-program.cjs.entry.js +2 -2
  25. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-notification-item.cjs.entry.js +2 -2
  27. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +2 -2
  30. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
  32. package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
  33. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-payments.cjs.entry.js +3 -3
  36. package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
  37. package/dist/cjs/salla-review-card.cjs.entry.js +2 -2
  38. package/dist/cjs/salla-reviews-page.cjs.entry.js +2 -2
  39. package/dist/cjs/salla-reviews.cjs.entry.js +2 -2
  40. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  41. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  43. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  46. package/dist/cjs/twilight.cjs.js +2 -2
  47. package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +1 -1
  48. package/dist/collection/components/salla-button/salla-button.js +29 -13
  49. package/dist/collection/components/salla-comments/salla-comment-item.js +8 -3
  50. package/dist/collection/components/salla-comments/salla-comments.js +1 -1
  51. package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +62 -12
  52. package/dist/collection/components/salla-gifting/salla-gifting.js +3 -3
  53. package/dist/collection/components/salla-hook/salla-hook.js +1 -1
  54. package/dist/collection/components/salla-list-tile/salla-list-tile.js +1 -1
  55. package/dist/collection/components/salla-loading/salla-loading.js +1 -1
  56. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +1 -1
  57. package/dist/collection/components/salla-login-modal/salla-login-modal.js +15 -2
  58. package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +1 -1
  59. package/dist/collection/components/salla-loyalty-program/salla-loyalty-program.js +1 -1
  60. package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +1 -1
  61. package/dist/collection/components/salla-map/salla-map.js +3 -3
  62. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +1 -1
  63. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
  64. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -4
  65. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +2 -2
  66. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +1 -1
  67. package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
  68. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
  69. package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.js +1 -1
  70. package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
  71. package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
  72. package/dist/collection/components/salla-payments/salla-payments.js +2 -2
  73. package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
  74. package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
  75. package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
  76. package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
  77. package/dist/collection/components/salla-product-options/salla-product-options.js +37 -16
  78. package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
  79. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +13 -2
  80. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +2 -2
  81. package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
  82. package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
  83. package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
  84. package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
  85. package/dist/collection/components/salla-search/salla-search.js +3 -3
  86. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  87. package/dist/collection/components/salla-slider/salla-slider.js +2 -2
  88. package/dist/collection/components/salla-social/salla-social.js +1 -1
  89. package/dist/collection/components/salla-social-share/salla-social-share.js +5 -1
  90. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  91. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  92. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  93. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  94. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  95. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  96. package/dist/collection/plugins/commonjs-cache-fix.js +21 -0
  97. package/dist/components/axios.js +583 -420
  98. package/dist/components/index.js +2 -2
  99. package/dist/components/salla-apps-icons.js +1 -1
  100. package/dist/components/salla-button2.js +29 -13
  101. package/dist/components/salla-comment-item2.js +8 -3
  102. package/dist/components/salla-comments.js +1 -1
  103. package/dist/components/salla-filters-widget2.js +61 -11
  104. package/dist/components/salla-gifting.js +3 -3
  105. package/dist/components/salla-hook.js +1 -1
  106. package/dist/components/salla-list-tile2.js +1 -1
  107. package/dist/components/salla-loading2.js +1 -1
  108. package/dist/components/salla-localization-modal.js +1 -1
  109. package/dist/components/salla-login-modal.js +15 -2
  110. package/dist/components/salla-loyalty-prize-item.js +1 -1
  111. package/dist/components/salla-loyalty-program.js +1 -1
  112. package/dist/components/salla-maintenance-alert.js +1 -1
  113. package/dist/components/salla-map2.js +3 -3
  114. package/dist/components/salla-multiple-bundle-product-cart2.js +1 -1
  115. package/dist/components/salla-multiple-bundle-product-details2.js +2 -2
  116. package/dist/components/salla-multiple-bundle-product-options-modal2.js +4 -4
  117. package/dist/components/salla-multiple-bundle-product-slider2.js +2 -2
  118. package/dist/components/salla-multiple-bundle-product.js +1 -1
  119. package/dist/components/salla-notification-item2.js +1 -1
  120. package/dist/components/salla-offer-modal.js +1 -1
  121. package/dist/components/salla-order-details-multiple-bundle-product2.js +1 -1
  122. package/dist/components/salla-order-details.js +1 -1
  123. package/dist/components/salla-order-summary.js +1 -1
  124. package/dist/components/salla-payments.js +2 -2
  125. package/dist/components/salla-placeholder2.js +1 -1
  126. package/dist/components/salla-price-range2.js +2 -2
  127. package/dist/components/salla-product-availability2.js +1 -1
  128. package/dist/components/salla-product-card2.js +5 -5
  129. package/dist/components/salla-product-options2.js +37 -16
  130. package/dist/components/salla-product-size-guide.js +2 -2
  131. package/dist/components/salla-quantity-input.js +13 -2
  132. package/dist/components/salla-quick-buy2.js +6 -4
  133. package/dist/components/salla-review-card2.js +1 -1
  134. package/dist/components/salla-reviews-page.js +1 -1
  135. package/dist/components/salla-reviews.js +1 -1
  136. package/dist/components/salla-scopes.js +1 -1
  137. package/dist/components/salla-search.js +3 -3
  138. package/dist/components/salla-skeleton2.js +1 -1
  139. package/dist/components/salla-slider2.js +2 -2
  140. package/dist/components/salla-social-share.js +5 -1
  141. package/dist/components/salla-social.js +1 -1
  142. package/dist/components/salla-tab-content2.js +1 -1
  143. package/dist/components/salla-tab-header2.js +1 -1
  144. package/dist/components/salla-tabs2.js +1 -1
  145. package/dist/components/salla-tel-input2.js +1 -1
  146. package/dist/components/salla-tooltip2.js +1 -1
  147. package/dist/components/salla-user-settings.js +1 -1
  148. package/dist/esm/{filepond-9b3kZc-1.js → filepond-CwjnR_95.js} +1 -1
  149. package/dist/esm/{filepond-plugin-file-poster-CUQ3777V.js → filepond-plugin-file-poster-DES9KQfe.js} +1 -1
  150. package/dist/esm/{filepond-plugin-file-validate-size-Dfk5mlDB.js → filepond-plugin-file-validate-size-BcloWdhO.js} +1 -1
  151. package/dist/esm/{filepond-plugin-file-validate-type-BPui8oQ-.js → filepond-plugin-file-validate-type-CbjGxksB.js} +1 -1
  152. package/dist/esm/{filepond-plugin-image-edit-BHp0JfV4.js → filepond-plugin-image-edit-BtZ6aJg8.js} +1 -1
  153. package/dist/esm/{filepond-plugin-image-exif-orientation-BZ-x6UNo.js → filepond-plugin-image-exif-orientation-BVNb0UTU.js} +1 -1
  154. package/dist/esm/{filepond-plugin-image-preview-D_CJzbI7.js → filepond-plugin-image-preview-t1v2q4Jq.js} +1 -1
  155. package/dist/esm/{index-CtDnNMoY.js → index-CRmtzwUF.js} +583 -420
  156. package/dist/esm/{index-90xXQpPV.js → index-HmYGeOpS.js} +1 -1
  157. package/dist/esm/loader.js +3 -3
  158. package/dist/esm/salla-accordion_62.entry.js +164 -93
  159. package/dist/esm/salla-advertisement.entry.js +1 -1
  160. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  161. package/dist/esm/salla-apps-icons.entry.js +2 -2
  162. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  163. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  164. package/dist/esm/salla-contacts.entry.js +1 -1
  165. package/dist/esm/salla-custom-fields.entry.js +1 -1
  166. package/dist/esm/salla-filters-widget.entry.js +60 -12
  167. package/dist/esm/salla-filters.entry.js +1 -1
  168. package/dist/esm/salla-hook.entry.js +2 -2
  169. package/dist/esm/salla-installment.entry.js +1 -1
  170. package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
  171. package/dist/esm/salla-loyalty-program.entry.js +2 -2
  172. package/dist/esm/salla-metadata.entry.js +1 -1
  173. package/dist/esm/salla-notification-item.entry.js +2 -2
  174. package/dist/esm/salla-notifications.entry.js +1 -1
  175. package/dist/esm/salla-offer.entry.js +1 -1
  176. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +2 -2
  177. package/dist/esm/salla-order-details-options.entry.js +1 -1
  178. package/dist/esm/salla-order-details.entry.js +2 -2
  179. package/dist/esm/salla-order-summary.entry.js +2 -2
  180. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  181. package/dist/esm/salla-orders.entry.js +1 -1
  182. package/dist/esm/salla-payments.entry.js +3 -3
  183. package/dist/esm/salla-price-range.entry.js +3 -3
  184. package/dist/esm/salla-review-card.entry.js +2 -2
  185. package/dist/esm/salla-reviews-page.entry.js +2 -2
  186. package/dist/esm/salla-reviews.entry.js +2 -2
  187. package/dist/esm/salla-social.entry.js +2 -2
  188. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  189. package/dist/esm/salla-tooltip.entry.js +2 -2
  190. package/dist/esm/salla-trust-badges.entry.js +1 -1
  191. package/dist/esm/salla-verify.entry.js +1 -1
  192. package/dist/esm/salla-wallet.entry.js +1 -1
  193. package/dist/esm/twilight.js +3 -3
  194. package/dist/twilight/p-057e38a1.entry.js +4 -0
  195. package/dist/twilight/p-19f40612.entry.js +4 -0
  196. package/dist/twilight/{p-10c954ff.entry.js → p-1c31f335.entry.js} +1 -1
  197. package/dist/twilight/{p-6baecf00.entry.js → p-1f31af27.entry.js} +1 -1
  198. package/dist/twilight/{p-bcae2015.entry.js → p-21ced14f.entry.js} +1 -1
  199. package/dist/twilight/{p-edc30e8d.entry.js → p-2bb93ed0.entry.js} +1 -1
  200. package/dist/twilight/{p-751f8d64.entry.js → p-3862a37f.entry.js} +1 -1
  201. package/dist/twilight/{p-9006bd13.entry.js → p-3f45a06b.entry.js} +1 -1
  202. package/dist/twilight/{p-77dbe4d3.entry.js → p-403bef37.entry.js} +1 -1
  203. package/dist/twilight/{p-6a6ca941.entry.js → p-4317d018.entry.js} +1 -1
  204. package/dist/twilight/{p-6f1bf015.entry.js → p-45053a9b.entry.js} +1 -1
  205. package/dist/twilight/{p-90f48bbc.entry.js → p-48d76aa7.entry.js} +1 -1
  206. package/dist/twilight/{p-abb6acb7.entry.js → p-56d3794f.entry.js} +1 -1
  207. package/dist/twilight/{p-cfd1bd43.entry.js → p-69600ceb.entry.js} +1 -1
  208. package/dist/twilight/{p-257c97c7.entry.js → p-817fca09.entry.js} +1 -1
  209. package/dist/twilight/{p-7da316d9.entry.js → p-877ee446.entry.js} +1 -1
  210. package/dist/twilight/p-878f405f.entry.js +4 -0
  211. package/dist/twilight/{p-aad5ea17.entry.js → p-88c9cdc0.entry.js} +1 -1
  212. package/dist/twilight/p-8d231ba5.entry.js +4 -0
  213. package/dist/twilight/p-9108e972.entry.js +4 -0
  214. package/dist/twilight/p-95f3e7ea.entry.js +4 -0
  215. package/dist/twilight/{p-C99niCgx.js → p-BgkeXrDK.js} +1 -1
  216. package/dist/twilight/{p-Cu8zDA0W.js → p-BxtqlawD.js} +1 -1
  217. package/dist/twilight/p-CRmtzwUF.js +5 -0
  218. package/dist/twilight/{p-VBs0_gXo.js → p-DTy6dAEi.js} +1 -1
  219. package/dist/twilight/{p-RIImqj-k.js → p-DdMTtNYY.js} +1 -1
  220. package/dist/twilight/{p-ChN2gm1a.js → p-VCBBJkYb.js} +1 -1
  221. package/dist/twilight/{p-B3B6KApY.js → p-YYVkPdoE.js} +1 -1
  222. package/dist/twilight/{p-81cb2ef8.entry.js → p-a3ae644b.entry.js} +1 -1
  223. package/dist/twilight/{p-a0720857.entry.js → p-a4ad6d0b.entry.js} +1 -1
  224. package/dist/twilight/{p-66e73a02.entry.js → p-a665ff5d.entry.js} +1 -1
  225. package/dist/twilight/{p-95e20ce6.entry.js → p-a9bec6cf.entry.js} +1 -1
  226. package/dist/twilight/{p-b6834fe3.entry.js → p-b7f1e672.entry.js} +1 -1
  227. package/dist/twilight/p-c0f8d377.entry.js +11 -0
  228. package/dist/twilight/{p-2f30b7d6.entry.js → p-e98f8bae.entry.js} +1 -1
  229. package/dist/twilight/{p-23b0afa5.entry.js → p-eb6378eb.entry.js} +1 -1
  230. package/dist/twilight/{p-4cb3c829.entry.js → p-ef827c32.entry.js} +1 -1
  231. package/dist/twilight/{p-fdda110d.entry.js → p-f01949b5.entry.js} +1 -1
  232. package/dist/twilight/{p-9f895d32.entry.js → p-f10087fd.entry.js} +1 -1
  233. package/dist/twilight/{p-a48db011.entry.js → p-f33a5658.entry.js} +1 -1
  234. package/dist/twilight/p-f4dc16e8.entry.js +4 -0
  235. package/dist/twilight/{p-c1f93ef4.entry.js → p-f6a7b2cf.entry.js} +1 -1
  236. package/dist/twilight/{p-my_auvQd.js → p-sFNa2aTl.js} +1 -1
  237. package/dist/twilight/{p-CSuYUYU-.js → p-xAxNmkBV.js} +1 -1
  238. package/dist/twilight/twilight.esm.js +1 -1
  239. package/dist/types/components/salla-button/salla-button.d.ts +0 -1
  240. package/dist/types/components/salla-comments/interfaces.d.ts +1 -0
  241. package/dist/types/components/salla-comments/salla-comment-item.d.ts +1 -0
  242. package/dist/types/components/salla-filters-widget/salla-filters-widget.d.ts +7 -2
  243. package/dist/types/components/salla-product-options/salla-product-options.d.ts +8 -0
  244. package/dist/types/components/salla-quantity-input/salla-quantity-input.d.ts +5 -1
  245. package/dist/types/components/salla-social-share/salla-social-share.d.ts +1 -0
  246. package/package.json +5 -5
  247. package/dist/twilight/p-44c0c27c.entry.js +0 -4
  248. package/dist/twilight/p-742e5dad.entry.js +0 -4
  249. package/dist/twilight/p-7b38bcfd.entry.js +0 -4
  250. package/dist/twilight/p-98dc3c50.entry.js +0 -4
  251. package/dist/twilight/p-CtDnNMoY.js +0 -5
  252. package/dist/twilight/p-a93459da.entry.js +0 -4
  253. package/dist/twilight/p-b3299eeb.entry.js +0 -4
  254. package/dist/twilight/p-e32ffd30.entry.js +0 -11
  255. package/dist/twilight/p-e47e36d7.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as o}from"./p-CtDnNMoY.js";const i=class{constructor(t){s(this,t),this.bordered=!0,this.placeholderImage="images/placeholder.png",this.optionsData=[]}componentWillLoad(){this.parseOptionsData()}componentWillUpdate(){this.parseOptionsData()}parseOptionsData(){if(this.options)if("string"==typeof this.options)try{this.optionsData=JSON.parse(this.options)}catch(s){this.optionsData=[]}else this.optionsData=Array.isArray(this.options)?this.options:[];else this.optionsData=[]}renderOptionValue(s){return s.is_image?t("div",{class:"s-order-details-option-image-container"},t("a",{href:s.value,target:"_blank"},t("img",{class:"s-order-details-option-image",src:s.value||this.placeholderImage,alt:s.name}))):s.color?t("span",{title:s.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:s.color}}):s.is_file?t("a",{href:s.value,target:"_blank",class:"s-order-details-option-file-link"},"Attachments"):s.is_color_picker?t("div",{class:"s-order-details-option-color-picker"},t("div",{class:"s-order-details-option-color-picker-content"},t("span",{class:"s-order-details-option-color-picker-text"},s.value),t("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:s.value,width:"1rem"}})),t("salla-button",{onClick:t=>this.copyToClipboard(t,s.value),shape:"link",class:"s-order-details-option-color-picker-button"},t("span",{class:"s-order-details-option-color-copy-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n'}))):s.is_map&&s.latitude&&s.longitude?t("salla-map",{id:`location_map_${s.id}`,class:`map_${s.id}`,zoom:15,readonly:!0,lat:s.latitude,lng:s.longitude},t("div",{slot:"button"},t("button",{type:"button",class:"s-order-details-option-map-button",onClick:()=>this.openMap(s.id)},"Show Location"))):t("span",{class:"s-order-details-option-default-text"},s.display_value||s.value)}copyToClipboard(s,t){s.preventDefault(),navigator.clipboard&&navigator.clipboard.writeText(t)}openMap(s){const t=document.querySelector(`salla-map.map_${s}`);t&&t.open&&t.open()}render(){if(!this.optionsData.length)return null;const s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return t(o,{class:"s-order-details-options-wrapper"},t("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),t("div",{class:s},t("dl",{class:"s-order-details-options-list"},this.optionsData.map((s=>t("div",{key:s.id,class:"s-order-details-options-item"},t("dt",{class:"s-order-details-options-item-name"},s.name,":"),t("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},this.renderOptionValue(s))))))))}};i.style="";export{i as salla_order_details_options}
4
+ import{r as s,h as t,H as o}from"./p-CRmtzwUF.js";const i=class{constructor(t){s(this,t),this.bordered=!0,this.placeholderImage="images/placeholder.png",this.optionsData=[]}componentWillLoad(){this.parseOptionsData()}componentWillUpdate(){this.parseOptionsData()}parseOptionsData(){if(this.options)if("string"==typeof this.options)try{this.optionsData=JSON.parse(this.options)}catch(s){this.optionsData=[]}else this.optionsData=Array.isArray(this.options)?this.options:[];else this.optionsData=[]}renderOptionValue(s){return s.is_image?t("div",{class:"s-order-details-option-image-container"},t("a",{href:s.value,target:"_blank"},t("img",{class:"s-order-details-option-image",src:s.value||this.placeholderImage,alt:s.name}))):s.color?t("span",{title:s.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:s.color}}):s.is_file?t("a",{href:s.value,target:"_blank",class:"s-order-details-option-file-link"},"Attachments"):s.is_color_picker?t("div",{class:"s-order-details-option-color-picker"},t("div",{class:"s-order-details-option-color-picker-content"},t("span",{class:"s-order-details-option-color-picker-text"},s.value),t("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:s.value,width:"1rem"}})),t("salla-button",{onClick:t=>this.copyToClipboard(t,s.value),shape:"link",class:"s-order-details-option-color-picker-button"},t("span",{class:"s-order-details-option-color-copy-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n'}))):s.is_map&&s.latitude&&s.longitude?t("salla-map",{id:`location_map_${s.id}`,class:`map_${s.id}`,zoom:15,readonly:!0,lat:s.latitude,lng:s.longitude},t("div",{slot:"button"},t("button",{type:"button",class:"s-order-details-option-map-button",onClick:()=>this.openMap(s.id)},"Show Location"))):t("span",{class:"s-order-details-option-default-text"},s.display_value||s.value)}copyToClipboard(s,t){s.preventDefault(),navigator.clipboard&&navigator.clipboard.writeText(t)}openMap(s){const t=document.querySelector(`salla-map.map_${s}`);t&&t.open&&t.open()}render(){if(!this.optionsData.length)return null;const s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return t(o,{class:"s-order-details-options-wrapper"},t("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),t("div",{class:s},t("dl",{class:"s-order-details-options-list"},this.optionsData.map((s=>t("div",{key:s.id,class:"s-order-details-options-item"},t("dt",{class:"s-order-details-options-item-name"},s.name,":"),t("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},this.renderOptionValue(s))))))))}};i.style="";export{i as salla_order_details_options}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as s,a as o}from"./p-CtDnNMoY.js";import{H as e}from"./p-Dljb4XCt.js";import"./p-CgtvEd63.js";const a=class{constructor(s){t(this,s),this.orderNumberText=salla.lang.get("pages.thank_you.order_id"),this.totalOrderText=salla.lang.get("pages.orders.total"),this.orderDateText=salla.lang.get("pages.orders.date"),this.orderStatusText=salla.lang.get("pages.orders.status"),this.noOrderText=salla.lang.get("pages.orders.non_orders"),this.load_more_text_trans=salla.lang.get("common.elements.load_more"),this.languageCode=salla.lang.locale,this.orders=[],salla.lang.onLoaded((()=>{this.languageCode=salla.lang.locale,this.orderNumberText=salla.lang.get("pages.thank_you.order_id"),this.totalOrderText=salla.lang.get("pages.orders.total"),this.orderDateText=salla.lang.get("pages.orders.date"),this.orderStatusText=salla.lang.get("pages.orders.status"),this.noOrderText=salla.lang.get("pages.orders.non_orders"),this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}loading(t=!0){let s=this.status?.querySelector(".s-button-text");s&&(e.toggleElementClassIf(s,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none")}initiateInfiniteScroll(){this.hasInfiniteScroll&&(this.wrapper?(this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!1,nextPage:this.nextPage,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.loading()})),this.infiniteScroll?.on("load",(t=>{this.loading(!1),this.pagination=t.pagination,this.nextPage=t.pagination?.links?.next||null,this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)}));let s=this.host.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(s)})),this.infiniteScroll?.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))):salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll."))}async loadMore(){this.infiniteScroll.loadNextPage()}handleResponse(t){return t.map((t=>this.getSingleOrderItem(t)))}async loadInitialData(){const t=new URL(window.location.href);await salla.order.api.fetch({...this.params,types:[""],feedback_status:t.searchParams.get("feedback_status")}).then((t=>{if(this.orders=t.data,this.hasInfiniteScroll=!!t.pagination?.links.next,this.pagination=t.pagination,this.total=t.pagination?.total,this.nextPage=t.pagination?.links?.next||null,!this.orders.length)return this.showPlaceholder=!0,this.loading(!1);setTimeout((()=>{this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)})),this.initiateInfiniteScroll();let s=this.wrapper.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(s)}),100)})).catch((t=>{this.showPlaceholder=!0,this.loading(!1),salla.logger.error(t)}))}getSingleOrderItem(t){const s=document.createElement("tr");s.classList.add("s-orders-table-tbody-tr","s-orders-table-tbody-tr-shadow");const o=document.createElement("td");o.classList.add("s-orders-table-tbody-tr-td");const a=document.createElement("div");a.classList.add("s-orders-table-tbody-tr-td-content");const r=document.createElement("span");r.classList.add("s-orders-mobile-title"),r.textContent=this.orderNumberText+":";const n=document.createElement("span");if(n.classList.add("s-orders-reference-id"),n.textContent="#"+t.reference_id,a.appendChild(r),a.appendChild(n),"buy_as_gift"==t.source){const t=document.createElement("i");t.classList.add("sicon-gift-sharing","s-orders-buy-as-gift-icon"),a.appendChild(t)}const i=document.createElement("a");i.href=t.url,a.appendChild(i);const d=document.createElement("div");d.classList.add("s-orders-copy-to-clipboard-button");const l=document.createElement("salla-button");l.classList.add("relative"),l.setAttribute("color","dark"),l.setAttribute("shape","link"),l.dataset.content=t.reference_id.toString(),l.addEventListener("click",(t=>{e.copyToClipboard(t),e.toggleElementClassIf(l,"copied","code-to-copy",(()=>!0)),setTimeout((()=>{e.toggleElementClassIf(l,"code-to-copy","copied",(()=>!0))}),1e3)}));const c=document.createElement("span");c.textContent="#"+t.reference_id;const h=document.createElement("i");h.classList.add("sicon-swap-stroke","s-orders-copy-to-clipboard-button-icon"),salla.config.get("theme.is_rtl",!0)?(l.appendChild(h),l.appendChild(c)):(l.appendChild(c),l.appendChild(h)),d.appendChild(l),a.appendChild(d),o.appendChild(a),s.appendChild(o);const u=document.createElement("td");u.classList.add("s-orders-table-tbody-tr-td");const b=document.createElement("div");b.classList.add("s-orders-table-tbody-tr-td-content");const m=document.createElement("span");m.classList.add("s-orders-mobile-title"),m.textContent=this.totalOrderText+":";const p=document.createElement("div");p.innerHTML=salla.money(t.total);const y=document.createElement("a");y.href=t.url,b.appendChild(m),b.appendChild(p),b.appendChild(y),u.appendChild(b),s.appendChild(u);const g=document.createElement("td");g.classList.add("s-orders-table-tbody-tr-td");const f=document.createElement("div");f.classList.add("s-orders-table-tbody-tr-td-content");const _=document.createElement("span");_.classList.add("s-orders-mobile-title"),_.textContent=this.orderDateText+":";const v=document.createElement("div");v.textContent=e.formatDateFromString(t.created_at.date,salla.helpers.number,this.languageCode);const k=document.createElement("a");k.href=t.url,f.appendChild(_),f.appendChild(v),f.appendChild(k),g.appendChild(f),s.appendChild(g);const w=document.createElement("td");w.classList.add("s-orders-table-tbody-tr-td");const x=document.createElement("div");x.classList.add("s-orders-table-tbody-tr-td-content");const C=document.createElement("span");C.classList.add("s-orders-mobile-title"),C.textContent=this.orderStatusText+":";const j=document.createElement("span");j.classList.add("s-orders-status-container"),j.style.color=t.status.color;const D=document.createElement("i");D.classList.add(t.status.icon);const I=document.createElement("span");I.textContent=t.status.name,j.appendChild(D),j.appendChild(I),x.appendChild(C),x.appendChild(j);const T=document.createElement("i");T.classList.add("sicon-star2","s-orders-status-rated",t.is_rated?"s-orders-rated-text":"s-orders-unrated-text"),x.appendChild(T);const E=document.createElement("a");return E.href=t.url,x.appendChild(E),w.appendChild(x),s.appendChild(w),s}render(){return this.showPlaceholder?s("div",{class:"s-orders-no-content"},s("i",{class:"sicon-packed-box icon"}),s("p",null,this.noOrderText)):s("div",{class:"s-orders-wrapper"},s("table",{class:"s-orders-table"},s("thead",{class:"s-orders-table-head"},s("tr",{class:"s-orders-table-head-tr"},s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderNumberText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.totalOrderText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderDateText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderStatusText))),s("tbody",{class:"s-orders-table-tbody",ref:t=>this.wrapper=t})),this.nextPage&&s("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},s("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},s("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText??this.load_more_text_trans),s("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))))}componentWillLoad(){return salla.onReady().then((()=>this.loadInitialData())).then((()=>this.initiateInfiniteScroll()))}get host(){return o(this)}};a.style=":host{display:block}";export{a as salla_orders}
4
+ import{r as t,h as s,a as o}from"./p-CRmtzwUF.js";import{H as e}from"./p-Dljb4XCt.js";import"./p-CgtvEd63.js";const a=class{constructor(s){t(this,s),this.orderNumberText=salla.lang.get("pages.thank_you.order_id"),this.totalOrderText=salla.lang.get("pages.orders.total"),this.orderDateText=salla.lang.get("pages.orders.date"),this.orderStatusText=salla.lang.get("pages.orders.status"),this.noOrderText=salla.lang.get("pages.orders.non_orders"),this.load_more_text_trans=salla.lang.get("common.elements.load_more"),this.languageCode=salla.lang.locale,this.orders=[],salla.lang.onLoaded((()=>{this.languageCode=salla.lang.locale,this.orderNumberText=salla.lang.get("pages.thank_you.order_id"),this.totalOrderText=salla.lang.get("pages.orders.total"),this.orderDateText=salla.lang.get("pages.orders.date"),this.orderStatusText=salla.lang.get("pages.orders.status"),this.noOrderText=salla.lang.get("pages.orders.non_orders"),this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}loading(t=!0){let s=this.status?.querySelector(".s-button-text");s&&(e.toggleElementClassIf(s,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none")}initiateInfiniteScroll(){this.hasInfiniteScroll&&(this.wrapper?(this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!1,nextPage:this.nextPage,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.loading()})),this.infiniteScroll?.on("load",(t=>{this.loading(!1),this.pagination=t.pagination,this.nextPage=t.pagination?.links?.next||null,this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)}));let s=this.host.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(s)})),this.infiniteScroll?.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))):salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll."))}async loadMore(){this.infiniteScroll.loadNextPage()}handleResponse(t){return t.map((t=>this.getSingleOrderItem(t)))}async loadInitialData(){const t=new URL(window.location.href);await salla.order.api.fetch({...this.params,types:[""],feedback_status:t.searchParams.get("feedback_status")}).then((t=>{if(this.orders=t.data,this.hasInfiniteScroll=!!t.pagination?.links.next,this.pagination=t.pagination,this.total=t.pagination?.total,this.nextPage=t.pagination?.links?.next||null,!this.orders.length)return this.showPlaceholder=!0,this.loading(!1);setTimeout((()=>{this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)})),this.initiateInfiniteScroll();let s=this.wrapper.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(s)}),100)})).catch((t=>{this.showPlaceholder=!0,this.loading(!1),salla.logger.error(t)}))}getSingleOrderItem(t){const s=document.createElement("tr");s.classList.add("s-orders-table-tbody-tr","s-orders-table-tbody-tr-shadow");const o=document.createElement("td");o.classList.add("s-orders-table-tbody-tr-td");const a=document.createElement("div");a.classList.add("s-orders-table-tbody-tr-td-content");const r=document.createElement("span");r.classList.add("s-orders-mobile-title"),r.textContent=this.orderNumberText+":";const n=document.createElement("span");if(n.classList.add("s-orders-reference-id"),n.textContent="#"+t.reference_id,a.appendChild(r),a.appendChild(n),"buy_as_gift"==t.source){const t=document.createElement("i");t.classList.add("sicon-gift-sharing","s-orders-buy-as-gift-icon"),a.appendChild(t)}const i=document.createElement("a");i.href=t.url,a.appendChild(i);const d=document.createElement("div");d.classList.add("s-orders-copy-to-clipboard-button");const l=document.createElement("salla-button");l.classList.add("relative"),l.setAttribute("color","dark"),l.setAttribute("shape","link"),l.dataset.content=t.reference_id.toString(),l.addEventListener("click",(t=>{e.copyToClipboard(t),e.toggleElementClassIf(l,"copied","code-to-copy",(()=>!0)),setTimeout((()=>{e.toggleElementClassIf(l,"code-to-copy","copied",(()=>!0))}),1e3)}));const c=document.createElement("span");c.textContent="#"+t.reference_id;const h=document.createElement("i");h.classList.add("sicon-swap-stroke","s-orders-copy-to-clipboard-button-icon"),salla.config.get("theme.is_rtl",!0)?(l.appendChild(h),l.appendChild(c)):(l.appendChild(c),l.appendChild(h)),d.appendChild(l),a.appendChild(d),o.appendChild(a),s.appendChild(o);const u=document.createElement("td");u.classList.add("s-orders-table-tbody-tr-td");const b=document.createElement("div");b.classList.add("s-orders-table-tbody-tr-td-content");const m=document.createElement("span");m.classList.add("s-orders-mobile-title"),m.textContent=this.totalOrderText+":";const p=document.createElement("div");p.innerHTML=salla.money(t.total);const y=document.createElement("a");y.href=t.url,b.appendChild(m),b.appendChild(p),b.appendChild(y),u.appendChild(b),s.appendChild(u);const g=document.createElement("td");g.classList.add("s-orders-table-tbody-tr-td");const f=document.createElement("div");f.classList.add("s-orders-table-tbody-tr-td-content");const _=document.createElement("span");_.classList.add("s-orders-mobile-title"),_.textContent=this.orderDateText+":";const v=document.createElement("div");v.textContent=e.formatDateFromString(t.created_at.date,salla.helpers.number,this.languageCode);const k=document.createElement("a");k.href=t.url,f.appendChild(_),f.appendChild(v),f.appendChild(k),g.appendChild(f),s.appendChild(g);const w=document.createElement("td");w.classList.add("s-orders-table-tbody-tr-td");const x=document.createElement("div");x.classList.add("s-orders-table-tbody-tr-td-content");const C=document.createElement("span");C.classList.add("s-orders-mobile-title"),C.textContent=this.orderStatusText+":";const j=document.createElement("span");j.classList.add("s-orders-status-container"),j.style.color=t.status.color;const I=document.createElement("i");I.classList.add(t.status.icon);const R=document.createElement("span");R.textContent=t.status.name,j.appendChild(I),j.appendChild(R),x.appendChild(C),x.appendChild(j);const T=document.createElement("i");T.classList.add("sicon-star2","s-orders-status-rated",t.is_rated?"s-orders-rated-text":"s-orders-unrated-text"),x.appendChild(T);const D=document.createElement("a");return D.href=t.url,x.appendChild(D),w.appendChild(x),s.appendChild(w),s}render(){return this.showPlaceholder?s("div",{class:"s-orders-no-content"},s("i",{class:"sicon-packed-box icon"}),s("p",null,this.noOrderText)):s("div",{class:"s-orders-wrapper"},s("table",{class:"s-orders-table"},s("thead",{class:"s-orders-table-head"},s("tr",{class:"s-orders-table-head-tr"},s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderNumberText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.totalOrderText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderDateText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderStatusText))),s("tbody",{class:"s-orders-table-tbody",ref:t=>this.wrapper=t})),this.nextPage&&s("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},s("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},s("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText??this.load_more_text_trans),s("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))))}componentWillLoad(){return salla.onReady().then((()=>this.loadInitialData())).then((()=>this.initiateInfiniteScroll()))}get host(){return o(this)}};a.style=":host{display:block}";export{a as salla_orders}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,H as r}from"./p-CtDnNMoY.js";var s;!function(e){e.PERCENTAGE="percentage",e.FIXED="fixed"}(s||(s={}));const i={staticIcons:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>'],staticColors:["#993018","#444444","#D18F36","#315F9C"]};class o{static findTierByIndex(e,t){return e.find((e=>e.index===t))||null}static findTierByName(e,t){return e.find((e=>e.tier_name===t))||null}static getTierNameByIndex(e,t){return this.findTierByIndex(e,t)?.tier_name}static findCurrentTierIndex(e,t){if(!t)return 0;for(let r=t.length-1;r>=0;r--)if(e>=t[r].threshold)return t[r].index;return 0}}const n=class{constructor(t){e(this,t),this.currentTierIndex=0,this.canRender=!1,this.isLoading=!1,this.handleTabClick=e=>{this.activeTabTier=e},salla.lang.onLoaded((()=>{this.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title"),this.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier"),this.discountText=salla.lang.get("blocks.tiered_offer.discount"),this.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}async componentWillLoad(){try{if(await salla.onReady(),!this.checkFeatureEnabled())return;if(!this.checkCartExists())return;this.isLoading=!0;const e=await this.fetchTieredOfferData();if(!e)return;this.initializeComponent(e)}catch(e){this.canRender=!1,salla.logger.warn("salla-tiered-offer:: ",e)}finally{this.isLoading=!1}}checkFeatureEnabled(){return salla.config.get("store.features")?.includes("tiered-offer")}checkCartExists(){return!!salla.storage.get("cart")?.summary?.count}validateCouponCompatibility(e,t){return!(t&&!e.details?.applied_with_coupon)}async fetchTieredOfferData(){try{const{data:e}=await salla.api.cart.offers(),t=e.find((e=>"tiered_offer"===e.type));return t?this.validateCouponCompatibility(t,salla.storage.get("cart")?.coupon)?t:(this.canRender=!1,null):null}catch(e){throw e}}initializeComponent(e){this.apiOfferData=e,this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData),this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;const t=this.findCurrentTierIndex(this.apiOfferData.details?.current_value||0);0!==t?(this.currentTierIndex=t,this.currentTier=o.getTierNameByIndex(this.tieredOfferData.tiers,t),this.activeTabTier=this.currentTier,this.canRender=!0):this.canRender=!1}componentDidLoad(){salla.event.on("cart::updated",(async e=>{const t=await this.fetchTieredOfferData();t&&this.updateOfferValues(e,t)}))}mapApiDataToTiers(e){const t=[...e.details.discounts].sort(((e,t)=>e.min_spend-t.min_spend)).map(((e,t)=>({name:e.name,tier_name:e.name,discount:e.type===s.PERCENTAGE?`${salla.helpers.number(e.value)}%`:salla.money(e.value),icon:i.staticIcons[t]||i.staticIcons[0],threshold:e.min_spend,text_color:i.staticColors[t],index:t+1})));return{current_tier:o.getTierNameByIndex(t,this.findCurrentTierIndex(e.details.current_value,t)),tiers:t}}findCurrentTierIndex(e,t=this.tieredOfferData?.tiers){return o.findCurrentTierIndex(e,t||[])}updateOfferValues(e,t){if(!t||!this.tieredOfferData)return;if(!this.validateCouponCompatibility(t,e.coupon))return void(this.canRender=!1);if(this.canRender=!0,!1===t.details?.with_current_cart)return;const r=t.details?.current_value||0;this.apiOfferData=t;const s=this.findCurrentTierIndex(r);0!==s?(this.canRender=!0,this.currentTierIndex=s,this.currentTier=o.getTierNameByIndex(this.tieredOfferData.tiers,s),this.activeTabTier!==this.currentTier&&(this.activeTabTier=this.currentTier)):this.canRender=!1}getLoadingSkeletonView(){return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-skeleton-wrapper"},t("div",{class:"s-tiered-offer-skeleton-title"},t("salla-skeleton",{height:"16px",width:"40%"})),t("div",{class:"s-tiered-offer-skeleton-subtitle"},t("salla-skeleton",{height:"20px",width:"60%"})),t("div",{class:"s-tiered-offer-skeleton-progress"},t("salla-skeleton",{height:"16px",width:"100%"})),t("div",{class:"s-tiered-offer-skeleton-tabs"},t("salla-skeleton",{height:"50px",width:"100%"})))))}getCurrentTierData(){return o.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]}getProgressWidth(){const e=this.tieredOfferData.tiers.length;return this.findCurrentTierIndex(this.apiOfferData.details?.current_value||0)/e*100}calculateMilestonePosition(e,t){return 1===t?"calc(100% - 18px)":`${Math.max(2,Math.min(95,(e+1)/t*100-8/t))}%`}getMilestoneStyles(e,t,r){const s="rtl"===document.documentElement.dir,i=this.calculateMilestonePosition(t,r),o=e.name.length>6?"flex-end":"center";return{[s?"right":"left"]:i,alignItems:o,position:"absolute",transform:s?"translateX(50%)":"translateX(-50%)"}}getMilestoneIconStyles(e,t,r){return t?{color:e.text_color}:r?{color:"var(--color-primary)"}:{}}renderProgressBarBackground(e){return[t("div",{class:"s-tiered-offer-progress-bg"}),t("div",{class:"s-tiered-offer-progress-fill",style:{width:`${e}%`}})]}renderMilestoneIcon(e,r,s){const i=["s-tiered-offer-milestone-icon",r?"s-tiered-offer-milestone-active":"",s?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return t("div",{class:i,style:this.getMilestoneIconStyles(e,r,s)},t("span",{innerHTML:e.icon}))}renderMilestoneName(e,r){return t("div",{class:"s-tiered-offer-milestone-name"},r&&t("span",{style:{color:e.text_color}},e.name))}renderMilestones(e,r){return t("div",{class:"s-tiered-offer-milestones-wrapper"},t("div",{class:1===r?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones"},this.tieredOfferData.tiers.map(((s,i)=>{const o=e>=s.threshold,n=s.tier_name===this.currentTier;return t("div",{class:"s-tiered-offer-milestone",style:this.getMilestoneStyles(s,i,r)},this.renderMilestoneIcon(s,n,o),this.renderMilestoneName(s,n))}))))}renderProgressBar(){const e=this.getProgressWidth(),r=this.tieredOfferData.tiers.length,s=this.apiOfferData.details?.current_value||0;return t("div",{class:"s-tiered-offer-progress-container"},t("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(e),this.renderMilestones(s,r)))}renderTabs(){return t("div",{class:"s-tiered-offer-tabs-container"},t("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((e=>t("button",{class:"s-tiered-offer-tab-header "+(e.tier_name===this.activeTabTier?"s-tiered-offer-tab-active":""),onClick:()=>this.handleTabClick(e.tier_name)},t("span",null,e.name))))),t("div",{class:"s-tiered-offer-tab-content-wrapper"},(()=>{const e=o.findTierByName(this.tieredOfferData.tiers,this.activeTabTier);return e?t("div",{class:"s-tiered-offer-tab-content"},t("div",{class:"s-tiered-offer-tab-content-inner"},t("div",{class:"s-tiered-offer-discount-section"},t("p",{class:"s-tiered-offer-discount-title"},this.discountText," ",t("span",{innerHTML:e.discount})),t("p",{class:"s-tiered-offer-benefit-description"},this.benefitText," ",e.name)))):null})()))}render(){if(this.isLoading)return this.getLoadingSkeletonView();if(!this.canRender||!this.tieredOfferData)return null;const e=this.getCurrentTierData();return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-header"},t("div",{class:"s-tiered-offer-header-content"},t("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),t("div",{class:"s-tiered-offer-current-tier-name-wrapper"},t("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",t("span",{class:"s-tiered-offer-tier-name"},e.name)),t("span",{innerHTML:e.icon})))),this.renderProgressBar(),this.renderTabs()))}};n.style=".s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{transform:scaleX(-1)}";export{n as salla_tiered_offer}
4
+ import{r as e,h as t,H as r}from"./p-CRmtzwUF.js";var s;!function(e){e.PERCENTAGE="percentage",e.FIXED="fixed"}(s||(s={}));const i={staticIcons:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>'],staticColors:["#993018","#444444","#D18F36","#315F9C"]};class o{static findTierByIndex(e,t){return e.find((e=>e.index===t))||null}static findTierByName(e,t){return e.find((e=>e.tier_name===t))||null}static getTierNameByIndex(e,t){return this.findTierByIndex(e,t)?.tier_name}static findCurrentTierIndex(e,t){if(!t)return 0;for(let r=t.length-1;r>=0;r--)if(e>=t[r].threshold)return t[r].index;return 0}}const n=class{constructor(t){e(this,t),this.currentTierIndex=0,this.canRender=!1,this.isLoading=!1,this.handleTabClick=e=>{this.activeTabTier=e},salla.lang.onLoaded((()=>{this.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title"),this.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier"),this.discountText=salla.lang.get("blocks.tiered_offer.discount"),this.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}async componentWillLoad(){try{if(await salla.onReady(),!this.checkFeatureEnabled())return;if(!this.checkCartExists())return;this.isLoading=!0;const e=await this.fetchTieredOfferData();if(!e)return;this.initializeComponent(e)}catch(e){this.canRender=!1,salla.logger.warn("salla-tiered-offer:: ",e)}finally{this.isLoading=!1}}checkFeatureEnabled(){return salla.config.get("store.features")?.includes("tiered-offer")}checkCartExists(){return!!salla.storage.get("cart")?.summary?.count}validateCouponCompatibility(e,t){return!(t&&!e.details?.applied_with_coupon)}async fetchTieredOfferData(){try{const{data:e}=await salla.api.cart.offers(),t=e.find((e=>"tiered_offer"===e.type));return t?this.validateCouponCompatibility(t,salla.storage.get("cart")?.coupon)?t:(this.canRender=!1,null):null}catch(e){throw e}}initializeComponent(e){this.apiOfferData=e,this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData),this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;const t=this.findCurrentTierIndex(this.apiOfferData.details?.current_value||0);0!==t?(this.currentTierIndex=t,this.currentTier=o.getTierNameByIndex(this.tieredOfferData.tiers,t),this.activeTabTier=this.currentTier,this.canRender=!0):this.canRender=!1}componentDidLoad(){salla.event.on("cart::updated",(async e=>{const t=await this.fetchTieredOfferData();t&&this.updateOfferValues(e,t)}))}mapApiDataToTiers(e){const t=[...e.details.discounts].sort(((e,t)=>e.min_spend-t.min_spend)).map(((e,t)=>({name:e.name,tier_name:e.name,discount:e.type===s.PERCENTAGE?`${salla.helpers.number(e.value)}%`:salla.money(e.value),icon:i.staticIcons[t]||i.staticIcons[0],threshold:e.min_spend,text_color:i.staticColors[t],index:t+1})));return{current_tier:o.getTierNameByIndex(t,this.findCurrentTierIndex(e.details.current_value,t)),tiers:t}}findCurrentTierIndex(e,t=this.tieredOfferData?.tiers){return o.findCurrentTierIndex(e,t||[])}updateOfferValues(e,t){if(!t||!this.tieredOfferData)return;if(!this.validateCouponCompatibility(t,e.coupon))return void(this.canRender=!1);if(this.canRender=!0,!1===t.details?.with_current_cart)return;const r=t.details?.current_value||0;this.apiOfferData=t;const s=this.findCurrentTierIndex(r);0!==s?(this.canRender=!0,this.currentTierIndex=s,this.currentTier=o.getTierNameByIndex(this.tieredOfferData.tiers,s),this.activeTabTier!==this.currentTier&&(this.activeTabTier=this.currentTier)):this.canRender=!1}getLoadingSkeletonView(){return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-skeleton-wrapper"},t("div",{class:"s-tiered-offer-skeleton-title"},t("salla-skeleton",{height:"16px",width:"40%"})),t("div",{class:"s-tiered-offer-skeleton-subtitle"},t("salla-skeleton",{height:"20px",width:"60%"})),t("div",{class:"s-tiered-offer-skeleton-progress"},t("salla-skeleton",{height:"16px",width:"100%"})),t("div",{class:"s-tiered-offer-skeleton-tabs"},t("salla-skeleton",{height:"50px",width:"100%"})))))}getCurrentTierData(){return o.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]}getProgressWidth(){const e=this.tieredOfferData.tiers.length;return this.findCurrentTierIndex(this.apiOfferData.details?.current_value||0)/e*100}calculateMilestonePosition(e,t){return 1===t?"calc(100% - 18px)":`${Math.max(2,Math.min(95,(e+1)/t*100-8/t))}%`}getMilestoneStyles(e,t,r){const s="rtl"===document.documentElement.dir,i=this.calculateMilestonePosition(t,r),o=e.name.length>6?"flex-end":"center";return{[s?"right":"left"]:i,alignItems:o,position:"absolute",transform:s?"translateX(50%)":"translateX(-50%)"}}getMilestoneIconStyles(e,t,r){return t?{color:e.text_color}:r?{color:"var(--color-primary)"}:{}}renderProgressBarBackground(e){return[t("div",{class:"s-tiered-offer-progress-bg"}),t("div",{class:"s-tiered-offer-progress-fill",style:{width:`${e}%`}})]}renderMilestoneIcon(e,r,s){const i=["s-tiered-offer-milestone-icon",r?"s-tiered-offer-milestone-active":"",s?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return t("div",{class:i,style:this.getMilestoneIconStyles(e,r,s)},t("span",{innerHTML:e.icon}))}renderMilestoneName(e,r){return t("div",{class:"s-tiered-offer-milestone-name"},r&&t("span",{style:{color:e.text_color}},e.name))}renderMilestones(e,r){return t("div",{class:"s-tiered-offer-milestones-wrapper"},t("div",{class:1===r?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones"},this.tieredOfferData.tiers.map(((s,i)=>{const o=e>=s.threshold,n=s.tier_name===this.currentTier;return t("div",{class:"s-tiered-offer-milestone",style:this.getMilestoneStyles(s,i,r)},this.renderMilestoneIcon(s,n,o),this.renderMilestoneName(s,n))}))))}renderProgressBar(){const e=this.getProgressWidth(),r=this.tieredOfferData.tiers.length,s=this.apiOfferData.details?.current_value||0;return t("div",{class:"s-tiered-offer-progress-container"},t("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(e),this.renderMilestones(s,r)))}renderTabs(){return t("div",{class:"s-tiered-offer-tabs-container"},t("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((e=>t("button",{class:"s-tiered-offer-tab-header "+(e.tier_name===this.activeTabTier?"s-tiered-offer-tab-active":""),onClick:()=>this.handleTabClick(e.tier_name)},t("span",null,e.name))))),t("div",{class:"s-tiered-offer-tab-content-wrapper"},(()=>{const e=o.findTierByName(this.tieredOfferData.tiers,this.activeTabTier);return e?t("div",{class:"s-tiered-offer-tab-content"},t("div",{class:"s-tiered-offer-tab-content-inner"},t("div",{class:"s-tiered-offer-discount-section"},t("p",{class:"s-tiered-offer-discount-title"},this.discountText," ",t("span",{innerHTML:e.discount})),t("p",{class:"s-tiered-offer-benefit-description"},this.benefitText," ",e.name)))):null})()))}render(){if(this.isLoading)return this.getLoadingSkeletonView();if(!this.canRender||!this.tieredOfferData)return null;const e=this.getCurrentTierData();return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-header"},t("div",{class:"s-tiered-offer-header-content"},t("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),t("div",{class:"s-tiered-offer-current-tier-name-wrapper"},t("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",t("span",{class:"s-tiered-offer-tier-name"},e.name)),t("span",{innerHTML:e.icon})))),this.renderProgressBar(),this.renderTabs()))}};n.style=".s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{transform:scaleX(-1)}";export{n as salla_tiered_offer}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as c,h as l,H as t,a as s}from"./p-CtDnNMoY.js";import{f as e,t as i}from"./p-Dz7o69vX.js";const o=class{constructor(l){c(this,l),this.links=salla.config.get("store.social"),this.iconsList={instagram:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>instagram</title>\n<path d="M23 32h-14c-4.971 0-9-4.029-9-9v0-14c0-4.971 4.029-9 9-9v0h14c4.971 0 9 4.029 9 9v0 14c0 4.971-4.029 9-9 9v0zM9 2c-3.866 0-7 3.134-7 7v0 14c0 3.866 3.134 7 7 7v0h14c3.866 0 7-3.134 7-7v0-14c0-3.866-3.134-7-7-7v0zM16 24c-4.418 0-8-3.582-8-8s3.582-8 8-8c4.418 0 8 3.582 8 8v0c0 4.418-3.582 8-8 8v0zM16 10c-3.314 0-6 2.686-6 6s2.686 6 6 6c3.314 0 6-2.686 6-6v0c0-3.314-2.686-6-6-6v0zM25 9c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2v0c0 1.105-0.895 2-2 2v0zM25 7v0z"></path>\n</svg>\n',twitter:i,facebook:e,youtube:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>youtube</title>\n<path d="M16 28c-3.666 0-8.376-0.056-10.29-0.162-0.113 0.010-0.244 0.016-0.376 0.016-1.676 0-3.139-0.91-3.922-2.264l-0.012-0.022c-0.97-1.6-1.4-4.248-1.4-8.558s0.436-6.962 1.412-8.6c0.782-1.36 2.227-2.262 3.883-2.262 0.148 0 0.293 0.007 0.437 0.021l-0.018-0.001c1.872-0.124 6.544-0.168 10.286-0.168s8.4 0.044 10.292 0.168c0.124-0.012 0.267-0.019 0.412-0.019 1.656 0 3.101 0.905 3.866 2.247l0.012 0.022c0.982 1.624 1.418 4.27 1.418 8.582 0 4.338-0.438 6.982-1.422 8.6-0.789 1.364-2.241 2.268-3.904 2.268-0.133 0-0.265-0.006-0.395-0.017l0.017 0.001c-1.926 0.092-6.632 0.148-10.296 0.148zM16 8c-3.712 0-8.334 0.042-10.168 0.164-1.688 0.094-2.14 0.306-2.702 1.268-0.756 1.81-1.195 3.913-1.195 6.119 0 0.51 0.024 1.015 0.069 1.513l-0.005-0.064c-0.042 0.435-0.065 0.941-0.065 1.453 0 2.198 0.438 4.294 1.231 6.205l-0.039-0.107c0.566 0.968 1.022 1.184 2.708 1.296 3.29 0.184 17.022 0.184 20.34 0 1.678-0.11 2.132-0.326 2.684-1.28 0.764-1.803 1.208-3.899 1.208-6.1 0-0.513-0.024-1.020-0.071-1.52l0.005 0.064c0.042-0.436 0.065-0.943 0.065-1.455 0-2.203-0.439-4.303-1.235-6.218l0.040 0.107v-0.016c-0.554-0.958-1-1.17-2.684-1.264-1.862-0.122-6.644-0.164-10.186-0.164zM13 23c-0.552 0-1-0.448-1-1v0-10c0 0 0 0 0 0 0-0.552 0.448-1 1-1 0.196 0 0.38 0.057 0.534 0.154l-0.004-0.002 8 5c0.284 0.18 0.47 0.492 0.47 0.848s-0.186 0.668-0.466 0.846l-0.004 0.002-8 5c-0.15 0.095-0.334 0.152-0.53 0.152 0 0 0 0 0 0v0zM14 13.8v6.4l5.114-3.2z"></path>\n</svg>\n',snapchat:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>snapchat</title>\n<path d="M16.186 30h-0.266c-1.843-0.023-3.525-0.693-4.834-1.792l0.012 0.010c-0.476-0.405-1.043-0.72-1.665-0.909l-0.033-0.009c-0.287-0.044-0.617-0.069-0.954-0.069-0.492 0-0.972 0.053-1.434 0.155l0.044-0.008c-0.261 0.061-0.564 0.102-0.875 0.114l-0.009 0c-0.017 0.001-0.036 0.001-0.056 0.001-0.811 0-1.495-0.545-1.705-1.288l-0.003-0.012c-0.076-0.26-0.132-0.506-0.186-0.746-0.961-0.157-1.822-0.412-2.633-0.76l0.073 0.028c-0.667-0.259-1.199-0.745-1.509-1.362l-0.007-0.016c-0.082-0.189-0.135-0.409-0.146-0.64l-0-0.004c-0.002-0.031-0.003-0.067-0.003-0.103 0-0.841 0.614-1.538 1.417-1.668l0.010-0.001c0.822-0.141 1.555-0.438 2.198-0.859l-0.022 0.013c0.611-0.405 1.138-0.872 1.591-1.404l0.009-0.010c0.526-0.595 0.98-1.273 1.337-2.007l0.023-0.053c0.060-0.102 0.107-0.22 0.135-0.346l0.001-0.008c-0.092-0.020-0.73-0.222-0.972-0.298s-0.374-0.12-0.506-0.17c-0.546-0.205-1.016-0.487-1.424-0.839l0.006 0.005c-0.471-0.388-0.768-0.971-0.768-1.624 0-0.126 0.011-0.249 0.032-0.369l-0.002 0.013c0.143-0.644 0.551-1.172 1.1-1.474l0.011-0.006c0.389-0.241 0.861-0.384 1.366-0.384 0.347 0 0.678 0.067 0.982 0.19l-0.018-0.006c0.128 0.060 0.242 0.106 0.344 0.142-0.082-0.573-0.129-1.235-0.129-1.908 0-1.482 0.227-2.91 0.648-4.253l-0.027 0.101c0.512-1.142 1.207-2.114 2.056-2.925l0.004-0.003c0.7-0.664 1.516-1.214 2.413-1.616l0.055-0.022c1.128-0.5 2.444-0.794 3.828-0.8h0.592c1.386 0.007 2.701 0.301 3.893 0.825l-0.063-0.025c0.956 0.42 1.777 0.967 2.485 1.632l-0.005-0.004c0.855 0.815 1.55 1.789 2.039 2.876l0.023 0.058c0.396 1.237 0.625 2.659 0.625 4.135 0 0.658-0.045 1.304-0.133 1.938l0.008-0.073 0.172-0.076c0.303-0.16 0.661-0.253 1.042-0.253 0.374 0 0.728 0.091 1.039 0.251l-0.013-0.006c0.886 0.274 1.528 1.063 1.582 2.008l0 0.006c-0.001 0.602-0.25 1.146-0.65 1.536l-0 0c-0.429 0.408-0.945 0.73-1.516 0.935l-0.030 0.009c-0.144 0.056-0.316 0.112-0.504 0.17-0.367 0.103-0.686 0.235-0.984 0.398l0.024-0.012c0.018 0.030 0.042 0.094 0.086 0.18 0.963 2.174 2.834 3.796 5.118 4.4l0.054 0.012c0.814 0.133 1.427 0.83 1.427 1.671 0 0.036-0.001 0.072-0.003 0.108l0-0.005c-0.012 0.241-0.070 0.465-0.165 0.669l0.005-0.011c-0.319 0.624-0.847 1.103-1.489 1.352l-0.019 0.006c-0.739 0.323-1.6 0.578-2.497 0.724l-0.063 0.008c-0.056 0.264-0.112 0.496-0.186 0.742-0.215 0.747-0.893 1.284-1.696 1.284-0.011 0-0.021-0-0.032-0l0.002 0c-0.328-0.004-0.644-0.042-0.949-0.11l0.031 0.006c-0.404-0.090-0.869-0.142-1.345-0.142-0.353 0-0.7 0.029-1.038 0.083l0.037-0.005c-0.653 0.195-1.218 0.508-1.699 0.917l0.007-0.005c-1.275 1.065-2.916 1.731-4.71 1.788l-0.012 0zM8.444 25.218c0.457 0.001 0.904 0.041 1.339 0.117l-0.047-0.007c0.966 0.232 1.808 0.664 2.516 1.252l-0.010-0.008c0.96 0.829 2.199 1.357 3.56 1.427l0.014 0.001h0.37c1.373-0.070 2.61-0.597 3.576-1.43l-0.008 0.006c0.701-0.583 1.546-1.016 2.474-1.239l0.042-0.009c0.394-0.063 0.849-0.1 1.312-0.1 0.615 0 1.216 0.064 1.795 0.186l-0.057-0.010c0.105 0.023 0.238 0.045 0.372 0.059l0.016 0.001c0.042-0.162 0.076-0.314 0.11-0.47 0.059-0.339 0.156-0.641 0.287-0.924l-0.009 0.023 0.234-0.44 0.492-0.078c0.99-0.119 1.892-0.359 2.738-0.705l-0.070 0.025c0.086-0.040 0.158-0.076 0.216-0.11-2.748-0.86-4.933-2.816-6.081-5.342l-0.025-0.062c-0.184-0.31-0.294-0.684-0.294-1.083 0-0.27 0.050-0.528 0.14-0.765l-0.005 0.015c0.492-0.783 1.284-1.339 2.212-1.507l0.020-0.003c0.14-0.044 0.27-0.084 0.376-0.126 0.327-0.108 0.609-0.272 0.849-0.482l-0.003 0.002c0.074-0.106 0-0.2-0.216-0.284-0.094-0.041-0.203-0.065-0.318-0.066h-0c-0.529 0.242-1.142 0.411-1.786 0.474l-0.024 0.002c-0.313-0-0.612-0.064-0.883-0.18l0.015 0.006-0.628-0.28 0.072-1.272c0.093-0.623 0.146-1.342 0.146-2.074 0-1.269-0.16-2.501-0.46-3.677l0.022 0.103c-0.396-0.896-0.936-1.659-1.598-2.296l-0.002-0.002c-0.541-0.508-1.172-0.928-1.865-1.233l-0.043-0.017c-0.895-0.396-1.939-0.629-3.036-0.634h-0.002l-0.218-1v1h-0.348c-1.105 0.003-2.155 0.237-3.106 0.656l0.050-0.020c-0.733 0.322-1.361 0.742-1.903 1.253l0.003-0.003c-0.663 0.638-1.203 1.398-1.582 2.247l-0.018 0.045c-0.279 1.065-0.44 2.287-0.44 3.547 0 0.704 0.050 1.395 0.147 2.072l-0.009-0.078 0.080 1.372-0.618 0.284c-0.31 0.108-0.666 0.17-1.038 0.17-0.6 0-1.163-0.163-1.645-0.446l0.015 0.008c-0.019-0.001-0.041-0.002-0.064-0.002-0.154 0-0.299 0.039-0.425 0.109l0.005-0.002c-0.063 0.032-0.115 0.078-0.153 0.135l-0.001 0.001c0.258 0.244 0.567 0.435 0.91 0.556l0.018 0.006c0.094 0.036 0.2 0.070 0.32 0.108 0.971 0.167 1.784 0.732 2.282 1.516l0.008 0.014c0.087 0.225 0.137 0.486 0.137 0.758 0 0.403-0.11 0.781-0.303 1.104l0.005-0.010c-0.459 0.983-1.016 1.829-1.677 2.582l0.011-0.012c-0.588 0.687-1.26 1.279-2.004 1.768l-0.036 0.022c-0.689 0.451-1.49 0.805-2.346 1.017l-0.054 0.011c0.060 0.034 0.132 0.072 0.218 0.112 0.776 0.322 1.678 0.561 2.618 0.675l0.050 0.005 0.498 0.078 0.234 0.446c0.116 0.255 0.209 0.553 0.265 0.863l0.003 0.023c0.038 0.164 0.072 0.328 0.118 0.496 0.12-0.014 0.242-0.042 0.378-0.068 0.528-0.12 1.138-0.192 1.762-0.2l0.006-0zM30.244 22.892v0z"></path>\n</svg>\n',tiktok:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tiktok</title>\n<path d="M29.046 7.029c-3.359 0-6.092-2.733-6.092-6.092 0-0.518-0.42-0.938-0.938-0.938h-5.021c-0.518 0-0.938 0.42-0.938 0.938v20.585c0 1.975-1.606 3.581-3.581 3.581s-3.581-1.606-3.581-3.581c0-1.975 1.606-3.581 3.581-3.581 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938-5.777 0-10.477 4.7-10.477 10.477s4.7 10.477 10.477 10.477c5.777 0 10.477-4.7 10.477-10.477v-9.112c1.866 0.995 3.942 1.514 6.092 1.514 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938zM28.108 12.011c-2.001-0.166-3.902-0.866-5.544-2.047-0.285-0.206-0.662-0.234-0.975-0.073s-0.51 0.482-0.51 0.834v10.798c0 4.743-3.859 8.602-8.602 8.602s-8.602-3.859-8.602-8.602c0-4.427 3.361-8.083 7.665-8.552v3.176c-2.563 0.446-4.519 2.687-4.519 5.376 0 3.009 2.447 5.456 5.456 5.456s5.456-2.448 5.456-5.456v-19.648h3.201c0.429 3.645 3.329 6.545 6.974 6.974z"></path>\n</svg>\n'},this.socialSlot=this.host.querySelector('[slot="social-item"]')?.innerHTML||'<a href={link} rel="noopener" target="_blank" title={type} aria-label={type}><span class="s-social-icon">{icon}</span></a>',salla.lang.onLoaded((()=>{this.links=salla.config.get("store.social")}))}getLinksArray(){return this.links?Object.entries(this.links).filter((([c,l])=>!!l&&"whatsapp"!==c)).map((([c,l])=>({type:c,value:l}))):[]}componentWillLoad(){return new Promise((c=>salla.onReady(c)))}render(){const c=this.getLinksArray();return l(t,{key:"ae314660ceb6b6619fda1c95ee9ebc9eb8b56e49"},l("ul",{key:"a1ffb8cdcdd6cacd98c76ae6e003e45919075c41",class:"s-social-list"},c.map((c=>l("li",{class:"s-social-link"},l("div",{id:"social-slot",innerHTML:this.socialSlot.replace(/\{icon\}/g,this.iconsList[c.type]).replace(/\{type\}/g,c.type).replace(/\{link\}/g,c.value.toString())}))))))}componentDidRender(){this.host.querySelectorAll("#social-slot").forEach((c=>c.replaceWith(c.firstChild))),this.host.querySelector('[slot="social-item"]')?.remove()}get host(){return s(this)}};o.style=":host{display:block}";export{o as salla_social}
4
+ import{r as c,h as l,H as t,a as s}from"./p-CRmtzwUF.js";import{f as e,t as i}from"./p-Dz7o69vX.js";const o=class{constructor(l){c(this,l),this.links=salla.config.get("store.social"),this.iconsList={instagram:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>instagram</title>\n<path d="M23 32h-14c-4.971 0-9-4.029-9-9v0-14c0-4.971 4.029-9 9-9v0h14c4.971 0 9 4.029 9 9v0 14c0 4.971-4.029 9-9 9v0zM9 2c-3.866 0-7 3.134-7 7v0 14c0 3.866 3.134 7 7 7v0h14c3.866 0 7-3.134 7-7v0-14c0-3.866-3.134-7-7-7v0zM16 24c-4.418 0-8-3.582-8-8s3.582-8 8-8c4.418 0 8 3.582 8 8v0c0 4.418-3.582 8-8 8v0zM16 10c-3.314 0-6 2.686-6 6s2.686 6 6 6c3.314 0 6-2.686 6-6v0c0-3.314-2.686-6-6-6v0zM25 9c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2v0c0 1.105-0.895 2-2 2v0zM25 7v0z"></path>\n</svg>\n',twitter:i,facebook:e,youtube:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>youtube</title>\n<path d="M16 28c-3.666 0-8.376-0.056-10.29-0.162-0.113 0.010-0.244 0.016-0.376 0.016-1.676 0-3.139-0.91-3.922-2.264l-0.012-0.022c-0.97-1.6-1.4-4.248-1.4-8.558s0.436-6.962 1.412-8.6c0.782-1.36 2.227-2.262 3.883-2.262 0.148 0 0.293 0.007 0.437 0.021l-0.018-0.001c1.872-0.124 6.544-0.168 10.286-0.168s8.4 0.044 10.292 0.168c0.124-0.012 0.267-0.019 0.412-0.019 1.656 0 3.101 0.905 3.866 2.247l0.012 0.022c0.982 1.624 1.418 4.27 1.418 8.582 0 4.338-0.438 6.982-1.422 8.6-0.789 1.364-2.241 2.268-3.904 2.268-0.133 0-0.265-0.006-0.395-0.017l0.017 0.001c-1.926 0.092-6.632 0.148-10.296 0.148zM16 8c-3.712 0-8.334 0.042-10.168 0.164-1.688 0.094-2.14 0.306-2.702 1.268-0.756 1.81-1.195 3.913-1.195 6.119 0 0.51 0.024 1.015 0.069 1.513l-0.005-0.064c-0.042 0.435-0.065 0.941-0.065 1.453 0 2.198 0.438 4.294 1.231 6.205l-0.039-0.107c0.566 0.968 1.022 1.184 2.708 1.296 3.29 0.184 17.022 0.184 20.34 0 1.678-0.11 2.132-0.326 2.684-1.28 0.764-1.803 1.208-3.899 1.208-6.1 0-0.513-0.024-1.020-0.071-1.52l0.005 0.064c0.042-0.436 0.065-0.943 0.065-1.455 0-2.203-0.439-4.303-1.235-6.218l0.040 0.107v-0.016c-0.554-0.958-1-1.17-2.684-1.264-1.862-0.122-6.644-0.164-10.186-0.164zM13 23c-0.552 0-1-0.448-1-1v0-10c0 0 0 0 0 0 0-0.552 0.448-1 1-1 0.196 0 0.38 0.057 0.534 0.154l-0.004-0.002 8 5c0.284 0.18 0.47 0.492 0.47 0.848s-0.186 0.668-0.466 0.846l-0.004 0.002-8 5c-0.15 0.095-0.334 0.152-0.53 0.152 0 0 0 0 0 0v0zM14 13.8v6.4l5.114-3.2z"></path>\n</svg>\n',snapchat:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>snapchat</title>\n<path d="M16.186 30h-0.266c-1.843-0.023-3.525-0.693-4.834-1.792l0.012 0.010c-0.476-0.405-1.043-0.72-1.665-0.909l-0.033-0.009c-0.287-0.044-0.617-0.069-0.954-0.069-0.492 0-0.972 0.053-1.434 0.155l0.044-0.008c-0.261 0.061-0.564 0.102-0.875 0.114l-0.009 0c-0.017 0.001-0.036 0.001-0.056 0.001-0.811 0-1.495-0.545-1.705-1.288l-0.003-0.012c-0.076-0.26-0.132-0.506-0.186-0.746-0.961-0.157-1.822-0.412-2.633-0.76l0.073 0.028c-0.667-0.259-1.199-0.745-1.509-1.362l-0.007-0.016c-0.082-0.189-0.135-0.409-0.146-0.64l-0-0.004c-0.002-0.031-0.003-0.067-0.003-0.103 0-0.841 0.614-1.538 1.417-1.668l0.010-0.001c0.822-0.141 1.555-0.438 2.198-0.859l-0.022 0.013c0.611-0.405 1.138-0.872 1.591-1.404l0.009-0.010c0.526-0.595 0.98-1.273 1.337-2.007l0.023-0.053c0.060-0.102 0.107-0.22 0.135-0.346l0.001-0.008c-0.092-0.020-0.73-0.222-0.972-0.298s-0.374-0.12-0.506-0.17c-0.546-0.205-1.016-0.487-1.424-0.839l0.006 0.005c-0.471-0.388-0.768-0.971-0.768-1.624 0-0.126 0.011-0.249 0.032-0.369l-0.002 0.013c0.143-0.644 0.551-1.172 1.1-1.474l0.011-0.006c0.389-0.241 0.861-0.384 1.366-0.384 0.347 0 0.678 0.067 0.982 0.19l-0.018-0.006c0.128 0.060 0.242 0.106 0.344 0.142-0.082-0.573-0.129-1.235-0.129-1.908 0-1.482 0.227-2.91 0.648-4.253l-0.027 0.101c0.512-1.142 1.207-2.114 2.056-2.925l0.004-0.003c0.7-0.664 1.516-1.214 2.413-1.616l0.055-0.022c1.128-0.5 2.444-0.794 3.828-0.8h0.592c1.386 0.007 2.701 0.301 3.893 0.825l-0.063-0.025c0.956 0.42 1.777 0.967 2.485 1.632l-0.005-0.004c0.855 0.815 1.55 1.789 2.039 2.876l0.023 0.058c0.396 1.237 0.625 2.659 0.625 4.135 0 0.658-0.045 1.304-0.133 1.938l0.008-0.073 0.172-0.076c0.303-0.16 0.661-0.253 1.042-0.253 0.374 0 0.728 0.091 1.039 0.251l-0.013-0.006c0.886 0.274 1.528 1.063 1.582 2.008l0 0.006c-0.001 0.602-0.25 1.146-0.65 1.536l-0 0c-0.429 0.408-0.945 0.73-1.516 0.935l-0.030 0.009c-0.144 0.056-0.316 0.112-0.504 0.17-0.367 0.103-0.686 0.235-0.984 0.398l0.024-0.012c0.018 0.030 0.042 0.094 0.086 0.18 0.963 2.174 2.834 3.796 5.118 4.4l0.054 0.012c0.814 0.133 1.427 0.83 1.427 1.671 0 0.036-0.001 0.072-0.003 0.108l0-0.005c-0.012 0.241-0.070 0.465-0.165 0.669l0.005-0.011c-0.319 0.624-0.847 1.103-1.489 1.352l-0.019 0.006c-0.739 0.323-1.6 0.578-2.497 0.724l-0.063 0.008c-0.056 0.264-0.112 0.496-0.186 0.742-0.215 0.747-0.893 1.284-1.696 1.284-0.011 0-0.021-0-0.032-0l0.002 0c-0.328-0.004-0.644-0.042-0.949-0.11l0.031 0.006c-0.404-0.090-0.869-0.142-1.345-0.142-0.353 0-0.7 0.029-1.038 0.083l0.037-0.005c-0.653 0.195-1.218 0.508-1.699 0.917l0.007-0.005c-1.275 1.065-2.916 1.731-4.71 1.788l-0.012 0zM8.444 25.218c0.457 0.001 0.904 0.041 1.339 0.117l-0.047-0.007c0.966 0.232 1.808 0.664 2.516 1.252l-0.010-0.008c0.96 0.829 2.199 1.357 3.56 1.427l0.014 0.001h0.37c1.373-0.070 2.61-0.597 3.576-1.43l-0.008 0.006c0.701-0.583 1.546-1.016 2.474-1.239l0.042-0.009c0.394-0.063 0.849-0.1 1.312-0.1 0.615 0 1.216 0.064 1.795 0.186l-0.057-0.010c0.105 0.023 0.238 0.045 0.372 0.059l0.016 0.001c0.042-0.162 0.076-0.314 0.11-0.47 0.059-0.339 0.156-0.641 0.287-0.924l-0.009 0.023 0.234-0.44 0.492-0.078c0.99-0.119 1.892-0.359 2.738-0.705l-0.070 0.025c0.086-0.040 0.158-0.076 0.216-0.11-2.748-0.86-4.933-2.816-6.081-5.342l-0.025-0.062c-0.184-0.31-0.294-0.684-0.294-1.083 0-0.27 0.050-0.528 0.14-0.765l-0.005 0.015c0.492-0.783 1.284-1.339 2.212-1.507l0.020-0.003c0.14-0.044 0.27-0.084 0.376-0.126 0.327-0.108 0.609-0.272 0.849-0.482l-0.003 0.002c0.074-0.106 0-0.2-0.216-0.284-0.094-0.041-0.203-0.065-0.318-0.066h-0c-0.529 0.242-1.142 0.411-1.786 0.474l-0.024 0.002c-0.313-0-0.612-0.064-0.883-0.18l0.015 0.006-0.628-0.28 0.072-1.272c0.093-0.623 0.146-1.342 0.146-2.074 0-1.269-0.16-2.501-0.46-3.677l0.022 0.103c-0.396-0.896-0.936-1.659-1.598-2.296l-0.002-0.002c-0.541-0.508-1.172-0.928-1.865-1.233l-0.043-0.017c-0.895-0.396-1.939-0.629-3.036-0.634h-0.002l-0.218-1v1h-0.348c-1.105 0.003-2.155 0.237-3.106 0.656l0.050-0.020c-0.733 0.322-1.361 0.742-1.903 1.253l0.003-0.003c-0.663 0.638-1.203 1.398-1.582 2.247l-0.018 0.045c-0.279 1.065-0.44 2.287-0.44 3.547 0 0.704 0.050 1.395 0.147 2.072l-0.009-0.078 0.080 1.372-0.618 0.284c-0.31 0.108-0.666 0.17-1.038 0.17-0.6 0-1.163-0.163-1.645-0.446l0.015 0.008c-0.019-0.001-0.041-0.002-0.064-0.002-0.154 0-0.299 0.039-0.425 0.109l0.005-0.002c-0.063 0.032-0.115 0.078-0.153 0.135l-0.001 0.001c0.258 0.244 0.567 0.435 0.91 0.556l0.018 0.006c0.094 0.036 0.2 0.070 0.32 0.108 0.971 0.167 1.784 0.732 2.282 1.516l0.008 0.014c0.087 0.225 0.137 0.486 0.137 0.758 0 0.403-0.11 0.781-0.303 1.104l0.005-0.010c-0.459 0.983-1.016 1.829-1.677 2.582l0.011-0.012c-0.588 0.687-1.26 1.279-2.004 1.768l-0.036 0.022c-0.689 0.451-1.49 0.805-2.346 1.017l-0.054 0.011c0.060 0.034 0.132 0.072 0.218 0.112 0.776 0.322 1.678 0.561 2.618 0.675l0.050 0.005 0.498 0.078 0.234 0.446c0.116 0.255 0.209 0.553 0.265 0.863l0.003 0.023c0.038 0.164 0.072 0.328 0.118 0.496 0.12-0.014 0.242-0.042 0.378-0.068 0.528-0.12 1.138-0.192 1.762-0.2l0.006-0zM30.244 22.892v0z"></path>\n</svg>\n',tiktok:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tiktok</title>\n<path d="M29.046 7.029c-3.359 0-6.092-2.733-6.092-6.092 0-0.518-0.42-0.938-0.938-0.938h-5.021c-0.518 0-0.938 0.42-0.938 0.938v20.585c0 1.975-1.606 3.581-3.581 3.581s-3.581-1.606-3.581-3.581c0-1.975 1.606-3.581 3.581-3.581 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938-5.777 0-10.477 4.7-10.477 10.477s4.7 10.477 10.477 10.477c5.777 0 10.477-4.7 10.477-10.477v-9.112c1.866 0.995 3.942 1.514 6.092 1.514 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938zM28.108 12.011c-2.001-0.166-3.902-0.866-5.544-2.047-0.285-0.206-0.662-0.234-0.975-0.073s-0.51 0.482-0.51 0.834v10.798c0 4.743-3.859 8.602-8.602 8.602s-8.602-3.859-8.602-8.602c0-4.427 3.361-8.083 7.665-8.552v3.176c-2.563 0.446-4.519 2.687-4.519 5.376 0 3.009 2.447 5.456 5.456 5.456s5.456-2.448 5.456-5.456v-19.648h3.201c0.429 3.645 3.329 6.545 6.974 6.974z"></path>\n</svg>\n'},this.socialSlot=this.host.querySelector('[slot="social-item"]')?.innerHTML||'<a href={link} rel="noopener" target="_blank" title={type} aria-label={type}><span class="s-social-icon">{icon}</span></a>',salla.lang.onLoaded((()=>{this.links=salla.config.get("store.social")}))}getLinksArray(){return this.links?Object.entries(this.links).filter((([c,l])=>!!l&&"whatsapp"!==c)).map((([c,l])=>({type:c,value:l}))):[]}componentWillLoad(){return new Promise((c=>salla.onReady(c)))}render(){const c=this.getLinksArray();return l(t,{key:"a0bcd60fddd2fd8e86f32cd71d484ec76d02cf49"},l("ul",{key:"b595d8de59199de5081370b9440c8a46cb8c751f",class:"s-social-list"},c.map((c=>l("li",{class:"s-social-link"},l("div",{id:"social-slot",innerHTML:this.socialSlot.replace(/\{icon\}/g,this.iconsList[c.type]).replace(/\{type\}/g,c.type).replace(/\{link\}/g,c.value.toString())}))))))}componentDidRender(){this.host.querySelectorAll("#social-slot").forEach((c=>c.replaceWith(c.firstChild))),this.host.querySelector('[slot="social-item"]')?.remove()}get host(){return s(this)}};o.style=":host{display:block}";export{o as salla_social}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as s,H as c,a}from"./p-CtDnNMoY.js";import{w as e}from"./p-DWksgowB.js";import{M as n}from"./p-DmgxDvXL.js";const o=class{constructor(s){t(this,s),this.contacts=salla.config.get("store.contacts"),this.iconsList={mobile:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',whatsapp:e,phone:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n',telegram:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n',email:n},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>`,salla.onReady((()=>{this.contacts=salla.config.get("store.contacts")})),salla.lang.onLoaded((()=>{this.contactsTitle=this.contactsTitle||salla.lang.get("blocks.footer.social")}))}getContactsArray(){return Object.entries(this.contacts).filter((([t,s])=>""!==s)).map((([t,s])=>({type:t,value:s})))}getContactLink(t){const s=this.contacts[t];switch(t){case"phone":case"mobile":return`tel:${s}`;case"whatsapp":const t=(s||"").toString().replace(/[^\d]/g,"");return t?`https://wa.me/${t}`:salla.url.get("whatsapp/send");case"email":return`mailto:${s}`;case"telegram":return s.startsWith("https://t.me/")?s:`https://t.me/${s}`;default:return s}}getContactIcon(t){return this.iconsList[t]}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}render(){const t=this.getContactsArray();if(t&&0!=t.length)return this.isHeader?s(c,{class:"s-contacts s-contacts-header"},t.filter((t=>"phone"==t.type||"email"==t.type)).map(((t,c)=>s("a",{href:this.getContactLink(t.type),key:c,class:"s-contacts-topnav-link"},"email"===t.type?t.value:[s("span",null,this.contactsTitle,": "),s("a",{class:"unicode",href:this.iconsList[t.type]},t.value)])))):s(c,{class:"s-contacts"},!this.hideTitle&&s("h3",{class:"s-contacts-title"},this.contactsTitle),s("div",{class:{"s-contacts-list":!0,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},t.map(((t,c)=>s("div",{key:c,id:"contact-slot",innerHTML:this.contactSlot.replace(/\{icon\}/g,this.getContactIcon(t.type)).replace(/\{value\}/g,t.value.toString()).replace(/\{link\}/g,this.getContactLink(t.type))})))))}componentDidRender(){this.host.querySelector('[slot="contact"]')?.remove()}get host(){return a(this)}};o.style=".unicode{unicode-bidi:plaintext}";export{o as salla_contacts}
4
+ import{r as t,h as s,H as c,a}from"./p-CRmtzwUF.js";import{w as e}from"./p-DWksgowB.js";import{M as n}from"./p-DmgxDvXL.js";const o=class{constructor(s){t(this,s),this.contacts=salla.config.get("store.contacts"),this.iconsList={mobile:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',whatsapp:e,phone:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n',telegram:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n',email:n},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>`,salla.onReady((()=>{this.contacts=salla.config.get("store.contacts")})),salla.lang.onLoaded((()=>{this.contactsTitle=this.contactsTitle||salla.lang.get("blocks.footer.social")}))}getContactsArray(){return Object.entries(this.contacts).filter((([t,s])=>""!==s)).map((([t,s])=>({type:t,value:s})))}getContactLink(t){const s=this.contacts[t];switch(t){case"phone":case"mobile":return`tel:${s}`;case"whatsapp":const t=(s||"").toString().replace(/[^\d]/g,"");return t?`https://wa.me/${t}`:salla.url.get("whatsapp/send");case"email":return`mailto:${s}`;case"telegram":return s.startsWith("https://t.me/")?s:`https://t.me/${s}`;default:return s}}getContactIcon(t){return this.iconsList[t]}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}render(){const t=this.getContactsArray();if(t&&0!=t.length)return this.isHeader?s(c,{class:"s-contacts s-contacts-header"},t.filter((t=>"phone"==t.type||"email"==t.type)).map(((t,c)=>s("a",{href:this.getContactLink(t.type),key:c,class:"s-contacts-topnav-link"},"email"===t.type?t.value:[s("span",null,this.contactsTitle,": "),s("a",{class:"unicode",href:this.iconsList[t.type]},t.value)])))):s(c,{class:"s-contacts"},!this.hideTitle&&s("h3",{class:"s-contacts-title"},this.contactsTitle),s("div",{class:{"s-contacts-list":!0,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},t.map(((t,c)=>s("div",{key:c,id:"contact-slot",innerHTML:this.contactSlot.replace(/\{icon\}/g,this.getContactIcon(t.type)).replace(/\{value\}/g,t.value.toString()).replace(/\{link\}/g,this.getContactLink(t.type))})))))}componentDidRender(){this.host.querySelector('[slot="contact"]')?.remove()}get host(){return a(this)}};o.style=".unicode{unicode-bidi:plaintext}";export{o as salla_contacts}