@salla.sa/twilight-components 2.14.575 → 2.14.577

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 (478) hide show
  1. package/dist/cjs/{filepond-NMq4bM2q.js → filepond-iflxa4A5.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-TEelNjjG.js → filepond-plugin-file-poster-NZ84xlKh.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DRVxzFUc.js → filepond-plugin-file-validate-size-m8Z_JlZX.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-75J1mHEB.js → filepond-plugin-file-validate-type-BfF6LYAT.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-CvC-CZjk.js → filepond-plugin-image-edit-DfRJ3iRj.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-D7mJeHKx.js → filepond-plugin-image-exif-orientation-BZxYZai-.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-QxURSuZ4.js → filepond-plugin-image-preview-BQ7HvH2d.js} +1 -1
  8. package/dist/cjs/{helpers-Dm4BirHO.js → helpers-DBynEhOO.js} +0 -15
  9. package/dist/cjs/{index-Bt8A6pnr.js → index-CSe-ijAV.js} +2 -2
  10. package/dist/cjs/{intlTelInput-Dq8y3YHO.js → intlTelInput-DHfYz8vv.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +3 -3
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +3 -3
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +17 -17
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +179 -187
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +160 -7
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +2 -2
  26. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-form_9.cjs.entry.js +4 -4
  30. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-count-down.cjs.entry.js +2 -2
  34. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-delivery-promise.cjs.entry.js +2 -2
  36. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
  38. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  39. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-gift-card-redeem.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
  42. package/dist/cjs/salla-hook.cjs.entry.js +2 -2
  43. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-list-tile.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-localization-modal.cjs.entry.js +2 -2
  47. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +15 -15
  49. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +3 -3
  50. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +2 -2
  52. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
  53. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +2 -2
  55. package/dist/cjs/salla-map_3.cjs.entry.js +4 -4
  56. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +4 -4
  59. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -6
  60. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +2 -2
  61. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
  63. package/dist/cjs/salla-offer-modal.cjs.entry.js +2 -2
  64. package/dist/cjs/salla-offer.cjs.entry.js +18 -2
  65. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
  70. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +2 -2
  72. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
  76. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-orders.cjs.entry.js +38 -13
  78. package/dist/cjs/salla-payments.cjs.entry.js +3 -3
  79. package/dist/cjs/salla-placeholder.cjs.entry.js +2 -2
  80. package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
  81. package/dist/cjs/salla-product-card-embed.cjs.entry.js +2 -2
  82. package/dist/cjs/salla-product-card.cjs.entry.js +6 -6
  83. package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
  84. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +2 -2
  90. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-search-product-card.cjs.entry.js +3 -3
  93. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
  95. package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
  96. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  97. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  98. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  100. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  104. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
  107. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +1 -1
  108. package/dist/cjs/twilight.cjs.js +2 -2
  109. package/dist/cjs/{vanilla-picker-BkJyQVMl.js → vanilla-picker-Brk9Mb54.js} +1 -1
  110. package/dist/collection/assets/svg/mini-map.svg +6 -30
  111. package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
  112. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.css +241 -238
  113. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +175 -146
  114. package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.css +154 -92
  115. package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +160 -5
  116. package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +1 -1
  117. package/dist/collection/components/salla-color-picker/salla-color-picker.js +1 -1
  118. package/dist/collection/components/salla-comment-form/salla-comment-form.js +1 -1
  119. package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +1 -1
  120. package/dist/collection/components/salla-count-down/salla-count-down.js +1 -1
  121. package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
  122. package/dist/collection/components/salla-file-upload/salla-file-upload.js +2 -2
  123. package/dist/collection/components/salla-filters/salla-filters.js +1 -1
  124. package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +2 -2
  125. package/dist/collection/components/salla-gifting/salla-gifting.js +2 -2
  126. package/dist/collection/components/salla-hook/salla-hook.js +1 -1
  127. package/dist/collection/components/salla-list-tile/salla-list-tile.js +1 -1
  128. package/dist/collection/components/salla-loading/salla-loading.js +1 -1
  129. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +1 -1
  130. package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +1 -1
  131. package/dist/collection/components/salla-loyalty-points-history/salla-loyalty-points-history.js +1 -1
  132. package/dist/collection/components/salla-loyalty-program/salla-loyalty-exchange-product-card.js +2 -2
  133. package/dist/collection/components/salla-loyalty-program/salla-loyalty-hero.js +3 -3
  134. package/dist/collection/components/salla-loyalty-program/salla-loyalty-point.js +4 -4
  135. package/dist/collection/components/salla-loyalty-program/salla-loyalty-reward.js +2 -2
  136. package/dist/collection/components/salla-loyalty-program/salla-reward-card.js +1 -1
  137. package/dist/collection/components/salla-loyalty-program/salla-reward-details.js +3 -3
  138. package/dist/collection/components/salla-loyalty-program/salla-reward-exchange.js +1 -1
  139. package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +1 -1
  140. package/dist/collection/components/salla-map/salla-map.js +3 -3
  141. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +1 -1
  142. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
  143. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -4
  144. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +1 -1
  145. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +1 -1
  146. package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
  147. package/dist/collection/components/salla-offer/salla-offer.js +17 -1
  148. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
  149. package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
  150. package/dist/collection/components/salla-order-edit/salla-order-edit-product-card.js +1 -1
  151. package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
  152. package/dist/collection/components/salla-orders/salla-orders.js +39 -12
  153. package/dist/collection/components/salla-payments/salla-payments.js +2 -2
  154. package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
  155. package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
  156. package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
  157. package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
  158. package/dist/collection/components/salla-product-card-embed/salla-product-card-embed.js +1 -1
  159. package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
  160. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
  161. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +1 -1
  162. package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
  163. package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.js +1 -1
  164. package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
  165. package/dist/collection/components/salla-search-product-card/salla-search-product-card.js +2 -2
  166. package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
  167. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  168. package/dist/collection/components/salla-social/salla-social.js +1 -1
  169. package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
  170. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  171. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  172. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  173. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  174. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  175. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  176. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
  177. package/dist/components/helpers.js +1 -15
  178. package/dist/components/index.js +2 -2
  179. package/dist/components/salla-accordion-head2.js +2 -2
  180. package/dist/components/salla-bullet-delivery.js +175 -184
  181. package/dist/components/salla-cart-coupons.js +161 -6
  182. package/dist/components/salla-cart-summary.js +1 -1
  183. package/dist/components/salla-color-picker2.js +1 -1
  184. package/dist/components/salla-comment-form2.js +1 -1
  185. package/dist/components/salla-conditional-fields2.js +1 -1
  186. package/dist/components/salla-count-down2.js +1 -1
  187. package/dist/components/salla-datetime-picker2.js +1 -1
  188. package/dist/components/salla-delivery-promise.js +1 -1
  189. package/dist/components/salla-file-upload2.js +2 -2
  190. package/dist/components/salla-filters-widget2.js +2 -2
  191. package/dist/components/salla-filters.js +1 -1
  192. package/dist/components/salla-gifting.js +2 -2
  193. package/dist/components/salla-hook.js +1 -1
  194. package/dist/components/salla-list-tile2.js +1 -1
  195. package/dist/components/salla-loading2.js +1 -1
  196. package/dist/components/salla-localization-modal.js +1 -1
  197. package/dist/components/salla-loyalty-exchange-product-card2.js +2 -2
  198. package/dist/components/salla-loyalty-hero2.js +3 -3
  199. package/dist/components/salla-loyalty-point2.js +4 -4
  200. package/dist/components/salla-loyalty-points-history.js +1 -1
  201. package/dist/components/salla-loyalty-prize-item.js +1 -1
  202. package/dist/components/salla-loyalty-reward.js +2 -2
  203. package/dist/components/salla-maintenance-alert.js +1 -1
  204. package/dist/components/salla-map2.js +3 -3
  205. package/dist/components/salla-multiple-bundle-product-cart2.js +1 -1
  206. package/dist/components/salla-multiple-bundle-product-details2.js +2 -2
  207. package/dist/components/salla-multiple-bundle-product-options-modal2.js +4 -4
  208. package/dist/components/salla-multiple-bundle-product-slider2.js +1 -1
  209. package/dist/components/salla-multiple-bundle-product.js +1 -1
  210. package/dist/components/salla-notification-item2.js +1 -1
  211. package/dist/components/salla-offer-modal.js +1 -1
  212. package/dist/components/salla-offer.js +17 -1
  213. package/dist/components/salla-order-details.js +1 -1
  214. package/dist/components/salla-order-edit-product-card.js +1 -1
  215. package/dist/components/salla-order-summary.js +1 -1
  216. package/dist/components/salla-orders.js +39 -12
  217. package/dist/components/salla-payments.js +2 -2
  218. package/dist/components/salla-placeholder2.js +1 -1
  219. package/dist/components/salla-price-range2.js +2 -2
  220. package/dist/components/salla-product-availability2.js +1 -1
  221. package/dist/components/salla-product-card-embed.js +1 -1
  222. package/dist/components/salla-product-card2.js +5 -5
  223. package/dist/components/salla-product-size-guide.js +2 -2
  224. package/dist/components/salla-quantity-input2.js +1 -1
  225. package/dist/components/salla-quick-buy2.js +1 -1
  226. package/dist/components/salla-review-card2.js +1 -1
  227. package/dist/components/salla-review-factors-tags2.js +1 -1
  228. package/dist/components/salla-reviews-page.js +1 -1
  229. package/dist/components/salla-reward-card2.js +1 -1
  230. package/dist/components/salla-reward-details2.js +3 -3
  231. package/dist/components/salla-reward-exchange2.js +1 -1
  232. package/dist/components/salla-search-product-card2.js +2 -2
  233. package/dist/components/salla-searchable-dropdown2.js +4 -4
  234. package/dist/components/salla-skeleton2.js +1 -1
  235. package/dist/components/salla-social-share2.js +1 -1
  236. package/dist/components/salla-social.js +1 -1
  237. package/dist/components/salla-tab-content2.js +1 -1
  238. package/dist/components/salla-tab-header2.js +1 -1
  239. package/dist/components/salla-tabs2.js +1 -1
  240. package/dist/components/salla-tel-input2.js +1 -1
  241. package/dist/components/salla-tooltip2.js +1 -1
  242. package/dist/components/salla-user-settings.js +1 -1
  243. package/dist/components/salla-wishlist-actions.js +1 -1
  244. package/dist/esm/{filepond-kmpJTY5p.js → filepond-Qm94dFPs.js} +1 -1
  245. package/dist/esm/{filepond-plugin-file-poster-8M0TsTUo.js → filepond-plugin-file-poster-CHpnwHYe.js} +1 -1
  246. package/dist/esm/{filepond-plugin-file-validate-size-CPVDzrMj.js → filepond-plugin-file-validate-size-BwHBxxMg.js} +1 -1
  247. package/dist/esm/{filepond-plugin-file-validate-type-D0qUdWNB.js → filepond-plugin-file-validate-type-BD-yTEPO.js} +1 -1
  248. package/dist/esm/{filepond-plugin-image-edit-K8nFORG9.js → filepond-plugin-image-edit-DKc0Yw10.js} +1 -1
  249. package/dist/esm/{filepond-plugin-image-exif-orientation-BSvnwKAw.js → filepond-plugin-image-exif-orientation-CepmNFGF.js} +1 -1
  250. package/dist/esm/{filepond-plugin-image-preview-hArDoD8N.js → filepond-plugin-image-preview-FhnzagMd.js} +1 -1
  251. package/dist/esm/{helpers-CV6uPJEJ.js → helpers-BJxBnTgv.js} +1 -15
  252. package/dist/esm/{index-a6lSRQK4.js → index-BAXTlrSC.js} +2 -2
  253. package/dist/esm/{intlTelInput-CC5xRRkd.js → intlTelInput-BJlOPJYY.js} +1 -1
  254. package/dist/esm/loader.js +3 -3
  255. package/dist/esm/salla-accordion-body_2.entry.js +3 -3
  256. package/dist/esm/salla-accordion_6.entry.js +2 -2
  257. package/dist/esm/salla-add-product-button_5.entry.js +3 -3
  258. package/dist/esm/salla-advertisement.entry.js +1 -1
  259. package/dist/esm/salla-alert_2.entry.js +1 -1
  260. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  261. package/dist/esm/salla-applied-filters.entry.js +1 -1
  262. package/dist/esm/salla-apps-icons.entry.js +1 -1
  263. package/dist/esm/salla-attachment-view_9.entry.js +17 -17
  264. package/dist/esm/salla-badge.entry.js +1 -1
  265. package/dist/esm/salla-basket-gap.entry.js +1 -1
  266. package/dist/esm/salla-bullet-delivery_3.entry.js +179 -187
  267. package/dist/esm/salla-cart-coupons.entry.js +160 -7
  268. package/dist/esm/salla-cart-item-offers_2.entry.js +2 -2
  269. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  270. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  271. package/dist/esm/salla-comment-factors.entry.js +1 -1
  272. package/dist/esm/salla-comment-form_9.entry.js +4 -4
  273. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  274. package/dist/esm/salla-contacts.entry.js +1 -1
  275. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  276. package/dist/esm/salla-count-down.entry.js +2 -2
  277. package/dist/esm/salla-custom-fields.entry.js +1 -1
  278. package/dist/esm/salla-delivery-promise.entry.js +2 -2
  279. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  280. package/dist/esm/salla-filters-widget.entry.js +3 -3
  281. package/dist/esm/salla-filters.entry.js +2 -2
  282. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  283. package/dist/esm/salla-gift-card-redeem.entry.js +1 -1
  284. package/dist/esm/salla-gifting.entry.js +3 -3
  285. package/dist/esm/salla-hook.entry.js +2 -2
  286. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  287. package/dist/esm/salla-installment.entry.js +1 -1
  288. package/dist/esm/salla-list-tile.entry.js +2 -2
  289. package/dist/esm/salla-localization-modal.entry.js +2 -2
  290. package/dist/esm/salla-login-modal.entry.js +1 -1
  291. package/dist/esm/salla-loyalty-banner_10.entry.js +15 -15
  292. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +3 -3
  293. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  294. package/dist/esm/salla-loyalty-points-history.entry.js +2 -2
  295. package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
  296. package/dist/esm/salla-loyalty.entry.js +1 -1
  297. package/dist/esm/salla-maintenance-alert.entry.js +2 -2
  298. package/dist/esm/salla-map_3.entry.js +4 -4
  299. package/dist/esm/salla-menu.entry.js +1 -1
  300. package/dist/esm/salla-metadata.entry.js +1 -1
  301. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +4 -4
  302. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -6
  303. package/dist/esm/salla-multiple-bundle-product.entry.js +2 -2
  304. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  305. package/dist/esm/salla-notification-item_2.entry.js +2 -2
  306. package/dist/esm/salla-offer-modal.entry.js +2 -2
  307. package/dist/esm/salla-offer.entry.js +18 -2
  308. package/dist/esm/salla-order-branch.entry.js +1 -1
  309. package/dist/esm/salla-order-cancel.entry.js +1 -1
  310. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  311. package/dist/esm/salla-order-details-options.entry.js +1 -1
  312. package/dist/esm/salla-order-details.entry.js +2 -2
  313. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  314. package/dist/esm/salla-order-edit-product-card.entry.js +2 -2
  315. package/dist/esm/salla-order-edit.entry.js +1 -1
  316. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  317. package/dist/esm/salla-order-shipments.entry.js +1 -1
  318. package/dist/esm/salla-order-summary.entry.js +2 -2
  319. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  320. package/dist/esm/salla-orders.entry.js +38 -13
  321. package/dist/esm/salla-payments.entry.js +3 -3
  322. package/dist/esm/salla-placeholder.entry.js +2 -2
  323. package/dist/esm/salla-price-range.entry.js +3 -3
  324. package/dist/esm/salla-product-card-embed.entry.js +2 -2
  325. package/dist/esm/salla-product-card.entry.js +6 -6
  326. package/dist/esm/salla-product-size-guide.entry.js +3 -3
  327. package/dist/esm/salla-products-list.entry.js +1 -1
  328. package/dist/esm/salla-products-slider.entry.js +1 -1
  329. package/dist/esm/salla-quick-order.entry.js +1 -1
  330. package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
  331. package/dist/esm/salla-rating-modal.entry.js +1 -1
  332. package/dist/esm/salla-review-factors-tags.entry.js +2 -2
  333. package/dist/esm/salla-review-order-item.entry.js +1 -1
  334. package/dist/esm/salla-scopes.entry.js +1 -1
  335. package/dist/esm/salla-search-product-card.entry.js +3 -3
  336. package/dist/esm/salla-search.entry.js +1 -1
  337. package/dist/esm/salla-skeleton.entry.js +2 -2
  338. package/dist/esm/salla-social-share.entry.js +2 -2
  339. package/dist/esm/salla-social.entry.js +2 -2
  340. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  341. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  342. package/dist/esm/salla-tooltip.entry.js +2 -2
  343. package/dist/esm/salla-trust-badges.entry.js +1 -1
  344. package/dist/esm/salla-user-menu.entry.js +1 -1
  345. package/dist/esm/salla-user-profile.entry.js +1 -1
  346. package/dist/esm/salla-user-settings.entry.js +2 -2
  347. package/dist/esm/salla-verify.entry.js +1 -1
  348. package/dist/esm/salla-wallet.entry.js +1 -1
  349. package/dist/esm/salla-wishlist-actions.entry.js +2 -2
  350. package/dist/esm/salla-wishlist-summary.entry.js +1 -1
  351. package/dist/esm/twilight.js +3 -3
  352. package/dist/esm/{vanilla-picker-CDhGfTst.js → vanilla-picker-C_cY41gl.js} +1 -1
  353. package/dist/twilight/{p-cc15290b.entry.js → p-00a727c3.entry.js} +1 -1
  354. package/dist/twilight/{p-fc13e706.entry.js → p-0227316e.entry.js} +1 -1
  355. package/dist/twilight/{p-aee0c658.entry.js → p-03c959bb.entry.js} +1 -1
  356. package/dist/twilight/{p-a177b13f.entry.js → p-072ee78f.entry.js} +1 -1
  357. package/dist/twilight/{p-f2f6f502.entry.js → p-073e1363.entry.js} +1 -1
  358. package/dist/twilight/{p-4a60be6d.entry.js → p-0806da7e.entry.js} +1 -1
  359. package/dist/twilight/{p-5134aae8.entry.js → p-08cedab0.entry.js} +1 -1
  360. package/dist/twilight/{p-69594ced.entry.js → p-0bcca7f8.entry.js} +1 -1
  361. package/dist/twilight/{p-9b04ed7f.entry.js → p-10a68a21.entry.js} +1 -1
  362. package/dist/twilight/{p-00e68964.entry.js → p-13abf9ca.entry.js} +1 -1
  363. package/dist/twilight/{p-742f2c15.entry.js → p-13c35685.entry.js} +1 -1
  364. package/dist/twilight/{p-540138a1.entry.js → p-162fa48e.entry.js} +1 -1
  365. package/dist/twilight/{p-e0b5a06d.entry.js → p-1762fd86.entry.js} +1 -1
  366. package/dist/twilight/{p-2af75479.entry.js → p-18c41e9a.entry.js} +1 -1
  367. package/dist/twilight/{p-d6803c56.entry.js → p-1fbb0b22.entry.js} +1 -1
  368. package/dist/twilight/{p-109472c5.entry.js → p-1fd6a10e.entry.js} +1 -1
  369. package/dist/twilight/p-28cdaf6b.entry.js +4 -0
  370. package/dist/twilight/{p-ebd9a6c2.entry.js → p-292a0b4a.entry.js} +1 -1
  371. package/dist/twilight/{p-d0fce326.entry.js → p-2ba4956f.entry.js} +1 -1
  372. package/dist/twilight/{p-6f371a84.entry.js → p-2c543420.entry.js} +1 -1
  373. package/dist/twilight/{p-b7624eb6.entry.js → p-2e3a56de.entry.js} +1 -1
  374. package/dist/twilight/p-2e4064eb.entry.js +4 -0
  375. package/dist/twilight/{p-d56cb23a.entry.js → p-3153f560.entry.js} +1 -1
  376. package/dist/twilight/{p-977e3e76.entry.js → p-3a3815a2.entry.js} +1 -1
  377. package/dist/twilight/{p-0a38d353.entry.js → p-3cef6be2.entry.js} +1 -1
  378. package/dist/twilight/{p-3500065c.entry.js → p-3dd612a6.entry.js} +1 -1
  379. package/dist/twilight/{p-312e8678.entry.js → p-411c1ab0.entry.js} +1 -1
  380. package/dist/twilight/p-423d852d.entry.js +4 -0
  381. package/dist/twilight/{p-c500e5fe.entry.js → p-44a6598e.entry.js} +1 -1
  382. package/dist/twilight/{p-7f69cf5d.entry.js → p-51d83216.entry.js} +1 -1
  383. package/dist/twilight/{p-6a7eacbd.entry.js → p-51fb8841.entry.js} +1 -1
  384. package/dist/twilight/{p-2541db96.entry.js → p-56609a91.entry.js} +1 -1
  385. package/dist/twilight/{p-2591eead.entry.js → p-58c1bf51.entry.js} +1 -1
  386. package/dist/twilight/{p-6051a92c.entry.js → p-59a7ca2e.entry.js} +1 -1
  387. package/dist/twilight/{p-426acd77.entry.js → p-5a77257c.entry.js} +1 -1
  388. package/dist/twilight/{p-9e53d7a6.entry.js → p-5c4e2ed3.entry.js} +1 -1
  389. package/dist/twilight/{p-a0d39b81.entry.js → p-5f464161.entry.js} +1 -1
  390. package/dist/twilight/{p-d1a0bd97.entry.js → p-637670fa.entry.js} +1 -1
  391. package/dist/twilight/{p-81c88f97.entry.js → p-6605f258.entry.js} +1 -1
  392. package/dist/twilight/{p-3bd153c1.entry.js → p-665bc308.entry.js} +1 -1
  393. package/dist/twilight/{p-7cc8b82b.entry.js → p-6bfe12d5.entry.js} +1 -1
  394. package/dist/twilight/{p-cbcbc9f8.entry.js → p-6de608eb.entry.js} +1 -1
  395. package/dist/twilight/{p-e9d73e7d.entry.js → p-6f9bc285.entry.js} +1 -1
  396. package/dist/twilight/{p-6958e848.entry.js → p-70451662.entry.js} +1 -1
  397. package/dist/twilight/{p-45b97699.entry.js → p-7b0cf8a1.entry.js} +1 -1
  398. package/dist/twilight/{p-6f741b21.entry.js → p-7d08dcfb.entry.js} +1 -1
  399. package/dist/twilight/{p-01cae03e.entry.js → p-7d37b650.entry.js} +1 -1
  400. package/dist/twilight/{p-254e6e0c.entry.js → p-7f3e110c.entry.js} +1 -1
  401. package/dist/twilight/{p-5fe0908b.entry.js → p-80302c52.entry.js} +1 -1
  402. package/dist/twilight/{p-583a63e5.entry.js → p-806083b4.entry.js} +1 -1
  403. package/dist/twilight/{p-50816838.entry.js → p-84cff600.entry.js} +1 -1
  404. package/dist/twilight/{p-c9779211.entry.js → p-884104a3.entry.js} +1 -1
  405. package/dist/twilight/{p-34d33337.entry.js → p-898ce93b.entry.js} +1 -1
  406. package/dist/twilight/{p-dc86737c.entry.js → p-8a865d37.entry.js} +1 -1
  407. package/dist/twilight/{p-bc54fc8b.entry.js → p-8c750736.entry.js} +1 -1
  408. package/dist/twilight/{p-7f861ac0.entry.js → p-8fc2eb01.entry.js} +1 -1
  409. package/dist/twilight/{p-2af98444.entry.js → p-97fee81d.entry.js} +1 -1
  410. package/dist/twilight/{p-c9ba30cd.entry.js → p-9920bbad.entry.js} +1 -1
  411. package/dist/twilight/{p-24bd13b8.entry.js → p-99b9bf66.entry.js} +1 -1
  412. package/dist/twilight/{p-b0c86557.entry.js → p-9b4a0dd3.entry.js} +1 -1
  413. package/dist/twilight/{p-0f1981ee.entry.js → p-9e054110.entry.js} +1 -1
  414. package/dist/twilight/{p-a6lSRQK4.js → p-BAXTlrSC.js} +1 -1
  415. package/dist/twilight/p-BJxBnTgv.js +4 -0
  416. package/dist/twilight/{p-BokV7EHy.js → p-BWpg3MwW.js} +1 -1
  417. package/dist/twilight/{p-DNjWzZsK.js → p-C6WaobtY.js} +1 -1
  418. package/dist/twilight/{p-wx2L9ZB0.js → p-CvebbG3m.js} +1 -1
  419. package/dist/twilight/{p-CSuif4Xw.js → p-D5lNzFgl.js} +1 -1
  420. package/dist/twilight/{p-CfhebjBE.js → p-DGzNHmGp.js} +1 -1
  421. package/dist/twilight/{p-BG1dHHdm.js → p-DnrvXyI6.js} +1 -1
  422. package/dist/twilight/{p-DOF2UkI4.js → p-DpI1J-G1.js} +1 -1
  423. package/dist/twilight/{p-DWPp9ZjN.js → p-SguJQlDo.js} +1 -1
  424. package/dist/twilight/{p-DZHubgN5.js → p-_f6GlygH.js} +1 -1
  425. package/dist/twilight/{p-5d72b7d7.entry.js → p-a2d07dba.entry.js} +1 -1
  426. package/dist/twilight/{p-8271e127.entry.js → p-a73a785d.entry.js} +1 -1
  427. package/dist/twilight/{p-e155a1a6.entry.js → p-a79c04a2.entry.js} +1 -1
  428. package/dist/twilight/{p-3a113599.entry.js → p-a9fcdac5.entry.js} +1 -1
  429. package/dist/twilight/{p-f1a3cf9e.entry.js → p-ab3ad37f.entry.js} +1 -1
  430. package/dist/twilight/{p-10968d1c.entry.js → p-abc3e5d5.entry.js} +1 -1
  431. package/dist/twilight/{p-0f9bfeeb.entry.js → p-b356f3f6.entry.js} +1 -1
  432. package/dist/twilight/{p-2bf8f0ed.entry.js → p-b55fb51b.entry.js} +1 -1
  433. package/dist/twilight/{p-28875055.entry.js → p-bb35af04.entry.js} +1 -1
  434. package/dist/twilight/{p-3ff2b8b6.entry.js → p-bf845ea7.entry.js} +1 -1
  435. package/dist/twilight/{p-5b1a0560.entry.js → p-c2e871ae.entry.js} +1 -1
  436. package/dist/twilight/{p-004584f5.entry.js → p-c38fb150.entry.js} +1 -1
  437. package/dist/twilight/{p-7b373051.entry.js → p-c63ff8ef.entry.js} +1 -1
  438. package/dist/twilight/{p-63a315e1.entry.js → p-c90600b1.entry.js} +1 -1
  439. package/dist/twilight/{p-2c480419.entry.js → p-cc1b3318.entry.js} +1 -1
  440. package/dist/twilight/{p-44b8d453.entry.js → p-ce1d3ad9.entry.js} +1 -1
  441. package/dist/twilight/{p-ea1c06ab.entry.js → p-ce80fb8f.entry.js} +1 -1
  442. package/dist/twilight/{p-d7e5b860.entry.js → p-d3556d1f.entry.js} +1 -1
  443. package/dist/twilight/{p-ef037207.entry.js → p-d3cf9f8a.entry.js} +1 -1
  444. package/dist/twilight/{p-af99726d.entry.js → p-dd18ac5c.entry.js} +1 -1
  445. package/dist/twilight/p-dda4d231.entry.js +4 -0
  446. package/dist/twilight/{p-86ad5af2.entry.js → p-e0d834a7.entry.js} +1 -1
  447. package/dist/twilight/{p-71ecb477.entry.js → p-e4ff7a77.entry.js} +1 -1
  448. package/dist/twilight/{p-5ddd9aa0.entry.js → p-e66856c5.entry.js} +1 -1
  449. package/dist/twilight/{p-a47b910f.entry.js → p-e7c4d4cc.entry.js} +1 -1
  450. package/dist/twilight/{p-12ab7c1a.entry.js → p-e944f02a.entry.js} +1 -1
  451. package/dist/twilight/{p-21e6b2e7.entry.js → p-e95fd91e.entry.js} +1 -1
  452. package/dist/twilight/{p-55e0745e.entry.js → p-ea7846fd.entry.js} +1 -1
  453. package/dist/twilight/p-f0ca37fc.entry.js +4 -0
  454. package/dist/twilight/{p-96cac80e.entry.js → p-f2e13d28.entry.js} +1 -1
  455. package/dist/twilight/p-f514b9f5.entry.js +4 -0
  456. package/dist/twilight/p-fa6f2b27.entry.js +4 -0
  457. package/dist/twilight/{p-84599aa5.entry.js → p-faadae59.entry.js} +1 -1
  458. package/dist/twilight/{p-4bf58226.entry.js → p-fc500047.entry.js} +1 -1
  459. package/dist/twilight/p-fdc97278.entry.js +4 -0
  460. package/dist/twilight/twilight.esm.js +1 -1
  461. package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +6 -0
  462. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +25 -12
  463. package/dist/types/components/salla-cart-coupons/interfaces.d.ts +20 -0
  464. package/dist/types/components/salla-cart-coupons/salla-cart-coupons.d.ts +49 -1
  465. package/dist/types/components/salla-offer/salla-offer.d.ts +10 -0
  466. package/dist/types/components/salla-orders/interface.d.ts +2 -0
  467. package/dist/types/components/salla-orders/salla-orders.d.ts +5 -1
  468. package/dist/types/components.d.ts +2 -2
  469. package/package.json +5 -5
  470. package/dist/twilight/p-127f0000.entry.js +0 -4
  471. package/dist/twilight/p-25a4633f.entry.js +0 -4
  472. package/dist/twilight/p-3357d33a.entry.js +0 -4
  473. package/dist/twilight/p-338f727b.entry.js +0 -4
  474. package/dist/twilight/p-7a19ef45.entry.js +0 -4
  475. package/dist/twilight/p-8d30dbac.entry.js +0 -4
  476. package/dist/twilight/p-CV6uPJEJ.js +0 -4
  477. package/dist/twilight/p-a391b31d.entry.js +0 -4
  478. package/dist/twilight/p-eb11b8be.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,H as s}from"./p-a6lSRQK4.js";var i='\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>user-off</title>\n<path d="M10.837 19.309c-4.963 1.284-8.171 4.303-8.171 7.691v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-2.101 2.48-4.155 6.172-5.109 0.713-0.184 1.141-0.912 0.957-1.625-0.184-0.711-0.908-1.137-1.625-0.956zM12.859 3.715c0.933-0.685 2.020-1.048 3.141-1.048 2.941 0 5.333 2.392 5.333 5.333 0 1.121-0.363 2.208-1.048 3.141-0.436 0.593-0.308 1.428 0.284 1.864 0.239 0.175 0.515 0.259 0.788 0.259 0.411 0 0.815-0.188 1.076-0.544 1.025-1.393 1.567-3.025 1.567-4.72 0-4.412-3.588-8-8-8-1.695 0-3.327 0.541-4.721 1.567-0.592 0.435-0.72 1.269-0.284 1.864 0.436 0.593 1.269 0.721 1.864 0.284zM31.609 29.724l-29.333-29.333c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l29.333 29.333c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n';const r=class{constructor(t){e(this,t),this.otpInputs=[],this.isDeleteAccountEnabled=!!salla.config.get("store.features",[])?.includes("customer-account-deletion"),this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.buttonLoading=!1,this.deletePendingDays=null,this.currentStep="confirm",this.isDeletePending=!1,this.otpType="email",this.otpHasError=!1,this.otpErrorMessage="",this.isSubmitting=!1,this.isVerifyingOtp=!1,this.isSwitchingChannel=!1,this.resendAfter=30,this.showResendLink=!1,this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.translationDefaults={"pages.profile.delete_account":{ar:"حذف الحساب",en:"Delete account"},"pages.profile.delete_account_description":{ar:"سيُحذف حسابك وبياناتك من المتجر نهائيًا، بما في ذلك سجل طلباتك.",en:"Your account and data will be permanently deleted from the store, including your order history."},"pages.profile.delete_account_confirm_title":{ar:"هل تريد حذف حسابك؟",en:"Do you want to delete your account?"},"pages.profile.delete_account_warning":{ar:"بعد الحذف، ستفقد الوصول إلى بياناتك، بما في ذلك سجل الطلبات، وقائمة الأمنيات، وأي نقاط ولاء أو رصيد متاح في المحفظة.",en:"After deletion, you will lose access to your data, including order history, wishlist, and any loyalty points or wallet balance."},"pages.profile.cancel":{ar:"إلغاء",en:"Cancel"},"pages.profile.delete_account_otp_title":{ar:"تأكيد حذف الحساب",en:"Confirm account deletion"},"pages.profile.delete_account_otp_instruction":{ar:"للمتابعة، أدخل رمز التحقٌّق المرسل إلى:",en:"To continue, enter the verification code sent to:"},"pages.profile.delete_account_confirm_otp":{ar:"تأكيد الحذف",en:"Confirm deletion"},"pages.profile.delete_account_otp_required":{ar:"يرجى إدخال رمز التحقٌّق",en:"Please enter the verification code"},"pages.profile.delete_account_send_via_phone":{ar:"إرسال عبر الهاتف",en:"Send via phone"},"pages.profile.delete_account_send_via_email":{ar:"إرسال عبر البريد الإلكتروني",en:"Send via email"},"pages.profile.delete_account_success_title":{ar:"أُرسل طلب حذف الحساب",en:"Account deletion request submitted"},"pages.profile.delete_account_success_message":{ar:"سيُحذف حسابك خلال 30 يومًا. يمكنك إلغاء الطلب بتسجيل الدخول مرة أخرى قبل اكتمال الحذف.",en:"Your account will be deleted within 30 days. You can cancel the request by signing in again before deletion is complete."},"pages.profile.ok":{ar:"موافق",en:"OK"},"pages.profile.cancel_deletion_request":{ar:"تراجع عن الحذف",en:"Withdraw deletion"},"pages.profile.delete_account_pending":{ar:"حسابك مجدول للحذف نهائيًا من المتجر خلال :days يومًا. يمكنك التراجع عن الحذف قبل انقضاء المدة.",en:"Your account will be deleted permanently from the store within :days days. You can withdraw the deletion before the deadline."},"pages.profile.delete_request_cancelled":{ar:"تم إلغاء طلب الحذف",en:"Deletion request cancelled"}},this.registerTranslationDefaults(),this.loadTranslations(),salla.onReady((()=>{this.isHiddenName=salla.config.get("user.is_hidden_name"),this.isNotifiable=salla.config.get("user.is_notifiable"),this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.isDeleteAccountEnabled&&this.fetchDeleteRequestStatus(),this.isNotifiable&&this.isHiddenName||salla.event.on("profile::info.fetched",(e=>{this.isHiddenName=e.data.is_hidden_name,this.isNotifiable=e.data.is_notifiable}))})),salla.lang.onLoaded((()=>{this.registerTranslationDefaults(),this.loadTranslations()}))}getDaysUntilExecution(e){return Math.max(0,Math.ceil(((e>1e12?e:1e3*e)-Date.now())/864e5))}applyPendingMessage(){const e=salla.lang.get("pages.profile.delete_account_pending");this.deleteAccountPending=null!=this.deletePendingDays?e.replace(/:days/g,String(salla.helpers.number(this.deletePendingDays))):e}async fetchDeleteRequestStatus(){try{const e=await salla.profile.getDeleteRequest(),t=e?.data??null,s=t?.data_request||t,i=s?.status;this.isDeletePending="pending"===i;const r=s?.execution_at;this.deletePendingDays=null==r||Number.isNaN(Number(r))?null:this.getDaysUntilExecution(Number(r)),this.applyPendingMessage()}catch{}}registerTranslationDefaults(){if(!salla?.lang?.addBulk)return;const e=Object.entries(this.translationDefaults).reduce(((e,[t,s])=>(salla.lang.get(t)===t&&(e[t]=s),e)),{});Object.keys(e).length&&salla.lang.addBulk(e)}loadTranslations(){this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.deleteAccount=salla.lang.get("pages.profile.delete_account"),this.deleteAccountDesc=salla.lang.get("pages.profile.delete_account_description"),this.deleteConfirmTitle=salla.lang.get("pages.profile.delete_account_confirm_title"),this.deleteAccountWarning=salla.lang.get("pages.profile.delete_account_warning"),this.cancelLabel=salla.lang.get("pages.profile.cancel"),this.deleteOtpTitle=salla.lang.get("pages.profile.delete_account_otp_title"),this.deleteOtpInstruction=salla.lang.get("pages.profile.delete_account_otp_instruction"),this.deleteConfirmOtp=salla.lang.get("pages.profile.delete_account_confirm_otp"),this.sendViaPhone=salla.lang.get("pages.profile.delete_account_send_via_phone"),this.sendViaEmail=salla.lang.get("pages.profile.delete_account_send_via_email"),this.deleteSuccessTitle=salla.lang.get("pages.profile.delete_account_success_title"),this.deleteSuccessMessage=salla.lang.get("pages.profile.delete_account_success_message"),this.okLabel=salla.lang.get("pages.profile.ok"),this.cancelDeletionRequest=salla.lang.get("pages.profile.cancel_deletion_request"),this.applyPendingMessage(),this.resendAfterLabel=salla.lang.get("blocks.header.resend_after"),this.resendLabel=salla.lang.get("blocks.comments.submit"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.hideMyName=salla.lang.get("pages.profile.hide_my_name"),this.hideMyNameDesc=salla.lang.get("pages.profile.hide_my_name_desc"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description")}toggleSetting(e,t){salla.profile.updateSettings({name:e,value:t.target.checked})}capitalizeText(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}getOtpTarget(){return"email"===this.otpType?salla.config.get("user.email")||"":salla.config.get("user.mobile")||""}updateModalForStep(){if(this.confirmationModal)switch(this.currentStep){case"confirm":this.confirmationModal.setTitle(this.capitalizeText(this.deleteConfirmTitle));break;case"otp":this.confirmationModal.setTitle(this.capitalizeText(this.deleteOtpTitle));break;case"success":this.confirmationModal.setTitle(this.capitalizeText(this.deleteSuccessTitle))}}openDeleteModal(){this.currentStep="confirm",this.otpType="email",this.resetOtpInputs(),this.clearResendTimer(),this.updateModalForStep(),this.confirmationModal.open()}openDeactivateModal(){this.confirmationModal.setTitle(this.capitalizeText(this.deactivateAccount)),this.confirmationModal.open()}async confirmDeactivateAccount(){this.buttonLoading=!0,await salla.profile.delete().finally((()=>{this.buttonLoading=!1,this.confirmationModal.close()}))}closeDeleteModal(){this.clearResendTimer(),this.confirmationModal?.close()}goBackFromOtp(){this.clearResendTimer(),this.resetOtpInputs(),this.resetOtpError(),this.currentStep="confirm",this.updateModalForStep()}async handleModalVisibilityChanged(e){if(e.detail)return;this.clearResendTimer();const t="success"===this.currentStep;t&&(this.isDeletePending=!0),this.currentStep="confirm",this.resetOtpInputs(),t&&await this.fetchDeleteRequestStatus()}formatResendTimer(e){return"00 : "+(e>=10?`${e}`:`0${e}`)}updateResendTimerDisplay(){this.timerEl&&(this.timerEl.innerHTML=this.formatResendTimer(this.resendAfter))}isDeleteRequestInFlight(){return this.isSubmitting||this.isSwitchingChannel||this.isVerifyingOtp}async initiateDeleteRequest(e="confirm"){if(!this.isDeleteRequestInFlight()){"switch"===e||"resend"===e?this.isSwitchingChannel=!0:this.isSubmitting=!0;try{await salla.profile.initiateDeleteRequest(this.otpType),this.currentStep="otp",this.updateModalForStep(),this.resetOtpInputs(),this.startResendTimer(),setTimeout((()=>this.otpInputs[0]?.focus()),100)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{"switch"===e||"resend"===e?this.isSwitchingChannel=!1:this.isSubmitting=!1}}}async switchOtpChannel(){this.isDeleteRequestInFlight()||(this.otpType="email"===this.otpType?"mobile":"email",await this.initiateDeleteRequest("switch"))}async resendOtp(){this.showResendLink&&!this.isDeleteRequestInFlight()&&await this.initiateDeleteRequest("resend")}collectOtpCode(){const e=salla.helpers.number(this.otpInputs.map((e=>e?.value||"")).join(""),!0).replace(/[^0-9]/g,"");return this.hiddenCodeInput&&(this.hiddenCodeInput.value=e),e}resetOtpError(){this.otpHasError=!1,this.otpErrorMessage=""}setOtpError(e){this.otpHasError=!0,this.otpErrorMessage=e}async verifyDeleteOtp(){if(this.isVerifyingOtp||this.isSwitchingChannel)return;const e=this.collectOtpCode();if(e.length<4)return this.setOtpError(salla.lang.get("pages.profile.delete_account_otp_required")),void this.otpInputs[e.length]?.focus();this.resetOtpError(),this.isVerifyingOtp=!0;try{const t=await salla.profile.verifyDeleteRequest({type:this.otpType,code:e});this.deleteSuccessMessage=t?.data?.message||salla.lang.get("pages.profile.delete_account_success_message"),this.clearResendTimer(),this.resetOtpInputs(),this.otpInputs=[],this.currentStep="success",this.updateModalForStep()}catch(e){this.setOtpError(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred")),this.resetOtpInputs()}finally{this.isVerifyingOtp=!1}}async confirmSuccess(){this.isDeletePending=!0,this.closeDeleteModal(),this.currentStep="confirm",await this.fetchDeleteRequestStatus()}async cancelDeleteRequest(){if(!this.isSubmitting){this.isSubmitting=!0;try{const e=(await salla.profile.cancelDeleteRequest()).message||salla.lang.get("pages.profile.delete_request_cancelled");this.isDeletePending=!1,salla.notify?.success?.(e)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{this.isSubmitting=!1}}}resetOtpInputs(){this.otpInputs.forEach((e=>{e&&(e.value="")})),this.hiddenCodeInput&&(this.hiddenCodeInput.value="")}modifyNextOtpInput(e,t){e.value=t[0],t=t.substring(1),e.nextElementSibling&&t.length?this.modifyNextOtpInput(e.nextElementSibling,t):e.nextElementSibling||0!==t.length?e.nextElementSibling&&0===t.length&&e.nextElementSibling.focus():e.focus()}splitOtpNumber(e){const t=salla.helpers.number(e.data||e.target.value||"",!0).replace(/[^0-9]/g,"");t&&1!==t.length&&this.modifyNextOtpInput(e.target,t)}allOtpInputsFilled(){return this.otpInputs.every((e=>e?.value))}handleOtpInput(e){this.resetOtpError(),e.target.value=salla.helpers.number(e.target.value||"",!0),salla.helpers.inputDigitsOnly(e.target),this.allOtpInputsFilled()&&setTimeout((()=>this.verifyDeleteOtp()),100)}handleOtpKeyUp(e){if(this.resetOtpError(),["Alt","Shift","Control","AltGraph","Ctrl"].includes(e.key))return;const t=e.keyCode||e.charCode;e.target.value?(e.target.nextElementSibling?.focus(),e.target.nextElementSibling?.select()):[8,46].includes(t)&&(e.target.previousElementSibling?.focus(),e.target.previousElementSibling?.select()),e.target.value.length>1&&this.splitOtpNumber(e)}handleOtpPaste(e){this.resetOtpError();const t=salla.helpers.number(e.clipboardData.getData("text")||"",!0).replace(/[^0-9]/g,"").substring(0,this.otpInputs.length);this.otpInputs.forEach((e=>e.value="")),this.otpInputs[0]&&this.modifyNextOtpInput(this.otpInputs[0],t)}handleOtpFocus(e){e.target!==this.otpInputs[0]&&(""===this.otpInputs[0]?.value&&this.otpInputs[0].focus(),""===e.target.previousElementSibling?.value&&e.target.previousElementSibling.focus())}startResendTimer(){this.clearResendTimer(),this.resendAfter=30,this.showResendLink=!1,this.updateResendTimerDisplay(),this.resendTimerId=setInterval((()=>{if(this.resendAfter--,this.resendAfter<=0)return this.clearResendTimer(),void(this.showResendLink=!0);this.updateResendTimerDisplay()}),1e3)}clearResendTimer(){this.resendTimerId&&(clearInterval(this.resendTimerId),this.resendTimerId=null),this.showResendLink=!1}renderUserDeleteIcon(){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",color:"currentColor",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},t("path",{d:"M14.5 8C14.5 5.23858 12.2614 3 9.5 3C6.73858 3 4.5 5.23858 4.5 8C4.5 10.7614 6.73858 13 9.5 13C12.2614 13 14.5 10.7614 14.5 8Z"}),t("path",{d:"M15.5 21L18.5 18M18.5 18L21.5 15M18.5 18L15.5 15M18.5 18L21.5 21"}),t("path",{d:"M2.5 20C2.5 16.134 5.63401 13 9.5 13C10.775 13 11.9704 13.3409 13 13.9365"}))}renderConfirmStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-warning"},this.deleteAccountWarning),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--row"},t("salla-button",{width:"wide",fill:"outline",color:"danger",onClick:()=>this.closeDeleteModal()},this.capitalizeText(this.cancelLabel)),t("salla-button",{width:"wide",color:"primary",loading:this.isSubmitting,onClick:()=>this.initiateDeleteRequest()},this.capitalizeText(this.deleteAccount))))}renderOtpStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-otp-instruction"},this.deleteOtpInstruction),t("p",{class:"s-user-settings-delete-otp-target"},this.getOtpTarget()),t("input",{type:"hidden",name:"code",maxlength:"4",ref:e=>this.hiddenCodeInput=e}),t("div",{class:{"s-user-settings-delete-otp-codes":!0,"has-error":this.otpHasError},dir:"ltr"},[1,2,3,4].map((e=>t("input",{type:"text",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",id:`delete-otp-${e}`,class:{"s-user-settings-delete-otp-input":!0,"s-has-error":this.otpHasError},onInput:e=>this.handleOtpInput(e),onPaste:e=>this.handleOtpPaste(e),onKeyUp:e=>this.handleOtpKeyUp(e),onFocus:e=>this.handleOtpFocus(e),ref:t=>this.otpInputs[e-1]=t,required:!0})))),this.otpHasError&&this.otpErrorMessage?t("span",{class:"s-user-settings-delete-otp-error"},this.otpErrorMessage):"",t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{width:"wide",color:"primary",disabled:this.isSwitchingChannel,onClick:()=>this.verifyDeleteOtp()},this.capitalizeText(this.deleteConfirmOtp)),t("salla-button",{width:"wide",fill:"outline",color:"primary",disabled:this.isVerifyingOtp,onClick:()=>this.switchOtpChannel()},this.capitalizeText("email"===this.otpType?this.sendViaPhone:this.sendViaEmail))),t("p",{class:"s-user-settings-delete-otp-resend",style:{display:this.showResendLink?"none":"block"}},this.resendAfterLabel,t("b",{class:"s-user-settings-delete-otp-timer mx-1 font-bold",ref:e=>this.timerEl=e})),t("a",{href:"#",class:"s-user-settings-delete-otp-resend-link",style:{display:this.showResendLink?"block":"none"},onClick:e=>{e.preventDefault(),this.resendOtp()}},this.resendLabel))}renderSuccessStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-success-body"},this.deleteSuccessMessage),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{class:"s-user-settings-delete-success-btn",width:"wide",color:"primary",onClick:()=>this.confirmSuccess()},this.capitalizeText(this.okLabel))))}renderDeleteStep(){switch(this.currentStep){case"otp":return this.renderOtpStep();case"success":return this.renderSuccessStep();default:return this.renderConfirmStep()}}renderDeleteSectionAction(){return this.isDeletePending?t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",loading:this.isSubmitting,onClick:()=>this.cancelDeleteRequest()},this.capitalizeText(this.cancelDeletionRequest)):t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeleteModal()},this.capitalizeText(this.deleteAccount))}render(){return t(s,{key:"9355ff42e49fc65cc851e69c0846f8c3e068c767",class:"s-user-settings-wrapper"},this.canHideName&&t("div",{key:"a41320b9d2f95d4643e579a7c327edccaa9bc0b6",class:"s-user-settings-section"},t("salla-list-tile",{key:"5a0266c508c3e660381740a650ee7b0024a654be"},t("div",{key:"f5db5dfa0592500eff32d67538d7ba48f2c13747",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"056d0c586336fb424b7e965adf3730e2774c1ac7",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>user-cancel</title>\n<path d="M29.885 16l1.724-1.724c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-1.724 1.724-1.724-1.724c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l1.724 1.724-1.724 1.724c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l1.724-1.724 1.724 1.724c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM10.667 16c4.043 0 7.333-3.289 7.333-7.333s-3.291-7.333-7.333-7.333-7.333 3.289-7.333 7.333 3.291 7.333 7.333 7.333zM10.667 4c2.573 0 4.667 2.093 4.667 4.667s-2.093 4.667-4.667 4.667-4.667-2.093-4.667-4.667 2.093-4.667 4.667-4.667zM10.667 18.667c-5.881 0-10.667 3.813-10.667 8.5v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-3.217 3.588-5.833 8-5.833s8 2.616 8 5.833v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-4.687-4.785-8.5-10.667-8.5z"></path>\n</svg>\n'})),t("div",{key:"6b48e3ea1f82990647838f6f9772c73bad938442",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.hideMyName)),t("div",{key:"ee670146ea0942bf399cac23cb27a416f460d7a0",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.hideMyNameDesc)),t("div",{key:"137fd3572f28030f90f82e5111778c7a1543a500",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"a8e3418b4a63c5bd948ad23d12c772d480ae2139",class:"s-toggle"},t("input",{key:"71b93d2099c4b4e85ac11e5de4d9f6ab9fea6bd5",class:"s-toggle-input",checked:this.isHiddenName,onChange:e=>this.toggleSetting("is_hidden_name",e),type:"checkbox"}),t("div",{key:"c236514337252f7f66386a62f34a4d4abb09b6d2",class:"s-toggle-switcher"}))))),t("div",{key:"ad4ef5352baa807e2cd80ad40f0e6fa443264eed",class:"s-user-settings-section"},t("salla-list-tile",{key:"1d7f11ed71f8adda90f705d1cf71ffd6f1b44bdd"},t("div",{key:"c3606deb96e20ba1be099ca41b720526825d8567",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"9a780d54d220d26d7b740d1bf3a3fa3f32643e0c",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>bullhorn</title>\n<path d="M30.129 0.264c-0.339-0.252-0.776-0.328-1.179-0.208l-24.951 7.485v-0.216c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v14.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-0.112l3.448 1.207-0.595 1.704c-0.321 1.019-0.227 2.103 0.267 3.051s1.327 1.647 2.345 1.968l6.359 2.004c0.399 0.127 0.804 0.187 1.201 0.187 1.699 0 3.277-1.091 3.812-2.785l0.423-1.295 7.633 2.672c0.143 0.049 0.292 0.075 0.44 0.075 0.273 0 0.543-0.084 0.772-0.247 0.352-0.249 0.561-0.655 0.561-1.087v-28c0-0.421-0.199-0.819-0.537-1.069zM18.297 28.4c-0.221 0.701-0.973 1.089-1.673 0.871l-6.357-2.004c-0.34-0.108-0.617-0.34-0.781-0.656s-0.196-0.676-0.101-0.977l0.581-1.665 8.777 3.072zM28 27.453l-24-8.4v-8.728l24-7.2z"></path>\n</svg>\n'})),t("div",{key:"d0af6ce3b901e51647d8a27740857f5fe68e99e3",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.promotionalMsgs)),t("div",{key:"7fdc90b7f3e3c6af0d97ff6192eb96a4ed5a8d0c",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.promotionalMsgsDesc)),t("div",{key:"d02d1d164316b31c20c51dae577cb55fb72054d1",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"5d37c33fec59a77017b0d1d7cc1d589f9907819b",class:"s-toggle"},t("input",{key:"d804611cacfaf25590e9eee835441c22c6243d49",class:"s-toggle-input",checked:this.isNotifiable,onChange:e=>this.toggleSetting("is_notifiable",e),type:"checkbox"}),t("div",{key:"118b70defeb3b5083d9712ef1f41e5edf5a428fc",class:"s-toggle-switcher"}))))),this.isDeleteAccountEnabled?t("div",{class:"s-user-settings-section s-user-settings-section-delete-user"},t("salla-list-tile",null,t("div",{slot:"icon",class:"s-user-settings-section-icon"},this.renderUserDeleteIcon()),t("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deleteAccount)),t("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.isDeletePending?this.deleteAccountPending:this.deleteAccountDesc)),t("div",{slot:"action",class:"s-user-settings-section-action"},this.renderDeleteSectionAction()))):t("div",{class:"s-user-settings-section s-user-settings-section-deactivate-user"},t("salla-list-tile",null,t("div",{slot:"icon",class:"s-user-settings-section-icon"},t("span",{innerHTML:i})),t("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deactivateAccount)),t("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.deactivateDesc)),t("div",{slot:"action",class:"s-user-settings-section-action"},t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeactivateModal()},this.capitalizeText(this.deactivateAccount))))),this.isDeleteAccountEnabled?t("salla-modal",{id:"salla-user-settings-delete-modal",width:"xs",centered:!0,showBack:"otp"===this.currentStep,isClosable:"success"!==this.currentStep,iconStyle:"success"===this.currentStep?"success":void 0,onModalVisibilityChanged:e=>this.handleModalVisibilityChanged(e),onModalBack:()=>this.goBackFromOtp(),ref:e=>this.confirmationModal=e},"success"!==this.currentStep?t("span",{slot:"icon",class:"s-user-settings-delete-icon"},this.renderUserDeleteIcon()):null,t("div",{key:this.currentStep,class:"s-user-settings-delete-step"},this.renderDeleteStep())):t("salla-modal",{width:"sm",subTitle:this.capitalizeText(this.sorryForLeavingText),ref:e=>this.confirmationModal=e},t("span",{slot:"icon",class:"s-user-settings-confirmation-icon",innerHTML:i}),t("div",{class:"s-user-settings-confirmation"},t("div",{class:"s-user-settings-confirmation-warning"},this.capitalizeText(this.warningText)),t("div",{class:"s-user-settings-confirmation-actions"},t("salla-button",{width:"wide",onClick:()=>this.confirmationModal.close()},this.capitalizeText(this.keepAccount)),t("salla-button",{fill:"outline",loading:this.buttonLoading,width:"wide",onClick:()=>this.confirmDeactivateAccount()},this.capitalizeText(this.deactivateAccount))))))}};r.style='/*!twlt*/.s-modal-header-inner{display:flex;flex-direction:column !important;align-items:center !important;justify-content:center !important}.s-modal-header-content{text-align:center !important}.s-user-settings-delete-body{text-align:center}.s-user-settings-delete-icon{display:inline-flex;align-items:center;justify-content:center;width:4rem;height:4rem;border-radius:9999px;border:1px solid var(--infinte-color);color:var(--infinte-color);margin:0 auto 1rem}.s-user-settings-delete-icon svg{width:1.5rem;height:1.5rem}.s-user-settings-delete-warning{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-actions--row{display:flex;gap:0.75rem;justify-content:center}.s-user-settings-delete-actions--row salla-button{flex:1}.s-user-settings-delete-actions--stack{display:flex;flex-direction:column;gap:0.75rem;margin-top:1.25rem}.s-user-settings-delete-otp-instruction{color:#6b7280;font-size:0.875rem}.s-user-settings-delete-otp-target{color:#6b7280;direction:ltr;margin-bottom:1.25rem}.s-user-settings-delete-otp-codes{display:flex;justify-content:stretch;gap:0.75rem;direction:ltr;margin-bottom:0.75rem;width:100%}.s-user-settings-delete-otp-codes.has-error{margin-bottom:0}.s-user-settings-delete-otp-input{flex:1 1 0;min-width:0;width:100%;height:3.5rem;text-align:center;border:1px solid #d1d5db;border-radius:0.5rem;font-size:1.25rem;font-weight:600;color:#111827;outline:none}.s-user-settings-delete-otp-input:focus{border-color:#004956;box-shadow:0 0 0 1px #004956}.s-user-settings-delete-otp-input.s-has-error{border-color:#ef4444 !important}.s-user-settings-delete-otp-input.s-has-error:focus{border-color:#ef4444 !important;box-shadow:0 0 0 1px #ef4444}.s-user-settings-delete-otp-input::-webkit-outer-spin-button,.s-user-settings-delete-otp-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-user-settings-delete-otp-input[type=text]{-moz-appearance:textfield}.s-user-settings-delete-otp-error{display:block;color:#ef4444;font-size:0.75rem;text-align:center;padding-top:0.75rem;margin-bottom:1.25rem}.s-user-settings-delete-otp-resend{color:#6b7280;font-size:0.75rem;margin-top:1rem;text-align:center}.s-user-settings-delete-otp-timer{font-weight:600;direction:ltr;display:inline-block}.s-user-settings-delete-otp-resend-link{display:block;color:#004956;font-size:0.875rem;margin-top:1rem;text-align:center;text-decoration:underline;cursor:pointer}.s-user-settings-delete-success-body{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-success-btn{--s-button-color:#004956}.mx-1{margin-left:0.25rem;margin-right:0.25rem}.block{display:block}.hidden{display:none}.font-bold{font-weight:700}.outline{outline-style:solid}.s-has-error{--tw-border-opacity:1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.s-has-error:focus{--tw-border-opacity:1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.has-error .s-form-label{color:#ff443a}.has-error .s-form-control,.has-error .s-tel-input-control,.has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.toggle-checkbox .s-toggle-input{position:absolute;visibility:hidden}.toggle-checkbox .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.toggle-checkbox .s-toggle-switcher:before,.toggle-checkbox .s-toggle-switcher:after{content:""}.toggle-checkbox .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.toggle-checkbox .s-toggle-input:checked+div{background:#30D158}.toggle-checkbox .s-toggle-input:checked+div:before{left:18px}.s-has-error{--tw-border-opacity:1 !important;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1)) !important;--tw-text-opacity:1 !important;color:rgb(239 68 68 / var(--tw-text-opacity, 1)) !important}.s-toggle{cursor:pointer;display:inline-block}.s-toggle .s-toggle-input{position:absolute;visibility:hidden}.s-toggle .s-toggle-label{margin-left:5px;position:relative;top:2px}.s-toggle .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.s-toggle .s-toggle-switcher:before,.s-toggle .s-toggle-switcher:after{content:""}.s-toggle .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.s-toggle .s-toggle-input:checked+div{background:#30D158}.s-toggle .s-toggle-input:checked+div:before{left:18px}.s-user-settings-section{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-user-settings-section:first-child{border-bottom-right-radius:0px;border-bottom-left-radius:0px;border-top-left-radius:0.375rem;border-top-right-radius:0.375rem}.s-user-settings-section:last-child{border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-width:0px}.s-user-settings-section .s-list-tile-item{align-items:flex-start;background-color:transparent;padding:1.25rem}@media (min-width: 768px){.s-user-settings-section .s-list-tile-item{align-items:center}}.s-user-settings-section .s-list-tile-item-action{margin-left:auto}.s-user-settings-section .s-list-tile-item-action:where([dir="rtl"],[dir="rtl"] *){margin-right:auto;margin-left:0px}.s-user-settings-section .s-list-tile-item-action button{width:100%;padding:10px}.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:wrap}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:nowrap}}.s-user-settings-section-delete-user .s-list-tile-item-icon{position:relative;top:5px}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-icon{top:0px}}@media (max-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-content{flex:1 0 85%}.s-user-settings-section-delete-user .s-list-tile-item-action{flex:1 1 100%;margin-top:1rem}}.s-user-settings-section-title{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-user-settings-section-subtitle{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-user-settings-section-icon svg{height:1.25rem;width:1.25rem}.s-user-settings-confirmation{text-align:center}.s-user-settings-confirmation svg{text-align:center}.s-user-settings-confirmation-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-user-settings-confirmation-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-user-settings-confirmation-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-user-settings-confirmation-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-user-settings-confirmation-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-user-settings-confirmation-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-user-settings-confirmation-icon svg{height:1.25rem;width:1.25rem;flex-shrink:0;fill:#9ca3af}.s-user-settings-confirmation-warning{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-user-settings-confirmation-actions{margin-top:1.25rem;display:flex;align-items:center;justify-content:space-between}.s-user-settings-confirmation-actions>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-user-settings-confirmation-actions:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}';export{r as salla_user_settings}
4
+ import{r as e,h as t,H as s}from"./p-BAXTlrSC.js";var i='\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>user-off</title>\n<path d="M10.837 19.309c-4.963 1.284-8.171 4.303-8.171 7.691v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-2.101 2.48-4.155 6.172-5.109 0.713-0.184 1.141-0.912 0.957-1.625-0.184-0.711-0.908-1.137-1.625-0.956zM12.859 3.715c0.933-0.685 2.020-1.048 3.141-1.048 2.941 0 5.333 2.392 5.333 5.333 0 1.121-0.363 2.208-1.048 3.141-0.436 0.593-0.308 1.428 0.284 1.864 0.239 0.175 0.515 0.259 0.788 0.259 0.411 0 0.815-0.188 1.076-0.544 1.025-1.393 1.567-3.025 1.567-4.72 0-4.412-3.588-8-8-8-1.695 0-3.327 0.541-4.721 1.567-0.592 0.435-0.72 1.269-0.284 1.864 0.436 0.593 1.269 0.721 1.864 0.284zM31.609 29.724l-29.333-29.333c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l29.333 29.333c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n';const r=class{constructor(t){e(this,t),this.otpInputs=[],this.isDeleteAccountEnabled=!!salla.config.get("store.features",[])?.includes("customer-account-deletion"),this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.buttonLoading=!1,this.deletePendingDays=null,this.currentStep="confirm",this.isDeletePending=!1,this.otpType="email",this.otpHasError=!1,this.otpErrorMessage="",this.isSubmitting=!1,this.isVerifyingOtp=!1,this.isSwitchingChannel=!1,this.resendAfter=30,this.showResendLink=!1,this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.translationDefaults={"pages.profile.delete_account":{ar:"حذف الحساب",en:"Delete account"},"pages.profile.delete_account_description":{ar:"سيُحذف حسابك وبياناتك من المتجر نهائيًا، بما في ذلك سجل طلباتك.",en:"Your account and data will be permanently deleted from the store, including your order history."},"pages.profile.delete_account_confirm_title":{ar:"هل تريد حذف حسابك؟",en:"Do you want to delete your account?"},"pages.profile.delete_account_warning":{ar:"بعد الحذف، ستفقد الوصول إلى بياناتك، بما في ذلك سجل الطلبات، وقائمة الأمنيات، وأي نقاط ولاء أو رصيد متاح في المحفظة.",en:"After deletion, you will lose access to your data, including order history, wishlist, and any loyalty points or wallet balance."},"pages.profile.cancel":{ar:"إلغاء",en:"Cancel"},"pages.profile.delete_account_otp_title":{ar:"تأكيد حذف الحساب",en:"Confirm account deletion"},"pages.profile.delete_account_otp_instruction":{ar:"للمتابعة، أدخل رمز التحقٌّق المرسل إلى:",en:"To continue, enter the verification code sent to:"},"pages.profile.delete_account_confirm_otp":{ar:"تأكيد الحذف",en:"Confirm deletion"},"pages.profile.delete_account_otp_required":{ar:"يرجى إدخال رمز التحقٌّق",en:"Please enter the verification code"},"pages.profile.delete_account_send_via_phone":{ar:"إرسال عبر الهاتف",en:"Send via phone"},"pages.profile.delete_account_send_via_email":{ar:"إرسال عبر البريد الإلكتروني",en:"Send via email"},"pages.profile.delete_account_success_title":{ar:"أُرسل طلب حذف الحساب",en:"Account deletion request submitted"},"pages.profile.delete_account_success_message":{ar:"سيُحذف حسابك خلال 30 يومًا. يمكنك إلغاء الطلب بتسجيل الدخول مرة أخرى قبل اكتمال الحذف.",en:"Your account will be deleted within 30 days. You can cancel the request by signing in again before deletion is complete."},"pages.profile.ok":{ar:"موافق",en:"OK"},"pages.profile.cancel_deletion_request":{ar:"تراجع عن الحذف",en:"Withdraw deletion"},"pages.profile.delete_account_pending":{ar:"حسابك مجدول للحذف نهائيًا من المتجر خلال :days يومًا. يمكنك التراجع عن الحذف قبل انقضاء المدة.",en:"Your account will be deleted permanently from the store within :days days. You can withdraw the deletion before the deadline."},"pages.profile.delete_request_cancelled":{ar:"تم إلغاء طلب الحذف",en:"Deletion request cancelled"}},this.registerTranslationDefaults(),this.loadTranslations(),salla.onReady((()=>{this.isHiddenName=salla.config.get("user.is_hidden_name"),this.isNotifiable=salla.config.get("user.is_notifiable"),this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.isDeleteAccountEnabled&&this.fetchDeleteRequestStatus(),this.isNotifiable&&this.isHiddenName||salla.event.on("profile::info.fetched",(e=>{this.isHiddenName=e.data.is_hidden_name,this.isNotifiable=e.data.is_notifiable}))})),salla.lang.onLoaded((()=>{this.registerTranslationDefaults(),this.loadTranslations()}))}getDaysUntilExecution(e){return Math.max(0,Math.ceil(((e>1e12?e:1e3*e)-Date.now())/864e5))}applyPendingMessage(){const e=salla.lang.get("pages.profile.delete_account_pending");this.deleteAccountPending=null!=this.deletePendingDays?e.replace(/:days/g,String(salla.helpers.number(this.deletePendingDays))):e}async fetchDeleteRequestStatus(){try{const e=await salla.profile.getDeleteRequest(),t=e?.data??null,s=t?.data_request||t,i=s?.status;this.isDeletePending="pending"===i;const r=s?.execution_at;this.deletePendingDays=null==r||Number.isNaN(Number(r))?null:this.getDaysUntilExecution(Number(r)),this.applyPendingMessage()}catch{}}registerTranslationDefaults(){if(!salla?.lang?.addBulk)return;const e=Object.entries(this.translationDefaults).reduce(((e,[t,s])=>(salla.lang.get(t)===t&&(e[t]=s),e)),{});Object.keys(e).length&&salla.lang.addBulk(e)}loadTranslations(){this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.deleteAccount=salla.lang.get("pages.profile.delete_account"),this.deleteAccountDesc=salla.lang.get("pages.profile.delete_account_description"),this.deleteConfirmTitle=salla.lang.get("pages.profile.delete_account_confirm_title"),this.deleteAccountWarning=salla.lang.get("pages.profile.delete_account_warning"),this.cancelLabel=salla.lang.get("pages.profile.cancel"),this.deleteOtpTitle=salla.lang.get("pages.profile.delete_account_otp_title"),this.deleteOtpInstruction=salla.lang.get("pages.profile.delete_account_otp_instruction"),this.deleteConfirmOtp=salla.lang.get("pages.profile.delete_account_confirm_otp"),this.sendViaPhone=salla.lang.get("pages.profile.delete_account_send_via_phone"),this.sendViaEmail=salla.lang.get("pages.profile.delete_account_send_via_email"),this.deleteSuccessTitle=salla.lang.get("pages.profile.delete_account_success_title"),this.deleteSuccessMessage=salla.lang.get("pages.profile.delete_account_success_message"),this.okLabel=salla.lang.get("pages.profile.ok"),this.cancelDeletionRequest=salla.lang.get("pages.profile.cancel_deletion_request"),this.applyPendingMessage(),this.resendAfterLabel=salla.lang.get("blocks.header.resend_after"),this.resendLabel=salla.lang.get("blocks.comments.submit"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.hideMyName=salla.lang.get("pages.profile.hide_my_name"),this.hideMyNameDesc=salla.lang.get("pages.profile.hide_my_name_desc"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description")}toggleSetting(e,t){salla.profile.updateSettings({name:e,value:t.target.checked})}capitalizeText(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}getOtpTarget(){return"email"===this.otpType?salla.config.get("user.email")||"":salla.config.get("user.mobile")||""}updateModalForStep(){if(this.confirmationModal)switch(this.currentStep){case"confirm":this.confirmationModal.setTitle(this.capitalizeText(this.deleteConfirmTitle));break;case"otp":this.confirmationModal.setTitle(this.capitalizeText(this.deleteOtpTitle));break;case"success":this.confirmationModal.setTitle(this.capitalizeText(this.deleteSuccessTitle))}}openDeleteModal(){this.currentStep="confirm",this.otpType="email",this.resetOtpInputs(),this.clearResendTimer(),this.updateModalForStep(),this.confirmationModal.open()}openDeactivateModal(){this.confirmationModal.setTitle(this.capitalizeText(this.deactivateAccount)),this.confirmationModal.open()}async confirmDeactivateAccount(){this.buttonLoading=!0,await salla.profile.delete().finally((()=>{this.buttonLoading=!1,this.confirmationModal.close()}))}closeDeleteModal(){this.clearResendTimer(),this.confirmationModal?.close()}goBackFromOtp(){this.clearResendTimer(),this.resetOtpInputs(),this.resetOtpError(),this.currentStep="confirm",this.updateModalForStep()}async handleModalVisibilityChanged(e){if(e.detail)return;this.clearResendTimer();const t="success"===this.currentStep;t&&(this.isDeletePending=!0),this.currentStep="confirm",this.resetOtpInputs(),t&&await this.fetchDeleteRequestStatus()}formatResendTimer(e){return"00 : "+(e>=10?`${e}`:`0${e}`)}updateResendTimerDisplay(){this.timerEl&&(this.timerEl.innerHTML=this.formatResendTimer(this.resendAfter))}isDeleteRequestInFlight(){return this.isSubmitting||this.isSwitchingChannel||this.isVerifyingOtp}async initiateDeleteRequest(e="confirm"){if(!this.isDeleteRequestInFlight()){"switch"===e||"resend"===e?this.isSwitchingChannel=!0:this.isSubmitting=!0;try{await salla.profile.initiateDeleteRequest(this.otpType),this.currentStep="otp",this.updateModalForStep(),this.resetOtpInputs(),this.startResendTimer(),setTimeout((()=>this.otpInputs[0]?.focus()),100)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{"switch"===e||"resend"===e?this.isSwitchingChannel=!1:this.isSubmitting=!1}}}async switchOtpChannel(){this.isDeleteRequestInFlight()||(this.otpType="email"===this.otpType?"mobile":"email",await this.initiateDeleteRequest("switch"))}async resendOtp(){this.showResendLink&&!this.isDeleteRequestInFlight()&&await this.initiateDeleteRequest("resend")}collectOtpCode(){const e=salla.helpers.number(this.otpInputs.map((e=>e?.value||"")).join(""),!0).replace(/[^0-9]/g,"");return this.hiddenCodeInput&&(this.hiddenCodeInput.value=e),e}resetOtpError(){this.otpHasError=!1,this.otpErrorMessage=""}setOtpError(e){this.otpHasError=!0,this.otpErrorMessage=e}async verifyDeleteOtp(){if(this.isVerifyingOtp||this.isSwitchingChannel)return;const e=this.collectOtpCode();if(e.length<4)return this.setOtpError(salla.lang.get("pages.profile.delete_account_otp_required")),void this.otpInputs[e.length]?.focus();this.resetOtpError(),this.isVerifyingOtp=!0;try{const t=await salla.profile.verifyDeleteRequest({type:this.otpType,code:e});this.deleteSuccessMessage=t?.data?.message||salla.lang.get("pages.profile.delete_account_success_message"),this.clearResendTimer(),this.resetOtpInputs(),this.otpInputs=[],this.currentStep="success",this.updateModalForStep()}catch(e){this.setOtpError(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred")),this.resetOtpInputs()}finally{this.isVerifyingOtp=!1}}async confirmSuccess(){this.isDeletePending=!0,this.closeDeleteModal(),this.currentStep="confirm",await this.fetchDeleteRequestStatus()}async cancelDeleteRequest(){if(!this.isSubmitting){this.isSubmitting=!0;try{const e=(await salla.profile.cancelDeleteRequest()).message||salla.lang.get("pages.profile.delete_request_cancelled");this.isDeletePending=!1,salla.notify?.success?.(e)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{this.isSubmitting=!1}}}resetOtpInputs(){this.otpInputs.forEach((e=>{e&&(e.value="")})),this.hiddenCodeInput&&(this.hiddenCodeInput.value="")}modifyNextOtpInput(e,t){e.value=t[0],t=t.substring(1),e.nextElementSibling&&t.length?this.modifyNextOtpInput(e.nextElementSibling,t):e.nextElementSibling||0!==t.length?e.nextElementSibling&&0===t.length&&e.nextElementSibling.focus():e.focus()}splitOtpNumber(e){const t=salla.helpers.number(e.data||e.target.value||"",!0).replace(/[^0-9]/g,"");t&&1!==t.length&&this.modifyNextOtpInput(e.target,t)}allOtpInputsFilled(){return this.otpInputs.every((e=>e?.value))}handleOtpInput(e){this.resetOtpError(),e.target.value=salla.helpers.number(e.target.value||"",!0),salla.helpers.inputDigitsOnly(e.target),this.allOtpInputsFilled()&&setTimeout((()=>this.verifyDeleteOtp()),100)}handleOtpKeyUp(e){if(this.resetOtpError(),["Alt","Shift","Control","AltGraph","Ctrl"].includes(e.key))return;const t=e.keyCode||e.charCode;e.target.value?(e.target.nextElementSibling?.focus(),e.target.nextElementSibling?.select()):[8,46].includes(t)&&(e.target.previousElementSibling?.focus(),e.target.previousElementSibling?.select()),e.target.value.length>1&&this.splitOtpNumber(e)}handleOtpPaste(e){this.resetOtpError();const t=salla.helpers.number(e.clipboardData.getData("text")||"",!0).replace(/[^0-9]/g,"").substring(0,this.otpInputs.length);this.otpInputs.forEach((e=>e.value="")),this.otpInputs[0]&&this.modifyNextOtpInput(this.otpInputs[0],t)}handleOtpFocus(e){e.target!==this.otpInputs[0]&&(""===this.otpInputs[0]?.value&&this.otpInputs[0].focus(),""===e.target.previousElementSibling?.value&&e.target.previousElementSibling.focus())}startResendTimer(){this.clearResendTimer(),this.resendAfter=30,this.showResendLink=!1,this.updateResendTimerDisplay(),this.resendTimerId=setInterval((()=>{if(this.resendAfter--,this.resendAfter<=0)return this.clearResendTimer(),void(this.showResendLink=!0);this.updateResendTimerDisplay()}),1e3)}clearResendTimer(){this.resendTimerId&&(clearInterval(this.resendTimerId),this.resendTimerId=null),this.showResendLink=!1}renderUserDeleteIcon(){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",color:"currentColor",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},t("path",{d:"M14.5 8C14.5 5.23858 12.2614 3 9.5 3C6.73858 3 4.5 5.23858 4.5 8C4.5 10.7614 6.73858 13 9.5 13C12.2614 13 14.5 10.7614 14.5 8Z"}),t("path",{d:"M15.5 21L18.5 18M18.5 18L21.5 15M18.5 18L15.5 15M18.5 18L21.5 21"}),t("path",{d:"M2.5 20C2.5 16.134 5.63401 13 9.5 13C10.775 13 11.9704 13.3409 13 13.9365"}))}renderConfirmStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-warning"},this.deleteAccountWarning),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--row"},t("salla-button",{width:"wide",fill:"outline",color:"danger",onClick:()=>this.closeDeleteModal()},this.capitalizeText(this.cancelLabel)),t("salla-button",{width:"wide",color:"primary",loading:this.isSubmitting,onClick:()=>this.initiateDeleteRequest()},this.capitalizeText(this.deleteAccount))))}renderOtpStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-otp-instruction"},this.deleteOtpInstruction),t("p",{class:"s-user-settings-delete-otp-target"},this.getOtpTarget()),t("input",{type:"hidden",name:"code",maxlength:"4",ref:e=>this.hiddenCodeInput=e}),t("div",{class:{"s-user-settings-delete-otp-codes":!0,"has-error":this.otpHasError},dir:"ltr"},[1,2,3,4].map((e=>t("input",{type:"text",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",id:`delete-otp-${e}`,class:{"s-user-settings-delete-otp-input":!0,"s-has-error":this.otpHasError},onInput:e=>this.handleOtpInput(e),onPaste:e=>this.handleOtpPaste(e),onKeyUp:e=>this.handleOtpKeyUp(e),onFocus:e=>this.handleOtpFocus(e),ref:t=>this.otpInputs[e-1]=t,required:!0})))),this.otpHasError&&this.otpErrorMessage?t("span",{class:"s-user-settings-delete-otp-error"},this.otpErrorMessage):"",t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{width:"wide",color:"primary",disabled:this.isSwitchingChannel,onClick:()=>this.verifyDeleteOtp()},this.capitalizeText(this.deleteConfirmOtp)),t("salla-button",{width:"wide",fill:"outline",color:"primary",disabled:this.isVerifyingOtp,onClick:()=>this.switchOtpChannel()},this.capitalizeText("email"===this.otpType?this.sendViaPhone:this.sendViaEmail))),t("p",{class:"s-user-settings-delete-otp-resend",style:{display:this.showResendLink?"none":"block"}},this.resendAfterLabel,t("b",{class:"s-user-settings-delete-otp-timer mx-1 font-bold",ref:e=>this.timerEl=e})),t("a",{href:"#",class:"s-user-settings-delete-otp-resend-link",style:{display:this.showResendLink?"block":"none"},onClick:e=>{e.preventDefault(),this.resendOtp()}},this.resendLabel))}renderSuccessStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-success-body"},this.deleteSuccessMessage),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{class:"s-user-settings-delete-success-btn",width:"wide",color:"primary",onClick:()=>this.confirmSuccess()},this.capitalizeText(this.okLabel))))}renderDeleteStep(){switch(this.currentStep){case"otp":return this.renderOtpStep();case"success":return this.renderSuccessStep();default:return this.renderConfirmStep()}}renderDeleteSectionAction(){return this.isDeletePending?t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",loading:this.isSubmitting,onClick:()=>this.cancelDeleteRequest()},this.capitalizeText(this.cancelDeletionRequest)):t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeleteModal()},this.capitalizeText(this.deleteAccount))}render(){return t(s,{key:"b9fa104d52437b3f7176ae0a4f06acbac1778987",class:"s-user-settings-wrapper"},this.canHideName&&t("div",{key:"e1b0b260366263fc442de70e5e122babe03dcfe8",class:"s-user-settings-section"},t("salla-list-tile",{key:"30e60c87d25c784af192290689a6dc759c5715f5"},t("div",{key:"7d4d7736da5461b063d733e68a675fd6ed2a8238",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"039b9dd91e1a5f90e23b4ec76c7de6a98c4c6ab3",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>user-cancel</title>\n<path d="M29.885 16l1.724-1.724c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-1.724 1.724-1.724-1.724c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l1.724 1.724-1.724 1.724c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l1.724-1.724 1.724 1.724c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM10.667 16c4.043 0 7.333-3.289 7.333-7.333s-3.291-7.333-7.333-7.333-7.333 3.289-7.333 7.333 3.291 7.333 7.333 7.333zM10.667 4c2.573 0 4.667 2.093 4.667 4.667s-2.093 4.667-4.667 4.667-4.667-2.093-4.667-4.667 2.093-4.667 4.667-4.667zM10.667 18.667c-5.881 0-10.667 3.813-10.667 8.5v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-3.217 3.588-5.833 8-5.833s8 2.616 8 5.833v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-4.687-4.785-8.5-10.667-8.5z"></path>\n</svg>\n'})),t("div",{key:"138baf4bf1591522d30c564e771b15b7cca06a42",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.hideMyName)),t("div",{key:"60987ffd6f6632509881ab112629895eea530ce6",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.hideMyNameDesc)),t("div",{key:"3cbd4b6b1fc8689330056fc9bf6b6cad996b75a5",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"055fe5441b629f8d8e8229808e104ab4ff4353f5",class:"s-toggle"},t("input",{key:"af144edb7b70bce586b394affeb93e542aee3341",class:"s-toggle-input",checked:this.isHiddenName,onChange:e=>this.toggleSetting("is_hidden_name",e),type:"checkbox"}),t("div",{key:"1215017ab0727286cb184f64d557d9f44fb7cb3b",class:"s-toggle-switcher"}))))),t("div",{key:"eeab204783a63a56c41d9647eec52adef69a4228",class:"s-user-settings-section"},t("salla-list-tile",{key:"09eef4e34b54a813a5ffe920dc4e285cb6c1d75c"},t("div",{key:"701d0e2837a35b9992c8e753689addf4deb2dc06",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"fb556a877e639099956ed3f36a54ff6a1a06003a",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>bullhorn</title>\n<path d="M30.129 0.264c-0.339-0.252-0.776-0.328-1.179-0.208l-24.951 7.485v-0.216c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v14.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-0.112l3.448 1.207-0.595 1.704c-0.321 1.019-0.227 2.103 0.267 3.051s1.327 1.647 2.345 1.968l6.359 2.004c0.399 0.127 0.804 0.187 1.201 0.187 1.699 0 3.277-1.091 3.812-2.785l0.423-1.295 7.633 2.672c0.143 0.049 0.292 0.075 0.44 0.075 0.273 0 0.543-0.084 0.772-0.247 0.352-0.249 0.561-0.655 0.561-1.087v-28c0-0.421-0.199-0.819-0.537-1.069zM18.297 28.4c-0.221 0.701-0.973 1.089-1.673 0.871l-6.357-2.004c-0.34-0.108-0.617-0.34-0.781-0.656s-0.196-0.676-0.101-0.977l0.581-1.665 8.777 3.072zM28 27.453l-24-8.4v-8.728l24-7.2z"></path>\n</svg>\n'})),t("div",{key:"ceb4a50d241370ce8d0f10f92952ef82ee99c5cd",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.promotionalMsgs)),t("div",{key:"2ec965b12e5291d63fc387a7bf3ac44db3d32e92",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.promotionalMsgsDesc)),t("div",{key:"381a0830162edcad08e129202c075e0885872299",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"d6c22984d6dcc2319fe9086a7ec11e52c5f41ba8",class:"s-toggle"},t("input",{key:"7081c62af618ff9ce4d092858313674a8114e7c1",class:"s-toggle-input",checked:this.isNotifiable,onChange:e=>this.toggleSetting("is_notifiable",e),type:"checkbox"}),t("div",{key:"2b6697d4ff6576b15d88c3c546ccfbc7d79373b9",class:"s-toggle-switcher"}))))),this.isDeleteAccountEnabled?t("div",{class:"s-user-settings-section s-user-settings-section-delete-user"},t("salla-list-tile",null,t("div",{slot:"icon",class:"s-user-settings-section-icon"},this.renderUserDeleteIcon()),t("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deleteAccount)),t("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.isDeletePending?this.deleteAccountPending:this.deleteAccountDesc)),t("div",{slot:"action",class:"s-user-settings-section-action"},this.renderDeleteSectionAction()))):t("div",{class:"s-user-settings-section s-user-settings-section-deactivate-user"},t("salla-list-tile",null,t("div",{slot:"icon",class:"s-user-settings-section-icon"},t("span",{innerHTML:i})),t("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deactivateAccount)),t("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.deactivateDesc)),t("div",{slot:"action",class:"s-user-settings-section-action"},t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeactivateModal()},this.capitalizeText(this.deactivateAccount))))),this.isDeleteAccountEnabled?t("salla-modal",{id:"salla-user-settings-delete-modal",width:"xs",centered:!0,showBack:"otp"===this.currentStep,isClosable:"success"!==this.currentStep,iconStyle:"success"===this.currentStep?"success":void 0,onModalVisibilityChanged:e=>this.handleModalVisibilityChanged(e),onModalBack:()=>this.goBackFromOtp(),ref:e=>this.confirmationModal=e},"success"!==this.currentStep?t("span",{slot:"icon",class:"s-user-settings-delete-icon"},this.renderUserDeleteIcon()):null,t("div",{key:this.currentStep,class:"s-user-settings-delete-step"},this.renderDeleteStep())):t("salla-modal",{width:"sm",subTitle:this.capitalizeText(this.sorryForLeavingText),ref:e=>this.confirmationModal=e},t("span",{slot:"icon",class:"s-user-settings-confirmation-icon",innerHTML:i}),t("div",{class:"s-user-settings-confirmation"},t("div",{class:"s-user-settings-confirmation-warning"},this.capitalizeText(this.warningText)),t("div",{class:"s-user-settings-confirmation-actions"},t("salla-button",{width:"wide",onClick:()=>this.confirmationModal.close()},this.capitalizeText(this.keepAccount)),t("salla-button",{fill:"outline",loading:this.buttonLoading,width:"wide",onClick:()=>this.confirmDeactivateAccount()},this.capitalizeText(this.deactivateAccount))))))}};r.style='/*!twlt*/.s-modal-header-inner{display:flex;flex-direction:column !important;align-items:center !important;justify-content:center !important}.s-modal-header-content{text-align:center !important}.s-user-settings-delete-body{text-align:center}.s-user-settings-delete-icon{display:inline-flex;align-items:center;justify-content:center;width:4rem;height:4rem;border-radius:9999px;border:1px solid var(--infinte-color);color:var(--infinte-color);margin:0 auto 1rem}.s-user-settings-delete-icon svg{width:1.5rem;height:1.5rem}.s-user-settings-delete-warning{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-actions--row{display:flex;gap:0.75rem;justify-content:center}.s-user-settings-delete-actions--row salla-button{flex:1}.s-user-settings-delete-actions--stack{display:flex;flex-direction:column;gap:0.75rem;margin-top:1.25rem}.s-user-settings-delete-otp-instruction{color:#6b7280;font-size:0.875rem}.s-user-settings-delete-otp-target{color:#6b7280;direction:ltr;margin-bottom:1.25rem}.s-user-settings-delete-otp-codes{display:flex;justify-content:stretch;gap:0.75rem;direction:ltr;margin-bottom:0.75rem;width:100%}.s-user-settings-delete-otp-codes.has-error{margin-bottom:0}.s-user-settings-delete-otp-input{flex:1 1 0;min-width:0;width:100%;height:3.5rem;text-align:center;border:1px solid #d1d5db;border-radius:0.5rem;font-size:1.25rem;font-weight:600;color:#111827;outline:none}.s-user-settings-delete-otp-input:focus{border-color:#004956;box-shadow:0 0 0 1px #004956}.s-user-settings-delete-otp-input.s-has-error{border-color:#ef4444 !important}.s-user-settings-delete-otp-input.s-has-error:focus{border-color:#ef4444 !important;box-shadow:0 0 0 1px #ef4444}.s-user-settings-delete-otp-input::-webkit-outer-spin-button,.s-user-settings-delete-otp-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-user-settings-delete-otp-input[type=text]{-moz-appearance:textfield}.s-user-settings-delete-otp-error{display:block;color:#ef4444;font-size:0.75rem;text-align:center;padding-top:0.75rem;margin-bottom:1.25rem}.s-user-settings-delete-otp-resend{color:#6b7280;font-size:0.75rem;margin-top:1rem;text-align:center}.s-user-settings-delete-otp-timer{font-weight:600;direction:ltr;display:inline-block}.s-user-settings-delete-otp-resend-link{display:block;color:#004956;font-size:0.875rem;margin-top:1rem;text-align:center;text-decoration:underline;cursor:pointer}.s-user-settings-delete-success-body{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-success-btn{--s-button-color:#004956}.mx-1{margin-left:0.25rem;margin-right:0.25rem}.block{display:block}.hidden{display:none}.font-bold{font-weight:700}.outline{outline-style:solid}.s-has-error{--tw-border-opacity:1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.s-has-error:focus{--tw-border-opacity:1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.has-error .s-form-label{color:#ff443a}.has-error .s-form-control,.has-error .s-tel-input-control,.has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.toggle-checkbox .s-toggle-input{position:absolute;visibility:hidden}.toggle-checkbox .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.toggle-checkbox .s-toggle-switcher:before,.toggle-checkbox .s-toggle-switcher:after{content:""}.toggle-checkbox .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.toggle-checkbox .s-toggle-input:checked+div{background:#30D158}.toggle-checkbox .s-toggle-input:checked+div:before{left:18px}.s-has-error{--tw-border-opacity:1 !important;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1)) !important;--tw-text-opacity:1 !important;color:rgb(239 68 68 / var(--tw-text-opacity, 1)) !important}.s-toggle{cursor:pointer;display:inline-block}.s-toggle .s-toggle-input{position:absolute;visibility:hidden}.s-toggle .s-toggle-label{margin-left:5px;position:relative;top:2px}.s-toggle .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.s-toggle .s-toggle-switcher:before,.s-toggle .s-toggle-switcher:after{content:""}.s-toggle .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.s-toggle .s-toggle-input:checked+div{background:#30D158}.s-toggle .s-toggle-input:checked+div:before{left:18px}.s-user-settings-section{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-user-settings-section:first-child{border-bottom-right-radius:0px;border-bottom-left-radius:0px;border-top-left-radius:0.375rem;border-top-right-radius:0.375rem}.s-user-settings-section:last-child{border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-width:0px}.s-user-settings-section .s-list-tile-item{align-items:flex-start;background-color:transparent;padding:1.25rem}@media (min-width: 768px){.s-user-settings-section .s-list-tile-item{align-items:center}}.s-user-settings-section .s-list-tile-item-action{margin-left:auto}.s-user-settings-section .s-list-tile-item-action:where([dir="rtl"],[dir="rtl"] *){margin-right:auto;margin-left:0px}.s-user-settings-section .s-list-tile-item-action button{width:100%;padding:10px}.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:wrap}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:nowrap}}.s-user-settings-section-delete-user .s-list-tile-item-icon{position:relative;top:5px}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-icon{top:0px}}@media (max-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-content{flex:1 0 85%}.s-user-settings-section-delete-user .s-list-tile-item-action{flex:1 1 100%;margin-top:1rem}}.s-user-settings-section-title{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-user-settings-section-subtitle{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-user-settings-section-icon svg{height:1.25rem;width:1.25rem}.s-user-settings-confirmation{text-align:center}.s-user-settings-confirmation svg{text-align:center}.s-user-settings-confirmation-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-user-settings-confirmation-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-user-settings-confirmation-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-user-settings-confirmation-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-user-settings-confirmation-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-user-settings-confirmation-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-user-settings-confirmation-icon svg{height:1.25rem;width:1.25rem;flex-shrink:0;fill:#9ca3af}.s-user-settings-confirmation-warning{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-user-settings-confirmation-actions{margin-top:1.25rem;display:flex;align-items:center;justify-content:space-between}.s-user-settings-confirmation-actions>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-user-settings-confirmation-actions:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}';export{r as salla_user_settings}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as e,c as r,a}from"./p-a6lSRQK4.js";const s=class{constructor(e){t(this,e),this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}render(){return e("div",{key:"6e4cce860f67539cbcdd0992459cb1ff411d1c28",class:{"s-tabs-content":!0,"s-tabs-content-selected":this.isSelected}},e("slot",{key:"b78d73bded8b8f2f6914474a9212b36b3df238c7"}))}};s.style="";const o=class{constructor(e){t(this,e),this.tabSelected=r(this,"tabSelected"),this.id=Math.random().toString(36).slice(2,10),this.activeClass=void 0,this.height=void 0,this.centered=!1,this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name,id:this.id}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}onClick(){this.getChild().then((t=>{this.tabSelected.emit(t)}))}render(){return[e("div",{key:"777c0dfcf45cf1f891e0ea7f5de46a28f9d3bd50",class:{"s-tabs-header-item":!0,"s-tabs-bg-normal":!0,"s-tabs-active":this.isSelected},onClick:this.onClick.bind(this)},e("slot",{key:"ff553a9fdf4158c9a6f5ca94ade09aa75f2733cd"}))]}};o.style="";const i=class{constructor(e){t(this,e),this.backgroundColor=void 0,this.vertical=!1}componentWillLoad(){this.createGroup().then((()=>{const[t]=this.tabGroup;this.selectGroup(t)}))}onSelectedTab(t){const e=this.tabGroup.find((e=>e.header.id===t.detail.id));this.selectGroup(e)}async createGroup(){const t=Array.from(this.host.querySelectorAll("salla-tab-header"));this.tabsHeader=await Promise.all(t.map((async t=>await t.getChild())));const e=Array.from(this.host.querySelectorAll("salla-tab-content"));this.tabsContent=await Promise.all(e.map((async t=>await t.getChild()))),this.tabGroup=this.tabsHeader.map((t=>{const e=this.tabsContent.find((e=>e.name===t.name));return{header:t,content:e}}))}selectGroup(t){this.tabGroup.map((t=>{t.header.unselect(),t.content.unselect()})),t.header.selected(),t.content.selected()}render(){return[e("div",{key:"57200f5c96819e44c3e62bf6a625c4d89ccb708b",class:"s-tabs"},e("div",{key:"9f5b874cbe4cac9a6d9980f13b708deb9f69c1ea",class:"s-tabs-header"},e("slot",{key:"2cbb90c9fee0457b76a542576f6ce4c07d08a28a",name:"header"})),e("div",{key:"9ab02e5b3dff4f87cb8b6468fb5063737d9695e8",class:"s-tabs-content-wrapper"},e("slot",{key:"dd9eb1088be3c88a835981b894b61f7eff7b4498",name:"content"})))]}get host(){return a(this)}};i.style='/*!twlt*/.s-tabs-header{-ms-overflow-style:none;scrollbar-width:none;}.s-tabs-header::-webkit-scrollbar{display:none}.flex{display:flex}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-loyalty-program-rewards-container .s-tabs-content-wrapper{padding:0px}@media (min-width: 768px){.s-loyalty-program-rewards-container .s-tabs-content-wrapper{padding-top:1rem}}.s-loyalty-program-rewards-container .s-tabs-header{display:flex;align-items:center;justify-content:space-between;border-style:none}.s-loyalty-program-rewards-container .s-tabs-header div{order:1}.s-loyalty-program-rewards-container .s-tabs-header-item{position:relative;margin:0px;display:flex;width:max-content;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.5rem;background-color:transparent;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-loyalty-program-rewards-container .s-tabs-bg-normal{background-color:transparent;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-loyalty-program-rewards-container-cart .s-tabs-bg-normal{background-color:transparent;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-loyalty-program-rewards-container-cart .s-tabs-header-item{display:flex;width:max-content;align-items:center;justify-content:center;gap:0.5rem;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem}.s-loyalty-program-rewards-container-cart .s-tabs-content-wrapper{padding:0px}.s-loyalty-program-rewards-container-cart .s-tabs-header{overflow-x:auto;border-bottom-width:1px;border-color:var(--color-primary-light);padding-left:1.25rem;padding-right:1.25rem}@media (min-width: 640px){.s-loyalty-program-rewards-container-cart .s-tabs-header{margin-left:1.25rem;margin-right:1.25rem;padding-left:0px;padding-right:0px}}.s-loyalty-program-rewards-container .s-tabs-active{background-color:var(--color-primary-light);--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-loyalty-program-rewards-container-cart .s-tabs-active{background-color:var(--color-primary-light);--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-loyalty-program-reward-details .s-tabs-header{margin-top:0.5rem;margin-bottom:0.5rem;margin-left:1rem;margin-right:1rem;display:flex}.s-loyalty-program-reward-details .s-tabs-header>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-loyalty-program-reward-details .s-tabs-header{border-style:none}@media (min-width: 768px){.s-loyalty-program-reward-details .s-tabs-header{margin-left:3rem;margin-right:3rem}}.s-loyalty-program-reward-details .s-tabs-header:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-loyalty-program-reward-details .s-tabs-header-item{display:flex;width:max-content;align-items:center}.s-loyalty-program-reward-details .s-tabs-header-item>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-loyalty-program-reward-details .s-tabs-header-item{border-radius:9999px;padding-top:0.25rem;padding-bottom:0.25rem;padding-left:1rem;padding-right:1rem}.s-loyalty-program-reward-details .s-tabs-header-item:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-loyalty-program-reward-details .s-tabs-bg-normal{background-color:transparent;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-loyalty-program-reward-details .s-tabs-active{background-color:var(--color-primary-light);font-weight:700;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-loyalty-program-reward-details .s-tabs-header-item span{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-loyalty-program-tabs-hider .s-tabs-header{border-style:none}.s-product-size-guide-wrapper .s-tabs-content{max-height:60vh;overflow:auto}@media (min-width: 768px){.s-product-size-guide-wrapper .s-tabs-content{max-height:70vh}}.s-tabs-bg-normal{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-tabs-header{display:flex;cursor:pointer;align-content:center;justify-content:flex-start}.s-tabs-header>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.25rem * var(--tw-space-x-reverse));margin-left:calc(0.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-tabs-header{overflow-x:auto;border-bottom-width:2px;border-color:var(--color-primary)}@media (min-width: 768px){.s-tabs-header{overflow-x:hidden}}.s-tabs-header:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-tabs-header *{pointer-events:auto !important}.s-tabs-header-item{border-top-left-radius:0.5rem;border-top-right-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;font-size:0.875rem;line-height:1.25rem}@media (min-width: 768px){.s-tabs-header-item{padding-left:1.75rem;padding-right:1.75rem}}.s-tabs-content{display:none}.s-tabs-content-wrapper{padding-top:0.75rem}.s-tabs-content-selected{display:block}.s-tabs-active{background-color:var(--color-primary);--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}';export{s as salla_tab_content,o as salla_tab_header,i as salla_tabs}
4
+ import{r as t,h as e,c as r,a}from"./p-BAXTlrSC.js";const s=class{constructor(e){t(this,e),this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}render(){return e("div",{key:"f2deb9c1508aafe3aff5352094cccc97bdcd42ef",class:{"s-tabs-content":!0,"s-tabs-content-selected":this.isSelected}},e("slot",{key:"460588864047444acdb06e757a7124d28935c24b"}))}};s.style="";const o=class{constructor(e){t(this,e),this.tabSelected=r(this,"tabSelected"),this.id=Math.random().toString(36).slice(2,10),this.activeClass=void 0,this.height=void 0,this.centered=!1,this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name,id:this.id}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}onClick(){this.getChild().then((t=>{this.tabSelected.emit(t)}))}render(){return[e("div",{key:"153247ab5a7c73819ccc506a45e60b9c084c391c",class:{"s-tabs-header-item":!0,"s-tabs-bg-normal":!0,"s-tabs-active":this.isSelected},onClick:this.onClick.bind(this)},e("slot",{key:"417a3ae0c0aec8a965b5d3be9a4f917f290d2109"}))]}};o.style="";const i=class{constructor(e){t(this,e),this.backgroundColor=void 0,this.vertical=!1}componentWillLoad(){this.createGroup().then((()=>{const[t]=this.tabGroup;this.selectGroup(t)}))}onSelectedTab(t){const e=this.tabGroup.find((e=>e.header.id===t.detail.id));this.selectGroup(e)}async createGroup(){const t=Array.from(this.host.querySelectorAll("salla-tab-header"));this.tabsHeader=await Promise.all(t.map((async t=>await t.getChild())));const e=Array.from(this.host.querySelectorAll("salla-tab-content"));this.tabsContent=await Promise.all(e.map((async t=>await t.getChild()))),this.tabGroup=this.tabsHeader.map((t=>{const e=this.tabsContent.find((e=>e.name===t.name));return{header:t,content:e}}))}selectGroup(t){this.tabGroup.map((t=>{t.header.unselect(),t.content.unselect()})),t.header.selected(),t.content.selected()}render(){return[e("div",{key:"ae50836f68ee92459720fa9bf00d73848d849627",class:"s-tabs"},e("div",{key:"55e8186e80381902269f9bad5738d9a555f71d37",class:"s-tabs-header"},e("slot",{key:"46ce3e1ea75f92165b3d5ee7c16f19f8693f6d31",name:"header"})),e("div",{key:"3669e643abb37ed2edca73fc0577822a3f7fbb90",class:"s-tabs-content-wrapper"},e("slot",{key:"2cf8b79f44630e21103991325ceff2cd3a4019ba",name:"content"})))]}get host(){return a(this)}};i.style='/*!twlt*/.s-tabs-header{-ms-overflow-style:none;scrollbar-width:none;}.s-tabs-header::-webkit-scrollbar{display:none}.flex{display:flex}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-loyalty-program-rewards-container .s-tabs-content-wrapper{padding:0px}@media (min-width: 768px){.s-loyalty-program-rewards-container .s-tabs-content-wrapper{padding-top:1rem}}.s-loyalty-program-rewards-container .s-tabs-header{display:flex;align-items:center;justify-content:space-between;border-style:none}.s-loyalty-program-rewards-container .s-tabs-header div{order:1}.s-loyalty-program-rewards-container .s-tabs-header-item{position:relative;margin:0px;display:flex;width:max-content;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.5rem;background-color:transparent;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-loyalty-program-rewards-container .s-tabs-bg-normal{background-color:transparent;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-loyalty-program-rewards-container-cart .s-tabs-bg-normal{background-color:transparent;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-loyalty-program-rewards-container-cart .s-tabs-header-item{display:flex;width:max-content;align-items:center;justify-content:center;gap:0.5rem;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem}.s-loyalty-program-rewards-container-cart .s-tabs-content-wrapper{padding:0px}.s-loyalty-program-rewards-container-cart .s-tabs-header{overflow-x:auto;border-bottom-width:1px;border-color:var(--color-primary-light);padding-left:1.25rem;padding-right:1.25rem}@media (min-width: 640px){.s-loyalty-program-rewards-container-cart .s-tabs-header{margin-left:1.25rem;margin-right:1.25rem;padding-left:0px;padding-right:0px}}.s-loyalty-program-rewards-container .s-tabs-active{background-color:var(--color-primary-light);--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-loyalty-program-rewards-container-cart .s-tabs-active{background-color:var(--color-primary-light);--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-loyalty-program-reward-details .s-tabs-header{margin-top:0.5rem;margin-bottom:0.5rem;margin-left:1rem;margin-right:1rem;display:flex}.s-loyalty-program-reward-details .s-tabs-header>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-loyalty-program-reward-details .s-tabs-header{border-style:none}@media (min-width: 768px){.s-loyalty-program-reward-details .s-tabs-header{margin-left:3rem;margin-right:3rem}}.s-loyalty-program-reward-details .s-tabs-header:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-loyalty-program-reward-details .s-tabs-header-item{display:flex;width:max-content;align-items:center}.s-loyalty-program-reward-details .s-tabs-header-item>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-loyalty-program-reward-details .s-tabs-header-item{border-radius:9999px;padding-top:0.25rem;padding-bottom:0.25rem;padding-left:1rem;padding-right:1rem}.s-loyalty-program-reward-details .s-tabs-header-item:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-loyalty-program-reward-details .s-tabs-bg-normal{background-color:transparent;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-loyalty-program-reward-details .s-tabs-active{background-color:var(--color-primary-light);font-weight:700;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-loyalty-program-reward-details .s-tabs-header-item span{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-loyalty-program-tabs-hider .s-tabs-header{border-style:none}.s-product-size-guide-wrapper .s-tabs-content{max-height:60vh;overflow:auto}@media (min-width: 768px){.s-product-size-guide-wrapper .s-tabs-content{max-height:70vh}}.s-tabs-bg-normal{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-tabs-header{display:flex;cursor:pointer;align-content:center;justify-content:flex-start}.s-tabs-header>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.25rem * var(--tw-space-x-reverse));margin-left:calc(0.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-tabs-header{overflow-x:auto;border-bottom-width:2px;border-color:var(--color-primary)}@media (min-width: 768px){.s-tabs-header{overflow-x:hidden}}.s-tabs-header:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-tabs-header *{pointer-events:auto !important}.s-tabs-header-item{border-top-left-radius:0.5rem;border-top-right-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;font-size:0.875rem;line-height:1.25rem}@media (min-width: 768px){.s-tabs-header-item{padding-left:1.75rem;padding-right:1.75rem}}.s-tabs-content{display:none}.s-tabs-content-wrapper{padding-top:0.75rem}.s-tabs-content-selected{display:block}.s-tabs-active{background-color:var(--color-primary);--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}';export{s as salla_tab_content,o as salla_tab_header,i as salla_tabs}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,h as t,H as l,a as n}from"./p-a6lSRQK4.js";const s=class{constructor(t){a(this,t),this.pointsData=null,this.productId=null}async componentWillLoad(){try{if(await salla.onReady(),await salla.lang.onLoaded(),this.productId=this.host.dataset.productId||salla.config.get("page.id"),!this.productId)return;const a=await salla.api.request(`/loyalty/products/${this.productId}/points`).catch((()=>null));this.pointsData=a?.data||null}catch(a){salla?.logger?.warn?.("salla-loyalty-points-banner: init failed",a)}}render(){return this.productId&&this.pointsData?.points?t(l,null,t("div",{class:"s-loyalty-points-banner-container"},t("div",{class:"s-loyalty-points-banner-icon"},t("span",{class:"s-loyalty-points-banner-inner-icon",innerHTML:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.76604 2.86201C9.31804 2.61001 9.93304 2.41501 10.611 2.27701C11.289 2.13901 12 2.07001 12.744 2.07001C13.572 2.07001 14.364 2.15401 15.12 2.32201C15.84 2.49001 16.356 2.81401 16.668 3.29401C16.932 3.70201 17.064 4.26001 17.064 4.96801V13.032C17.064 13.416 16.95 13.752 16.722 14.04C16.506 14.304 16.227 14.493 15.885 14.607C15.543 14.721 15.204 14.742 14.868 14.67C14.196 14.514 13.488 14.436 12.744 14.436C12.084 14.436 11.442 14.502 10.818 14.634C10.23 14.754 9.70204 14.922 9.23404 15.138C8.68204 15.39 8.06704 15.585 7.38904 15.723C6.71104 15.861 6.00004 15.93 5.25604 15.93C4.42804 15.93 3.63604 15.846 2.88004 15.678C2.18404 15.522 1.68004 15.21 1.36804 14.742C1.08004 14.322 0.936035 13.752 0.936035 13.032V4.96801C0.936035 4.58401 1.05004 4.24801 1.27804 3.96001C1.49404 3.69601 1.77304 3.50701 2.11504 3.39301C2.45704 3.27901 2.79604 3.25801 3.13204 3.33001C3.80404 3.48601 4.51204 3.56401 5.25604 3.56401C5.91604 3.56401 6.55804 3.49801 7.18204 3.36601C7.77004 3.24601 8.29804 3.07801 8.76604 2.86201ZM11.25 9.00001C11.25 8.59201 11.148 8.21701 10.944 7.87501C10.74 7.53301 10.467 7.26001 10.125 7.05601C9.78304 6.85201 9.40804 6.75001 9.00004 6.75001C8.59204 6.75001 8.21704 6.85201 7.87504 7.05601C7.53304 7.26001 7.26004 7.53301 7.05604 7.87501C6.85204 8.21701 6.75004 8.59201 6.75004 9.00001C6.75004 9.40801 6.85204 9.78301 7.05604 10.125C7.26004 10.467 7.53304 10.74 7.87504 10.944C8.21704 11.148 8.59204 11.25 9.00004 11.25C9.40804 11.25 9.78304 11.148 10.125 10.944C10.467 10.74 10.74 10.467 10.944 10.125C11.148 9.78301 11.25 9.40801 11.25 9.00001ZM14.328 7.79401C14.076 7.75801 13.812 7.73401 13.536 7.72201C13.38 7.71001 13.245 7.75501 13.131 7.85701C13.017 7.95901 12.954 8.08801 12.942 8.24401C12.93 8.40001 12.975 8.53501 13.077 8.64901C13.179 8.76301 13.308 8.82601 13.464 8.83801C13.704 8.85001 13.938 8.87401 14.166 8.91001C14.322 8.93401 14.463 8.90101 14.589 8.81101C14.715 8.72101 14.787 8.59801 14.805 8.44201C14.823 8.28601 14.787 8.14501 14.697 8.01901C14.607 7.89301 14.484 7.81801 14.328 7.79401ZM4.53604 9.16201C4.29604 9.15001 4.06204 9.12601 3.83404 9.09001C3.67804 9.06601 3.53704 9.09901 3.41104 9.18901C3.28504 9.27901 3.21304 9.40201 3.19504 9.55801C3.17704 9.71401 3.21304 9.85501 3.30304 9.98101C3.39304 10.107 3.51604 10.182 3.67204 10.206C3.92404 10.242 4.18804 10.266 4.46404 10.278C4.62004 10.29 4.75504 10.245 4.86904 10.143C4.98304 10.041 5.04604 9.91201 5.05804 9.75601C5.07004 9.60001 5.02504 9.46501 4.92304 9.35101C4.82104 9.23701 4.69204 9.17401 4.53604 9.16201Z" fill="white"/>\n</svg>\n'})),t("p",null,t("span",{class:"s-loyalty-points-banner-label"},salla.lang.get("pages.loyalty_program.earn")," "),t("span",{class:"s-loyalty-points-banner-label"},`+${this.pointsData.points}`," "),t("span",{class:"s-loyalty-points-banner-label"},salla.lang.get("pages.loyalty_program.loyalty_point")," "),t("span",{class:"s-loyalty-points-banner-description"},salla.lang.get("pages.loyalty_program.on_order_total_when_purchase"))))):null}get host(){return n(this)}};s.style="/*!twlt*/.s-loyalty-points-banner-container{margin-bottom:0.75rem;display:flex;width:100%;align-items:center;gap:0.5rem;border-radius:0.5rem;background-color:rgb(209 180 76 / var(--tw-bg-opacity, 1));--tw-bg-opacity:0.1;padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem}.s-loyalty-points-banner-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(209 180 76 / var(--tw-bg-opacity, 1))}.s-loyalty-points-banner-label{font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(209 180 76 / var(--tw-text-opacity, 1))}.s-loyalty-points-banner-description{font-size:0.875rem;line-height:1.25rem}";export{s as salla_loyalty_points_banner}
4
+ import{r as a,h as t,H as l,a as n}from"./p-BAXTlrSC.js";const s=class{constructor(t){a(this,t),this.pointsData=null,this.productId=null}async componentWillLoad(){try{if(await salla.onReady(),await salla.lang.onLoaded(),this.productId=this.host.dataset.productId||salla.config.get("page.id"),!this.productId)return;const a=await salla.api.request(`/loyalty/products/${this.productId}/points`).catch((()=>null));this.pointsData=a?.data||null}catch(a){salla?.logger?.warn?.("salla-loyalty-points-banner: init failed",a)}}render(){return this.productId&&this.pointsData?.points?t(l,null,t("div",{class:"s-loyalty-points-banner-container"},t("div",{class:"s-loyalty-points-banner-icon"},t("span",{class:"s-loyalty-points-banner-inner-icon",innerHTML:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.76604 2.86201C9.31804 2.61001 9.93304 2.41501 10.611 2.27701C11.289 2.13901 12 2.07001 12.744 2.07001C13.572 2.07001 14.364 2.15401 15.12 2.32201C15.84 2.49001 16.356 2.81401 16.668 3.29401C16.932 3.70201 17.064 4.26001 17.064 4.96801V13.032C17.064 13.416 16.95 13.752 16.722 14.04C16.506 14.304 16.227 14.493 15.885 14.607C15.543 14.721 15.204 14.742 14.868 14.67C14.196 14.514 13.488 14.436 12.744 14.436C12.084 14.436 11.442 14.502 10.818 14.634C10.23 14.754 9.70204 14.922 9.23404 15.138C8.68204 15.39 8.06704 15.585 7.38904 15.723C6.71104 15.861 6.00004 15.93 5.25604 15.93C4.42804 15.93 3.63604 15.846 2.88004 15.678C2.18404 15.522 1.68004 15.21 1.36804 14.742C1.08004 14.322 0.936035 13.752 0.936035 13.032V4.96801C0.936035 4.58401 1.05004 4.24801 1.27804 3.96001C1.49404 3.69601 1.77304 3.50701 2.11504 3.39301C2.45704 3.27901 2.79604 3.25801 3.13204 3.33001C3.80404 3.48601 4.51204 3.56401 5.25604 3.56401C5.91604 3.56401 6.55804 3.49801 7.18204 3.36601C7.77004 3.24601 8.29804 3.07801 8.76604 2.86201ZM11.25 9.00001C11.25 8.59201 11.148 8.21701 10.944 7.87501C10.74 7.53301 10.467 7.26001 10.125 7.05601C9.78304 6.85201 9.40804 6.75001 9.00004 6.75001C8.59204 6.75001 8.21704 6.85201 7.87504 7.05601C7.53304 7.26001 7.26004 7.53301 7.05604 7.87501C6.85204 8.21701 6.75004 8.59201 6.75004 9.00001C6.75004 9.40801 6.85204 9.78301 7.05604 10.125C7.26004 10.467 7.53304 10.74 7.87504 10.944C8.21704 11.148 8.59204 11.25 9.00004 11.25C9.40804 11.25 9.78304 11.148 10.125 10.944C10.467 10.74 10.74 10.467 10.944 10.125C11.148 9.78301 11.25 9.40801 11.25 9.00001ZM14.328 7.79401C14.076 7.75801 13.812 7.73401 13.536 7.72201C13.38 7.71001 13.245 7.75501 13.131 7.85701C13.017 7.95901 12.954 8.08801 12.942 8.24401C12.93 8.40001 12.975 8.53501 13.077 8.64901C13.179 8.76301 13.308 8.82601 13.464 8.83801C13.704 8.85001 13.938 8.87401 14.166 8.91001C14.322 8.93401 14.463 8.90101 14.589 8.81101C14.715 8.72101 14.787 8.59801 14.805 8.44201C14.823 8.28601 14.787 8.14501 14.697 8.01901C14.607 7.89301 14.484 7.81801 14.328 7.79401ZM4.53604 9.16201C4.29604 9.15001 4.06204 9.12601 3.83404 9.09001C3.67804 9.06601 3.53704 9.09901 3.41104 9.18901C3.28504 9.27901 3.21304 9.40201 3.19504 9.55801C3.17704 9.71401 3.21304 9.85501 3.30304 9.98101C3.39304 10.107 3.51604 10.182 3.67204 10.206C3.92404 10.242 4.18804 10.266 4.46404 10.278C4.62004 10.29 4.75504 10.245 4.86904 10.143C4.98304 10.041 5.04604 9.91201 5.05804 9.75601C5.07004 9.60001 5.02504 9.46501 4.92304 9.35101C4.82104 9.23701 4.69204 9.17401 4.53604 9.16201Z" fill="white"/>\n</svg>\n'})),t("p",null,t("span",{class:"s-loyalty-points-banner-label"},salla.lang.get("pages.loyalty_program.earn")," "),t("span",{class:"s-loyalty-points-banner-label"},`+${this.pointsData.points}`," "),t("span",{class:"s-loyalty-points-banner-label"},salla.lang.get("pages.loyalty_program.loyalty_point")," "),t("span",{class:"s-loyalty-points-banner-description"},salla.lang.get("pages.loyalty_program.on_order_total_when_purchase"))))):null}get host(){return n(this)}};s.style="/*!twlt*/.s-loyalty-points-banner-container{margin-bottom:0.75rem;display:flex;width:100%;align-items:center;gap:0.5rem;border-radius:0.5rem;background-color:rgb(209 180 76 / var(--tw-bg-opacity, 1));--tw-bg-opacity:0.1;padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem}.s-loyalty-points-banner-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(209 180 76 / var(--tw-bg-opacity, 1))}.s-loyalty-points-banner-label{font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(209 180 76 / var(--tw-text-opacity, 1))}.s-loyalty-points-banner-description{font-size:0.875rem;line-height:1.25rem}";export{s as salla_loyalty_points_banner}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as e,H as t}from"./p-a6lSRQK4.js";import{S as o}from"./p-BscTeWDc.js";var i;!function(s){s.DEFAULT="default",s.AVAILABILITY="availability"}(i||(i={}));const r=class{constructor(e){s(this,e),this.loadedScopes={[i.DEFAULT]:null,[i.AVAILABILITY]:null},this.translationLoaded=!1,this.mode=i.DEFAULT,this.scopes=[],this.originalScopesList=[],this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.hasError=!1,this.loading=!1,this.selection="optional",this.searchDisplayLimit=6,this.getFormTitle=()=>{if(this.originalScopesList?.length<2)return"";const s=salla.config.get("store.features")?.includes("multi-countries");return this.mode===i.DEFAULT?salla.lang.get(s?"blocks.scope.shopping_from_another_market":"blocks.scope.shopping_from_another_branch"):salla.lang.get(s?"blocks.scope.search_for_availability_in_other_markets":"blocks.scope.search_for_availability_in_other_branches")},salla.event.on("scopes::open",(({mode:s=null,product_id:e=null}={})=>{this.open(s,e)})),salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}get isNativeApp(){return!!salla.mobile?.isSpaWebview?.()}async close(){return await(this.modal?.close())}async open(s=i.DEFAULT,e=null){return this.isNativeApp?(salla.log("SallaScope:: delegated open to native app"),void salla.mobile?.openScopes?.()):(this.hasError=!1,this.mode=[i.AVAILABILITY,i.DEFAULT].includes(s)?s:i.DEFAULT,this.loading=!this.loadedScopes[this.mode],this.setScopeValues([]),salla.log("SallaScope:: opened"),this.modal.open(),this.loading?await salla.api.withoutNotifier((()=>s==i.AVAILABILITY?salla.scope.getProductAvailability(e):salla.scope.get())).then((e=>{if(s==i.AVAILABILITY)return this.setScopeValues(this.loadedScopes[i.AVAILABILITY]=e.data);this.setScopeValues(this.loadedScopes[this.mode]=e.data.scopes)})).catch((s=>{console.log(s),this.hasError=!0})).finally((()=>{this.modal.stopLoading(),this.loading=!1})):(this.setScopeValues(this.loadedScopes[this.mode]),this.modal.stopLoading()))}async handleSubmit(){let s={id:this.current_scope.id};return this.changeBtn.load(),await salla.scope.change(s).then((()=>{salla.storage.set("branch-choosed-before",!0),salla.storage.set("scope",{type:this.current_scope.type,id:this.current_scope.id}),salla.cart.reset(),window.location.replace(salla.helpers.addParamToUrl("scope",this.current_scope.id))})).catch((s=>console.log(s))).finally((()=>{this.changeBtn.stop()}))}setScopeValues(s){this.scopes=s,this.originalScopesList=s,1==s?.length?(this.current_scope=s[0],this.selected_scope=s[0],this.scopes=[s[0]]):(this.current_scope=s?.find((s=>s.selected)),this.selected_scope=s?.find((s=>s.selected)))}handleSearchFieldTyping(s){let e=s.target.value.toLocaleLowerCase();this.scopes=e?this.originalScopesList.filter((s=>s.name.toLowerCase().includes(e))):this.originalScopesList}handleScopeSelection(s){this.current_scope=this.scopes?.find((e=>e.id==s.target.value))}placeholderContent(){return e("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},e("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),e("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))}defaultContent(){return[e("div",{class:"s-scopes-container s-scrollbar"},this.scopes?.map((s=>e("div",{class:"s-scopes-input-wrap","data-selection":this.selection},e("input",{id:`${this.selection} + '_scope_' + ${s.id}`,name:"lang",type:"radio",value:s.id,onChange:s=>this.handleScopeSelection(s),class:"s-scopes-input",checked:!!this.current_scope&&this.current_scope.id==s.id}),e("label",{htmlFor:`${this.selection} + '_scope_' + ${s.id}`,class:"s-scopes-label s-scopes-clickable"},e("span",null,s.name)))))),this.footerContent()]}availabilityContent(){return e("div",{class:"s-scopes-container"},this.scopes?.map((s=>e("div",{class:"s-scopes-input-wrap","data-selection":this.selection},e("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===i.DEFAULT}},e("span",null,s.name)),e("h2",{style:{color:s?.availability?.color},class:`s-scopes-${s?.availability?.key}`},s?.availability?.label)))))}footerContent(){return e("div",{class:"s-scopes-footer"},e("slot",{name:"footer"},e("salla-button",{ref:s=>this.changeBtn=s,disabled:!this.current_scope,onClick:()=>this.handleSubmit(),class:"s-scopes-submit","loader-position":"center",width:"wide"},salla.lang.get("common.elements.confirm"))))}componentWillLoad(){return salla.onReady()}render(){return this.isNativeApp?null:e(t,null,e("salla-modal",{ref:s=>this.modal=s,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:this.loading,"has-skeleton":!0},this.loading?e("div",{slot:"loading"},e("div",{class:"s-scopes-skeleton"},e("salla-list-tile",{class:"s-scopes-header"},e("div",{slot:"icon",class:"s-scopes-header-icon"},e("salla-skeleton",{type:"circle"})),e("div",{slot:"title",class:"s-scopes-header-title mb-5"},e("salla-skeleton",{height:"15px",width:"50%"})),e("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},e("salla-skeleton",{height:"10px"}),e("salla-skeleton",{height:"10px",width:"75%"}))),e("div",{class:"s-scopes-skeleton-search"},e("salla-skeleton",{height:"10px",width:"50%"}),e("salla-skeleton",{height:"30px",width:"100%"})),e("div",{class:"s-scopes-skeleton-scopes"},e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"})),e("div",{class:"s-scopes-skeleton-btn"},e("salla-skeleton",{height:"40px",width:"100%"})))):[e("salla-list-tile",{class:this.originalScopesList?.length?"s-scopes-header block":"s-hidden"},e("div",{slot:"icon",class:"s-scopes-header-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>store-alt</title>\n<path d="M6.667 24h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.86 10.071l-4-8c-0.227-0.452-0.688-0.737-1.193-0.737h-21.333c-0.505 0-0.967 0.285-1.193 0.737l-4 8c-0.092 0.184-0.14 0.389-0.14 0.596v18.667c0 0.737 0.597 1.333 1.333 1.333h29.333c0.736 0 1.333-0.596 1.333-1.333v-18.667c0-0.207-0.048-0.412-0.14-0.596zM6.157 4h19.685l3.333 6.667h-26.352zM24 28h-5.333v-9.333h5.333zM29.333 28h-2.667v-10.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333v10.667h-13.333v-14.667h26.667zM6.667 18.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n'}),e("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),e("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),e("div",{class:"s-scopes-wrap"},!!this.originalScopesList?.length&&e("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList?.length>this.searchDisplayLimit?e("div",{class:"s-scopes-search-wrapper"},e("div",{class:"s-scopes-search-icon",innerHTML:o}),e("input",{type:"text",class:"s-scopes-search-input",onInput:s=>this.handleSearchFieldTyping(s),enterkeyhint:"search",placeholder:salla.lang.get("blocks.scope.searching_for_a_branch")})):"",this.hasError||!this.originalScopesList?.length&&this.mode!==i.AVAILABILITY?this.placeholderContent():this.mode===i.DEFAULT?this.defaultContent():this.availabilityContent())]))}async componentDidLoad(){await Salla.hooks.registerComponent("salla-scopes",this),salla.config.isMobileApp()||this.isNativeApp||this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};r.style='/*!twlt*/.s-scopes-availability-content{display:flex;justify-content:center;align-items:center}.s-scopes-placeholder{flex:0 0 85%}.mb-5{margin-bottom:1.25rem}.block{display:block}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-hidden{display:none}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.s-hidden{display:none}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-scopes-title{margin-bottom:0.75rem}.s-scopes-header{margin-bottom:0.5rem;display:block;text-align:center}.s-scopes-header-icon{margin:auto;display:flex;height:5rem;width:5rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(252 252 252 / var(--tw-bg-opacity, 1))}.s-scopes-header-icon svg{height:2rem;fill:var(--color-primary)}.s-scopes-header-title{font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-scopes-header-subtitle{text-align:left;font-size:1.25rem;line-height:1.75rem}.s-scopes-header-subtitle:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-scopes-search-wrapper{position:relative;width:100%}.s-scopes-search-icon{pointer-events:none;position:absolute;top:0px;bottom:0px;left:0px;display:flex;align-items:center;padding-left:0.75rem}.s-scopes-search-icon:where([dir="rtl"],[dir="rtl"] *){left:auto;right:0px;padding-left:0px;padding-right:0.75rem}.s-scopes-search-icon svg{height:1.25rem;width:1.25rem;fill:#9ca3af}.s-scopes-search-input{display:block;width:100%;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:0.625rem;padding-left:2.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-scopes-search-input:focus{--tw-ring-color:var(--color-primary)}.s-scopes-search-input:where([dir="rtl"],[dir="rtl"] *){padding-left:0px;padding-right:2.5rem}.s-scopes-input-wrap{margin-bottom:1.25rem;display:flex;align-items:center}.s-scopes-input-wrap:last-child{margin-bottom:0px}.s-scopes-input{height:1rem;width:1rem;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-scopes-input:focus{--tw-ring-color:var(--color-primary)}.s-scopes-input:where([dir="ltr"],[dir="ltr"] *){margin-right:0.75rem}.s-scopes-input:where([dir="rtl"],[dir="rtl"] *){margin-left:0.75rem}.s-scopes-label{display:flex;flex-grow:1;align-items:center;justify-content:space-between;font-size:1rem;line-height:1.5rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-scopes-select{height:2.5rem;width:100%;appearance:none;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-scopes-select:focus{border-color:var(--color-primary)}.s-scopes-container{margin-top:1.25rem;max-height:300px;overflow-y:auto;padding-left:0.5rem}.s-scopes-container:where([dir="rtl"],[dir="rtl"] *){padding-left:0px;padding-right:0.5rem}.s-scopes-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.s-scopes-is-closed{opacity:0.5}.s-scopes-closed-badge{--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-scopes-clickable{cursor:pointer}.s-scopes-submit{margin-top:1.5rem;height:auto}.s-scopes-color-red{--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-scopes-color-green{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.s-scopes-color-gray{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-scopes-hidden{display:none}.s-scopes-input-wrap.is-hidden-branch{display:none}.s-scopes-wrap{display:flex;max-height:350px;flex-direction:column}.s-scopes-wrap .s-placeholder-wrapper{display:flex;height:12rem;flex-direction:column;align-items:center;justify-content:center}.s-scopes-footer{margin-top:auto}.s-scopes-modal .s-modal-header{display:block !important}.s-scopes-skeleton .s-list-tile-item-content{display:block;width:100%}.s-scopes-skeleton .s-scopes-header-title>salla-skeleton{margin-top:0.75rem;margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-scopes-header-subtitle>salla-skeleton{margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-scopes-skeleton-scopes>salla-skeleton{margin-bottom:1.25rem;display:block}.s-scopes-skeleton .s-scopes-skeleton-search{margin-top:2rem;margin-bottom:2rem}.s-scopes-skeleton .s-scopes-skeleton-search>salla-skeleton{margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-list-tile-item-icon{margin-right:2rem}.s-scopes-skeleton .s-list-tile-item-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:2rem}.s-scopes-skeleton-btn{margin-top:2rem}';export{r as salla_scopes}
4
+ import{r as s,h as e,H as t}from"./p-BAXTlrSC.js";import{S as o}from"./p-BscTeWDc.js";var i;!function(s){s.DEFAULT="default",s.AVAILABILITY="availability"}(i||(i={}));const r=class{constructor(e){s(this,e),this.loadedScopes={[i.DEFAULT]:null,[i.AVAILABILITY]:null},this.translationLoaded=!1,this.mode=i.DEFAULT,this.scopes=[],this.originalScopesList=[],this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.hasError=!1,this.loading=!1,this.selection="optional",this.searchDisplayLimit=6,this.getFormTitle=()=>{if(this.originalScopesList?.length<2)return"";const s=salla.config.get("store.features")?.includes("multi-countries");return this.mode===i.DEFAULT?salla.lang.get(s?"blocks.scope.shopping_from_another_market":"blocks.scope.shopping_from_another_branch"):salla.lang.get(s?"blocks.scope.search_for_availability_in_other_markets":"blocks.scope.search_for_availability_in_other_branches")},salla.event.on("scopes::open",(({mode:s=null,product_id:e=null}={})=>{this.open(s,e)})),salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}get isNativeApp(){return!!salla.mobile?.isSpaWebview?.()}async close(){return await(this.modal?.close())}async open(s=i.DEFAULT,e=null){return this.isNativeApp?(salla.log("SallaScope:: delegated open to native app"),void salla.mobile?.openScopes?.()):(this.hasError=!1,this.mode=[i.AVAILABILITY,i.DEFAULT].includes(s)?s:i.DEFAULT,this.loading=!this.loadedScopes[this.mode],this.setScopeValues([]),salla.log("SallaScope:: opened"),this.modal.open(),this.loading?await salla.api.withoutNotifier((()=>s==i.AVAILABILITY?salla.scope.getProductAvailability(e):salla.scope.get())).then((e=>{if(s==i.AVAILABILITY)return this.setScopeValues(this.loadedScopes[i.AVAILABILITY]=e.data);this.setScopeValues(this.loadedScopes[this.mode]=e.data.scopes)})).catch((s=>{console.log(s),this.hasError=!0})).finally((()=>{this.modal.stopLoading(),this.loading=!1})):(this.setScopeValues(this.loadedScopes[this.mode]),this.modal.stopLoading()))}async handleSubmit(){let s={id:this.current_scope.id};return this.changeBtn.load(),await salla.scope.change(s).then((()=>{salla.storage.set("branch-choosed-before",!0),salla.storage.set("scope",{type:this.current_scope.type,id:this.current_scope.id}),salla.cart.reset(),window.location.replace(salla.helpers.addParamToUrl("scope",this.current_scope.id))})).catch((s=>console.log(s))).finally((()=>{this.changeBtn.stop()}))}setScopeValues(s){this.scopes=s,this.originalScopesList=s,1==s?.length?(this.current_scope=s[0],this.selected_scope=s[0],this.scopes=[s[0]]):(this.current_scope=s?.find((s=>s.selected)),this.selected_scope=s?.find((s=>s.selected)))}handleSearchFieldTyping(s){let e=s.target.value.toLocaleLowerCase();this.scopes=e?this.originalScopesList.filter((s=>s.name.toLowerCase().includes(e))):this.originalScopesList}handleScopeSelection(s){this.current_scope=this.scopes?.find((e=>e.id==s.target.value))}placeholderContent(){return e("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},e("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),e("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))}defaultContent(){return[e("div",{class:"s-scopes-container s-scrollbar"},this.scopes?.map((s=>e("div",{class:"s-scopes-input-wrap","data-selection":this.selection},e("input",{id:`${this.selection} + '_scope_' + ${s.id}`,name:"lang",type:"radio",value:s.id,onChange:s=>this.handleScopeSelection(s),class:"s-scopes-input",checked:!!this.current_scope&&this.current_scope.id==s.id}),e("label",{htmlFor:`${this.selection} + '_scope_' + ${s.id}`,class:"s-scopes-label s-scopes-clickable"},e("span",null,s.name)))))),this.footerContent()]}availabilityContent(){return e("div",{class:"s-scopes-container"},this.scopes?.map((s=>e("div",{class:"s-scopes-input-wrap","data-selection":this.selection},e("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===i.DEFAULT}},e("span",null,s.name)),e("h2",{style:{color:s?.availability?.color},class:`s-scopes-${s?.availability?.key}`},s?.availability?.label)))))}footerContent(){return e("div",{class:"s-scopes-footer"},e("slot",{name:"footer"},e("salla-button",{ref:s=>this.changeBtn=s,disabled:!this.current_scope,onClick:()=>this.handleSubmit(),class:"s-scopes-submit","loader-position":"center",width:"wide"},salla.lang.get("common.elements.confirm"))))}componentWillLoad(){return salla.onReady()}render(){return this.isNativeApp?null:e(t,null,e("salla-modal",{ref:s=>this.modal=s,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:this.loading,"has-skeleton":!0},this.loading?e("div",{slot:"loading"},e("div",{class:"s-scopes-skeleton"},e("salla-list-tile",{class:"s-scopes-header"},e("div",{slot:"icon",class:"s-scopes-header-icon"},e("salla-skeleton",{type:"circle"})),e("div",{slot:"title",class:"s-scopes-header-title mb-5"},e("salla-skeleton",{height:"15px",width:"50%"})),e("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},e("salla-skeleton",{height:"10px"}),e("salla-skeleton",{height:"10px",width:"75%"}))),e("div",{class:"s-scopes-skeleton-search"},e("salla-skeleton",{height:"10px",width:"50%"}),e("salla-skeleton",{height:"30px",width:"100%"})),e("div",{class:"s-scopes-skeleton-scopes"},e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"})),e("div",{class:"s-scopes-skeleton-btn"},e("salla-skeleton",{height:"40px",width:"100%"})))):[e("salla-list-tile",{class:this.originalScopesList?.length?"s-scopes-header block":"s-hidden"},e("div",{slot:"icon",class:"s-scopes-header-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>store-alt</title>\n<path d="M6.667 24h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.86 10.071l-4-8c-0.227-0.452-0.688-0.737-1.193-0.737h-21.333c-0.505 0-0.967 0.285-1.193 0.737l-4 8c-0.092 0.184-0.14 0.389-0.14 0.596v18.667c0 0.737 0.597 1.333 1.333 1.333h29.333c0.736 0 1.333-0.596 1.333-1.333v-18.667c0-0.207-0.048-0.412-0.14-0.596zM6.157 4h19.685l3.333 6.667h-26.352zM24 28h-5.333v-9.333h5.333zM29.333 28h-2.667v-10.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333v10.667h-13.333v-14.667h26.667zM6.667 18.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n'}),e("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),e("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),e("div",{class:"s-scopes-wrap"},!!this.originalScopesList?.length&&e("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList?.length>this.searchDisplayLimit?e("div",{class:"s-scopes-search-wrapper"},e("div",{class:"s-scopes-search-icon",innerHTML:o}),e("input",{type:"text",class:"s-scopes-search-input",onInput:s=>this.handleSearchFieldTyping(s),enterkeyhint:"search",placeholder:salla.lang.get("blocks.scope.searching_for_a_branch")})):"",this.hasError||!this.originalScopesList?.length&&this.mode!==i.AVAILABILITY?this.placeholderContent():this.mode===i.DEFAULT?this.defaultContent():this.availabilityContent())]))}async componentDidLoad(){await Salla.hooks.registerComponent("salla-scopes",this),salla.config.isMobileApp()||this.isNativeApp||this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};r.style='/*!twlt*/.s-scopes-availability-content{display:flex;justify-content:center;align-items:center}.s-scopes-placeholder{flex:0 0 85%}.mb-5{margin-bottom:1.25rem}.block{display:block}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-hidden{display:none}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.s-hidden{display:none}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-scopes-title{margin-bottom:0.75rem}.s-scopes-header{margin-bottom:0.5rem;display:block;text-align:center}.s-scopes-header-icon{margin:auto;display:flex;height:5rem;width:5rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(252 252 252 / var(--tw-bg-opacity, 1))}.s-scopes-header-icon svg{height:2rem;fill:var(--color-primary)}.s-scopes-header-title{font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-scopes-header-subtitle{text-align:left;font-size:1.25rem;line-height:1.75rem}.s-scopes-header-subtitle:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-scopes-search-wrapper{position:relative;width:100%}.s-scopes-search-icon{pointer-events:none;position:absolute;top:0px;bottom:0px;left:0px;display:flex;align-items:center;padding-left:0.75rem}.s-scopes-search-icon:where([dir="rtl"],[dir="rtl"] *){left:auto;right:0px;padding-left:0px;padding-right:0.75rem}.s-scopes-search-icon svg{height:1.25rem;width:1.25rem;fill:#9ca3af}.s-scopes-search-input{display:block;width:100%;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:0.625rem;padding-left:2.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-scopes-search-input:focus{--tw-ring-color:var(--color-primary)}.s-scopes-search-input:where([dir="rtl"],[dir="rtl"] *){padding-left:0px;padding-right:2.5rem}.s-scopes-input-wrap{margin-bottom:1.25rem;display:flex;align-items:center}.s-scopes-input-wrap:last-child{margin-bottom:0px}.s-scopes-input{height:1rem;width:1rem;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-scopes-input:focus{--tw-ring-color:var(--color-primary)}.s-scopes-input:where([dir="ltr"],[dir="ltr"] *){margin-right:0.75rem}.s-scopes-input:where([dir="rtl"],[dir="rtl"] *){margin-left:0.75rem}.s-scopes-label{display:flex;flex-grow:1;align-items:center;justify-content:space-between;font-size:1rem;line-height:1.5rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-scopes-select{height:2.5rem;width:100%;appearance:none;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-scopes-select:focus{border-color:var(--color-primary)}.s-scopes-container{margin-top:1.25rem;max-height:300px;overflow-y:auto;padding-left:0.5rem}.s-scopes-container:where([dir="rtl"],[dir="rtl"] *){padding-left:0px;padding-right:0.5rem}.s-scopes-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.s-scopes-is-closed{opacity:0.5}.s-scopes-closed-badge{--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-scopes-clickable{cursor:pointer}.s-scopes-submit{margin-top:1.5rem;height:auto}.s-scopes-color-red{--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-scopes-color-green{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.s-scopes-color-gray{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-scopes-hidden{display:none}.s-scopes-input-wrap.is-hidden-branch{display:none}.s-scopes-wrap{display:flex;max-height:350px;flex-direction:column}.s-scopes-wrap .s-placeholder-wrapper{display:flex;height:12rem;flex-direction:column;align-items:center;justify-content:center}.s-scopes-footer{margin-top:auto}.s-scopes-modal .s-modal-header{display:block !important}.s-scopes-skeleton .s-list-tile-item-content{display:block;width:100%}.s-scopes-skeleton .s-scopes-header-title>salla-skeleton{margin-top:0.75rem;margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-scopes-header-subtitle>salla-skeleton{margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-scopes-skeleton-scopes>salla-skeleton{margin-bottom:1.25rem;display:block}.s-scopes-skeleton .s-scopes-skeleton-search{margin-top:2rem;margin-bottom:2rem}.s-scopes-skeleton .s-scopes-skeleton-search>salla-skeleton{margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-list-tile-item-icon{margin-right:2rem}.s-scopes-skeleton .s-list-tile-item-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:2rem}.s-scopes-skeleton-btn{margin-top:2rem}';export{r as salla_scopes}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as a,H as e,a as r}from"./p-a6lSRQK4.js";const s=class{constructor(a){if(t(this,a),this.entity="product",this.specs=[],this.download=salla.lang.get("pages.thank_you.download"),this.entityId)try{return void(this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId))}catch(t){salla.log("Bad json passed via entityId prop")}}getValue(t){if("file"===t.type)return`<a href="${t.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`;if("url"===t.type)return`<a href="${t.value}" class="text-blue-700 underline" target="_blank">${t.value}</a>`;if("date"===t.type){const a=new Date(t.value);return`${String(a.getDate()).padStart(2,"0")}/${String(a.getMonth()+1).padStart(2,"0")}/${a.getFullYear()}`}return t.value}async componentWillLoad(){if(await salla.onReady(),!salla.config.get("store.features")?.includes("custom-fields"))return salla.logger.error("feature custom-fields is not activated");if(this.entityId||!salla.url.is_page("product.single")&&!salla.url.is_page("product.showNewUrls")||(this.entityId=salla.config.get("page.id")),!this.entityId)return salla.logger.error("can't render salla-metadata without enity-id prop!");await salla.lang.onLoaded(),this.download=salla.lang.get("pages.thank_you.download");const t=await Salla.api.metadata.fetchValues(this.entity,this.entityId);this.specs=t.data[0]?.sections}render(){if(this.specs.length)return a(e,{class:"s-metadata-wrapper"},this.specs.map((t=>a("div",{class:"s-metadata-box"},a("div",{class:"s-metadata-box-header"},a("i",{class:"sicon-list"}),t.name),t.fields.map((t=>a("div",{class:"s-metadata-row"},a("p",{class:"s-metadata-row-name"},t.name),a("p",{class:"s-metadata-row-value",innerHTML:this.getValue(t)}))))))))}get host(){return r(this)}};s.style="/*!twlt*/.text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-primary{color:var(--color-primary)}.underline{text-decoration-line:underline}.s-metadata-box{margin-bottom:1.25rem;display:block;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1.25rem}.s-metadata-box-header{margin-bottom:0.75rem;display:flex;align-items:center;column-gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-bottom:0.75rem;font-size:1rem;line-height:1.5rem;font-weight:700}.s-metadata-row{margin-bottom:0.75rem;display:flex;flex-direction:row;justify-content:space-between;gap:0.5rem;line-height:1.25rem}.s-metadata-row:last-child{margin-bottom:0px}.s-metadata-row-name{font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}";export{s as salla_metadata}
4
+ import{r as t,h as a,H as e,a as r}from"./p-BAXTlrSC.js";const s=class{constructor(a){if(t(this,a),this.entity="product",this.specs=[],this.download=salla.lang.get("pages.thank_you.download"),this.entityId)try{return void(this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId))}catch(t){salla.log("Bad json passed via entityId prop")}}getValue(t){if("file"===t.type)return`<a href="${t.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`;if("url"===t.type)return`<a href="${t.value}" class="text-blue-700 underline" target="_blank">${t.value}</a>`;if("date"===t.type){const a=new Date(t.value);return`${String(a.getDate()).padStart(2,"0")}/${String(a.getMonth()+1).padStart(2,"0")}/${a.getFullYear()}`}return t.value}async componentWillLoad(){if(await salla.onReady(),!salla.config.get("store.features")?.includes("custom-fields"))return salla.logger.error("feature custom-fields is not activated");if(this.entityId||!salla.url.is_page("product.single")&&!salla.url.is_page("product.showNewUrls")||(this.entityId=salla.config.get("page.id")),!this.entityId)return salla.logger.error("can't render salla-metadata without enity-id prop!");await salla.lang.onLoaded(),this.download=salla.lang.get("pages.thank_you.download");const t=await Salla.api.metadata.fetchValues(this.entity,this.entityId);this.specs=t.data[0]?.sections}render(){if(this.specs.length)return a(e,{class:"s-metadata-wrapper"},this.specs.map((t=>a("div",{class:"s-metadata-box"},a("div",{class:"s-metadata-box-header"},a("i",{class:"sicon-list"}),t.name),t.fields.map((t=>a("div",{class:"s-metadata-row"},a("p",{class:"s-metadata-row-name"},t.name),a("p",{class:"s-metadata-row-value",innerHTML:this.getValue(t)}))))))))}get host(){return r(this)}};s.style="/*!twlt*/.text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-primary{color:var(--color-primary)}.underline{text-decoration-line:underline}.s-metadata-box{margin-bottom:1.25rem;display:block;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1.25rem}.s-metadata-box-header{margin-bottom:0.75rem;display:flex;align-items:center;column-gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-bottom:0.75rem;font-size:1rem;line-height:1.5rem;font-weight:700}.s-metadata-row{margin-bottom:0.75rem;display:flex;flex-direction:row;justify-content:space-between;gap:0.5rem;line-height:1.25rem}.s-metadata-row:last-child{margin-bottom:0px}.s-metadata-row-name{font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}";export{s as salla_metadata}