@salla.sa/twilight-components 2.14.550 → 2.14.552

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 (331) hide show
  1. package/dist/cjs/{filepond-B-8syvXC.js → filepond-BTsLGLic.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DxfU_d7d.js → filepond-plugin-file-poster-DSHHkMx8.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-C0XIW0bl.js → filepond-plugin-file-validate-size-BB6ltSRf.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-BHyBHLOg.js → filepond-plugin-file-validate-type-CNWlgtpi.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-Dnni9gl-.js → filepond-plugin-image-edit-DuY72vJR.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-C7pHXy9M.js → filepond-plugin-image-exif-orientation-DWzZOyOL.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-CFttWV9E.js → filepond-plugin-image-preview-ropJ4nYL.js} +1 -1
  8. package/dist/cjs/{helpers-DHdDjm5V.js → helpers-Dm4BirHO.js} +2 -2
  9. package/dist/cjs/{index-CHvvKGJc.js → index-CoSVCFSp.js} +4 -4
  10. package/dist/cjs/{intlTelInput--yv-lZaU.js → intlTelInput-BSHBNNPO.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  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 +10 -10
  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_2.cjs.entry.js → salla-bullet-delivery_3.cjs.entry.js} +60 -3
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  38. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-options-modal_2.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  105. package/dist/cjs/twilight.cjs.js +2 -2
  106. package/dist/cjs/{vanilla-picker-D-X0hQ7w.js → vanilla-picker-DdIwY7TN.js} +1 -1
  107. package/dist/collection/collection-manifest.json +6 -4
  108. package/dist/collection/components/salla-bullet-delivery/helpers.js +2 -2
  109. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +7 -1
  110. package/dist/collection/components/salla-bullet-delivery-tag/salla-bullet-delivery-tag.css +70 -0
  111. package/dist/collection/components/salla-bullet-delivery-tag/salla-bullet-delivery-tag.js +77 -0
  112. package/dist/components/helpers.js +2 -2
  113. package/dist/components/index.js +2 -2
  114. package/dist/components/salla-bullet-delivery-tag.d.ts +11 -0
  115. package/dist/components/salla-bullet-delivery-tag.js +76 -0
  116. package/dist/components/salla-bullet-delivery.js +7 -1
  117. package/dist/esm/{filepond-rGVsy4ep.js → filepond-CqbRA3Vl.js} +1 -1
  118. package/dist/esm/{filepond-plugin-file-poster-bfSOezL4.js → filepond-plugin-file-poster-Byt9onuT.js} +1 -1
  119. package/dist/esm/{filepond-plugin-file-validate-size-DagZiT3e.js → filepond-plugin-file-validate-size-C1P2OJEv.js} +1 -1
  120. package/dist/esm/{filepond-plugin-file-validate-type-Cf4JwDq-.js → filepond-plugin-file-validate-type-BP2FLMsG.js} +1 -1
  121. package/dist/esm/{filepond-plugin-image-edit-DWZ8nbdr.js → filepond-plugin-image-edit-C69hhmiF.js} +1 -1
  122. package/dist/esm/{filepond-plugin-image-exif-orientation-NHp2unXf.js → filepond-plugin-image-exif-orientation-B2QzeXLq.js} +1 -1
  123. package/dist/esm/{filepond-plugin-image-preview-BSi_AIFs.js → filepond-plugin-image-preview-CR1odLVd.js} +1 -1
  124. package/dist/esm/{helpers-BDChq2t4.js → helpers-CV6uPJEJ.js} +2 -2
  125. package/dist/esm/{index-Bf2Z6A1M.js → index-Q9lz4Iuq.js} +4 -4
  126. package/dist/esm/{intlTelInput-DLtsxnoY.js → intlTelInput-DzbfeHCl.js} +1 -1
  127. package/dist/esm/loader.js +3 -3
  128. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  129. package/dist/esm/salla-accordion_6.entry.js +1 -1
  130. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  131. package/dist/esm/salla-advertisement.entry.js +1 -1
  132. package/dist/esm/salla-alert_2.entry.js +1 -1
  133. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  134. package/dist/esm/salla-applied-filters.entry.js +1 -1
  135. package/dist/esm/salla-apps-icons.entry.js +1 -1
  136. package/dist/esm/salla-attachment-view_9.entry.js +10 -10
  137. package/dist/esm/salla-badge.entry.js +1 -1
  138. package/dist/esm/salla-basket-gap.entry.js +1 -1
  139. package/dist/esm/{salla-bullet-delivery_2.entry.js → salla-bullet-delivery_3.entry.js} +60 -4
  140. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  141. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  142. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  143. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  144. package/dist/esm/salla-comment-factors.entry.js +1 -1
  145. package/dist/esm/salla-comment-form_9.entry.js +1 -1
  146. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  147. package/dist/esm/salla-contacts.entry.js +1 -1
  148. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  149. package/dist/esm/salla-count-down.entry.js +1 -1
  150. package/dist/esm/salla-custom-fields.entry.js +1 -1
  151. package/dist/esm/salla-delivery-promise.entry.js +2 -2
  152. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  153. package/dist/esm/salla-filters-widget.entry.js +1 -1
  154. package/dist/esm/salla-filters.entry.js +1 -1
  155. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  156. package/dist/esm/salla-gifting.entry.js +1 -1
  157. package/dist/esm/salla-hook.entry.js +1 -1
  158. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  159. package/dist/esm/salla-installment.entry.js +1 -1
  160. package/dist/esm/salla-list-tile.entry.js +1 -1
  161. package/dist/esm/salla-localization-modal.entry.js +1 -1
  162. package/dist/esm/salla-login-modal.entry.js +1 -1
  163. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  164. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  165. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  166. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  167. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  168. package/dist/esm/salla-loyalty.entry.js +1 -1
  169. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  170. package/dist/esm/salla-map_2.entry.js +1 -1
  171. package/dist/esm/salla-menu.entry.js +1 -1
  172. package/dist/esm/salla-metadata.entry.js +1 -1
  173. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  174. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  175. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  176. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  177. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  178. package/dist/esm/salla-offer-modal.entry.js +1 -1
  179. package/dist/esm/salla-offer.entry.js +1 -1
  180. package/dist/esm/salla-order-branch.entry.js +1 -1
  181. package/dist/esm/salla-order-cancel.entry.js +1 -1
  182. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  183. package/dist/esm/salla-order-details-options.entry.js +1 -1
  184. package/dist/esm/salla-order-details.entry.js +1 -1
  185. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  186. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  187. package/dist/esm/salla-order-edit.entry.js +1 -1
  188. package/dist/esm/salla-order-options-modal_2.entry.js +1 -1
  189. package/dist/esm/salla-order-shipments.entry.js +1 -1
  190. package/dist/esm/salla-order-summary.entry.js +1 -1
  191. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  192. package/dist/esm/salla-orders.entry.js +1 -1
  193. package/dist/esm/salla-payments.entry.js +1 -1
  194. package/dist/esm/salla-placeholder.entry.js +1 -1
  195. package/dist/esm/salla-price-range.entry.js +1 -1
  196. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  197. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  198. package/dist/esm/salla-products-list.entry.js +1 -1
  199. package/dist/esm/salla-products-slider.entry.js +1 -1
  200. package/dist/esm/salla-quick-order.entry.js +1 -1
  201. package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
  202. package/dist/esm/salla-rating-modal.entry.js +1 -1
  203. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  204. package/dist/esm/salla-review-order-item.entry.js +1 -1
  205. package/dist/esm/salla-scopes.entry.js +1 -1
  206. package/dist/esm/salla-search.entry.js +1 -1
  207. package/dist/esm/salla-skeleton.entry.js +1 -1
  208. package/dist/esm/salla-slider.entry.js +1 -1
  209. package/dist/esm/salla-social-share.entry.js +1 -1
  210. package/dist/esm/salla-social.entry.js +1 -1
  211. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  212. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  213. package/dist/esm/salla-tooltip.entry.js +1 -1
  214. package/dist/esm/salla-trust-badges.entry.js +1 -1
  215. package/dist/esm/salla-user-menu.entry.js +1 -1
  216. package/dist/esm/salla-user-profile.entry.js +1 -1
  217. package/dist/esm/salla-user-settings.entry.js +1 -1
  218. package/dist/esm/salla-verify.entry.js +1 -1
  219. package/dist/esm/salla-wallet.entry.js +1 -1
  220. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  221. package/dist/esm/twilight.js +3 -3
  222. package/dist/esm/{vanilla-picker-AjTapsL5.js → vanilla-picker-DZSS4OVz.js} +1 -1
  223. package/dist/twilight/{p-b19102f6.entry.js → p-008dcf73.entry.js} +1 -1
  224. package/dist/twilight/{p-b2380c6b.entry.js → p-00bb1a13.entry.js} +1 -1
  225. package/dist/twilight/{p-27396f6f.entry.js → p-0100262e.entry.js} +1 -1
  226. package/dist/twilight/{p-6e78cc02.entry.js → p-06109ef0.entry.js} +1 -1
  227. package/dist/twilight/{p-8838ad5c.entry.js → p-06abf9fb.entry.js} +1 -1
  228. package/dist/twilight/{p-69d75b45.entry.js → p-0bb678e7.entry.js} +1 -1
  229. package/dist/twilight/{p-e284728d.entry.js → p-1242708e.entry.js} +1 -1
  230. package/dist/twilight/{p-c818e0eb.entry.js → p-171c1927.entry.js} +1 -1
  231. package/dist/twilight/{p-e8b220e1.entry.js → p-1dc63988.entry.js} +1 -1
  232. package/dist/twilight/{p-277f3a46.entry.js → p-25017fcd.entry.js} +1 -1
  233. package/dist/twilight/{p-57b7cd9f.entry.js → p-25b7344e.entry.js} +1 -1
  234. package/dist/twilight/{p-581eeaf8.entry.js → p-27176c04.entry.js} +1 -1
  235. package/dist/twilight/{p-9e702ebb.entry.js → p-2845de1c.entry.js} +1 -1
  236. package/dist/twilight/{p-2c212d54.entry.js → p-31394018.entry.js} +1 -1
  237. package/dist/twilight/{p-9ae3a15c.entry.js → p-31d03d8c.entry.js} +1 -1
  238. package/dist/twilight/{p-f1322c8e.entry.js → p-34dfff49.entry.js} +1 -1
  239. package/dist/twilight/{p-d2c204f4.entry.js → p-36aa4c09.entry.js} +1 -1
  240. package/dist/twilight/{p-0dc61077.entry.js → p-382e5a40.entry.js} +1 -1
  241. package/dist/twilight/{p-5256180e.entry.js → p-3c0705e2.entry.js} +1 -1
  242. package/dist/twilight/{p-2f2771de.entry.js → p-40b70c18.entry.js} +1 -1
  243. package/dist/twilight/{p-03db1fe6.entry.js → p-462a49e4.entry.js} +1 -1
  244. package/dist/twilight/{p-0e12c9ca.entry.js → p-492c72eb.entry.js} +1 -1
  245. package/dist/twilight/{p-649ced48.entry.js → p-4941b3cd.entry.js} +1 -1
  246. package/dist/twilight/{p-cd51e722.entry.js → p-49cbb9ed.entry.js} +1 -1
  247. package/dist/twilight/{p-1c662f1d.entry.js → p-4abffe52.entry.js} +1 -1
  248. package/dist/twilight/{p-9cbc4733.entry.js → p-4b827efc.entry.js} +1 -1
  249. package/dist/twilight/{p-cfbf287b.entry.js → p-4bac36be.entry.js} +1 -1
  250. package/dist/twilight/{p-8cf65dbf.entry.js → p-52e1754b.entry.js} +1 -1
  251. package/dist/twilight/{p-b017b72e.entry.js → p-53e430c6.entry.js} +1 -1
  252. package/dist/twilight/{p-aa71f393.entry.js → p-5470f52a.entry.js} +1 -1
  253. package/dist/twilight/{p-c31b966f.entry.js → p-54bdc583.entry.js} +1 -1
  254. package/dist/twilight/{p-12d74e96.entry.js → p-56e93806.entry.js} +1 -1
  255. package/dist/twilight/{p-8e0bdbbc.entry.js → p-5b94bea7.entry.js} +1 -1
  256. package/dist/twilight/{p-4f1102f8.entry.js → p-5d671536.entry.js} +1 -1
  257. package/dist/twilight/{p-13fb9b74.entry.js → p-61ca8dd2.entry.js} +1 -1
  258. package/dist/twilight/{p-a8d6804c.entry.js → p-67b60d33.entry.js} +1 -1
  259. package/dist/twilight/{p-a3eb15e4.entry.js → p-6860331a.entry.js} +1 -1
  260. package/dist/twilight/{p-7e9d98c3.entry.js → p-6867eb35.entry.js} +1 -1
  261. package/dist/twilight/{p-785cee9b.entry.js → p-688b40b4.entry.js} +1 -1
  262. package/dist/twilight/{p-0c4c4419.entry.js → p-6f6d6f45.entry.js} +1 -1
  263. package/dist/twilight/{p-ebb73bcc.entry.js → p-7022989a.entry.js} +1 -1
  264. package/dist/twilight/{p-0ccba871.entry.js → p-729f3fa0.entry.js} +1 -1
  265. package/dist/twilight/{p-7e101885.entry.js → p-754af3dd.entry.js} +1 -1
  266. package/dist/twilight/{p-efa79191.entry.js → p-79451510.entry.js} +1 -1
  267. package/dist/twilight/{p-7b6fa77f.entry.js → p-79e2d7eb.entry.js} +1 -1
  268. package/dist/twilight/{p-cf21323d.entry.js → p-7d3899e7.entry.js} +1 -1
  269. package/dist/twilight/{p-3627d945.entry.js → p-7d9e3032.entry.js} +1 -1
  270. package/dist/twilight/{p-9fdb6380.entry.js → p-7dda74dd.entry.js} +1 -1
  271. package/dist/twilight/{p-f2e5f1fd.entry.js → p-7deba3f8.entry.js} +1 -1
  272. package/dist/twilight/{p-bded58cb.entry.js → p-7e8b2b0d.entry.js} +1 -1
  273. package/dist/twilight/{p-17c30aa6.entry.js → p-7f2bc499.entry.js} +1 -1
  274. package/dist/twilight/{p-9ee1e01c.entry.js → p-808fef3d.entry.js} +1 -1
  275. package/dist/twilight/{p-be95b40b.entry.js → p-8920aae0.entry.js} +1 -1
  276. package/dist/twilight/{p-3a4160c2.entry.js → p-89aad90f.entry.js} +1 -1
  277. package/dist/twilight/{p-c56725b9.entry.js → p-8abf3859.entry.js} +1 -1
  278. package/dist/twilight/{p-b603a180.entry.js → p-8bcf6db3.entry.js} +1 -1
  279. package/dist/twilight/{p-434f3557.entry.js → p-9118b3cf.entry.js} +1 -1
  280. package/dist/twilight/{p-3615a99b.entry.js → p-92fbada7.entry.js} +1 -1
  281. package/dist/twilight/{p-44ee3af8.entry.js → p-9f4fef0f.entry.js} +1 -1
  282. package/dist/twilight/{p-B59qdBmY.js → p-B31LPQuk.js} +1 -1
  283. package/dist/twilight/{p-BdsgfewR.js → p-BCwAi8HD.js} +1 -1
  284. package/dist/twilight/{p-CG1Rwy3q.js → p-CA-ne4vX.js} +1 -1
  285. package/dist/twilight/{p-CPqpCDCi.js → p-CPEEGqkw.js} +1 -1
  286. package/dist/twilight/{p-BDChq2t4.js → p-CV6uPJEJ.js} +1 -1
  287. package/dist/twilight/{p-uOF6Cufg.js → p-Ce0SoG8e.js} +1 -1
  288. package/dist/twilight/{p-BlDax_46.js → p-DPu3dYaG.js} +1 -1
  289. package/dist/twilight/{p-Bf2Z6A1M.js → p-Q9lz4Iuq.js} +1 -1
  290. package/dist/twilight/{p-DfIHi_xi.js → p-VPmzkmKU.js} +1 -1
  291. package/dist/twilight/{p-B-Q5WD6p.js → p-WyyaE0fN.js} +1 -1
  292. package/dist/twilight/{p-e54cc4f8.entry.js → p-a0e73c0f.entry.js} +1 -1
  293. package/dist/twilight/{p-bd3fef37.entry.js → p-a24168ae.entry.js} +1 -1
  294. package/dist/twilight/{p-5383a324.entry.js → p-a70cbfe9.entry.js} +1 -1
  295. package/dist/twilight/{p-97136699.entry.js → p-a7417d3a.entry.js} +1 -1
  296. package/dist/twilight/{p-5a4f7313.entry.js → p-aa1af88d.entry.js} +1 -1
  297. package/dist/twilight/{p-2607ac8e.entry.js → p-ae5ce421.entry.js} +1 -1
  298. package/dist/twilight/{p-33842645.entry.js → p-b881f716.entry.js} +1 -1
  299. package/dist/twilight/{p-c24f6325.entry.js → p-b92af898.entry.js} +1 -1
  300. package/dist/twilight/{p-0fb44a3c.entry.js → p-bbdec84a.entry.js} +1 -1
  301. package/dist/twilight/{p-95a3b9b9.entry.js → p-bd389ba7.entry.js} +1 -1
  302. package/dist/twilight/{p-09c1d9c8.entry.js → p-bf860754.entry.js} +1 -1
  303. package/dist/twilight/{p-4df5f9a0.entry.js → p-bfa2b7c5.entry.js} +1 -1
  304. package/dist/twilight/{p-0d199866.entry.js → p-c0599e5d.entry.js} +1 -1
  305. package/dist/twilight/{p-1653256e.entry.js → p-c6ed3a34.entry.js} +1 -1
  306. package/dist/twilight/{p-38b4dfa9.entry.js → p-c7482df4.entry.js} +1 -1
  307. package/dist/twilight/{p-4d3e018b.entry.js → p-c90ff0bf.entry.js} +1 -1
  308. package/dist/twilight/{p-bc595ee3.entry.js → p-ce8205e2.entry.js} +1 -1
  309. package/dist/twilight/{p-e8a1c501.entry.js → p-d6a04817.entry.js} +1 -1
  310. package/dist/twilight/{p-34240222.entry.js → p-d70c704f.entry.js} +25 -25
  311. package/dist/twilight/{p-fc587040.entry.js → p-d7c03cf7.entry.js} +1 -1
  312. package/dist/twilight/{p-d65a6462.entry.js → p-dfc67513.entry.js} +1 -1
  313. package/dist/twilight/{p-dfaf0617.entry.js → p-e0868b92.entry.js} +1 -1
  314. package/dist/twilight/{p-a818352a.entry.js → p-e305f635.entry.js} +1 -1
  315. package/dist/twilight/{p-018456c8.entry.js → p-e69f6c43.entry.js} +1 -1
  316. package/dist/twilight/{p-9f1d1b76.entry.js → p-e6b1dd40.entry.js} +1 -1
  317. package/dist/twilight/{p-c0c561b9.entry.js → p-ea3480ff.entry.js} +1 -1
  318. package/dist/twilight/{p-0da8a64f.entry.js → p-eddf3ee5.entry.js} +1 -1
  319. package/dist/twilight/{p-f586c239.entry.js → p-f0cefe50.entry.js} +1 -1
  320. package/dist/twilight/{p-d2556680.entry.js → p-f4207ccf.entry.js} +1 -1
  321. package/dist/twilight/{p-d63ca8bb.entry.js → p-f5485435.entry.js} +1 -1
  322. package/dist/twilight/{p-b7b4231f.entry.js → p-f632b2f7.entry.js} +1 -1
  323. package/dist/twilight/{p-b452c8a0.entry.js → p-f7c2ff0f.entry.js} +1 -1
  324. package/dist/twilight/{p-cfac0aa1.entry.js → p-fe34bfd0.entry.js} +1 -1
  325. package/dist/twilight/{p-0739e769.entry.js → p-ff6672b6.entry.js} +1 -1
  326. package/dist/twilight/{p-CMQ7Gxqu.js → p-sDtjU0pK.js} +1 -1
  327. package/dist/twilight/twilight.esm.js +1 -1
  328. package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +2 -0
  329. package/dist/types/components/salla-bullet-delivery-tag/salla-bullet-delivery-tag.d.ts +26 -0
  330. package/dist/types/components.d.ts +77 -0
  331. package/package.json +5 -5
@@ -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-Bf2Z6A1M.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("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-Q9lz4Iuq.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("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 o,H as r,a}from"./p-Bf2Z6A1M.js";const s=class{constructor(o){t(this,o),this.availableCoupons=[],this.cartTotal=0,this.cartTotalReady=!1,this.currentCoupon="",this.couponInputValue="",this.couponError="",this.isApplying=!1,this.appliedCoupons=[],this.multiCoupon=!1,this.isHandlingInternalError=!1,this.cartUpdatedHandler=t=>{this.syncCartTotal(t),(this.multiCoupon?Array.isArray(t?.coupons):t&&"coupon"in t)&&this.syncAppliedFromCart(t),this.couponError=""},this.couponAddedHandler=()=>{this.isApplying||this.isHandlingInternalError||this.refreshFromServer()},this.couponAdditionFailedHandler=t=>{this.isApplying||this.isHandlingInternalError||this.showCouponError(t?.message||salla.lang.get("pages.cart.coupon_application_error"))},this.couponDeletedHandler=()=>{this.isApplying||this.isHandlingInternalError||this.refreshFromServer()},this.onKeyUp=t=>{"Enter"===t.key&&this.couponButtonRef?.click(),this.couponError=""},this.onInput=t=>{this.couponInputValue=t.target.value}}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.multiCoupon=!!salla.config.get("store.settings.cart.multi_coupon"),this.loadCouponsData(),this.seedFromStorage(),this.loadCartTotal(),this.setupCartEventListeners()}setupCartEventListeners(){salla.event.on("cart::updated",this.cartUpdatedHandler),salla.event.on("cart::coupon.added",this.couponAddedHandler),salla.event.on("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.on("cart::coupon.deleted",this.couponDeletedHandler)}disconnectedCallback(){salla.event.off("cart::updated",this.cartUpdatedHandler),salla.event.off("cart::coupon.added",this.couponAddedHandler),salla.event.off("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.off("cart::coupon.deleted",this.couponDeletedHandler)}async selectCoupon(t){const o=this.availableCoupons.find((o=>o.code===t));if(o){if(!this.isEligible(o))throw new Error("Coupon not eligible: minimum cart amount not met");try{await this.applyCoupon(t),this.host.dispatchEvent(new CustomEvent("salla::cart-coupons.coupon.selected",{detail:o,bubbles:!0}))}catch(t){throw t}}return o}async loadCouponsData(){try{const t=await salla.api.request("coupons"),o=t?.data,r=Array.isArray(o)?o:Array.isArray(o?.data)?o.data:[];this.availableCoupons=r}catch(t){console.warn("Failed to load coupons:",t),this.availableCoupons=[]}}async loadCartTotal(){await this.refreshFromServer()}seedFromStorage(){if(this.multiCoupon)return;const t=salla.storage.get("cart");t&&"object"==typeof t&&"coupon"in t&&this.applyCart(t),this.seedTotalsFromSummaryStorage()}seedTotalsFromSummaryStorage(){const t=salla.storage.get("cart.summary");t&&"object"==typeof t&&null!=t.sub_total&&(this.cartTotal=Number(t.sub_total),this.cartTotalReady=!0)}syncCartTotal(t){const o=t?.summary?.sub_total??t?.sub_total??t?.total;null!=o&&(this.cartTotal=Number(o),this.cartTotalReady=!0)}async refreshFromServer(){try{const t=await salla.cart.details(),o=t?.data?.cart??t?.data??t;if(o&&"object"==typeof o&&(Array.isArray(o.coupons)||"coupon"in o))return void this.applyCart(o)}catch(t){}const t=salla.storage.get("cart");t&&this.applyCart(t),this.seedTotalsFromSummaryStorage()}applyCart(t){this.syncCartTotal(t),this.syncAppliedFromCart(t)}syncAppliedFromCart(t){this.currentCoupon=t?.coupon||"",this.multiCoupon?this.appliedCoupons=Array.isArray(t?.coupons)?t.coupons.filter(Boolean):this.currentCoupon?[this.currentCoupon]:[]:(this.couponInputValue=this.currentCoupon,this.appliedCoupons=this.currentCoupon?[this.currentCoupon]:[])}async handleApplyClick(){if(this.isApplying)return;const t=this.couponInputValue.trim();if(t){this.isApplying=!0,this.isHandlingInternalError=!0;try{await salla.cart.addCoupon(t),await this.refreshFromServer(),this.couponInputValue=""}catch(t){this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}else this.showCouponError(salla.lang.get("pages.cart.enter_coupon_code"))}async handleCouponButtonClick(){if(this.isApplying)return;const t=!!this.currentCoupon;if(t||this.couponInputValue.trim()){this.isApplying=!0,this.isHandlingInternalError=!0;try{t?await salla.cart.deleteCoupon():await salla.cart.addCoupon(this.couponInputValue.trim()),await this.refreshFromServer()}catch(t){this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}else this.showCouponError(salla.lang.get("pages.cart.enter_coupon_code"))}async removeCoupon(t){if(!this.isApplying){this.isApplying=!0,this.isHandlingInternalError=!0;try{this.multiCoupon?await salla.cart.deleteCoupon(t):await salla.cart.deleteCoupon(),await this.refreshFromServer()}catch(t){this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}}showCouponError(t){this.couponError=t}handleCouponClick(t){this.applyCoupon(t.code,!1).catch((()=>{}))}async applyCoupon(t,o=!0){if(this.isApplying){if(o)throw new Error("Coupon application already in progress")}else{this.couponInputValue=t,this.couponError="",this.isApplying=!0,this.isHandlingInternalError=!0;try{await salla.cart.addCoupon(t.trim()),await this.refreshFromServer(),this.multiCoupon&&(this.couponInputValue="")}catch(t){if(this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error")),o)throw t}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}}formatMainAmount(t){if("percentage"===t.type)return`${salla.helpers.number("object"==typeof t.amount?t.amount.amount:t.amount)}%`;{const r="object"==typeof t.amount?t.amount:{amount:t.amount,currency:t.minimum_amount?.currency||salla.config.get("store.currency.code","SAR")};return o("span",{innerHTML:salla.money(r.amount,r.currency)})}}isEligible(t){return!this.cartTotalReady||!t.minimum_amount||this.cartTotal>=parseFloat(t.minimum_amount.amount)}renderCouponCard(t){const r=this.isEligible(t);return o("div",{class:"s-cart-coupons-slide-one-fourth swiper-slide"},o("div",{class:"s-cart-coupons-card "+(!r||this.isApplying?"s-cart-coupons-disabled":""),onClick:()=>r&&!this.isApplying&&this.handleCouponClick(t)},o("div",{class:"s-cart-coupons-top-section"},o("div",{class:"s-cart-coupons-discount-values"},o("div",{class:"s-cart-coupons-main-amount"},this.formatMainAmount(t)),t.free_shipping?o("div",{class:"s-cart-coupons-secondary-info"},"+ ",salla.lang.get("pages.cart.free_shipping")):t.maximum_amount&&o("div",{class:"s-cart-coupons-secondary-info"},salla.lang.get("pages.cart.up_to")," ",o("span",{innerHTML:salla.money(t.maximum_amount.amount,t.maximum_amount.currency)}))),o("div",{class:"s-cart-coupons-code"},t.code)),o("div",{class:"s-cart-coupons-divider"}),o("div",{class:"s-cart-coupons-bottom-section"},o("div",{class:"s-cart-coupons-terms"},null!=t.remaining_days&&o("div",{class:"s-cart-coupons-expiry "+(t.remaining_days<=3?"s-cart-coupons-expiry-warning":"")},0===t.remaining_days?salla.lang.get("pages.cart.expires_today"):`${salla.lang.get("pages.cart.expires_after")} ${t.remaining_days} ${salla.lang.get("pages.cart.day")}`),t.minimum_amount&&parseFloat(t.minimum_amount.amount)>0&&o("div",{class:"s-cart-coupons-minimum"},salla.lang.get("pages.cart.minimum")," ",o("span",{innerHTML:salla.money(t.minimum_amount.amount,t.minimum_amount.currency)}))),o("div",{class:"s-cart-coupons-action"},r?salla.lang.get("pages.cart.save_coupon"):salla.lang.get("pages.cart.coupon_not_compatible")))))}render(){return o(r,{key:"e3bed8f1f2019db5e1c5ca4280696933913e3081"},o("div",{key:"9c6a7c383394f9bd19107db9b8e76fd9129648e3",class:"s-cart-coupons-wrapper"},o("div",{key:"1e7f74969e709062c36aa19ff4ec27bde0bb10df",class:"s-cart-coupons-input-section"},o("label",{key:"f3bc1f4ffa9c8a64bee8af273597d6f8ff1f8fd0",htmlFor:"coupon-input",class:"s-cart-coupons-coupon-label"},salla.lang.get("pages.cart.have_coupon")),o("div",{key:"7abbdbd41cf6e65b6c08928bb10a68bfb2677d85",class:"s-cart-coupons-coupon-input-container"},this.multiCoupon?[o("input",{type:"text",id:"coupon-input",name:"coupon",class:"form-input "+(this.couponError?"s-coupon-input-error":""),placeholder:salla.lang.get("pages.cart.coupon_placeholder"),value:this.couponInputValue,disabled:this.isApplying,onInput:this.onInput,onKeyUp:this.onKeyUp,"aria-label":salla.lang.get("pages.cart.apply_coupon"),key:"coupon-input"}),o("salla-button",{ref:t=>this.couponButtonRef=t,class:"s-cart-coupons-coupon-button s-cart-coupons-coupon-button-apply",color:"primary",loading:this.isApplying,"loader-position":"center",onClick:()=>this.handleApplyClick(),key:"apply-button"},o("span",null,salla.lang.get("pages.cart.save_coupon")))]:[o("input",{type:"text",id:"coupon-input",name:"coupon",class:"form-input "+(this.couponError?"s-coupon-input-error":""),placeholder:salla.lang.get("pages.cart.coupon_placeholder"),value:this.couponInputValue,disabled:!!this.currentCoupon||this.isApplying,onInput:this.onInput,onKeyUp:this.onKeyUp,"aria-label":salla.lang.get("pages.cart.apply_coupon"),key:"coupon-input"}),o("salla-button",{ref:t=>this.couponButtonRef=t,class:"s-cart-coupons-coupon-button "+(this.currentCoupon?"s-cart-coupons-coupon-button-remove":"s-cart-coupons-coupon-button-apply"),color:this.currentCoupon?"danger":"primary",loading:this.isApplying,"loader-position":"center",onClick:()=>this.handleCouponButtonClick(),key:"apply-button"},this.currentCoupon?o("i",{class:"sicon-cancel"}):o("span",null,salla.lang.get("pages.cart.save_coupon")))]),this.couponError&&o("span",{key:"6c259fbca7a2a3c2ece3d4c335707c833be5f8d6",class:"s-cart-coupons-coupon-error"},this.couponError),this.multiCoupon&&this.appliedCoupons.length>0&&o("div",{key:"87335fd875279e97fc7a02c9f3519af51a953a7b",class:"s-cart-coupons-applied-list"},this.appliedCoupons.map((t=>o("div",{class:"s-cart-coupons-applied-item",key:t},o("span",{class:"s-cart-coupons-applied-code"},t),o("button",{type:"button",class:"s-cart-coupons-applied-remove","aria-label":`${salla.lang.get("pages.cart.delete")} ${t}`,disabled:this.isApplying,onClick:()=>this.removeCoupon(t)},o("i",{class:"sicon-cancel"}))))))),this.availableCoupons&&this.availableCoupons.length>0&&o("salla-slider",{key:"86c665d3135fa8bc393c4b7ad9daca3ce87bed50",type:"carousel",showControls:!1,class:"s-cart-coupons-slider"},o("div",{key:"45ddccd7e0c5d38e9b98f42862a6d64f6040c942",slot:"items"},this.availableCoupons.map((t=>this.renderCouponCard(t)))))))}get host(){return a(this)}};s.style='/*!twlt*/.s-cart-coupons-applied-list{display:flex;flex-direction:column;gap:8px;margin-top:12px}.s-cart-coupons-applied-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;background:#fff;border:1px solid #e5e7eb;border-radius:10px;border-inline-start:3px solid #10b981}.s-cart-coupons-applied-code{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:#111827}.s-cart-coupons-applied-code::before{content:"";width:7px;height:7px;border-radius:9999px;background:#10b981}.s-cart-coupons-applied-remove{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:#ef4444;background:transparent;border:0;border-radius:9999px;cursor:pointer;transition:background-color 0.15s ease, color 0.15s ease}.s-cart-coupons-applied-remove:hover{background:#fef2f2}.s-cart-coupons-applied-remove:disabled{opacity:0.5;cursor:not-allowed}.visible{visibility:visible}.fixed{position:fixed}.shrink{flex-shrink:1}.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)}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));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}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.s-cart-coupons-wrapper{display:block;width:100%;padding-top:1.25rem;padding-bottom:1.25rem}.s-cart-coupons-input-section{margin-bottom:0.625rem}.s-cart-coupons-coupon-label{margin-bottom:0.625rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-coupon-input-container{position:relative;display:flex;align-items:stretch}.s-cart-coupons-coupon-input-container .form-input{height:auto;flex:1 1 0%}.s-cart-coupons-coupon-input-container .form-input:where([dir="ltr"],[dir="ltr"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important;border-right-width:0px}.s-cart-coupons-coupon-input-container .form-input:where([dir="rtl"],[dir="rtl"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important;border-left-width:0px}.s-cart-coupons-coupon-input-container .form-input:focus{position:relative;z-index:10}.s-cart-coupons-coupon-button:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px;border-bottom-left-radius:0px}.s-cart-coupons-coupon-button:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px;border-bottom-right-radius:0px}.s-cart-coupons-coupon-button-remove:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important}.s-cart-coupons-coupon-button-remove:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important}.s-cart-coupons-coupon-button-apply:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:0.5rem !important;border-bottom-right-radius:0.5rem !important;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important}.s-cart-coupons-coupon-button-apply:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:0.5rem !important;border-bottom-left-radius:0.5rem !important;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important}.s-cart-coupons-coupon-error{margin-top:0.5rem;display:block;font-size:10px;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-cart-coupons-slider{width:100%;overflow:hidden;padding-left:0.375rem;padding-right:0.375rem}.s-cart-coupons-card{position:relative;cursor:pointer;overflow:hidden;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-coupons-card:is(.dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-card:hover{--tw-translate-y:-0.125rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-cart-coupons-disabled{cursor:not-allowed;opacity:0.5}.s-cart-coupons-disabled:hover{transform:none;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-cart-coupons-top-section{display:flex;height:60px;flex-direction:row;align-items:center;justify-content:space-between;border-top-left-radius:0.75rem;border-top-right-radius:0.75rem;border-width:1px;border-bottom-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-top:1rem;padding-bottom:1rem;padding-left:0.75rem;padding-right:0.75rem}.s-cart-coupons-discount-values{display:flex;flex-direction:column;align-items:flex-start}.s-cart-coupons-discount-values .s-cart-coupons-main-amount{display:flex;align-items:center;gap:0.25rem;white-space:nowrap;font-size:1.25rem;line-height:1.75rem;font-weight:900;line-height:1;--tw-text-opacity:1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.s-cart-coupons-discount-values .s-cart-coupons-secondary-info{margin:0px;font-size:10px;line-height:1rem}.s-cart-coupons-code{font-size:10px;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-coupons-divider{position:relative;z-index:10;margin:0px;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-cart-coupons-bottom-section{display:flex;min-height:44px;flex-direction:row;align-items:center;justify-content:space-between;border-bottom-right-radius:0.75rem;border-bottom-left-radius:0.75rem;border-width:1px;border-top-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.75rem;padding-right:0.75rem}.s-cart-coupons-terms{display:flex;flex-direction:column;align-items:flex-start}.s-cart-coupons-terms .s-cart-coupons-expiry{margin:0px;font-size:10px;line-height:16px;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-terms .s-cart-coupons-minimum{margin:0px;font-size:10px;line-height:16px;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-terms .s-cart-coupons-expiry.s-cart-coupons-expiry-warning{font-weight:500;--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-cart-coupons-action{cursor:pointer;white-space:nowrap;border-width:0px;background-color:transparent;padding:0px;font-size:9px;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));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:150ms}.s-cart-coupons-action:hover{--tw-text-opacity:1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.s-cart-coupons-slide-one-fourth{width:calc(75% - 10px);min-width:200px !important;padding-left:5px !important;padding-right:5px !important;padding-top:2px !important}@media (min-width: 1024px){.s-cart-coupons-slide-one-fourth{width:calc(40% - 10px) !important}}.s-cart-coupons-card:before{pointer-events:none;position:absolute;right:-10px;top:60px;z-index:20;height:1.25rem;width:1.25rem;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));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(255 255 255 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-cart-coupons-card:is(.dark *):before{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-card:after{pointer-events:none;position:absolute;left:-10px;top:60px;z-index:20;height:1.25rem;width:1.25rem;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));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(255 255 255 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-cart-coupons-card:is(.dark *):after{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-coupon-input-container .form-input.s-coupon-input-error{--tw-shadow:0 0 0 3px rgba(239,68,68,0.1) !important;--tw-shadow-colored:0 0 0 3px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important}';export{s as salla_cart_coupons}
4
+ import{r as t,h as o,H as r,a}from"./p-Q9lz4Iuq.js";const s=class{constructor(o){t(this,o),this.availableCoupons=[],this.cartTotal=0,this.cartTotalReady=!1,this.currentCoupon="",this.couponInputValue="",this.couponError="",this.isApplying=!1,this.appliedCoupons=[],this.multiCoupon=!1,this.isHandlingInternalError=!1,this.cartUpdatedHandler=t=>{this.syncCartTotal(t),(this.multiCoupon?Array.isArray(t?.coupons):t&&"coupon"in t)&&this.syncAppliedFromCart(t),this.couponError=""},this.couponAddedHandler=()=>{this.isApplying||this.isHandlingInternalError||this.refreshFromServer()},this.couponAdditionFailedHandler=t=>{this.isApplying||this.isHandlingInternalError||this.showCouponError(t?.message||salla.lang.get("pages.cart.coupon_application_error"))},this.couponDeletedHandler=()=>{this.isApplying||this.isHandlingInternalError||this.refreshFromServer()},this.onKeyUp=t=>{"Enter"===t.key&&this.couponButtonRef?.click(),this.couponError=""},this.onInput=t=>{this.couponInputValue=t.target.value}}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.multiCoupon=!!salla.config.get("store.settings.cart.multi_coupon"),this.loadCouponsData(),this.seedFromStorage(),this.loadCartTotal(),this.setupCartEventListeners()}setupCartEventListeners(){salla.event.on("cart::updated",this.cartUpdatedHandler),salla.event.on("cart::coupon.added",this.couponAddedHandler),salla.event.on("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.on("cart::coupon.deleted",this.couponDeletedHandler)}disconnectedCallback(){salla.event.off("cart::updated",this.cartUpdatedHandler),salla.event.off("cart::coupon.added",this.couponAddedHandler),salla.event.off("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.off("cart::coupon.deleted",this.couponDeletedHandler)}async selectCoupon(t){const o=this.availableCoupons.find((o=>o.code===t));if(o){if(!this.isEligible(o))throw new Error("Coupon not eligible: minimum cart amount not met");try{await this.applyCoupon(t),this.host.dispatchEvent(new CustomEvent("salla::cart-coupons.coupon.selected",{detail:o,bubbles:!0}))}catch(t){throw t}}return o}async loadCouponsData(){try{const t=await salla.api.request("coupons"),o=t?.data,r=Array.isArray(o)?o:Array.isArray(o?.data)?o.data:[];this.availableCoupons=r}catch(t){console.warn("Failed to load coupons:",t),this.availableCoupons=[]}}async loadCartTotal(){await this.refreshFromServer()}seedFromStorage(){if(this.multiCoupon)return;const t=salla.storage.get("cart");t&&"object"==typeof t&&"coupon"in t&&this.applyCart(t),this.seedTotalsFromSummaryStorage()}seedTotalsFromSummaryStorage(){const t=salla.storage.get("cart.summary");t&&"object"==typeof t&&null!=t.sub_total&&(this.cartTotal=Number(t.sub_total),this.cartTotalReady=!0)}syncCartTotal(t){const o=t?.summary?.sub_total??t?.sub_total??t?.total;null!=o&&(this.cartTotal=Number(o),this.cartTotalReady=!0)}async refreshFromServer(){try{const t=await salla.cart.details(),o=t?.data?.cart??t?.data??t;if(o&&"object"==typeof o&&(Array.isArray(o.coupons)||"coupon"in o))return void this.applyCart(o)}catch(t){}const t=salla.storage.get("cart");t&&this.applyCart(t),this.seedTotalsFromSummaryStorage()}applyCart(t){this.syncCartTotal(t),this.syncAppliedFromCart(t)}syncAppliedFromCart(t){this.currentCoupon=t?.coupon||"",this.multiCoupon?this.appliedCoupons=Array.isArray(t?.coupons)?t.coupons.filter(Boolean):this.currentCoupon?[this.currentCoupon]:[]:(this.couponInputValue=this.currentCoupon,this.appliedCoupons=this.currentCoupon?[this.currentCoupon]:[])}async handleApplyClick(){if(this.isApplying)return;const t=this.couponInputValue.trim();if(t){this.isApplying=!0,this.isHandlingInternalError=!0;try{await salla.cart.addCoupon(t),await this.refreshFromServer(),this.couponInputValue=""}catch(t){this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}else this.showCouponError(salla.lang.get("pages.cart.enter_coupon_code"))}async handleCouponButtonClick(){if(this.isApplying)return;const t=!!this.currentCoupon;if(t||this.couponInputValue.trim()){this.isApplying=!0,this.isHandlingInternalError=!0;try{t?await salla.cart.deleteCoupon():await salla.cart.addCoupon(this.couponInputValue.trim()),await this.refreshFromServer()}catch(t){this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}else this.showCouponError(salla.lang.get("pages.cart.enter_coupon_code"))}async removeCoupon(t){if(!this.isApplying){this.isApplying=!0,this.isHandlingInternalError=!0;try{this.multiCoupon?await salla.cart.deleteCoupon(t):await salla.cart.deleteCoupon(),await this.refreshFromServer()}catch(t){this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}}showCouponError(t){this.couponError=t}handleCouponClick(t){this.applyCoupon(t.code,!1).catch((()=>{}))}async applyCoupon(t,o=!0){if(this.isApplying){if(o)throw new Error("Coupon application already in progress")}else{this.couponInputValue=t,this.couponError="",this.isApplying=!0,this.isHandlingInternalError=!0;try{await salla.cart.addCoupon(t.trim()),await this.refreshFromServer(),this.multiCoupon&&(this.couponInputValue="")}catch(t){if(this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error")),o)throw t}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}}formatMainAmount(t){if("percentage"===t.type)return`${salla.helpers.number("object"==typeof t.amount?t.amount.amount:t.amount)}%`;{const r="object"==typeof t.amount?t.amount:{amount:t.amount,currency:t.minimum_amount?.currency||salla.config.get("store.currency.code","SAR")};return o("span",{innerHTML:salla.money(r.amount,r.currency)})}}isEligible(t){return!this.cartTotalReady||!t.minimum_amount||this.cartTotal>=parseFloat(t.minimum_amount.amount)}renderCouponCard(t){const r=this.isEligible(t);return o("div",{class:"s-cart-coupons-slide-one-fourth swiper-slide"},o("div",{class:"s-cart-coupons-card "+(!r||this.isApplying?"s-cart-coupons-disabled":""),onClick:()=>r&&!this.isApplying&&this.handleCouponClick(t)},o("div",{class:"s-cart-coupons-top-section"},o("div",{class:"s-cart-coupons-discount-values"},o("div",{class:"s-cart-coupons-main-amount"},this.formatMainAmount(t)),t.free_shipping?o("div",{class:"s-cart-coupons-secondary-info"},"+ ",salla.lang.get("pages.cart.free_shipping")):t.maximum_amount&&o("div",{class:"s-cart-coupons-secondary-info"},salla.lang.get("pages.cart.up_to")," ",o("span",{innerHTML:salla.money(t.maximum_amount.amount,t.maximum_amount.currency)}))),o("div",{class:"s-cart-coupons-code"},t.code)),o("div",{class:"s-cart-coupons-divider"}),o("div",{class:"s-cart-coupons-bottom-section"},o("div",{class:"s-cart-coupons-terms"},null!=t.remaining_days&&o("div",{class:"s-cart-coupons-expiry "+(t.remaining_days<=3?"s-cart-coupons-expiry-warning":"")},0===t.remaining_days?salla.lang.get("pages.cart.expires_today"):`${salla.lang.get("pages.cart.expires_after")} ${t.remaining_days} ${salla.lang.get("pages.cart.day")}`),t.minimum_amount&&parseFloat(t.minimum_amount.amount)>0&&o("div",{class:"s-cart-coupons-minimum"},salla.lang.get("pages.cart.minimum")," ",o("span",{innerHTML:salla.money(t.minimum_amount.amount,t.minimum_amount.currency)}))),o("div",{class:"s-cart-coupons-action"},r?salla.lang.get("pages.cart.save_coupon"):salla.lang.get("pages.cart.coupon_not_compatible")))))}render(){return o(r,{key:"e3bed8f1f2019db5e1c5ca4280696933913e3081"},o("div",{key:"9c6a7c383394f9bd19107db9b8e76fd9129648e3",class:"s-cart-coupons-wrapper"},o("div",{key:"1e7f74969e709062c36aa19ff4ec27bde0bb10df",class:"s-cart-coupons-input-section"},o("label",{key:"f3bc1f4ffa9c8a64bee8af273597d6f8ff1f8fd0",htmlFor:"coupon-input",class:"s-cart-coupons-coupon-label"},salla.lang.get("pages.cart.have_coupon")),o("div",{key:"7abbdbd41cf6e65b6c08928bb10a68bfb2677d85",class:"s-cart-coupons-coupon-input-container"},this.multiCoupon?[o("input",{type:"text",id:"coupon-input",name:"coupon",class:"form-input "+(this.couponError?"s-coupon-input-error":""),placeholder:salla.lang.get("pages.cart.coupon_placeholder"),value:this.couponInputValue,disabled:this.isApplying,onInput:this.onInput,onKeyUp:this.onKeyUp,"aria-label":salla.lang.get("pages.cart.apply_coupon"),key:"coupon-input"}),o("salla-button",{ref:t=>this.couponButtonRef=t,class:"s-cart-coupons-coupon-button s-cart-coupons-coupon-button-apply",color:"primary",loading:this.isApplying,"loader-position":"center",onClick:()=>this.handleApplyClick(),key:"apply-button"},o("span",null,salla.lang.get("pages.cart.save_coupon")))]:[o("input",{type:"text",id:"coupon-input",name:"coupon",class:"form-input "+(this.couponError?"s-coupon-input-error":""),placeholder:salla.lang.get("pages.cart.coupon_placeholder"),value:this.couponInputValue,disabled:!!this.currentCoupon||this.isApplying,onInput:this.onInput,onKeyUp:this.onKeyUp,"aria-label":salla.lang.get("pages.cart.apply_coupon"),key:"coupon-input"}),o("salla-button",{ref:t=>this.couponButtonRef=t,class:"s-cart-coupons-coupon-button "+(this.currentCoupon?"s-cart-coupons-coupon-button-remove":"s-cart-coupons-coupon-button-apply"),color:this.currentCoupon?"danger":"primary",loading:this.isApplying,"loader-position":"center",onClick:()=>this.handleCouponButtonClick(),key:"apply-button"},this.currentCoupon?o("i",{class:"sicon-cancel"}):o("span",null,salla.lang.get("pages.cart.save_coupon")))]),this.couponError&&o("span",{key:"6c259fbca7a2a3c2ece3d4c335707c833be5f8d6",class:"s-cart-coupons-coupon-error"},this.couponError),this.multiCoupon&&this.appliedCoupons.length>0&&o("div",{key:"87335fd875279e97fc7a02c9f3519af51a953a7b",class:"s-cart-coupons-applied-list"},this.appliedCoupons.map((t=>o("div",{class:"s-cart-coupons-applied-item",key:t},o("span",{class:"s-cart-coupons-applied-code"},t),o("button",{type:"button",class:"s-cart-coupons-applied-remove","aria-label":`${salla.lang.get("pages.cart.delete")} ${t}`,disabled:this.isApplying,onClick:()=>this.removeCoupon(t)},o("i",{class:"sicon-cancel"}))))))),this.availableCoupons&&this.availableCoupons.length>0&&o("salla-slider",{key:"86c665d3135fa8bc393c4b7ad9daca3ce87bed50",type:"carousel",showControls:!1,class:"s-cart-coupons-slider"},o("div",{key:"45ddccd7e0c5d38e9b98f42862a6d64f6040c942",slot:"items"},this.availableCoupons.map((t=>this.renderCouponCard(t)))))))}get host(){return a(this)}};s.style='/*!twlt*/.s-cart-coupons-applied-list{display:flex;flex-direction:column;gap:8px;margin-top:12px}.s-cart-coupons-applied-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;background:#fff;border:1px solid #e5e7eb;border-radius:10px;border-inline-start:3px solid #10b981}.s-cart-coupons-applied-code{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:#111827}.s-cart-coupons-applied-code::before{content:"";width:7px;height:7px;border-radius:9999px;background:#10b981}.s-cart-coupons-applied-remove{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:#ef4444;background:transparent;border:0;border-radius:9999px;cursor:pointer;transition:background-color 0.15s ease, color 0.15s ease}.s-cart-coupons-applied-remove:hover{background:#fef2f2}.s-cart-coupons-applied-remove:disabled{opacity:0.5;cursor:not-allowed}.visible{visibility:visible}.fixed{position:fixed}.shrink{flex-shrink:1}.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)}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));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}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.s-cart-coupons-wrapper{display:block;width:100%;padding-top:1.25rem;padding-bottom:1.25rem}.s-cart-coupons-input-section{margin-bottom:0.625rem}.s-cart-coupons-coupon-label{margin-bottom:0.625rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-coupon-input-container{position:relative;display:flex;align-items:stretch}.s-cart-coupons-coupon-input-container .form-input{height:auto;flex:1 1 0%}.s-cart-coupons-coupon-input-container .form-input:where([dir="ltr"],[dir="ltr"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important;border-right-width:0px}.s-cart-coupons-coupon-input-container .form-input:where([dir="rtl"],[dir="rtl"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important;border-left-width:0px}.s-cart-coupons-coupon-input-container .form-input:focus{position:relative;z-index:10}.s-cart-coupons-coupon-button:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px;border-bottom-left-radius:0px}.s-cart-coupons-coupon-button:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px;border-bottom-right-radius:0px}.s-cart-coupons-coupon-button-remove:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important}.s-cart-coupons-coupon-button-remove:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important}.s-cart-coupons-coupon-button-apply:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:0.5rem !important;border-bottom-right-radius:0.5rem !important;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important}.s-cart-coupons-coupon-button-apply:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:0.5rem !important;border-bottom-left-radius:0.5rem !important;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important}.s-cart-coupons-coupon-error{margin-top:0.5rem;display:block;font-size:10px;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-cart-coupons-slider{width:100%;overflow:hidden;padding-left:0.375rem;padding-right:0.375rem}.s-cart-coupons-card{position:relative;cursor:pointer;overflow:hidden;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-coupons-card:is(.dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-card:hover{--tw-translate-y:-0.125rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-cart-coupons-disabled{cursor:not-allowed;opacity:0.5}.s-cart-coupons-disabled:hover{transform:none;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-cart-coupons-top-section{display:flex;height:60px;flex-direction:row;align-items:center;justify-content:space-between;border-top-left-radius:0.75rem;border-top-right-radius:0.75rem;border-width:1px;border-bottom-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-top:1rem;padding-bottom:1rem;padding-left:0.75rem;padding-right:0.75rem}.s-cart-coupons-discount-values{display:flex;flex-direction:column;align-items:flex-start}.s-cart-coupons-discount-values .s-cart-coupons-main-amount{display:flex;align-items:center;gap:0.25rem;white-space:nowrap;font-size:1.25rem;line-height:1.75rem;font-weight:900;line-height:1;--tw-text-opacity:1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.s-cart-coupons-discount-values .s-cart-coupons-secondary-info{margin:0px;font-size:10px;line-height:1rem}.s-cart-coupons-code{font-size:10px;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-coupons-divider{position:relative;z-index:10;margin:0px;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-cart-coupons-bottom-section{display:flex;min-height:44px;flex-direction:row;align-items:center;justify-content:space-between;border-bottom-right-radius:0.75rem;border-bottom-left-radius:0.75rem;border-width:1px;border-top-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.75rem;padding-right:0.75rem}.s-cart-coupons-terms{display:flex;flex-direction:column;align-items:flex-start}.s-cart-coupons-terms .s-cart-coupons-expiry{margin:0px;font-size:10px;line-height:16px;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-terms .s-cart-coupons-minimum{margin:0px;font-size:10px;line-height:16px;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-terms .s-cart-coupons-expiry.s-cart-coupons-expiry-warning{font-weight:500;--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-cart-coupons-action{cursor:pointer;white-space:nowrap;border-width:0px;background-color:transparent;padding:0px;font-size:9px;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));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:150ms}.s-cart-coupons-action:hover{--tw-text-opacity:1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.s-cart-coupons-slide-one-fourth{width:calc(75% - 10px);min-width:200px !important;padding-left:5px !important;padding-right:5px !important;padding-top:2px !important}@media (min-width: 1024px){.s-cart-coupons-slide-one-fourth{width:calc(40% - 10px) !important}}.s-cart-coupons-card:before{pointer-events:none;position:absolute;right:-10px;top:60px;z-index:20;height:1.25rem;width:1.25rem;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));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(255 255 255 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-cart-coupons-card:is(.dark *):before{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-card:after{pointer-events:none;position:absolute;left:-10px;top:60px;z-index:20;height:1.25rem;width:1.25rem;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));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(255 255 255 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-cart-coupons-card:is(.dark *):after{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-coupon-input-container .form-input.s-coupon-input-error{--tw-shadow:0 0 0 3px rgba(239,68,68,0.1) !important;--tw-shadow-colored:0 0 0 3px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important}';export{s as salla_cart_coupons}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as r,H as t}from"./p-Bf2Z6A1M.js";const a=250,o={customer:"أُلغي الطلب من قِبل العميل",merchant:"أُلغي الطلب من قِبل المتجر"},l=[["pages.orders.cancel_modal_title","إلغاء الطلب","Cancel order"],["pages.orders.cancel_reason_title","لماذا ترغب في إلغاء الطلب؟","Why do you want to cancel this order?"],["pages.orders.cancel_reason_subtitle","ساعدنا نعرف السبب لتحسين تجربتك.","Help us understand why to improve your experience."],["pages.orders.cancel_reason_confirm","تأكيد إلغاء الطلب","Confirm order cancellation"],["pages.orders.cancel_reason_back","تراجع","Go back"],["pages.orders.cancel_reason_note_placeholder","اذكر السبب","Mention the reason"],["pages.orders.cancelled_by_customer",o.customer,"Order cancelled by the customer"],["pages.orders.cancelled_by_merchant",o.merchant,"Order cancelled by the merchant"],["pages.orders.cancel_reason_char_limit","يتجاوز النص حد الأحرف المسموح","Text exceeds the allowed character limit"]],s=e=>{if(!e)return null;try{const r="string"==typeof e?JSON.parse(e):e;return r&&"object"==typeof r?r:null}catch{return null}},i=e=>e.filter((e=>!1!==e.is_active)).sort(((e,r)=>(e.sort??0)-(r.sort??0))),n=class{constructor(r){e(this,r),this.reasons=[],this.selectedReasonId=null,this.reasonNote="",this.confirmLoading=!1,this.loading=!0,this.modalTitleLabel="",this.questionLabel="",this.subtitleLabel="",this.confirmLabel="",this.backLabel="",this.notePlaceholder="",this.charLimitLabel="",salla.lang.onLoaded((()=>{const e=salla.lang.messages?.["ar.trans"],r=salla.lang.messages?.["en.trans"];if(e&&r&&salla.helpers?.setNested)for(const[t,a,o]of l)salla.helpers.setNested(e,t,a),salla.helpers.setNested(r,t,o);this.refreshLabels()}))}onCancellationReasonsChange(){this.load()}async componentWillLoad(){await salla.onReady(),this.refreshLabels(),await this.load()}refreshLabels(){const e=(e,r)=>salla.lang.getWithDefault(e,r);this.modalTitleLabel=e("pages.orders.cancel_modal_title","إلغاء الطلب"),this.questionLabel=e("pages.orders.cancel_reason_title","لماذا ترغب في إلغاء الطلب؟"),this.subtitleLabel=e("pages.orders.cancel_reason_subtitle","ساعدنا نعرف السبب لتحسين تجربتك."),this.confirmLabel=e("pages.orders.cancel_reason_confirm","تأكيد إلغاء الطلب"),this.backLabel=e("pages.orders.cancel_reason_back","تراجع"),this.notePlaceholder=e("pages.orders.cancel_reason_note_placeholder","اذكر السبب"),this.charLimitLabel=e("pages.orders.cancel_reason_char_limit","يتجاوز النص حد الأحرف المسموح")}get resolvedOrderId(){const e=this.orderId??this.pageOrder?.id??salla.config.get("page.id"),r=Number(e);return Number.isFinite(r)?r:e}readPageOrder(){const e=document.querySelector("salla-order-totals-card");return e?s(e.order??e.getAttribute("order")):null}waitForPageOrder(){const e=this.readPageOrder();return e?Promise.resolve(e):"undefined"==typeof MutationObserver?Promise.resolve().then((()=>this.readPageOrder())):new Promise((e=>{let r=!1;const t=()=>{r||(r=!0,o.disconnect(),clearTimeout(l),e(this.readPageOrder()))},a=document.querySelector("salla-order-totals-card"),o=new MutationObserver(t);o.observe(a??document.documentElement,a?{attributes:!0,attributeFilter:["order"]}:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["order"]});const l=setTimeout(t,2500)}))}cancelledByLabel(e){return salla.lang.getWithDefault(`pages.orders.cancelled_by_${e}`,o[e])}mountCancelledHeader(e=0){const r=this.orderCancelledReason,t=r?.reasons[0];if(!t||document.querySelector("[data-salla-order-cancelled-reason]"))return;const a=document.querySelector("td.single-order-header-item:not(.flex)");if(!a)return void(e<20&&requestAnimationFrame((()=>this.mountCancelledHeader(e+1))));const o=document.createElement("td");o.className="s-order-cancel-cancelled-header-item",o.setAttribute("data-salla-order-cancelled-reason","");const l=document.createElement("div");l.className="s-order-cancel-cancelled-header-label",l.textContent=this.cancelledByLabel(r.cancelled_by);const s=document.createElement("b");s.className="s-order-cancel-cancelled-header-reason",s.textContent=t,s.title=t,o.append(l,s),a.insertAdjacentElement("afterend",o)}purgeLegacyModal(){if(this.reasons.length)for(const e of document.querySelectorAll("salla-modal#modal-order-cancel:not([data-salla-order-cancel])"))e.remove()}applyPageOrder(e){this.pageOrder=e,this.orderCancelledReason=(e=>{const r=s(e),t=Array.isArray(r?.reasons)?r.reasons.filter((e=>"string"==typeof e&&e.length>0)):[];return t.length?{cancelled_by:"merchant"===r?.cancelled_by?"merchant":"customer",reasons:t}:null})(e.order_cancelled_reason)??void 0}async load(){this.loading=!0;try{const e=(e=>{if(null==e||""===e)return null;const r="string"==typeof e?s(e):e;return Array.isArray(r)&&r.length?r:null})(this.cancellationReasons);if(!this.pageOrder){const e=this.readPageOrder();e&&this.applyPageOrder(e)}if(this.pageOrder||e)this.pageOrder||this.waitForPageOrder().then((e=>{e&&(this.applyPageOrder(e),this.mountCancelledHeader())}));else{const e=await this.waitForPageOrder();e&&this.applyPageOrder(e)}const r=this.pageOrder;this.reasons=e?i(e):r?i(Array.isArray(r.cancellation_reasons)?r.cancellation_reasons:[]):[]}finally{this.loading=!1,this.purgeLegacyModal(),this.mountCancelledHeader()}}reasonLabel(e){const r=salla.lang.getLocale?.()||"ar";return e.translations?.[r]?.name||e.name}get hasOtherSelected(){return null!==this.selectedReasonId&&this.reasons.some((e=>e.id===this.selectedReasonId&&"other"===e.slug))}get canConfirm(){if(null===this.selectedReasonId)return!1;if(!this.hasOtherSelected)return!0;const e=this.reasonNote.trim().length;return e>0&&e<=a}selectReason(e){if(this.selectedReasonId===e)return"other"===this.reasons.find((r=>r.id===e))?.slug&&(this.reasonNote=""),void(this.selectedReasonId=null);if("other"===this.reasons.find((e=>e.id===this.selectedReasonId))?.slug&&(this.reasonNote=""),this.selectedReasonId=e,this.reasons.length&&this.reasons[this.reasons.length-1].id===e){const r=setTimeout((()=>{requestAnimationFrame((()=>{document.getElementById(`s-order-cancel-reason-${e}`)?.scrollIntoView({block:"start",behavior:"smooth"});const t=document.querySelector(".s-order-cancel-textarea");t?.focus(),clearTimeout(r)}))}),200)}}resetForm(){this.selectedReasonId=null,this.reasonNote="",this.confirmLoading=!1}setReasonNote(e){this.reasonNote=e.target.value}onKeyActivate(e,r){"Enter"!==e.key&&" "!==e.key||r()}async confirmCancel(){if(this.canConfirm&&!this.confirmLoading){this.confirmLoading=!0;try{const e=this.hasOtherSelected?this.reasonNote.trim():"",r={reasons:[String(this.selectedReasonId)],...e&&{reason_note:e}};await salla.order.api.cancel(this.resolvedOrderId,r),window.location.reload()}catch{this.confirmLoading=!1}}}render(){return this.loading||!this.reasons.length?r(t,{class:"s-order-cancel-wrapper"}):r(t,{class:"s-order-cancel-wrapper"},r("salla-modal",{id:"modal-order-cancel",class:"s-order-cancel-modal","data-salla-order-cancel":"",ref:e=>{this.modal=e,e?.setTitle?.(this.modalTitleLabel)},width:"sm",onModalVisibilityChanged:e=>!e.detail&&this.resetForm()},r("div",{class:"s-order-cancel-content"},r("div",{class:"s-order-cancel-intro"},r("p",{class:"s-order-cancel-heading"},this.questionLabel),r("p",{class:"s-order-cancel-subtitle"},this.subtitleLabel)),r("div",{class:"s-order-cancel-reasons s-scrollbar"},this.reasons.map((e=>{const t=`s-order-cancel-reason-${e.id}`;return r("label",{key:e.id,class:"s-order-cancel-reason",htmlFor:t},r("input",{type:"radio",name:"cancellation_reason",id:t,class:"s-order-cancel-radio s-radio",checked:this.selectedReasonId===e.id,onChange:()=>this.selectReason(e.id)}),r("span",{class:"s-order-cancel-reason-label"},this.reasonLabel(e)))}))),this.hasOtherSelected&&r("div",{class:"s-order-cancel-other-field"},r("textarea",{class:"s-order-cancel-textarea",placeholder:this.notePlaceholder,value:this.reasonNote,onInput:e=>this.setReasonNote(e)}),r("p",{class:{"s-order-cancel-counter":!0,"s-order-cancel-counter--limit":this.reasonNote.length>=a}},this.reasonNote.length>=a&&`${this.charLimitLabel} `,a,"/",this.reasonNote.length)),r("div",{class:"s-order-cancel-actions"},r("salla-button",{color:"primary",class:"w-full",width:"wide",disabled:!this.canConfirm,loading:this.confirmLoading,onClick:()=>this.confirmCancel(),onKeyDown:e=>this.onKeyActivate(e,(()=>this.confirmCancel()))},this.confirmLabel),r("salla-button",{class:"w-full",width:"wide",fill:"outline",color:"gray",onClick:()=>this.modal?.close(),onKeyDown:e=>this.onKeyActivate(e,(()=>this.modal?.close()))},this.backLabel)))))}static get watchers(){return{cancellationReasons:["onCancellationReasonsChange"]}}};n.style='/*!twlt*/.s-order-cancel-reason .s-order-cancel-radio::before,.s-order-cancel-reason .s-radio::before{content:"";width:10px;height:10px;border-radius:50%;transform:scale(0);transition:120ms transform ease-in-out;background-color:#fff;box-shadow:inset 1em 1em #fff}.s-order-cancel-reason .s-order-cancel-radio:checked::before,.s-order-cancel-reason .s-radio:checked::before{transform:scale(1);background-color:var(--color-primary);box-shadow:inset 1em 1em var(--color-primary)}.block{display:block}.flex{display:flex}.table{display:table}.w-full{width:100%}.outline{outline-style:solid}.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-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}salla-modal.s-order-cancel-modal .s-modal-body{display:inline-flex;max-height:100svh;flex-direction:column;overflow:hidden;text-align:start}@media (min-width: 768px){salla-modal.s-order-cancel-modal .s-modal-body{max-height:92svh}}salla-modal.s-order-cancel-modal .s-modal-header{width:100%;flex-shrink:0;align-items:flex-start;text-align:start}salla-modal.s-order-cancel-modal .s-modal-header-inner{margin-bottom:1.25rem;display:block !important;width:100%;padding-inline-end:2.5rem;padding-inline-start:0px;text-align:start}@media (min-width: 768px){salla-modal.s-order-cancel-modal .s-modal-header-inner{padding:0px}}salla-modal.s-order-cancel-modal .s-modal-header-inner:where([dir="rtl"],[dir="rtl"] *){padding-inline-start:2.5rem;padding-inline-end:0px}salla-modal.s-order-cancel-modal .s-modal-header-content{width:100%;align-items:flex-start;text-align:start}salla-modal.s-order-cancel-modal .s-modal-title{margin-bottom:0px;width:100%;text-align:start;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-order-cancel-cancelled-header-item{display:flex;width:100%;min-width:0px;align-items:center;justify-content:space-between;padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}@media (min-width: 768px){.s-order-cancel-cancelled-header-item{display:table-cell;width:auto;max-width:14rem;padding-left:1.5rem;padding-right:1.5rem;padding-top:1rem;padding-bottom:1rem}}.s-order-cancel-cancelled-header-label{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-weight:400;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-order-cancel-cancelled-header-label:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}.s-order-cancel-cancelled-header-label:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}.s-order-cancel-cancelled-header-reason{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;display:block;overflow-wrap:break-word;font-weight:700}.s-order-cancel-wrapper{display:block}.s-order-cancel-content{display:flex;min-height:0px;width:100%;flex:1 1 0%;flex-direction:column;gap:1.5rem;overflow:hidden;text-align:start}.s-order-cancel-intro{display:flex;width:100%;flex-shrink:0;flex-direction:column;gap:0.5rem}.s-order-cancel-heading{font-size:1rem;font-weight:700;line-height:1.5rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-order-cancel-subtitle{font-size:0.875rem;line-height:1.25rem;font-weight:400;line-height:1.5;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-cancel-reasons{display:flex;min-height:0px;width:100%;flex:1 1 0%;flex-direction:column;gap:1rem;overflow-y:auto;padding-left:0.25rem;padding-right:0.25rem;padding-top:0.5rem;padding-bottom:0.5rem}.s-order-cancel-reason{display:flex;width:100%;cursor:pointer;align-items:center;gap:0.5rem;accent-color:var(--color-primary)}.s-order-cancel-reason-label{flex:1 1 0%;text-align:start;font-size:0.875rem;font-weight:500;line-height:1.25rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-order-cancel-radio{margin:0px;display:grid;height:1.25rem;width:1.25rem;min-width:1.25rem;flex-shrink:0;cursor:pointer;appearance:none;place-content:center;border-radius:9999px;border-width:1px;border-color:var(--color-primary);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-order-cancel-radio:checked{border-color:var(--color-primary);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-order-cancel-radio:focus-visible{border-color:var(--color-primary);outline-color:var(--color-primary)}.s-order-cancel-radio:focus-visible:checked{border-color:var(--color-primary);outline-color:var(--color-primary)}.s-order-cancel-other-field{display:flex;width:100%;flex-shrink:0;flex-direction:column;gap:0.25rem}.s-order-cancel-textarea{min-height:6rem;width:100%;resize:none;text-align:start}.has-error .s-order-cancel-textarea{border-color:#ff443a;color:#ff443a}.s-order-cancel-textarea{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(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-order-cancel-textarea:focus{border-color:var(--color-primary);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.s-order-cancel-counter{text-align:end;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-cancel-counter--limit{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-order-cancel-actions{display:flex;width:100%;flex-shrink:0;flex-direction:column;gap:1rem;padding-top:0px}';export{n as salla_order_cancel}
4
+ import{r as e,h as r,H as t}from"./p-Q9lz4Iuq.js";const a=250,o={customer:"أُلغي الطلب من قِبل العميل",merchant:"أُلغي الطلب من قِبل المتجر"},l=[["pages.orders.cancel_modal_title","إلغاء الطلب","Cancel order"],["pages.orders.cancel_reason_title","لماذا ترغب في إلغاء الطلب؟","Why do you want to cancel this order?"],["pages.orders.cancel_reason_subtitle","ساعدنا نعرف السبب لتحسين تجربتك.","Help us understand why to improve your experience."],["pages.orders.cancel_reason_confirm","تأكيد إلغاء الطلب","Confirm order cancellation"],["pages.orders.cancel_reason_back","تراجع","Go back"],["pages.orders.cancel_reason_note_placeholder","اذكر السبب","Mention the reason"],["pages.orders.cancelled_by_customer",o.customer,"Order cancelled by the customer"],["pages.orders.cancelled_by_merchant",o.merchant,"Order cancelled by the merchant"],["pages.orders.cancel_reason_char_limit","يتجاوز النص حد الأحرف المسموح","Text exceeds the allowed character limit"]],s=e=>{if(!e)return null;try{const r="string"==typeof e?JSON.parse(e):e;return r&&"object"==typeof r?r:null}catch{return null}},i=e=>e.filter((e=>!1!==e.is_active)).sort(((e,r)=>(e.sort??0)-(r.sort??0))),n=class{constructor(r){e(this,r),this.reasons=[],this.selectedReasonId=null,this.reasonNote="",this.confirmLoading=!1,this.loading=!0,this.modalTitleLabel="",this.questionLabel="",this.subtitleLabel="",this.confirmLabel="",this.backLabel="",this.notePlaceholder="",this.charLimitLabel="",salla.lang.onLoaded((()=>{const e=salla.lang.messages?.["ar.trans"],r=salla.lang.messages?.["en.trans"];if(e&&r&&salla.helpers?.setNested)for(const[t,a,o]of l)salla.helpers.setNested(e,t,a),salla.helpers.setNested(r,t,o);this.refreshLabels()}))}onCancellationReasonsChange(){this.load()}async componentWillLoad(){await salla.onReady(),this.refreshLabels(),await this.load()}refreshLabels(){const e=(e,r)=>salla.lang.getWithDefault(e,r);this.modalTitleLabel=e("pages.orders.cancel_modal_title","إلغاء الطلب"),this.questionLabel=e("pages.orders.cancel_reason_title","لماذا ترغب في إلغاء الطلب؟"),this.subtitleLabel=e("pages.orders.cancel_reason_subtitle","ساعدنا نعرف السبب لتحسين تجربتك."),this.confirmLabel=e("pages.orders.cancel_reason_confirm","تأكيد إلغاء الطلب"),this.backLabel=e("pages.orders.cancel_reason_back","تراجع"),this.notePlaceholder=e("pages.orders.cancel_reason_note_placeholder","اذكر السبب"),this.charLimitLabel=e("pages.orders.cancel_reason_char_limit","يتجاوز النص حد الأحرف المسموح")}get resolvedOrderId(){const e=this.orderId??this.pageOrder?.id??salla.config.get("page.id"),r=Number(e);return Number.isFinite(r)?r:e}readPageOrder(){const e=document.querySelector("salla-order-totals-card");return e?s(e.order??e.getAttribute("order")):null}waitForPageOrder(){const e=this.readPageOrder();return e?Promise.resolve(e):"undefined"==typeof MutationObserver?Promise.resolve().then((()=>this.readPageOrder())):new Promise((e=>{let r=!1;const t=()=>{r||(r=!0,o.disconnect(),clearTimeout(l),e(this.readPageOrder()))},a=document.querySelector("salla-order-totals-card"),o=new MutationObserver(t);o.observe(a??document.documentElement,a?{attributes:!0,attributeFilter:["order"]}:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["order"]});const l=setTimeout(t,2500)}))}cancelledByLabel(e){return salla.lang.getWithDefault(`pages.orders.cancelled_by_${e}`,o[e])}mountCancelledHeader(e=0){const r=this.orderCancelledReason,t=r?.reasons[0];if(!t||document.querySelector("[data-salla-order-cancelled-reason]"))return;const a=document.querySelector("td.single-order-header-item:not(.flex)");if(!a)return void(e<20&&requestAnimationFrame((()=>this.mountCancelledHeader(e+1))));const o=document.createElement("td");o.className="s-order-cancel-cancelled-header-item",o.setAttribute("data-salla-order-cancelled-reason","");const l=document.createElement("div");l.className="s-order-cancel-cancelled-header-label",l.textContent=this.cancelledByLabel(r.cancelled_by);const s=document.createElement("b");s.className="s-order-cancel-cancelled-header-reason",s.textContent=t,s.title=t,o.append(l,s),a.insertAdjacentElement("afterend",o)}purgeLegacyModal(){if(this.reasons.length)for(const e of document.querySelectorAll("salla-modal#modal-order-cancel:not([data-salla-order-cancel])"))e.remove()}applyPageOrder(e){this.pageOrder=e,this.orderCancelledReason=(e=>{const r=s(e),t=Array.isArray(r?.reasons)?r.reasons.filter((e=>"string"==typeof e&&e.length>0)):[];return t.length?{cancelled_by:"merchant"===r?.cancelled_by?"merchant":"customer",reasons:t}:null})(e.order_cancelled_reason)??void 0}async load(){this.loading=!0;try{const e=(e=>{if(null==e||""===e)return null;const r="string"==typeof e?s(e):e;return Array.isArray(r)&&r.length?r:null})(this.cancellationReasons);if(!this.pageOrder){const e=this.readPageOrder();e&&this.applyPageOrder(e)}if(this.pageOrder||e)this.pageOrder||this.waitForPageOrder().then((e=>{e&&(this.applyPageOrder(e),this.mountCancelledHeader())}));else{const e=await this.waitForPageOrder();e&&this.applyPageOrder(e)}const r=this.pageOrder;this.reasons=e?i(e):r?i(Array.isArray(r.cancellation_reasons)?r.cancellation_reasons:[]):[]}finally{this.loading=!1,this.purgeLegacyModal(),this.mountCancelledHeader()}}reasonLabel(e){const r=salla.lang.getLocale?.()||"ar";return e.translations?.[r]?.name||e.name}get hasOtherSelected(){return null!==this.selectedReasonId&&this.reasons.some((e=>e.id===this.selectedReasonId&&"other"===e.slug))}get canConfirm(){if(null===this.selectedReasonId)return!1;if(!this.hasOtherSelected)return!0;const e=this.reasonNote.trim().length;return e>0&&e<=a}selectReason(e){if(this.selectedReasonId===e)return"other"===this.reasons.find((r=>r.id===e))?.slug&&(this.reasonNote=""),void(this.selectedReasonId=null);if("other"===this.reasons.find((e=>e.id===this.selectedReasonId))?.slug&&(this.reasonNote=""),this.selectedReasonId=e,this.reasons.length&&this.reasons[this.reasons.length-1].id===e){const r=setTimeout((()=>{requestAnimationFrame((()=>{document.getElementById(`s-order-cancel-reason-${e}`)?.scrollIntoView({block:"start",behavior:"smooth"});const t=document.querySelector(".s-order-cancel-textarea");t?.focus(),clearTimeout(r)}))}),200)}}resetForm(){this.selectedReasonId=null,this.reasonNote="",this.confirmLoading=!1}setReasonNote(e){this.reasonNote=e.target.value}onKeyActivate(e,r){"Enter"!==e.key&&" "!==e.key||r()}async confirmCancel(){if(this.canConfirm&&!this.confirmLoading){this.confirmLoading=!0;try{const e=this.hasOtherSelected?this.reasonNote.trim():"",r={reasons:[String(this.selectedReasonId)],...e&&{reason_note:e}};await salla.order.api.cancel(this.resolvedOrderId,r),window.location.reload()}catch{this.confirmLoading=!1}}}render(){return this.loading||!this.reasons.length?r(t,{class:"s-order-cancel-wrapper"}):r(t,{class:"s-order-cancel-wrapper"},r("salla-modal",{id:"modal-order-cancel",class:"s-order-cancel-modal","data-salla-order-cancel":"",ref:e=>{this.modal=e,e?.setTitle?.(this.modalTitleLabel)},width:"sm",onModalVisibilityChanged:e=>!e.detail&&this.resetForm()},r("div",{class:"s-order-cancel-content"},r("div",{class:"s-order-cancel-intro"},r("p",{class:"s-order-cancel-heading"},this.questionLabel),r("p",{class:"s-order-cancel-subtitle"},this.subtitleLabel)),r("div",{class:"s-order-cancel-reasons s-scrollbar"},this.reasons.map((e=>{const t=`s-order-cancel-reason-${e.id}`;return r("label",{key:e.id,class:"s-order-cancel-reason",htmlFor:t},r("input",{type:"radio",name:"cancellation_reason",id:t,class:"s-order-cancel-radio s-radio",checked:this.selectedReasonId===e.id,onChange:()=>this.selectReason(e.id)}),r("span",{class:"s-order-cancel-reason-label"},this.reasonLabel(e)))}))),this.hasOtherSelected&&r("div",{class:"s-order-cancel-other-field"},r("textarea",{class:"s-order-cancel-textarea",placeholder:this.notePlaceholder,value:this.reasonNote,onInput:e=>this.setReasonNote(e)}),r("p",{class:{"s-order-cancel-counter":!0,"s-order-cancel-counter--limit":this.reasonNote.length>=a}},this.reasonNote.length>=a&&`${this.charLimitLabel} `,a,"/",this.reasonNote.length)),r("div",{class:"s-order-cancel-actions"},r("salla-button",{color:"primary",class:"w-full",width:"wide",disabled:!this.canConfirm,loading:this.confirmLoading,onClick:()=>this.confirmCancel(),onKeyDown:e=>this.onKeyActivate(e,(()=>this.confirmCancel()))},this.confirmLabel),r("salla-button",{class:"w-full",width:"wide",fill:"outline",color:"gray",onClick:()=>this.modal?.close(),onKeyDown:e=>this.onKeyActivate(e,(()=>this.modal?.close()))},this.backLabel)))))}static get watchers(){return{cancellationReasons:["onCancellationReasonsChange"]}}};n.style='/*!twlt*/.s-order-cancel-reason .s-order-cancel-radio::before,.s-order-cancel-reason .s-radio::before{content:"";width:10px;height:10px;border-radius:50%;transform:scale(0);transition:120ms transform ease-in-out;background-color:#fff;box-shadow:inset 1em 1em #fff}.s-order-cancel-reason .s-order-cancel-radio:checked::before,.s-order-cancel-reason .s-radio:checked::before{transform:scale(1);background-color:var(--color-primary);box-shadow:inset 1em 1em var(--color-primary)}.block{display:block}.flex{display:flex}.table{display:table}.w-full{width:100%}.outline{outline-style:solid}.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-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}salla-modal.s-order-cancel-modal .s-modal-body{display:inline-flex;max-height:100svh;flex-direction:column;overflow:hidden;text-align:start}@media (min-width: 768px){salla-modal.s-order-cancel-modal .s-modal-body{max-height:92svh}}salla-modal.s-order-cancel-modal .s-modal-header{width:100%;flex-shrink:0;align-items:flex-start;text-align:start}salla-modal.s-order-cancel-modal .s-modal-header-inner{margin-bottom:1.25rem;display:block !important;width:100%;padding-inline-end:2.5rem;padding-inline-start:0px;text-align:start}@media (min-width: 768px){salla-modal.s-order-cancel-modal .s-modal-header-inner{padding:0px}}salla-modal.s-order-cancel-modal .s-modal-header-inner:where([dir="rtl"],[dir="rtl"] *){padding-inline-start:2.5rem;padding-inline-end:0px}salla-modal.s-order-cancel-modal .s-modal-header-content{width:100%;align-items:flex-start;text-align:start}salla-modal.s-order-cancel-modal .s-modal-title{margin-bottom:0px;width:100%;text-align:start;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-order-cancel-cancelled-header-item{display:flex;width:100%;min-width:0px;align-items:center;justify-content:space-between;padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}@media (min-width: 768px){.s-order-cancel-cancelled-header-item{display:table-cell;width:auto;max-width:14rem;padding-left:1.5rem;padding-right:1.5rem;padding-top:1rem;padding-bottom:1rem}}.s-order-cancel-cancelled-header-label{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-weight:400;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-order-cancel-cancelled-header-label:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}.s-order-cancel-cancelled-header-label:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}.s-order-cancel-cancelled-header-reason{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;display:block;overflow-wrap:break-word;font-weight:700}.s-order-cancel-wrapper{display:block}.s-order-cancel-content{display:flex;min-height:0px;width:100%;flex:1 1 0%;flex-direction:column;gap:1.5rem;overflow:hidden;text-align:start}.s-order-cancel-intro{display:flex;width:100%;flex-shrink:0;flex-direction:column;gap:0.5rem}.s-order-cancel-heading{font-size:1rem;font-weight:700;line-height:1.5rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-order-cancel-subtitle{font-size:0.875rem;line-height:1.25rem;font-weight:400;line-height:1.5;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-cancel-reasons{display:flex;min-height:0px;width:100%;flex:1 1 0%;flex-direction:column;gap:1rem;overflow-y:auto;padding-left:0.25rem;padding-right:0.25rem;padding-top:0.5rem;padding-bottom:0.5rem}.s-order-cancel-reason{display:flex;width:100%;cursor:pointer;align-items:center;gap:0.5rem;accent-color:var(--color-primary)}.s-order-cancel-reason-label{flex:1 1 0%;text-align:start;font-size:0.875rem;font-weight:500;line-height:1.25rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-order-cancel-radio{margin:0px;display:grid;height:1.25rem;width:1.25rem;min-width:1.25rem;flex-shrink:0;cursor:pointer;appearance:none;place-content:center;border-radius:9999px;border-width:1px;border-color:var(--color-primary);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-order-cancel-radio:checked{border-color:var(--color-primary);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-order-cancel-radio:focus-visible{border-color:var(--color-primary);outline-color:var(--color-primary)}.s-order-cancel-radio:focus-visible:checked{border-color:var(--color-primary);outline-color:var(--color-primary)}.s-order-cancel-other-field{display:flex;width:100%;flex-shrink:0;flex-direction:column;gap:0.25rem}.s-order-cancel-textarea{min-height:6rem;width:100%;resize:none;text-align:start}.has-error .s-order-cancel-textarea{border-color:#ff443a;color:#ff443a}.s-order-cancel-textarea{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(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-order-cancel-textarea:focus{border-color:var(--color-primary);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.s-order-cancel-counter{text-align:end;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-cancel-counter--limit{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-order-cancel-actions{display:flex;width:100%;flex-shrink:0;flex-direction:column;gap:1rem;padding-top:0px}';export{n as salla_order_cancel}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,H as a,a as n}from"./p-Bf2Z6A1M.js";import{C as i}from"./p-BsLF_HK7.js";const r=class{constructor(t){e(this,t)}componentWillLoad(){this.title=salla.config.get("maintenance_details.title"),this.message=salla.config.get("maintenance_details.message");const e="undefined"!=typeof window&&!window.matchMedia("(min-width: 768px)").matches;this.buttonTitle=e?salla.config.get("maintenance_details.button_title"):salla.config.get("maintenance_details.button_full_title")}closeAlert(){salla.storage.set("hide_salla-maintenance-alert_at",Date.now()),this.host.style.display="none"}render(){return t(a,{key:"e27395e05c81dcaa9c105208997ce5cbf3b8fbb2",class:"s-maintenance-alert-wrapper"},t("button",{key:"278105559b3001246e829d57e13a54ed067e629e",class:"s-maintenance-alert-close",innerHTML:i,onClick:()=>this.closeAlert()}),t("div",{key:"643ab2c22dbfa44f51a267ab098154ea19ffd6b4",class:"s-maintenance-alert-content"},t("div",{key:"15d0f8369577ff359db19ad95adf49df717df960",class:"s-maintenance-alert-container"},t("div",{key:"10839c38008ae904678d3e4e815d669a4112d0ca",class:"s-maintenance-alert-icon"},t("img",{key:"b9853fd903db772180f3bc4435c604dc5640d409",src:salla.url.cdn("images/alert.png"),alt:"Alert"})),t("div",{key:"e7dac10cd9677094ef30708dbb30b94075d13380",class:"s-maintenance-alert-text"},t("h2",{key:"476e13b23928a0633d78a9897d084a95e48085a7"},this.title),t("p",{key:"8d44c1bff80ec334bf3ba8678201630172c0188d"},this.message))),t("div",{key:"958b4fef3310ae507df1871386bfe4e1d464a6b7"},t("a",{key:"c20313b563098396a96aa07e76852cd72662ca71",class:"s-maintenance-alert-btn",href:salla.config.get("maintenance_details.button_url")},this.buttonTitle))))}componentDidLoad(){let e=salla.storage.get("hide_salla-maintenance-alert_at");e&&(Date.now()-e)/1e3/60<60&&this.closeAlert()}get host(){return n(this)}};r.style='/*!twlt*/.s-maintenance-alert-wrapper{display:flex;min-height:40px;width:100%;flex-direction:row;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(26, 38, 61, var(--tw-bg-opacity));padding:0.25rem 0.5rem;--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity))}.s-maintenance-alert-wrapper a{transition:0.35s cubic-bezier(0.2, 1, 0.3, 1)}.s-maintenance-alert-wrapper *{color:inherit}@media (min-width: 640px){.s-maintenance-alert-wrapper{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-content{margin-top:1rem;margin-bottom:1rem;display:flex;width:100%;align-items:center;justify-content:space-between}@media (min-width: 640px){.s-maintenance-alert-content{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-container{display:flex;align-items:center}.s-maintenance-alert-icon{margin-right:1.25rem;display:none}@media (min-width: 640px){.s-maintenance-alert-icon{display:block}}.s-maintenance-alert-text h2{margin-bottom:0.5rem;font-size:0.875rem;font-weight:700;line-height:1.4}@media (min-width: 640px){.s-maintenance-alert-text h2{font-size:1.5rem;line-height:2rem}}.s-maintenance-alert-text p{margin:0px;text-align:right;font-size:10px;line-height:1.2}@media (min-width: 640px){.s-maintenance-alert-text p{text-align:center;font-size:0.75rem;line-height:1}}.s-maintenance-alert-btn{position:relative;margin-left:4px;margin-right:4px;display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;border-radius:0.125rem;border-width:1px;--tw-border-opacity:1;border-color:rgba(93, 213, 196, var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgba(93, 213, 196, var(--tw-bg-opacity));padding:0.5rem;text-align:center;vertical-align:middle;font-size:0.875rem;font-weight:400;line-height:1.4;--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity))}.s-maintenance-alert-btn:hover{--tw-bg-opacity:1;background-color:rgba(53, 203, 181, var(--tw-bg-opacity))}.s-maintenance-alert-btn *{pointer-events:none}[dir=rtl] .s-maintenance-alert-btn{margin-left:1.25rem;margin-right:0}@media (min-width: 640px){.s-maintenance-alert-btn{padding:0.5rem 1rem}}.s-maintenance-alert-wrapper{position:relative;display:flex;min-height:40px;width:100%;flex-direction:row;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgb(26 38 61 / var(--tw-bg-opacity, 1));padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-maintenance-alert-wrapper{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-wrapper a{transition:0.35s cubic-bezier(0.2, 1, 0.3, 1)}.s-maintenance-alert-wrapper *{color:inherit}.s-maintenance-alert-close{position:absolute;top:0.25rem;right:0.25rem}@media (min-width: 768px){.s-maintenance-alert-close{top:0.75rem;right:0.75rem}}.s-maintenance-alert-close:where([dir="rtl"],[dir="rtl"] *){right:unset;left:0.25rem}@media (min-width: 768px){.s-maintenance-alert-close:where([dir="rtl"],[dir="rtl"] *){left:0.75rem}}.s-maintenance-alert-close svg{height:1rem;width:1rem;fill:#fff}@media (min-width: 768px){.s-maintenance-alert-close svg{height:1.25rem;width:1.25rem}}.s-maintenance-alert-content{margin-top:1rem;margin-bottom:1rem;display:flex;width:100%;align-items:center;justify-content:space-between}@media (min-width: 640px){.s-maintenance-alert-content{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-container{display:flex;align-items:center}.s-maintenance-alert-icon{margin-right:1.25rem;display:none}@media (min-width: 640px){.s-maintenance-alert-icon{display:block}}.s-maintenance-alert-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:1.25rem;margin-right:0px}.s-maintenance-alert-text h2{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;line-height:1.4}@media (min-width: 640px){.s-maintenance-alert-text h2{font-size:1.5rem;line-height:2rem}}.s-maintenance-alert-text p{margin:0px;text-align:right;font-size:10px;line-height:1.2}@media (min-width: 640px){.s-maintenance-alert-text p{text-align:center;font-size:0.75rem;line-height:1rem;line-height:1}}.s-maintenance-alert-btn{position:relative;margin-left:4px;margin-right:4px;display:inline-block;cursor:pointer;user-select:none;white-space:nowrap;border-radius:0.125rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(93 213 196 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(93 213 196 / var(--tw-bg-opacity, 1));padding:0.5rem;text-align:center;vertical-align:middle;font-size:0.875rem;line-height:1.25rem;font-weight:400;line-height:1.4;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-maintenance-alert-btn:hover{--tw-bg-opacity:1;background-color:rgb(53 203 181 / var(--tw-bg-opacity, 1))}@media (min-width: 640px){.s-maintenance-alert-btn{padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem}}';export{r as salla_maintenance_alert}
4
+ import{r as e,h as t,H as a,a as n}from"./p-Q9lz4Iuq.js";import{C as i}from"./p-BsLF_HK7.js";const r=class{constructor(t){e(this,t)}componentWillLoad(){this.title=salla.config.get("maintenance_details.title"),this.message=salla.config.get("maintenance_details.message");const e="undefined"!=typeof window&&!window.matchMedia("(min-width: 768px)").matches;this.buttonTitle=e?salla.config.get("maintenance_details.button_title"):salla.config.get("maintenance_details.button_full_title")}closeAlert(){salla.storage.set("hide_salla-maintenance-alert_at",Date.now()),this.host.style.display="none"}render(){return t(a,{key:"e27395e05c81dcaa9c105208997ce5cbf3b8fbb2",class:"s-maintenance-alert-wrapper"},t("button",{key:"278105559b3001246e829d57e13a54ed067e629e",class:"s-maintenance-alert-close",innerHTML:i,onClick:()=>this.closeAlert()}),t("div",{key:"643ab2c22dbfa44f51a267ab098154ea19ffd6b4",class:"s-maintenance-alert-content"},t("div",{key:"15d0f8369577ff359db19ad95adf49df717df960",class:"s-maintenance-alert-container"},t("div",{key:"10839c38008ae904678d3e4e815d669a4112d0ca",class:"s-maintenance-alert-icon"},t("img",{key:"b9853fd903db772180f3bc4435c604dc5640d409",src:salla.url.cdn("images/alert.png"),alt:"Alert"})),t("div",{key:"e7dac10cd9677094ef30708dbb30b94075d13380",class:"s-maintenance-alert-text"},t("h2",{key:"476e13b23928a0633d78a9897d084a95e48085a7"},this.title),t("p",{key:"8d44c1bff80ec334bf3ba8678201630172c0188d"},this.message))),t("div",{key:"958b4fef3310ae507df1871386bfe4e1d464a6b7"},t("a",{key:"c20313b563098396a96aa07e76852cd72662ca71",class:"s-maintenance-alert-btn",href:salla.config.get("maintenance_details.button_url")},this.buttonTitle))))}componentDidLoad(){let e=salla.storage.get("hide_salla-maintenance-alert_at");e&&(Date.now()-e)/1e3/60<60&&this.closeAlert()}get host(){return n(this)}};r.style='/*!twlt*/.s-maintenance-alert-wrapper{display:flex;min-height:40px;width:100%;flex-direction:row;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(26, 38, 61, var(--tw-bg-opacity));padding:0.25rem 0.5rem;--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity))}.s-maintenance-alert-wrapper a{transition:0.35s cubic-bezier(0.2, 1, 0.3, 1)}.s-maintenance-alert-wrapper *{color:inherit}@media (min-width: 640px){.s-maintenance-alert-wrapper{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-content{margin-top:1rem;margin-bottom:1rem;display:flex;width:100%;align-items:center;justify-content:space-between}@media (min-width: 640px){.s-maintenance-alert-content{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-container{display:flex;align-items:center}.s-maintenance-alert-icon{margin-right:1.25rem;display:none}@media (min-width: 640px){.s-maintenance-alert-icon{display:block}}.s-maintenance-alert-text h2{margin-bottom:0.5rem;font-size:0.875rem;font-weight:700;line-height:1.4}@media (min-width: 640px){.s-maintenance-alert-text h2{font-size:1.5rem;line-height:2rem}}.s-maintenance-alert-text p{margin:0px;text-align:right;font-size:10px;line-height:1.2}@media (min-width: 640px){.s-maintenance-alert-text p{text-align:center;font-size:0.75rem;line-height:1}}.s-maintenance-alert-btn{position:relative;margin-left:4px;margin-right:4px;display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;border-radius:0.125rem;border-width:1px;--tw-border-opacity:1;border-color:rgba(93, 213, 196, var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgba(93, 213, 196, var(--tw-bg-opacity));padding:0.5rem;text-align:center;vertical-align:middle;font-size:0.875rem;font-weight:400;line-height:1.4;--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity))}.s-maintenance-alert-btn:hover{--tw-bg-opacity:1;background-color:rgba(53, 203, 181, var(--tw-bg-opacity))}.s-maintenance-alert-btn *{pointer-events:none}[dir=rtl] .s-maintenance-alert-btn{margin-left:1.25rem;margin-right:0}@media (min-width: 640px){.s-maintenance-alert-btn{padding:0.5rem 1rem}}.s-maintenance-alert-wrapper{position:relative;display:flex;min-height:40px;width:100%;flex-direction:row;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgb(26 38 61 / var(--tw-bg-opacity, 1));padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-maintenance-alert-wrapper{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-wrapper a{transition:0.35s cubic-bezier(0.2, 1, 0.3, 1)}.s-maintenance-alert-wrapper *{color:inherit}.s-maintenance-alert-close{position:absolute;top:0.25rem;right:0.25rem}@media (min-width: 768px){.s-maintenance-alert-close{top:0.75rem;right:0.75rem}}.s-maintenance-alert-close:where([dir="rtl"],[dir="rtl"] *){right:unset;left:0.25rem}@media (min-width: 768px){.s-maintenance-alert-close:where([dir="rtl"],[dir="rtl"] *){left:0.75rem}}.s-maintenance-alert-close svg{height:1rem;width:1rem;fill:#fff}@media (min-width: 768px){.s-maintenance-alert-close svg{height:1.25rem;width:1.25rem}}.s-maintenance-alert-content{margin-top:1rem;margin-bottom:1rem;display:flex;width:100%;align-items:center;justify-content:space-between}@media (min-width: 640px){.s-maintenance-alert-content{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-container{display:flex;align-items:center}.s-maintenance-alert-icon{margin-right:1.25rem;display:none}@media (min-width: 640px){.s-maintenance-alert-icon{display:block}}.s-maintenance-alert-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:1.25rem;margin-right:0px}.s-maintenance-alert-text h2{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;line-height:1.4}@media (min-width: 640px){.s-maintenance-alert-text h2{font-size:1.5rem;line-height:2rem}}.s-maintenance-alert-text p{margin:0px;text-align:right;font-size:10px;line-height:1.2}@media (min-width: 640px){.s-maintenance-alert-text p{text-align:center;font-size:0.75rem;line-height:1rem;line-height:1}}.s-maintenance-alert-btn{position:relative;margin-left:4px;margin-right:4px;display:inline-block;cursor:pointer;user-select:none;white-space:nowrap;border-radius:0.125rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(93 213 196 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(93 213 196 / var(--tw-bg-opacity, 1));padding:0.5rem;text-align:center;vertical-align:middle;font-size:0.875rem;line-height:1.25rem;font-weight:400;line-height:1.4;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-maintenance-alert-btn:hover{--tw-bg-opacity:1;background-color:rgb(53 203 181 / var(--tw-bg-opacity, 1))}@media (min-width: 640px){.s-maintenance-alert-btn{padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem}}';export{r as salla_maintenance_alert}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,H as l}from"./p-Bf2Z6A1M.js";const i=class{constructor(t){e(this,t),this.translationLoaded=!1,this.icon='\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>inbox</title>\n<path d="M31.984 19.797l-2.667-17.333c-0.1-0.651-0.659-1.131-1.317-1.131h-24c-0.659 0-1.217 0.48-1.317 1.131l-2.667 17.333c-0.011 0.067-0.016 0.135-0.016 0.203v6.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-6.667c0-0.068-0.005-0.136-0.016-0.203zM5.144 4h21.712l2.256 14.667h-9.112c-0.736 0-1.333 0.596-1.333 1.333 0 1.471-1.196 2.667-2.667 2.667s-2.667-1.196-2.667-2.667c0-0.737-0.597-1.333-1.333-1.333h-9.112zM29.333 26.667c0 0.736-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.597-1.333-1.333v-5.333h8.168c0.593 2.299 2.684 4 5.165 4s4.571-1.701 5.165-4h8.168z"></path>\n</svg>\n',this.alignment="left",this.iconSize="md",salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}alignmentClass(){return{"s-placeholder-wrapper":!0,"s-placeholder-align-left":"left"==this.alignment,"s-placeholder-align-center":"center"==this.alignment,"s-placeholder-align-right":"right"==this.alignment}}render(){return t(l,{key:"c1d7092a1bfdbf8e25595ef2205d7e5721f338ed",class:this.alignmentClass()},t("div",{key:"85929e725cbd6e092b18038a240fbe0bda095648",class:`s-placeholder-icon s-placeholder-icon-${this.iconSize}`,innerHTML:this.icon}),t("div",{key:"773b9c9723a4542ca9518833ffad1470955a973b",class:"s-placeholder-title"},t("slot",{key:"c42d3d92f66cd5917952542360aacf936bde0d23",name:"title"},t("span",{key:"850e1a5abb42bbe69ea64d7c26f196d05fcf721d"},salla.lang.get("common.elements.no_options")))),t("div",{key:"4f56988f2a84ab394f39ff931f5ac8858a010d1e",class:"s-placeholder-description"},t("slot",{key:"886cae5311fa0ca5b763fb20ce9fe7c1845d4cab",name:"description"},t("span",{key:"f0cb7f4c50a1449d12467aaa802d47abbb4e0e53"},salla.lang.get("common.errors.empty_results")))))}};i.style='/*!twlt*/.inline{display:inline}.contents{display:contents}.s-bullet-delivery-placeholder.s-placeholder-wrapper{margin-top:1rem !important;margin-bottom:1rem !important}.s-loyalty-confirmation-modal-content .s-placeholder-title{margin-bottom:0.75rem}.s-loyalty-confirmation-modal-content .s-placeholder-icon svg b{--tw-text-opacity:1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.s-loyalty-confirmation-modal-content .s-placeholder-description{padding-left:1.25rem;padding-right:1.25rem}.s-placeholder-title{margin-bottom:0.25rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-placeholder-description{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-placeholder-icon{margin-bottom:1rem;fill:#e5e7eb}.s-placeholder-align-left{text-align:left}.s-placeholder-align-center{text-align:center}.s-placeholder-align-right{text-align:right}.s-placeholder-align-right>.s-placeholder-icon{display:flex;align-items:center;justify-content:flex-end}.s-placeholder-align-right>.s-placeholder-icon:where([dir="rtl"],[dir="rtl"] *){justify-content:flex-start}.s-placeholder-align-center>.s-placeholder-icon{display:flex;align-items:center;justify-content:center}.s-placeholder-icon-xs>svg{height:1.5rem;width:1.5rem}.s-placeholder-icon-sm>svg{height:2.5rem;width:2.5rem}.s-placeholder-icon-md>svg{height:3.5rem;width:3.5rem}.s-placeholder-icon-lg>svg{height:4rem;width:4rem}.s-placeholder-icon-xl>svg{height:5rem;width:5rem}.s-placeholder-icon-xxl>svg{height:6rem;width:6rem}.s-placeholder-icon-xxxl>svg{height:7rem;width:7rem}.s-placeholder-icon-xs>i{font-size:20px}.s-placeholder-icon-sm>i{font-size:35px}.s-placeholder-icon-md>i{font-size:45px}.s-placeholder-icon-lg>i{font-size:58px}.s-placeholder-icon-xl>i{font-size:75px}.s-placeholder-icon-xxl>i{font-size:85px}.s-placeholder-icon-xxxl>i{font-size:100px}.s-placeholder-wrapper{margin-top:3rem;margin-bottom:3rem;display:block}.s-scopes-wrap .s-placeholder-wrapper{display:flex;height:12rem;flex-direction:column;align-items:center;justify-content:center}';export{i as salla_placeholder}
4
+ import{r as e,h as t,H as l}from"./p-Q9lz4Iuq.js";const i=class{constructor(t){e(this,t),this.translationLoaded=!1,this.icon='\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>inbox</title>\n<path d="M31.984 19.797l-2.667-17.333c-0.1-0.651-0.659-1.131-1.317-1.131h-24c-0.659 0-1.217 0.48-1.317 1.131l-2.667 17.333c-0.011 0.067-0.016 0.135-0.016 0.203v6.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-6.667c0-0.068-0.005-0.136-0.016-0.203zM5.144 4h21.712l2.256 14.667h-9.112c-0.736 0-1.333 0.596-1.333 1.333 0 1.471-1.196 2.667-2.667 2.667s-2.667-1.196-2.667-2.667c0-0.737-0.597-1.333-1.333-1.333h-9.112zM29.333 26.667c0 0.736-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.597-1.333-1.333v-5.333h8.168c0.593 2.299 2.684 4 5.165 4s4.571-1.701 5.165-4h8.168z"></path>\n</svg>\n',this.alignment="left",this.iconSize="md",salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}alignmentClass(){return{"s-placeholder-wrapper":!0,"s-placeholder-align-left":"left"==this.alignment,"s-placeholder-align-center":"center"==this.alignment,"s-placeholder-align-right":"right"==this.alignment}}render(){return t(l,{key:"c1d7092a1bfdbf8e25595ef2205d7e5721f338ed",class:this.alignmentClass()},t("div",{key:"85929e725cbd6e092b18038a240fbe0bda095648",class:`s-placeholder-icon s-placeholder-icon-${this.iconSize}`,innerHTML:this.icon}),t("div",{key:"773b9c9723a4542ca9518833ffad1470955a973b",class:"s-placeholder-title"},t("slot",{key:"c42d3d92f66cd5917952542360aacf936bde0d23",name:"title"},t("span",{key:"850e1a5abb42bbe69ea64d7c26f196d05fcf721d"},salla.lang.get("common.elements.no_options")))),t("div",{key:"4f56988f2a84ab394f39ff931f5ac8858a010d1e",class:"s-placeholder-description"},t("slot",{key:"886cae5311fa0ca5b763fb20ce9fe7c1845d4cab",name:"description"},t("span",{key:"f0cb7f4c50a1449d12467aaa802d47abbb4e0e53"},salla.lang.get("common.errors.empty_results")))))}};i.style='/*!twlt*/.inline{display:inline}.contents{display:contents}.s-bullet-delivery-placeholder.s-placeholder-wrapper{margin-top:1rem !important;margin-bottom:1rem !important}.s-loyalty-confirmation-modal-content .s-placeholder-title{margin-bottom:0.75rem}.s-loyalty-confirmation-modal-content .s-placeholder-icon svg b{--tw-text-opacity:1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.s-loyalty-confirmation-modal-content .s-placeholder-description{padding-left:1.25rem;padding-right:1.25rem}.s-placeholder-title{margin-bottom:0.25rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-placeholder-description{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-placeholder-icon{margin-bottom:1rem;fill:#e5e7eb}.s-placeholder-align-left{text-align:left}.s-placeholder-align-center{text-align:center}.s-placeholder-align-right{text-align:right}.s-placeholder-align-right>.s-placeholder-icon{display:flex;align-items:center;justify-content:flex-end}.s-placeholder-align-right>.s-placeholder-icon:where([dir="rtl"],[dir="rtl"] *){justify-content:flex-start}.s-placeholder-align-center>.s-placeholder-icon{display:flex;align-items:center;justify-content:center}.s-placeholder-icon-xs>svg{height:1.5rem;width:1.5rem}.s-placeholder-icon-sm>svg{height:2.5rem;width:2.5rem}.s-placeholder-icon-md>svg{height:3.5rem;width:3.5rem}.s-placeholder-icon-lg>svg{height:4rem;width:4rem}.s-placeholder-icon-xl>svg{height:5rem;width:5rem}.s-placeholder-icon-xxl>svg{height:6rem;width:6rem}.s-placeholder-icon-xxxl>svg{height:7rem;width:7rem}.s-placeholder-icon-xs>i{font-size:20px}.s-placeholder-icon-sm>i{font-size:35px}.s-placeholder-icon-md>i{font-size:45px}.s-placeholder-icon-lg>i{font-size:58px}.s-placeholder-icon-xl>i{font-size:75px}.s-placeholder-icon-xxl>i{font-size:85px}.s-placeholder-icon-xxxl>i{font-size:100px}.s-placeholder-wrapper{margin-top:3rem;margin-bottom:3rem;display:block}.s-scopes-wrap .s-placeholder-wrapper{display:flex;height:12rem;flex-direction:column;align-items:center;justify-content:center}';export{i as salla_placeholder}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,H as l}from"./p-Bf2Z6A1M.js";const i=class{constructor(t){e(this,t),this.methods=[],this.shouldRender=!1}async componentDidLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),Salla.config.get("store.shipping.support_pickup")&&(this.shouldRender=!0,this.setLabels())}setLabels(){this.methods=[{id:"delivery",title:Salla.lang.getWithDefault("pages.products.promise_delivery_title","متاح للتوصيل"),subtitle:Salla.lang.getWithDefault("pages.products.promise_delivery_subtitle","طلبك يوصلك لباب البيت بسهولة."),iconClass:"sicon-location"},{id:"pickup",title:Salla.lang.getWithDefault("pages.products.promise_pickup_title","متاح للاستلام"),subtitle:Salla.lang.getWithDefault("pages.products.promise_pickup_subtitle","استلام فوري من أقرب فرع."),iconClass:"sicon-store"}]}render(){return this.shouldRender?t(l,{class:"s-fulfillment-methods"},t("div",{class:"s-fulfillment-methods-list"},this.methods.map((e=>t("div",{key:e.id,class:"s-fulfillment-methods-card"},t("div",{class:"s-fulfillment-methods-content"},t("div",{class:"s-fulfillment-methods-icon-wrap"},t("i",{class:`${e.iconClass} s-fulfillment-methods-icon`})),t("div",{class:"s-fulfillment-methods-text"},t("span",{class:"s-fulfillment-methods-title"},e.title),t("span",{class:"s-fulfillment-methods-subtitle"},e.subtitle)))))))):null}};i.style='/*!twlt*/:host{display:block}.s-fulfillment-methods{font-family:inherit}.s-fulfillment-methods-list{display:flex;gap:16px;flex-wrap:wrap;margin-bottom:12px;margin-top:12px}:host-context([dir=rtl]) .s-fulfillment-methods-content{flex-direction:row-reverse}:host-context([dir=ltr]) .s-fulfillment-methods-content{flex-direction:row}.s-fulfillment-methods-card{flex:1;min-width:0;border:1px solid var(--color-border, #e5e7eb);border-radius:12px;padding:16px}.s-fulfillment-methods-content{display:flex;align-items:center;gap:12px}.s-fulfillment-methods-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.s-fulfillment-methods-title{font-weight:700;font-size:14px;line-height:1.3;color:var(--color-text-primary, #2b2d34)}.s-fulfillment-methods-subtitle{font-size:12px;line-height:1.4;color:var(--color-text-secondary, #6b7280)}.s-fulfillment-methods-icon-wrap{flex-shrink:0;width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:var(--color-surface-secondary, #f3f4f6);border-radius:10px}.s-fulfillment-methods-icon{font-size:22px;color:var(--color-text-secondary, #6b7280);line-height:1}.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-fulfillment-methods-list{margin-bottom:0.75rem;margin-top:0.75rem;display:flex;flex-wrap:wrap;gap:1rem}.s-fulfillment-methods-card{min-width:0px;flex:1 1 0%;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:1rem}.s-fulfillment-methods-content{display:flex;flex-direction:row;align-items:center;gap:0.75rem}.s-fulfillment-methods-content:where([dir="rtl"],[dir="rtl"] *){flex-direction:row-reverse}.s-fulfillment-methods-text{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.25rem}.s-fulfillment-methods-title{font-size:0.875rem;line-height:1.25rem;font-weight:700;line-height:1.375;color:var(--color-text-primary,#2b2d34)}.s-fulfillment-methods-subtitle{font-size:0.75rem;line-height:1rem;line-height:1.4;color:var(--color-text-secondary,#6b7280)}.s-fulfillment-methods-icon-wrap{display:flex;height:2.75rem;width:2.75rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:10px;background-color:var(--color-surface-secondary,#f3f4f6)}.s-fulfillment-methods-icon{font-size:22px;line-height:1;color:var(--color-text-secondary,#6b7280)}';export{i as salla_fulfillment_methods}
4
+ import{r as e,h as t,H as l}from"./p-Q9lz4Iuq.js";const i=class{constructor(t){e(this,t),this.methods=[],this.shouldRender=!1}async componentDidLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),Salla.config.get("store.shipping.support_pickup")&&(this.shouldRender=!0,this.setLabels())}setLabels(){this.methods=[{id:"delivery",title:Salla.lang.getWithDefault("pages.products.promise_delivery_title","متاح للتوصيل"),subtitle:Salla.lang.getWithDefault("pages.products.promise_delivery_subtitle","طلبك يوصلك لباب البيت بسهولة."),iconClass:"sicon-location"},{id:"pickup",title:Salla.lang.getWithDefault("pages.products.promise_pickup_title","متاح للاستلام"),subtitle:Salla.lang.getWithDefault("pages.products.promise_pickup_subtitle","استلام فوري من أقرب فرع."),iconClass:"sicon-store"}]}render(){return this.shouldRender?t(l,{class:"s-fulfillment-methods"},t("div",{class:"s-fulfillment-methods-list"},this.methods.map((e=>t("div",{key:e.id,class:"s-fulfillment-methods-card"},t("div",{class:"s-fulfillment-methods-content"},t("div",{class:"s-fulfillment-methods-icon-wrap"},t("i",{class:`${e.iconClass} s-fulfillment-methods-icon`})),t("div",{class:"s-fulfillment-methods-text"},t("span",{class:"s-fulfillment-methods-title"},e.title),t("span",{class:"s-fulfillment-methods-subtitle"},e.subtitle)))))))):null}};i.style='/*!twlt*/:host{display:block}.s-fulfillment-methods{font-family:inherit}.s-fulfillment-methods-list{display:flex;gap:16px;flex-wrap:wrap;margin-bottom:12px;margin-top:12px}:host-context([dir=rtl]) .s-fulfillment-methods-content{flex-direction:row-reverse}:host-context([dir=ltr]) .s-fulfillment-methods-content{flex-direction:row}.s-fulfillment-methods-card{flex:1;min-width:0;border:1px solid var(--color-border, #e5e7eb);border-radius:12px;padding:16px}.s-fulfillment-methods-content{display:flex;align-items:center;gap:12px}.s-fulfillment-methods-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.s-fulfillment-methods-title{font-weight:700;font-size:14px;line-height:1.3;color:var(--color-text-primary, #2b2d34)}.s-fulfillment-methods-subtitle{font-size:12px;line-height:1.4;color:var(--color-text-secondary, #6b7280)}.s-fulfillment-methods-icon-wrap{flex-shrink:0;width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:var(--color-surface-secondary, #f3f4f6);border-radius:10px}.s-fulfillment-methods-icon{font-size:22px;color:var(--color-text-secondary, #6b7280);line-height:1}.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-fulfillment-methods-list{margin-bottom:0.75rem;margin-top:0.75rem;display:flex;flex-wrap:wrap;gap:1rem}.s-fulfillment-methods-card{min-width:0px;flex:1 1 0%;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:1rem}.s-fulfillment-methods-content{display:flex;flex-direction:row;align-items:center;gap:0.75rem}.s-fulfillment-methods-content:where([dir="rtl"],[dir="rtl"] *){flex-direction:row-reverse}.s-fulfillment-methods-text{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.25rem}.s-fulfillment-methods-title{font-size:0.875rem;line-height:1.25rem;font-weight:700;line-height:1.375;color:var(--color-text-primary,#2b2d34)}.s-fulfillment-methods-subtitle{font-size:0.75rem;line-height:1rem;line-height:1.4;color:var(--color-text-secondary,#6b7280)}.s-fulfillment-methods-icon-wrap{display:flex;height:2.75rem;width:2.75rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:10px;background-color:var(--color-surface-secondary,#f3f4f6)}.s-fulfillment-methods-icon{font-size:22px;line-height:1;color:var(--color-text-secondary,#6b7280)}';export{i as salla_fulfillment_methods}