@salla.sa/twilight-components 2.14.389 → 2.14.391

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 (302) hide show
  1. package/dist/cjs/{filepond-D-Sm5mfd.js → filepond-DFNeUlJZ.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-D_Q9tOzh.js → filepond-plugin-file-poster-CdscjCyV.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-jE8i9yLT.js → filepond-plugin-file-validate-size-CeIHus23.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-ClNK2GsY.js → filepond-plugin-file-validate-type-B-xReGXI.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BtI2loP1.js → filepond-plugin-image-edit-BEZKgnin.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-DFksd-cT.js → filepond-plugin-image-exif-orientation-BsIhjiXV.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-B6iy7dvj.js → filepond-plugin-image-preview-CgGyHHMF.js} +1 -1
  8. package/dist/cjs/{index-CZzG9P8m.js → index-RCgJUM7B.js} +34 -10
  9. package/dist/cjs/{index-PbcABX0l.js → index-U__MmWip.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +63 -0
  12. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-add-product-button_4.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  19. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-count-down.cjs.entry.js +196 -0
  27. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-delivery-promise.cjs.entry.js +230 -0
  29. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +45 -0
  32. package/dist/cjs/salla-gifting.cjs.entry.js +91 -16
  33. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  43. package/dist/cjs/{salla-accordion-body_3.cjs.entry.js → salla-map.cjs.entry.js} +1 -57
  44. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-order-edit-item.cjs.entry.js +95 -0
  57. package/dist/cjs/salla-order-edit.cjs.entry.js +181 -0
  58. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  64. package/dist/cjs/{salla-count-down_2.cjs.entry.js → salla-product-card.cjs.entry.js} +1 -160
  65. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  86. package/dist/cjs/twilight.cjs.js +2 -2
  87. package/dist/cjs/{vanilla-picker-BP4lqf-K.js → vanilla-picker-yWlr4I9a.js} +1 -1
  88. package/dist/collection/collection-manifest.json +4 -0
  89. package/dist/collection/components/salla-count-down/salla-count-down.css +4 -0
  90. package/dist/collection/components/salla-count-down/salla-count-down.js +122 -13
  91. package/dist/collection/components/salla-delivery-promise/interfaces.js +1 -0
  92. package/dist/collection/components/salla-delivery-promise/salla-delivery-promise.js +247 -0
  93. package/dist/collection/components/salla-fulfillment-methods/salla-fulfillment-methods.js +51 -0
  94. package/dist/collection/components/salla-gifting/salla-gifting.js +96 -15
  95. package/dist/collection/components/salla-order-edit/interfaces.js +1 -0
  96. package/dist/collection/components/salla-order-edit/salla-order-edit-item.css +0 -0
  97. package/dist/collection/components/salla-order-edit/salla-order-edit-item.js +185 -0
  98. package/dist/collection/components/salla-order-edit/salla-order-edit.css +0 -0
  99. package/dist/collection/components/salla-order-edit/salla-order-edit.js +256 -0
  100. package/dist/components/index.js +2 -2
  101. package/dist/components/salla-count-down2.js +49 -13
  102. package/dist/components/salla-delivery-promise.d.ts +11 -0
  103. package/dist/components/salla-delivery-promise.js +266 -0
  104. package/dist/components/salla-fulfillment-methods.d.ts +11 -0
  105. package/dist/components/salla-fulfillment-methods.js +64 -0
  106. package/dist/components/salla-gifting.js +96 -15
  107. package/dist/components/salla-order-edit-item.d.ts +11 -0
  108. package/dist/components/salla-order-edit-item.js +9 -0
  109. package/dist/components/salla-order-edit-item2.js +184 -0
  110. package/dist/components/salla-order-edit.d.ts +11 -0
  111. package/dist/components/salla-order-edit.js +291 -0
  112. package/dist/components/salla-quantity-input.js +1 -125
  113. package/dist/components/salla-quantity-input2.js +130 -0
  114. package/dist/esm/{filepond-PPWykQxI.js → filepond-dioc1UNj.js} +1 -1
  115. package/dist/esm/{filepond-plugin-file-poster-BRSyNznG.js → filepond-plugin-file-poster-BpOMmY57.js} +1 -1
  116. package/dist/esm/{filepond-plugin-file-validate-size-BKa_IBRc.js → filepond-plugin-file-validate-size-D3zrIASS.js} +1 -1
  117. package/dist/esm/{filepond-plugin-file-validate-type-B2Gqcysx.js → filepond-plugin-file-validate-type-C_O5sg3V.js} +1 -1
  118. package/dist/esm/{filepond-plugin-image-edit-C0UvZ9iA.js → filepond-plugin-image-edit-vV9cFwQt.js} +1 -1
  119. package/dist/esm/{filepond-plugin-image-exif-orientation-Dmzu9ZJy.js → filepond-plugin-image-exif-orientation-DQHJunT0.js} +1 -1
  120. package/dist/esm/{filepond-plugin-image-preview-CaZ36U6e.js → filepond-plugin-image-preview-CK8pdQ2g.js} +1 -1
  121. package/dist/esm/{index-C3w2qMi0.js → index-B6FFbRiW.js} +1 -1
  122. package/dist/esm/{index-CyfZeaV2.js → index-BBHnyTVS.js} +34 -10
  123. package/dist/esm/loader.js +3 -3
  124. package/dist/esm/salla-accordion-body_2.entry.js +60 -0
  125. package/dist/esm/salla-accordion_6.entry.js +1 -1
  126. package/dist/esm/salla-add-product-button_4.entry.js +1 -1
  127. package/dist/esm/salla-advertisement.entry.js +1 -1
  128. package/dist/esm/salla-alert_2.entry.js +1 -1
  129. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  130. package/dist/esm/salla-apps-icons.entry.js +1 -1
  131. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  132. package/dist/esm/salla-bullet-delivery.entry.js +1 -1
  133. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  134. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  135. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  136. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  137. package/dist/esm/salla-contacts.entry.js +1 -1
  138. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  139. package/dist/esm/salla-count-down.entry.js +194 -0
  140. package/dist/esm/salla-custom-fields.entry.js +1 -1
  141. package/dist/esm/salla-delivery-promise.entry.js +228 -0
  142. package/dist/esm/salla-filters-widget.entry.js +1 -1
  143. package/dist/esm/salla-filters.entry.js +1 -1
  144. package/dist/esm/salla-fulfillment-methods.entry.js +43 -0
  145. package/dist/esm/salla-gifting.entry.js +91 -16
  146. package/dist/esm/salla-hook.entry.js +1 -1
  147. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  148. package/dist/esm/salla-installment.entry.js +1 -1
  149. package/dist/esm/salla-list-tile.entry.js +1 -1
  150. package/dist/esm/salla-localization-modal.entry.js +1 -1
  151. package/dist/esm/salla-login-modal.entry.js +1 -1
  152. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  153. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  154. package/dist/esm/salla-loyalty.entry.js +1 -1
  155. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  156. package/dist/esm/{salla-accordion-body_3.entry.js → salla-map.entry.js} +2 -56
  157. package/dist/esm/salla-menu.entry.js +1 -1
  158. package/dist/esm/salla-metadata.entry.js +1 -1
  159. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  160. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  161. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  162. package/dist/esm/salla-notification-item.entry.js +1 -1
  163. package/dist/esm/salla-notifications.entry.js +1 -1
  164. package/dist/esm/salla-offer-modal.entry.js +1 -1
  165. package/dist/esm/salla-offer.entry.js +1 -1
  166. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  167. package/dist/esm/salla-order-details-options.entry.js +1 -1
  168. package/dist/esm/salla-order-details.entry.js +1 -1
  169. package/dist/esm/salla-order-edit-item.entry.js +93 -0
  170. package/dist/esm/salla-order-edit.entry.js +179 -0
  171. package/dist/esm/salla-order-summary.entry.js +1 -1
  172. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  173. package/dist/esm/salla-orders.entry.js +1 -1
  174. package/dist/esm/salla-payments.entry.js +1 -1
  175. package/dist/esm/salla-placeholder.entry.js +1 -1
  176. package/dist/esm/salla-price-range.entry.js +1 -1
  177. package/dist/esm/{salla-count-down_2.entry.js → salla-product-card.entry.js} +2 -160
  178. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  179. package/dist/esm/salla-products-list.entry.js +1 -1
  180. package/dist/esm/salla-products-slider.entry.js +1 -1
  181. package/dist/esm/salla-progress-bar.entry.js +1 -1
  182. package/dist/esm/salla-quick-order.entry.js +1 -1
  183. package/dist/esm/salla-rating-modal.entry.js +1 -1
  184. package/dist/esm/salla-scopes.entry.js +1 -1
  185. package/dist/esm/salla-search.entry.js +1 -1
  186. package/dist/esm/salla-skeleton.entry.js +1 -1
  187. package/dist/esm/salla-slider.entry.js +1 -1
  188. package/dist/esm/salla-social-share.entry.js +1 -1
  189. package/dist/esm/salla-social.entry.js +1 -1
  190. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  191. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  192. package/dist/esm/salla-tooltip.entry.js +1 -1
  193. package/dist/esm/salla-trust-badges.entry.js +1 -1
  194. package/dist/esm/salla-user-menu.entry.js +1 -1
  195. package/dist/esm/salla-user-profile.entry.js +1 -1
  196. package/dist/esm/salla-user-settings.entry.js +1 -1
  197. package/dist/esm/salla-verify.entry.js +1 -1
  198. package/dist/esm/salla-wallet.entry.js +1 -1
  199. package/dist/esm/twilight.js +3 -3
  200. package/dist/esm/{vanilla-picker-BnLjo9lg.js → vanilla-picker-DSMkPxn-.js} +1 -1
  201. package/dist/twilight/p-01cb129f.entry.js +4 -0
  202. package/dist/twilight/{p-CKAWVE2E.js → p-03jJUGJM.js} +1 -1
  203. package/dist/twilight/{p-414f399b.entry.js → p-042206f2.entry.js} +1 -1
  204. package/dist/twilight/{p-8c1f6ff5.entry.js → p-0557c403.entry.js} +1 -1
  205. package/dist/twilight/{p-f9b6a945.entry.js → p-06d3f60c.entry.js} +1 -1
  206. package/dist/twilight/{p-8538541b.entry.js → p-099267e9.entry.js} +1 -1
  207. package/dist/twilight/{p-d224ad78.entry.js → p-0a779ecb.entry.js} +1 -1
  208. package/dist/twilight/p-0c45b777.entry.js +4 -0
  209. package/dist/twilight/{p-c782ba90.entry.js → p-143f385c.entry.js} +1 -1
  210. package/dist/twilight/p-1646270f.entry.js +4 -0
  211. package/dist/twilight/{p-7eebae69.entry.js → p-1a7e8dc4.entry.js} +1 -1
  212. package/dist/twilight/p-1b50e37e.entry.js +4 -0
  213. package/dist/twilight/{p-f8b53b4a.entry.js → p-1bacbd68.entry.js} +1 -1
  214. package/dist/twilight/{p-5db4f7be.entry.js → p-214c17ba.entry.js} +1 -1
  215. package/dist/twilight/{p-5a3fbfcc.entry.js → p-23c450bb.entry.js} +1 -1
  216. package/dist/twilight/{p-3490e1f2.entry.js → p-2534ee8d.entry.js} +1 -1
  217. package/dist/twilight/{p-2d3c3fc0.entry.js → p-2690964e.entry.js} +1 -1
  218. package/dist/twilight/{p-749f87cc.entry.js → p-2f4352f5.entry.js} +1 -1
  219. package/dist/twilight/{p-fdb99998.entry.js → p-2fd9954e.entry.js} +1 -1
  220. package/dist/twilight/{p-de4fc6d3.entry.js → p-3094c1a1.entry.js} +1 -1
  221. package/dist/twilight/{p-313e016b.entry.js → p-31cff9d6.entry.js} +1 -1
  222. package/dist/twilight/{p-49178d13.entry.js → p-3570139b.entry.js} +1 -1
  223. package/dist/twilight/p-3a20fbc0.entry.js +4 -0
  224. package/dist/twilight/{p-fca12e58.entry.js → p-43a3d74b.entry.js} +1 -1
  225. package/dist/twilight/{p-b6924b12.entry.js → p-43fd9024.entry.js} +1 -1
  226. package/dist/twilight/{p-7367264c.entry.js → p-45c1eaa8.entry.js} +1 -1
  227. package/dist/twilight/p-49260c6c.entry.js +4 -0
  228. package/dist/twilight/{p-f713d4c1.entry.js → p-495a9262.entry.js} +1 -1
  229. package/dist/twilight/{p-9b03dc5f.entry.js → p-4b78b5b6.entry.js} +1 -1
  230. package/dist/twilight/{p-92aa6f9c.entry.js → p-4f664ee5.entry.js} +1 -1
  231. package/dist/twilight/{p-981aa6b2.entry.js → p-5039c032.entry.js} +1 -1
  232. package/dist/twilight/{p-282b2717.entry.js → p-51eeff00.entry.js} +1 -1
  233. package/dist/twilight/{p-a3479656.entry.js → p-5abc72fb.entry.js} +1 -1
  234. package/dist/twilight/{p-52249b73.entry.js → p-5de17423.entry.js} +1 -1
  235. package/dist/twilight/{p-71e9036c.entry.js → p-5e08505f.entry.js} +1 -1
  236. package/dist/twilight/{p-7b3e9e94.entry.js → p-64316672.entry.js} +1 -1
  237. package/dist/twilight/{p-68e1946b.entry.js → p-698cda6b.entry.js} +1 -1
  238. package/dist/twilight/p-6d9ff62d.entry.js +4 -0
  239. package/dist/twilight/p-72128782.entry.js +4 -0
  240. package/dist/twilight/{p-9af46409.entry.js → p-736661d1.entry.js} +1 -1
  241. package/dist/twilight/{p-6f230886.entry.js → p-73fc8bc2.entry.js} +1 -1
  242. package/dist/twilight/{p-e51abff8.entry.js → p-78230ff2.entry.js} +1 -1
  243. package/dist/twilight/{p-9dace77f.entry.js → p-7b1e18b9.entry.js} +1 -1
  244. package/dist/twilight/p-8735bed6.entry.js +4 -0
  245. package/dist/twilight/{p-d0d9eaa7.entry.js → p-911df985.entry.js} +1 -1
  246. package/dist/twilight/{p-b85269f0.entry.js → p-917e279a.entry.js} +1 -1
  247. package/dist/twilight/{p-0dcadf17.entry.js → p-9623211d.entry.js} +1 -1
  248. package/dist/twilight/{p-56f20bf9.entry.js → p-98365139.entry.js} +1 -1
  249. package/dist/twilight/{p-e4984da6.entry.js → p-9a2fa95c.entry.js} +1 -1
  250. package/dist/twilight/{p-3424772f.entry.js → p-9f09f917.entry.js} +1 -1
  251. package/dist/twilight/{p-CyfZeaV2.js → p-BBHnyTVS.js} +2 -2
  252. package/dist/twilight/{p-DV84B4Zf.js → p-BLNd0Q7w.js} +1 -1
  253. package/dist/twilight/p-BdSnnWWn.js +9 -0
  254. package/dist/twilight/{p-DgRZXtp7.js → p-BywTh96y.js} +1 -1
  255. package/dist/twilight/{p-B5sTdzgA.js → p-CWQJdJyB.js} +1 -1
  256. package/dist/twilight/{p-DaXFe_AG.js → p-CttEbJoQ.js} +1 -1
  257. package/dist/twilight/{p-oPo_An7U.js → p-HRFCteJK.js} +1 -1
  258. package/dist/twilight/{p-nDM6sAQW.js → p-IulbkBPB.js} +1 -1
  259. package/dist/twilight/{p-71199938.entry.js → p-a50a28ea.entry.js} +1 -1
  260. package/dist/twilight/{p-1fa74395.entry.js → p-abfc0327.entry.js} +1 -1
  261. package/dist/twilight/{p-9ae66ab7.entry.js → p-b9a7a8b1.entry.js} +1 -1
  262. package/dist/twilight/{p-646ac137.entry.js → p-bc9aa300.entry.js} +1 -1
  263. package/dist/twilight/{p-28691a37.entry.js → p-c800360f.entry.js} +1 -1
  264. package/dist/twilight/{p-83bb3e08.entry.js → p-cc8c8ee0.entry.js} +1 -1
  265. package/dist/twilight/{p-a5215f9c.entry.js → p-ccf81e66.entry.js} +1 -1
  266. package/dist/twilight/{p-46715ed4.entry.js → p-ce4e06b8.entry.js} +1 -1
  267. package/dist/twilight/{p-85e08789.entry.js → p-d375a0d6.entry.js} +1 -1
  268. package/dist/twilight/{p-ccc3689d.entry.js → p-d5bea7d7.entry.js} +1 -1
  269. package/dist/twilight/{p-dccaabbe.entry.js → p-daf6d030.entry.js} +1 -1
  270. package/dist/twilight/{p-6c5ab45f.entry.js → p-db1699d8.entry.js} +1 -1
  271. package/dist/twilight/{p-75744403.entry.js → p-db8ea013.entry.js} +1 -1
  272. package/dist/twilight/{p-f2a021d2.entry.js → p-dd95dd45.entry.js} +1 -1
  273. package/dist/twilight/{p-6b642ef5.entry.js → p-df66218c.entry.js} +1 -1
  274. package/dist/twilight/{p-0e064e79.entry.js → p-e2a6cc78.entry.js} +1 -1
  275. package/dist/twilight/{p-b6d4d88f.entry.js → p-e5faf311.entry.js} +1 -1
  276. package/dist/twilight/{p-8c918f58.entry.js → p-e8ee7b09.entry.js} +1 -1
  277. package/dist/twilight/{p-016b3b19.entry.js → p-ec2a876a.entry.js} +1 -1
  278. package/dist/twilight/{p-549d8385.entry.js → p-f08590d7.entry.js} +1 -1
  279. package/dist/twilight/{p-c48e2a05.entry.js → p-f17b1333.entry.js} +1 -1
  280. package/dist/twilight/{p-4a0248ab.entry.js → p-f8b8c0da.entry.js} +1 -1
  281. package/dist/twilight/{p-833e8364.entry.js → p-f8beca67.entry.js} +1 -1
  282. package/dist/twilight/{p-77a89284.entry.js → p-fc6852a0.entry.js} +1 -1
  283. package/dist/twilight/{p-69ae622f.entry.js → p-fd540f5b.entry.js} +1 -1
  284. package/dist/twilight/{p-1a9b64ea.entry.js → p-fe417603.entry.js} +1 -1
  285. package/dist/twilight/{p-CJnMMMxb.js → p-okSe2zH1.js} +1 -1
  286. package/dist/twilight/twilight.esm.js +1 -1
  287. package/dist/types/components/salla-count-down/salla-count-down.d.ts +24 -0
  288. package/dist/types/components/salla-delivery-promise/interfaces.d.ts +27 -0
  289. package/dist/types/components/salla-delivery-promise/salla-delivery-promise.d.ts +48 -0
  290. package/dist/types/components/salla-fulfillment-methods/salla-fulfillment-methods.d.ts +18 -0
  291. package/dist/types/components/salla-gifting/gift-schema.d.ts +4 -0
  292. package/dist/types/components/salla-gifting/intefaces.d.ts +1 -0
  293. package/dist/types/components/salla-gifting/salla-gifting.d.ts +10 -1
  294. package/dist/types/components/salla-order-edit/interfaces.d.ts +114 -0
  295. package/dist/types/components/salla-order-edit/salla-order-edit-item.d.ts +35 -0
  296. package/dist/types/components/salla-order-edit/salla-order-edit.d.ts +42 -0
  297. package/dist/types/components.d.ts +236 -0
  298. package/package.json +5 -5
  299. package/dist/twilight/p-1048b469.entry.js +0 -4
  300. package/dist/twilight/p-C11T4TVo.js +0 -9
  301. package/dist/twilight/p-d33f3c58.entry.js +0 -4
  302. package/dist/twilight/p-fbcc194e.entry.js +0 -4
@@ -0,0 +1,247 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import { h, Host } from "@stencil/core";
5
+ /**
6
+ * @name SallaDeliveryPromise
7
+ * @description Displays delivery promise message (from BE) with city selection
8
+ * @tag salla-delivery-promise
9
+ */
10
+ export class SallaDeliveryPromise {
11
+ constructor() {
12
+ this.cities = [];
13
+ this.filteredCities = [];
14
+ this.selectedCity = null;
15
+ this.deliveryMessage = null;
16
+ this.isLoadingCities = false;
17
+ this.isLoadingPromises = false;
18
+ this.isDropdownOpen = false;
19
+ this.searchQuery = '';
20
+ this.hasError = false;
21
+ this.errorMessage = '';
22
+ /** i18n labels for city selector only; message comes from BE */
23
+ this.labels = {
24
+ deliveryTo: 'توصيل إلى',
25
+ pickupFromBranch: 'الاستلام من فرع',
26
+ searchPlaceholder: 'بحث...',
27
+ noResults: 'لا توجد نتائج',
28
+ selectCity: 'اختر المدينة',
29
+ };
30
+ this.canRender = false;
31
+ this.requiresShipping = false;
32
+ /** Used only for API calls, not rendered — no need for @State */
33
+ this.productId = undefined;
34
+ this.onClickOutside = (e) => {
35
+ if (this.host.contains(e.target)) {
36
+ return; // click inside component (e.g. search input, city list) — don't close
37
+ }
38
+ this.isDropdownOpen = false;
39
+ window.removeEventListener('click', this.onClickOutside);
40
+ };
41
+ }
42
+ setLabels() {
43
+ this.labels = {
44
+ deliveryTo: salla.lang.getWithDefault('pages.products.promise_deliver_to', 'توصيل إلى'),
45
+ pickupFromBranch: salla.lang.getWithDefault('pages.products.promise_pickup_from_branch', 'الاستلام من فرع'),
46
+ searchPlaceholder: salla.lang.getWithDefault('blocks.header.search_placeholder', 'بحث...'),
47
+ noResults: salla.lang.getWithDefault('common.elements.no_options', 'لا توجد نتائج'),
48
+ selectCity: salla.lang.getWithDefault('common.elements.select_city', 'اختر المدينة'),
49
+ };
50
+ }
51
+ logger(message, data) {
52
+ if (localStorage.getItem('salla-delivery-promise-debug')) {
53
+ if (data) {
54
+ console.log(message, data);
55
+ }
56
+ else {
57
+ console.log(message);
58
+ }
59
+ }
60
+ }
61
+ async componentDidLoad() {
62
+ await salla.onReady();
63
+ await salla.lang.onLoaded();
64
+ this.setLabels();
65
+ this.requiresShipping = salla.url.is_page('product.single') &&
66
+ salla.config.get('store.features', []).includes('delivery-promises');
67
+ if (this.requiresShipping) {
68
+ this.logger('requiresShipping', this.requiresShipping);
69
+ this.productId = salla.config.get('page.id');
70
+ this.logger('productId', this.productId);
71
+ }
72
+ else {
73
+ this.canRender = false;
74
+ this.logger('not requiresShipping', {
75
+ is_product_single: salla.url.is_page('product.single'),
76
+ includesDeliveryPromises: salla.config.get('store.features', []).includes('delivery-promises')
77
+ });
78
+ return;
79
+ }
80
+ await this.fetchCities();
81
+ }
82
+ async fetchCities() {
83
+ this.logger('start startfetchCities');
84
+ this.isLoadingCities = true;
85
+ this.hasError = false;
86
+ try {
87
+ const response = await salla.api.request(salla.url.api(`products/${this.productId}/delivery-promises/cities`));
88
+ if (response.success && Array.isArray(response.data) && response.data.length > 0) {
89
+ this.logger('fetchCities success', { cities: response.data });
90
+ // Sort cities: explicit cities first (id !== -1), then "Rest of cities" (id === -1)
91
+ this.cities = this.sortCities(response.data);
92
+ this.filteredCities = [...this.cities];
93
+ // First, check if API returns a selected city (is_selected: true)
94
+ let cityToSelect = this.cities.find(c => c.is_selected);
95
+ if (!cityToSelect) {
96
+ this.logger('no selectedCity from API response');
97
+ }
98
+ else {
99
+ this.logger('selectedCity', cityToSelect);
100
+ this.selectedCity = cityToSelect;
101
+ await this.fetchDeliveryMessage(cityToSelect.id);
102
+ }
103
+ this.canRender = true;
104
+ }
105
+ else {
106
+ this.logger('no data returned from fetchCities', { response: response });
107
+ this.canRender = false;
108
+ }
109
+ }
110
+ catch (error) {
111
+ this.logger('fetchCities error', { error: error.message });
112
+ this.hasError = true;
113
+ this.errorMessage = error.message || 'Failed to load cities';
114
+ this.canRender = false;
115
+ }
116
+ finally {
117
+ this.isLoadingCities = false;
118
+ }
119
+ }
120
+ async fetchDeliveryMessage(cityId) {
121
+ this.logger('start fetchDeliveryMessage', { cityId });
122
+ this.isLoadingPromises = true;
123
+ this.hasError = false;
124
+ this.deliveryMessage = null;
125
+ try {
126
+ const response = await salla.api.withoutNotifier(() => salla.api.request(salla.url.api(`products/${this.productId}/delivery-promises?city_id=${cityId}`)));
127
+ if (response.success && response.data?.message) {
128
+ const message = response.data.message.trim();
129
+ this.logger('fetchDeliveryMessage success', { message });
130
+ this.deliveryMessage = message || null;
131
+ }
132
+ else {
133
+ this.logger('deliveryMessage not valid', { response });
134
+ }
135
+ }
136
+ catch (error) {
137
+ this.logger('fetchDeliveryMessage error', { error: error.message });
138
+ this.hasError = true;
139
+ this.errorMessage = error.message || 'Failed to load delivery message';
140
+ }
141
+ finally {
142
+ this.isLoadingPromises = false;
143
+ }
144
+ }
145
+ toggleDropdown(e) {
146
+ e?.stopPropagation();
147
+ this.isDropdownOpen = !this.isDropdownOpen;
148
+ if (this.isDropdownOpen) {
149
+ window.addEventListener('click', this.onClickOutside);
150
+ if (this.searchInputRef) {
151
+ setTimeout(() => this.searchInputRef.focus(), 100);
152
+ }
153
+ }
154
+ else {
155
+ window.removeEventListener('click', this.onClickOutside);
156
+ }
157
+ }
158
+ disconnectedCallback() {
159
+ window.removeEventListener('click', this.onClickOutside);
160
+ }
161
+ /**
162
+ * Sort cities: explicit cities first (id !== -1), then "Rest of cities" (id === -1) at the end
163
+ */
164
+ sortCities(cities) {
165
+ return [...cities].sort((a, b) => {
166
+ // "Rest of cities" (id === -1) should always be at the end
167
+ if (a.id === -1)
168
+ return 1;
169
+ if (b.id === -1)
170
+ return -1;
171
+ return 0;
172
+ });
173
+ }
174
+ handleSearch(event) {
175
+ const query = event.target.value.toLowerCase();
176
+ this.searchQuery = query;
177
+ if (query.length > 0) {
178
+ this.filteredCities = this.cities.filter(city => city.name.toLowerCase()?.includes(query) ||
179
+ (city.name_en || '').toLowerCase()?.includes(query));
180
+ }
181
+ else {
182
+ this.filteredCities = [...this.cities];
183
+ }
184
+ }
185
+ async selectCity(city) {
186
+ this.logger('selectCity', { city: city });
187
+ this.selectedCity = city;
188
+ this.isDropdownOpen = false;
189
+ window.removeEventListener('click', this.onClickOutside);
190
+ this.searchQuery = '';
191
+ this.filteredCities = [...this.cities];
192
+ await this.fetchDeliveryMessage(city.id);
193
+ }
194
+ renderDropdown() {
195
+ return (h("div", { class: "s-delivery-promise-dropdown" }, h("div", { class: "s-delivery-promise-dropdown-search" }, h("i", { class: "sicon-search" }), h("input", { type: "text", placeholder: this.labels.searchPlaceholder, value: this.searchQuery, onInput: (e) => this.handleSearch(e), ref: el => this.searchInputRef = el })), h("div", { class: "s-delivery-promise-dropdown-list" }, this.filteredCities.length === 0 ? (h("div", { class: "s-delivery-promise-dropdown-empty" }, this.labels.noResults)) : (this.filteredCities.map(city => (h("div", { key: city.id, class: `s-delivery-promise-dropdown-item ${this.selectedCity?.id === city.id ? 'selected' : ''}`, onClick: () => this.selectCity(city) }, h("span", { class: "s-delivery-promise-city-name" }, city.name), this.selectedCity?.id === city.id && (h("i", { class: "sicon-check" })))))))));
196
+ }
197
+ /**
198
+ * Skeleton shown during initial city fetch to avoid blank period and layout shift.
199
+ * Matches the structure/size of the real content (header + message area).
200
+ */
201
+ renderInitialLoadingSkeleton() {
202
+ return (h(Host, { class: "s-delivery-promise-wrapper s-delivery-promise-skeleton" }, h("div", { class: "s-delivery-promise-container" }, h("div", { class: "s-delivery-promise-header s-delivery-promise-header-skeleton" }, h("div", { class: "s-delivery-promise-location" }, h("salla-skeleton", { height: "14px", width: "180px" })), h("salla-skeleton", { height: "18px", width: "18px" })), h("div", { class: "s-delivery-promise-loading" }, h("salla-skeleton", { height: "20px", width: "80%" })))));
203
+ }
204
+ renderDeliveryMessage() {
205
+ if (this.isLoadingPromises) {
206
+ return (h("div", { class: "s-delivery-promise-loading" }, h("salla-skeleton", { height: "20px", width: "80%" })));
207
+ }
208
+ if (!this.deliveryMessage) {
209
+ return null;
210
+ }
211
+ return (h("div", { class: "s-delivery-promise-message" }, this.deliveryMessage));
212
+ }
213
+ render() {
214
+ // Not on product page or delivery-promises disabled — hide entirely
215
+ if (!this.requiresShipping) {
216
+ return null;
217
+ }
218
+ // Initial city fetch: show skeleton to avoid blank period and layout shift
219
+ if (this.isLoadingCities) {
220
+ return this.renderInitialLoadingSkeleton();
221
+ }
222
+ // Fetch done but no cities / error — hide
223
+ if (!this.canRender || this.cities.length === 0) {
224
+ return null;
225
+ }
226
+ return (h(Host, { class: "s-delivery-promise-wrapper" }, h("div", { class: "s-delivery-promise-container" }, h("div", { class: "s-delivery-promise-header", onClick: (e) => this.toggleDropdown(e) }, h("div", { class: "s-delivery-promise-location" }, h("span", { class: "s-delivery-promise-title" }, this.labels.deliveryTo, " ", this.selectedCity?.name || this.labels.selectCity)), h("i", { class: `sicon-keyboard_arrow_down s-delivery-promise-arrow ${this.isDropdownOpen ? 'open' : ''}` })), this.hasError && (h("div", { class: "s-delivery-promise-error" }, this.errorMessage)), this.isDropdownOpen && this.renderDropdown(), !this.hasError && this.renderDeliveryMessage())));
227
+ }
228
+ static get is() { return "salla-delivery-promise"; }
229
+ static get states() {
230
+ return {
231
+ "cities": {},
232
+ "filteredCities": {},
233
+ "selectedCity": {},
234
+ "deliveryMessage": {},
235
+ "isLoadingCities": {},
236
+ "isLoadingPromises": {},
237
+ "isDropdownOpen": {},
238
+ "searchQuery": {},
239
+ "hasError": {},
240
+ "errorMessage": {},
241
+ "labels": {},
242
+ "canRender": {},
243
+ "requiresShipping": {}
244
+ };
245
+ }
246
+ static get elementRef() { return "host"; }
247
+ }
@@ -0,0 +1,51 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import { h, Host } from "@stencil/core";
5
+ /**
6
+ * @name SallaFulfillmentMethods
7
+ * @description Displays product fulfillment options (pickup and delivery) as two side-by-side cards
8
+ * @tag salla-fulfillment-methods
9
+ */
10
+ export class SallaFulfillmentMethods {
11
+ constructor() {
12
+ this.methods = [];
13
+ this.shouldRender = false;
14
+ }
15
+ async componentDidLoad() {
16
+ await Salla.onReady();
17
+ await Salla.lang.onLoaded();
18
+ if (!Salla.config.get('store.support_pickup'))
19
+ return;
20
+ this.shouldRender = true;
21
+ this.setLabels();
22
+ }
23
+ setLabels() {
24
+ this.methods = [
25
+ {
26
+ id: 'delivery',
27
+ title: Salla.lang.getWithDefault('pages.products.promise_delivery_title', 'متاح للتوصيل'),
28
+ subtitle: Salla.lang.getWithDefault('pages.products.promise_delivery_subtitle', 'طلبك يوصلك لباب البيت بسهولة.'),
29
+ iconClass: 'sicon-location',
30
+ },
31
+ {
32
+ id: 'pickup',
33
+ title: Salla.lang.getWithDefault('pages.products.promise_pickup_title', 'متاح للاستلام'),
34
+ subtitle: Salla.lang.getWithDefault('pages.products.promise_pickup_subtitle', 'استلام فوري من أقرب فرع.'),
35
+ iconClass: 'sicon-store',
36
+ },
37
+ ];
38
+ }
39
+ render() {
40
+ if (!this.shouldRender)
41
+ return null;
42
+ return (h(Host, { class: "s-fulfillment-methods" }, h("div", { class: "s-fulfillment-methods-list" }, this.methods.map((method) => (h("div", { key: method.id, class: "s-fulfillment-methods-card" }, h("div", { class: "s-fulfillment-methods-content" }, h("div", { class: "s-fulfillment-methods-icon-wrap" }, h("i", { class: `${method.iconClass} s-fulfillment-methods-icon` })), h("div", { class: "s-fulfillment-methods-text" }, h("span", { class: "s-fulfillment-methods-title" }, method.title), h("span", { class: "s-fulfillment-methods-subtitle" }, method.subtitle)))))))));
43
+ }
44
+ static get is() { return "salla-fulfillment-methods"; }
45
+ static get states() {
46
+ return {
47
+ "methods": {},
48
+ "shouldRender": {}
49
+ };
50
+ }
51
+ }
@@ -26,6 +26,11 @@ export class SallaGifting {
26
26
  this.selectedCountryId = undefined;
27
27
  this.selectedCountryCode = undefined;
28
28
  this.loadingCities = false;
29
+ this.loadingRegions = false;
30
+ this.regions = [];
31
+ this.selectedRegionId = undefined;
32
+ this.isKSA = false;
33
+ this.step2Animated = false;
29
34
  this.showTextArea = false;
30
35
  /// Gift Form Data
31
36
  this.selectedImage = undefined;
@@ -60,6 +65,8 @@ export class SallaGifting {
60
65
  this.selectCountry = salla.lang.get('pages.checkout.select_country');
61
66
  this.selectCityInfo = salla.lang.get('blocks.buy_as_gift.city_info');
62
67
  this.receiverCityFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_city');
68
+ this.receiverRegionFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_region') || salla.lang.get('pages.checkout.region');
69
+ this.selectRegion = salla.lang.get('pages.checkout.select_region');
63
70
  this.receiverEmailFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_email');
64
71
  this.emailPlaceholder = salla.lang.get('common.elements.email_placeholder');
65
72
  this.sendLater = salla.lang.get('blocks.buy_as_gift.send_later');
@@ -137,7 +144,7 @@ export class SallaGifting {
137
144
  */
138
145
  async setWrapperHeight(asStep = 1, delay = 250, additionSpace = 0, newHeight = 0) {
139
146
  let currentStep = document.querySelector(`#${this.hostId} .gift-step-${asStep}`);
140
- setTimeout(() => {
147
+ const updateHeight = () => {
141
148
  let currentStepHeight = currentStep.offsetHeight;
142
149
  if (newHeight) {
143
150
  this.stepsWrapper.style.height = `${newHeight}px`;
@@ -145,7 +152,13 @@ export class SallaGifting {
145
152
  else {
146
153
  this.stepsWrapper.style.height = currentStepHeight + additionSpace + 'px';
147
154
  }
148
- }, delay);
155
+ };
156
+ if (this.step2Animated && asStep === 2) {
157
+ requestAnimationFrame(updateHeight);
158
+ }
159
+ else {
160
+ setTimeout(updateHeight, delay);
161
+ }
149
162
  }
150
163
  toggleCalendar() {
151
164
  this.showCalendar = !this.showCalendar;
@@ -214,6 +227,7 @@ export class SallaGifting {
214
227
  item.classList.remove('opacity-0');
215
228
  item.removeAttribute('style');
216
229
  });
230
+ this.step2Animated = true;
217
231
  }
218
232
  }, '-=1200');
219
233
  this.currentStep = 2;
@@ -255,6 +269,7 @@ export class SallaGifting {
255
269
  }
256
270
  }, '-=1200');
257
271
  stepBackAnime.play();
272
+ this.step2Animated = false;
258
273
  this.setWrapperHeight(1, 600, 0);
259
274
  this.currentStep = 1;
260
275
  this.parentClass = `is-current-step-${this.currentStep}`;
@@ -304,23 +319,72 @@ export class SallaGifting {
304
319
  this.clearError('receiver.city_id');
305
320
  }
306
321
  async handleCountryChange(event) {
307
- const countryId = event.target.value;
322
+ const countryId = Number(event.target.value);
308
323
  this.selectedCountryId = countryId;
309
324
  this.clearError('receiver.country');
310
325
  // Find the selected country and store its country_code
311
326
  const selectedCountry = this.gift?.countries?.find(country => country.id == countryId);
312
327
  this.selectedCountryCode = selectedCountry?.country_code;
328
+ this.isKSA = selectedCountry?.country_code === 'SA';
329
+ // Reset region and city
330
+ this.regions = [];
331
+ this.selectedRegionId = undefined;
332
+ this.gift = { ...this.gift, cities: [] };
333
+ this.receiverCity = undefined;
313
334
  if (!countryId || this.gift?.countries?.length === 0) {
314
- this.gift = { ...this.gift, cities: [] };
315
- this.receiverCity = undefined;
316
335
  this.selectedCountryCode = undefined;
336
+ this.isKSA = false;
337
+ this.setWrapperHeight(2, 0, 0);
317
338
  return;
318
339
  }
319
- this.loadingCities = true;
340
+ if (this.isKSA) {
341
+ // For KSA, fetch regions first
342
+ this.loadingRegions = true;
343
+ this.setWrapperHeight(2, 0, 0);
344
+ try {
345
+ const response = await salla.api.request(`shipping/countries/${countryId}/regions`);
346
+ if (response && response.data) {
347
+ this.regions = response.data;
348
+ }
349
+ }
350
+ catch (error) {
351
+ console.error('Error fetching regions:', error);
352
+ }
353
+ finally {
354
+ this.loadingRegions = false;
355
+ this.setWrapperHeight(2, 0, 0);
356
+ }
357
+ }
358
+ else {
359
+ // For non-KSA, fetch cities directly
360
+ this.loadingCities = true;
361
+ this.setWrapperHeight(2, 0, 0);
362
+ try {
363
+ const response = await salla.api.request(`shipping/cities?for_branch=0&country_id=${countryId}`);
364
+ if (response && response.data) {
365
+ this.gift = { ...this.gift, cities: response.data };
366
+ }
367
+ }
368
+ catch (error) {
369
+ console.error('Error fetching cities:', error);
370
+ }
371
+ finally {
372
+ this.loadingCities = false;
373
+ }
374
+ }
375
+ }
376
+ async handleRegionChange(event) {
377
+ const regionId = Number(event.target.value);
378
+ this.selectedRegionId = regionId;
379
+ this.clearError('receiver.region');
380
+ // Reset city when region changes
320
381
  this.gift = { ...this.gift, cities: [] };
321
382
  this.receiverCity = undefined;
383
+ if (!regionId)
384
+ return;
385
+ this.loadingCities = true;
322
386
  try {
323
- const response = await salla.api.request(`shipping/cities?for_branch=0&country_id=${countryId}`);
387
+ const response = await salla.api.request(`shipping/cities?for_branch=0&country_id=${this.selectedCountryId}&region_id=${regionId}`);
324
388
  if (response && response.data) {
325
389
  this.gift = { ...this.gift, cities: response.data };
326
390
  }
@@ -330,6 +394,7 @@ export class SallaGifting {
330
394
  }
331
395
  finally {
332
396
  this.loadingCities = false;
397
+ this.setWrapperHeight(2, 0, 0);
333
398
  }
334
399
  }
335
400
  handleUploadImage(img) {
@@ -385,6 +450,7 @@ export class SallaGifting {
385
450
  { key: 'receiver.mobile', value: this.receiverMobile, label: this.receiverMobileFieldLabel },
386
451
  ...(this.physicalProducts ? [
387
452
  { key: 'receiver.country', value: this.selectedCountryId, label: this.receiverCountryFieldLabel },
453
+ ...(this.isKSA ? [{ key: 'receiver.region', value: this.selectedRegionId, label: this.receiverRegionFieldLabel }] : []),
388
454
  { key: 'receiver.city_id', value: this.receiverCity, label: this.receiverCityFieldLabel },
389
455
  ] : []),
390
456
  ];
@@ -411,6 +477,7 @@ export class SallaGifting {
411
477
  mobile_country_code: this.receiverCountryCode,
412
478
  mobile: this.receiverMobile,
413
479
  ...(this.physicalProducts && this.selectedCountryCode ? { country_code: this.selectedCountryCode } : {}),
480
+ ...(this.physicalProducts && this.selectedRegionId ? { region_id: this.selectedRegionId } : {}),
414
481
  ...(this.receiverCity && this.physicalProducts ? { city_id: this.receiverCity } : {})
415
482
  },
416
483
  has_apple_pay: salla.helpers.hasApplePay(),
@@ -435,6 +502,10 @@ export class SallaGifting {
435
502
  this.setWrapperHeight(2, 150, 0);
436
503
  });
437
504
  }
505
+ step2ItemClass(extra = '') {
506
+ const base = `anime-item${this.step2Animated ? '' : ' opacity-0'}`;
507
+ return extra ? `${extra} ${base}` : base;
508
+ }
438
509
  generateClass() {
439
510
  return {
440
511
  "s-gifting-widget": true,
@@ -468,7 +539,7 @@ export class SallaGifting {
468
539
  }
469
540
  render() {
470
541
  return [
471
- h("div", { key: '5959120e43b44cd294d9466003422efb26090897' }, h("salla-list-tile", { key: '6ba52f5157d734e4c8443a9b4a59703d69eb8e84', class: this.generateClass() }, h("div", { key: '26130f1b0e64f7dcc488f2865a19c04c4da28afe', slot: "title" }, this.vertical ? h("span", { innerHTML: GiftSharing }) : '', h("h3", { key: 'b26949ce590efdeb7d364bbb65f04cc2e58eb396' }, !!this.widgetTitle ? this.widgetTitle : this.sectionTitle)), h("div", { key: 'bfa36868bc7681aa8fb218dcaa032a414609413c', slot: "subtitle" }, h("div", { key: 'b070fb428965fd7f2f58573970d5d0604564f682' }, !!this.widgetSubtitle ? this.widgetSubtitle : this.sectionSubtitle)), h("div", { key: '343729605e7b97a7a35e63ca26b46ef2b48d5d8e', slot: "action" }, h("salla-button", { key: 'f8d6e1d5f60ea02a271b504fd3daa36215e9a8f3', color: "primary", fill: "outline", width: "wide", class: "s-gifting-widget-action", onClick: () => this.handleGiftButtonClick() }, h("slot", { key: 'c9cc5ec40b0e09aa99e15f464701deb5c9a3f486', name: "widget-btn-content" }, h("div", { key: '5b431294450b2c45bc5b3503e022d03872cd4252', class: "s-gifting-widget-action-content" }, h("span", { key: '4397140781cf6e311de760e384e1b0f3f429eeeb', innerHTML: GiftSharing }), " \u00A0", h("span", { key: 'e993b5010cca3eb5c09ab6abc592d29c149292bb' }, this.sectionBtnText)))))), h("salla-modal", { key: '13a1010f08acd0c9ef7bdd4eafd3488ae083b0a4', id: this.hostId, isLoading: true, class: "s-gifting-modal", width: "sm", ref: modal => this.modal = modal }, h("div", { key: '0eea1fa6d0ea8240d198e8e7fdd68dc7327fa817', slot: "loading" }, h("div", { key: '9e98de0165db06a39e51984419cb93dcb4bd40ad', class: "s-gifting-skeleton" }, h("div", { key: 'd302e19b737bc272ccece10bfca0eb019b6ca2cf', class: "s-gifting-modal-header" }, h("salla-skeleton", { key: '787d98c862475e7a263d4d501842d0b769e9be4a', type: 'circle', height: '5rem', width: '5rem' }), h("h2", { key: '86b67bbbe29fe5b1bad587432652f36480269c86', class: "s-gifting-modal-title" }, h("div", { key: 'af9eb2262a435ce110e355b75f5c0ebdd2a3acdc', class: "s-gifting-modal-badge-wrapper" }, h("salla-skeleton", { key: '9311ddd1eb3afdc7c02530451eafc27bbba8b776', height: '15px', width: '150px' })))), h("div", { key: '5c87083930311249c7ea735697c3c7d20be4b2e7', class: "s-gifting-skeleton-content" }, h("salla-skeleton", { key: 'f42adea83216bc972863bd56c5ba0b5f02df6eb1', height: '10px', width: '150px' }), h("salla-skeleton", { key: '7781766e62dedadff68943e69bc97b54fe6eb22b', height: '230px' }), h("salla-skeleton", { key: 'a61810158f2edf8b0f7ed0f44c4985ca1f4b01e7', height: '10px', width: '150px' }), h("salla-skeleton", { key: '2f2763deca90fcfe66a462befbfb7072decf63c1', height: '30px' }), h("salla-skeleton", { key: '2f34b53353830532c900e70660a81d9124bbc1e8', height: '40px' })))), h("slot", { key: 'd6f51bf3ee6a11019d25150e26c45fa80a534c43', name: "header" }), !!this.hasError ?
542
+ h("div", { key: '5d0eec8210f77d166c144704ec78bffcaf1f4ce0' }, h("salla-list-tile", { key: '19cc20b4f70bbb8a7d267f60052db77589901962', class: this.generateClass() }, h("div", { key: '1c3c52b5ac48e71a6ac26c60494657ac28d16457', slot: "title" }, this.vertical ? h("span", { innerHTML: GiftSharing }) : '', h("h3", { key: 'e3379fb3ed39d1bc63500346058b26b883c3be13' }, !!this.widgetTitle ? this.widgetTitle : this.sectionTitle)), h("div", { key: 'f6c2a522727546aa27cef725faa8be082da063da', slot: "subtitle" }, h("div", { key: '7b58ad967f39fa2cc660369b72e73f8dc49f90dc' }, !!this.widgetSubtitle ? this.widgetSubtitle : this.sectionSubtitle)), h("div", { key: '848396dcd6ce6009ebc4cf1a209a055ad1adbf15', slot: "action" }, h("salla-button", { key: '2ba69b670f1c958784c6f1dca6b2dd0b93f20859', color: "primary", fill: "outline", width: "wide", class: "s-gifting-widget-action", onClick: () => this.handleGiftButtonClick() }, h("slot", { key: '6ac9ac339e321fc9433465cfd75f299307ee7152', name: "widget-btn-content" }, h("div", { key: 'c61dd36375886c1ecf87f115e5248dca1af7efc9', class: "s-gifting-widget-action-content" }, h("span", { key: '0c8a3630ba6b15889fc4bf3d55a1279cdf713400', innerHTML: GiftSharing }), " \u00A0", h("span", { key: 'c9299ec752e5393f30a78e1e01d367be9e97ca50' }, this.sectionBtnText)))))), h("salla-modal", { key: '9ee17e79f97eee59d25d9627d5b1cd4ada7cadb3', id: this.hostId, isLoading: true, class: "s-gifting-modal", width: "sm", ref: modal => this.modal = modal }, h("div", { key: 'aba3b6a4d3e903934c9b5e629119c3a3b5bc90ab', slot: "loading" }, h("div", { key: 'e03613cc85bf4024f63d2e256a2744ec78f7eabf', class: "s-gifting-skeleton" }, h("div", { key: '01156691d540ce5ef5723902610a1da27fba3ddb', class: "s-gifting-modal-header" }, h("salla-skeleton", { key: 'e45b4868e4fa5633aeb22f758f75f5412290b179', type: 'circle', height: '5rem', width: '5rem' }), h("h2", { key: '2b427d38dd6e0569e16de84ef46eb2052d23b739', class: "s-gifting-modal-title" }, h("div", { key: 'c4f9cb6f513e3ebd2e6ad209648a1f70bcafbcb5', class: "s-gifting-modal-badge-wrapper" }, h("salla-skeleton", { key: 'e684b682a4cca89262128cca13604b7aa9a83cd7', height: '15px', width: '150px' })))), h("div", { key: '2941865d68cd216b4dd82bb8279f6bcbaa062bf3', class: "s-gifting-skeleton-content" }, h("salla-skeleton", { key: '7c4f4235a666930ceef3dc0b38809aea5ee5ce5c', height: '10px', width: '150px' }), h("salla-skeleton", { key: '0257f401762a11b0bf3da7db603b4e5f57bd1aae', height: '230px' }), h("salla-skeleton", { key: 'cced26b189549fcee4eff3a3fbd943a5735b4c6c', height: '10px', width: '150px' }), h("salla-skeleton", { key: 'f5893e5c631564c91bfe42c4102190d43f913947', height: '30px' }), h("salla-skeleton", { key: '64d3738017cf6732b429848c1de4ca16db1adc06', height: '40px' })))), h("slot", { key: '77d5bda8147f7f09d73b97fd7456121626b465a7', name: "header" }), !!this.hasError ?
472
543
  h("salla-placeholder", { alignment: "center" }, h("span", { slot: "title" }, this.errorMessage || salla.lang.get('common.errors.empty_results')), h("span", { slot: "description" }, " "))
473
544
  :
474
545
  [
@@ -477,14 +548,18 @@ export class SallaGifting {
477
548
  h("salla-slider", { id: "gifting-slider", loop: false, "controls-outer": true, class: "s-gifting-slider", type: "carousel" }, h("div", { slot: "items" }, this.gift && this.gift.gift_images ?
478
549
  this.gift?.gift_images.map((item) => h("a", { class: "s-gifting-clickable s-gifting-image", onClick: () => this.setPreview(item) }, h("img", { style: { "width": "120px" }, src: item.url, alt: `${item.id}` }))) : ''))
479
550
  : ""), h("div", { class: "anime-item" }, h("div", { class: "s-form-group s-gifting-selectText", ref: el => this.textSelect = el }, h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, h("option", { "data-id": null, selected: true }, this.selectGiftMessage), this.gift && this.gift.gift_texts ?
480
- this.gift?.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)) : '', h("option", { "data-id": "custom" }, this.giftCustomText))), h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide", ref: (el) => this.customTextArea = el }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2", ref: el => this.step2Elems = el }, h("div", { class: this.errors && this.errors['sender_name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ?
481
- h("span", { class: "s-gifting-error" }, this.errors['sender_name']) : ''), h("div", { class: this.errors && this.errors['receiver.name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ?
482
- h("span", { class: "s-gifting-error" }, this.errors['receiver.name']) : ''), h("div", { class: this.errors && this.errors['receiver.mobile'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ?
551
+ this.gift?.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)) : '', h("option", { "data-id": "custom" }, this.giftCustomText))), h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide", ref: (el) => this.customTextArea = el }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2", ref: el => this.step2Elems = el }, h("div", { class: this.step2ItemClass(this.errors?.['sender_name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ?
552
+ h("span", { class: "s-gifting-error" }, this.errors['sender_name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ?
553
+ h("span", { class: "s-gifting-error" }, this.errors['receiver.name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.mobile'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ?
483
554
  h("span", { class: "s-gifting-error" }, this.errors['receiver.mobile']) : ''), this.physicalProducts &&
484
- h("div", null, h("div", { class: this.errors && this.errors['receiver.country'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { class: "s-form-label" }, this.receiverCountryFieldLabel), h("select", { name: "country", class: "s-form-control", onChange: (event) => this.handleCountryChange(event), required: true }, h("option", { value: "" }, this.selectCountry), this.gift?.countries?.map((country) => (h("option", { value: country.id }, country.name)))), this.errors && this.errors['receiver.country'] ?
485
- h("span", { class: "s-gifting-error" }, this.errors['receiver.country']) : ''), h("div", { class: this.errors && this.errors['receiver.city_id'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { class: "s-form-label" }, this.receiverCityFieldLabel), h("select", { name: "city", "aria-label": salla.lang.get('blocks.buy_as_gift.select_city'), class: "s-form-control", onChange: (event) => this.handleReceiverCity(event), disabled: this.loadingCities }, h("option", { value: "", selected: true }, this.loadingCities ? salla.lang.get('common.elements.loading') : this.selectCity), this.gift?.cities?.map((city) => (h("option", { value: city.id }, city.name)))), this.errors && this.errors['receiver.city_id'] ?
486
- h("span", { class: "s-gifting-error" }, this.errors['receiver.city_id']) : ''), h("div", { class: "s-gifting-info anime-item opacity-0" }, h("span", { innerHTML: Alert }), h("span", null, this.selectCityInfo))), !this.physicalProducts && h("div", { class: "anime-item opacity-0" }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: `schedule-${this.hostId}` }, h("input", { type: "checkbox", name: 'schedule', id: `schedule-${this.hostId}`, onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: "s-gifting-step-two-footer anime-item opacity-0" }, h("a", { href: "#!", innerHTML: LeftArrow, onClick: (e) => this.goToStep1(e) }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
487
- ], h("slot", { key: 'a08d6d434a1d144bd7aa5d3b13754980083a3f4d', name: "footer" })))
555
+ h("div", { class: this.step2ItemClass(this.errors?.['receiver.country'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverCountryFieldLabel), h("select", { name: "country", class: "s-form-control", onChange: (event) => this.handleCountryChange(event), required: true }, h("option", { value: "" }, this.selectCountry), this.gift?.countries?.map((country) => (h("option", { value: country.id }, country.name)))), this.errors && this.errors['receiver.country'] ?
556
+ h("span", { class: "s-gifting-error" }, this.errors['receiver.country']) : ''), this.physicalProducts && this.isKSA &&
557
+ h("div", { class: this.step2ItemClass(this.errors?.['receiver.region'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverRegionFieldLabel), h("select", { name: "region", class: "s-form-control", onChange: (event) => this.handleRegionChange(event), disabled: this.loadingRegions }, h("option", { value: "", selected: true }, this.loadingRegions ? salla.lang.get('common.elements.loading') : this.selectRegion), this.regions?.map((region) => (h("option", { value: region.id }, region.name)))), this.errors && this.errors['receiver.region'] ?
558
+ h("span", { class: "s-gifting-error" }, this.errors['receiver.region']) : ''), this.physicalProducts &&
559
+ h("div", { class: this.step2ItemClass(this.errors?.['receiver.city_id'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverCityFieldLabel), h("select", { name: "city", "aria-label": salla.lang.get('blocks.buy_as_gift.select_city'), class: "s-form-control", onChange: (event) => this.handleReceiverCity(event), disabled: this.loadingCities || (this.isKSA && !this.selectedRegionId) }, h("option", { value: "", selected: true }, this.loadingCities ? salla.lang.get('common.elements.loading') : this.selectCity), this.gift?.cities?.map((city) => (h("option", { value: city.id }, city.name)))), this.errors && this.errors['receiver.city_id'] ?
560
+ h("span", { class: "s-gifting-error" }, this.errors['receiver.city_id']) : ''), this.physicalProducts &&
561
+ h("div", { class: this.step2ItemClass('s-gifting-info') }, h("span", { innerHTML: Alert }), h("span", null, this.selectCityInfo)), !this.physicalProducts && h("div", { class: this.step2ItemClass() }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: `schedule-${this.hostId}` }, h("input", { type: "checkbox", name: 'schedule', id: `schedule-${this.hostId}`, onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: this.step2ItemClass('s-gifting-step-two-footer') }, h("a", { href: "#!", innerHTML: LeftArrow, onClick: (e) => this.goToStep1(e) }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
562
+ ], h("slot", { key: '46da7ff69a3c10b75886a23936f2f9ad8ad0e7bf', name: "footer" })))
488
563
  ];
489
564
  }
490
565
  static get is() { return "salla-gifting"; }
@@ -639,6 +714,8 @@ export class SallaGifting {
639
714
  "selectCity": {},
640
715
  "selectCityInfo": {},
641
716
  "receiverCityFieldLabel": {},
717
+ "receiverRegionFieldLabel": {},
718
+ "selectRegion": {},
642
719
  "receiverEmailFieldLabel": {},
643
720
  "emailPlaceholder": {},
644
721
  "sendLater": {},
@@ -657,6 +734,10 @@ export class SallaGifting {
657
734
  "selectedCountryId": {},
658
735
  "selectedCountryCode": {},
659
736
  "loadingCities": {},
737
+ "loadingRegions": {},
738
+ "regions": {},
739
+ "selectedRegionId": {},
740
+ "isKSA": {},
660
741
  "parsedFormData": {},
661
742
  "showTextArea": {},
662
743
  "selectedImage": {},