@salla.sa/twilight-components 2.14.272 → 2.14.273

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 (247) hide show
  1. package/dist/cjs/{filepond-EG2Mf8a1.js → filepond-B6LUaQ9F.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DjNsnxTw.js → filepond-plugin-file-poster-DlB67Vv3.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-BlM1btNO.js → filepond-plugin-file-validate-size-D7kuqaEC.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DhymSoh9.js → filepond-plugin-file-validate-type-CliXp1Qt.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BQfvfpQ1.js → filepond-plugin-image-edit-BRIZbIyN.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-DOi06s13.js → filepond-plugin-image-exif-orientation-bFbWHyQs.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-Rfix7Xbt.js → filepond-plugin-image-preview-24nxaVX6.js} +1 -1
  8. package/dist/cjs/{index-DS7mXxWq.js → index-BpUrZ_-D.js} +136 -26
  9. package/dist/cjs/{index-vIV5iX-W.js → index-xI-pRoDr.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +3 -4
  11. package/dist/cjs/{salla-add-product-button_51.cjs.entry.js → salla-accordion_62.cjs.entry.js} +2104 -120
  12. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-notification-item.cjs.entry.js +2 -2
  25. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  28. package/dist/cjs/{salla-accordion_4.cjs.entry.js → salla-order-details-options.cjs.entry.js} +1 -100
  29. package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
  30. package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
  31. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-payments.cjs.entry.js +3 -3
  33. package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
  34. package/dist/cjs/salla-review-card.cjs.entry.js +2 -2
  35. package/dist/cjs/salla-reviews-page.cjs.entry.js +2 -2
  36. package/dist/cjs/salla-reviews.cjs.entry.js +2 -2
  37. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  38. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  40. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  42. package/dist/cjs/twilight.cjs.js +3 -4
  43. package/dist/collection/collection-manifest.json +5 -0
  44. package/dist/collection/components/salla-accordion/salla-accordion-head.js +8 -2
  45. package/dist/collection/components/salla-comments/salla-comments.js +20 -1
  46. package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +33 -5
  47. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.css +0 -0
  48. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +89 -0
  49. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.css +0 -0
  50. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +195 -0
  51. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.css +3 -0
  52. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +595 -0
  53. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.css +0 -0
  54. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +174 -0
  55. package/dist/collection/components/salla-multiple-bundle-product/interfaces.js +1 -0
  56. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.css +3 -0
  57. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +132 -0
  58. package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
  59. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
  60. package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
  61. package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
  62. package/dist/collection/components/salla-payments/salla-payments.js +2 -2
  63. package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
  64. package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
  65. package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
  66. package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
  67. package/dist/collection/components/salla-product-options/salla-product-options.js +105 -22
  68. package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
  69. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
  70. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +1 -1
  71. package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
  72. package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
  73. package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
  74. package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
  75. package/dist/collection/components/salla-search/salla-search.js +3 -3
  76. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  77. package/dist/collection/components/salla-slider/salla-slider.js +2 -2
  78. package/dist/collection/components/salla-social/salla-social.js +1 -1
  79. package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
  80. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  81. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  82. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  83. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  84. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  85. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  86. package/dist/components/index.js +2 -2
  87. package/dist/components/salla-accordion-head2.js +2 -2
  88. package/dist/components/salla-comments.js +20 -1
  89. package/dist/components/salla-conditional-fields2.js +28 -6
  90. package/dist/components/salla-multiple-bundle-product-cart.d.ts +11 -0
  91. package/dist/components/salla-multiple-bundle-product-cart.js +9 -0
  92. package/dist/components/salla-multiple-bundle-product-cart2.js +153 -0
  93. package/dist/components/salla-multiple-bundle-product-details.d.ts +11 -0
  94. package/dist/components/salla-multiple-bundle-product-details.js +9 -0
  95. package/dist/components/salla-multiple-bundle-product-details2.js +283 -0
  96. package/dist/components/salla-multiple-bundle-product-options-modal.d.ts +11 -0
  97. package/dist/components/salla-multiple-bundle-product-options-modal.js +9 -0
  98. package/dist/components/salla-multiple-bundle-product-options-modal2.js +585 -0
  99. package/dist/components/salla-multiple-bundle-product-slider.d.ts +11 -0
  100. package/dist/components/salla-multiple-bundle-product-slider.js +9 -0
  101. package/dist/components/salla-multiple-bundle-product-slider2.js +81 -0
  102. package/dist/components/salla-multiple-bundle-product.d.ts +11 -0
  103. package/dist/components/salla-multiple-bundle-product.js +210 -0
  104. package/dist/components/salla-notification-item2.js +1 -1
  105. package/dist/components/salla-offer-modal.js +1 -1
  106. package/dist/components/salla-order-details.js +1 -1
  107. package/dist/components/salla-order-summary.js +1 -1
  108. package/dist/components/salla-payments.js +2 -2
  109. package/dist/components/salla-placeholder2.js +1 -1
  110. package/dist/components/salla-price-range2.js +2 -2
  111. package/dist/components/salla-product-availability2.js +1 -1
  112. package/dist/components/salla-product-card2.js +5 -5
  113. package/dist/components/salla-product-options.js +1 -810
  114. package/dist/{esm/salla-product-options.entry.js → components/salla-product-options2.js} +197 -30
  115. package/dist/components/salla-product-size-guide.js +2 -2
  116. package/dist/components/salla-quantity-input.js +1 -1
  117. package/dist/components/salla-quick-buy2.js +1 -1
  118. package/dist/components/salla-review-card2.js +1 -1
  119. package/dist/components/salla-reviews-page.js +1 -1
  120. package/dist/components/salla-reviews.js +1 -1
  121. package/dist/components/salla-scopes.js +1 -1
  122. package/dist/components/salla-search.js +3 -3
  123. package/dist/components/salla-skeleton2.js +1 -1
  124. package/dist/components/salla-slider2.js +2 -2
  125. package/dist/components/salla-social-share.js +1 -1
  126. package/dist/components/salla-social.js +1 -1
  127. package/dist/components/salla-tab-content2.js +1 -1
  128. package/dist/components/salla-tab-header2.js +1 -1
  129. package/dist/components/salla-tabs2.js +1 -1
  130. package/dist/components/salla-tel-input2.js +1 -1
  131. package/dist/components/salla-tooltip2.js +1 -1
  132. package/dist/components/salla-user-settings.js +1 -1
  133. package/dist/esm/{filepond-DbR8YXoW.js → filepond-C8M-qAIs.js} +1 -1
  134. package/dist/esm/{filepond-plugin-file-poster-DEj3O3wZ.js → filepond-plugin-file-poster-UfHq-uvl.js} +1 -1
  135. package/dist/esm/{filepond-plugin-file-validate-size-DYnIp5yF.js → filepond-plugin-file-validate-size-DZ15xnJZ.js} +1 -1
  136. package/dist/esm/{filepond-plugin-file-validate-type-Cx_PD8SU.js → filepond-plugin-file-validate-type-CWR9opI0.js} +1 -1
  137. package/dist/esm/{filepond-plugin-image-edit-BwmXRkmP.js → filepond-plugin-image-edit-XbR1h-bg.js} +1 -1
  138. package/dist/esm/{filepond-plugin-image-exif-orientation-BtsMS4U-.js → filepond-plugin-image-exif-orientation-cSRDvvXQ.js} +1 -1
  139. package/dist/esm/{filepond-plugin-image-preview-DQ0c3hIt.js → filepond-plugin-image-preview-B-SvzNFg.js} +1 -1
  140. package/dist/esm/{index-xiIpq8fU.js → index-Q_DltBmK.js} +1 -1
  141. package/dist/esm/{index-D5PGwR59.js → index-gLeBNvS1.js} +136 -26
  142. package/dist/esm/loader.js +3 -4
  143. package/dist/esm/{salla-add-product-button_51.entry.js → salla-accordion_62.entry.js} +2084 -111
  144. package/dist/esm/salla-advertisement.entry.js +1 -1
  145. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  146. package/dist/esm/salla-apps-icons.entry.js +1 -1
  147. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  148. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  149. package/dist/esm/salla-contacts.entry.js +1 -1
  150. package/dist/esm/salla-filters-widget.entry.js +1 -1
  151. package/dist/esm/salla-filters.entry.js +1 -1
  152. package/dist/esm/salla-installment.entry.js +1 -1
  153. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  154. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  155. package/dist/esm/salla-metadata.entry.js +1 -1
  156. package/dist/esm/salla-notification-item.entry.js +2 -2
  157. package/dist/esm/salla-notifications.entry.js +1 -1
  158. package/dist/esm/salla-offer.entry.js +1 -1
  159. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  160. package/dist/esm/{salla-accordion_4.entry.js → salla-order-details-options.entry.js} +2 -98
  161. package/dist/esm/salla-order-details.entry.js +2 -2
  162. package/dist/esm/salla-order-summary.entry.js +2 -2
  163. package/dist/esm/salla-orders.entry.js +1 -1
  164. package/dist/esm/salla-payments.entry.js +3 -3
  165. package/dist/esm/salla-price-range.entry.js +3 -3
  166. package/dist/esm/salla-review-card.entry.js +2 -2
  167. package/dist/esm/salla-reviews-page.entry.js +2 -2
  168. package/dist/esm/salla-reviews.entry.js +2 -2
  169. package/dist/esm/salla-social.entry.js +2 -2
  170. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  171. package/dist/esm/salla-tooltip.entry.js +2 -2
  172. package/dist/esm/salla-verify.entry.js +1 -1
  173. package/dist/esm/salla-wallet.entry.js +1 -1
  174. package/dist/esm/twilight.js +3 -4
  175. package/dist/twilight/{p-4611a11b.entry.js → p-00d8544c.entry.js} +1 -1
  176. package/dist/twilight/{p-b40d5871.entry.js → p-06d126b6.entry.js} +1 -1
  177. package/dist/twilight/{p-2bf21126.entry.js → p-1cc68ef5.entry.js} +1 -1
  178. package/dist/twilight/{p-BsHa_73h.js → p-1ekWkYOJ.js} +1 -1
  179. package/dist/twilight/p-21b37923.entry.js +4 -0
  180. package/dist/twilight/{p-bcab2639.entry.js → p-263b9b06.entry.js} +1 -1
  181. package/dist/twilight/{p-8ba8efe1.entry.js → p-2787ff9f.entry.js} +1 -1
  182. package/dist/twilight/p-3c1484b9.entry.js +11 -0
  183. package/dist/twilight/{p-c15928d5.entry.js → p-5057b400.entry.js} +1 -1
  184. package/dist/twilight/{p-280c1f64.entry.js → p-5278b873.entry.js} +1 -1
  185. package/dist/twilight/{p-e3b0a71f.entry.js → p-56f7a2ba.entry.js} +1 -1
  186. package/dist/twilight/{p-65b1fcea.entry.js → p-697db5c6.entry.js} +1 -1
  187. package/dist/twilight/{p-b94ebbd9.entry.js → p-73a8296a.entry.js} +1 -1
  188. package/dist/twilight/{p-eae51196.entry.js → p-7603a820.entry.js} +1 -1
  189. package/dist/twilight/{p-56fa3b9c.entry.js → p-7c8d7ca3.entry.js} +1 -1
  190. package/dist/twilight/{p-e95284d7.entry.js → p-80a07063.entry.js} +1 -1
  191. package/dist/twilight/{p-eaad31d1.entry.js → p-82c156ab.entry.js} +1 -1
  192. package/dist/twilight/{p-7df916fc.entry.js → p-8380c411.entry.js} +1 -1
  193. package/dist/twilight/{p-a61e2b8e.entry.js → p-946e5649.entry.js} +1 -1
  194. package/dist/twilight/{p-f3c29342.entry.js → p-9bcd9c87.entry.js} +1 -1
  195. package/dist/twilight/p-9c477fdf.entry.js +4 -0
  196. package/dist/twilight/{p-DV_VEuIe.js → p-B-nQtFTN.js} +1 -1
  197. package/dist/twilight/{p-DEUne75O.js → p-BI2zk2yo.js} +1 -1
  198. package/dist/twilight/{p-C4wd-bXb.js → p-BRD27esZ.js} +1 -1
  199. package/dist/twilight/{p-Bvez5luh.js → p-CUYEEJ4c.js} +1 -1
  200. package/dist/twilight/{p-CH8-uKSN.js → p-DUvdNUoC.js} +1 -1
  201. package/dist/twilight/{p-D0ZZ4jO5.js → p-DhR67rwu.js} +1 -1
  202. package/dist/twilight/p-a01dd6b7.entry.js +4 -0
  203. package/dist/twilight/{p-9e3f55be.entry.js → p-a3e000ef.entry.js} +1 -1
  204. package/dist/twilight/{p-3f412ab2.entry.js → p-a6c14a64.entry.js} +1 -1
  205. package/dist/twilight/p-b0b79820.entry.js +4 -0
  206. package/dist/twilight/{p-10856491.entry.js → p-b5581886.entry.js} +1 -1
  207. package/dist/twilight/p-b81437f4.entry.js +4 -0
  208. package/dist/twilight/{p-de200512.entry.js → p-bf010154.entry.js} +1 -1
  209. package/dist/twilight/{p-0ffafdea.entry.js → p-c0388251.entry.js} +1 -1
  210. package/dist/twilight/{p-2613f6dc.entry.js → p-c9ab361e.entry.js} +1 -1
  211. package/dist/twilight/{p-92848d53.entry.js → p-ed85bc00.entry.js} +1 -1
  212. package/dist/twilight/p-f7863a58.entry.js +4 -0
  213. package/dist/twilight/{p-D5PGwR59.js → p-gLeBNvS1.js} +2 -2
  214. package/dist/twilight/{p-D5p2t_CX.js → p-j4lbZMJ0.js} +1 -1
  215. package/dist/twilight/twilight.esm.js +1 -1
  216. package/dist/types/components/salla-accordion/salla-accordion-head.d.ts +6 -0
  217. package/dist/types/components/salla-conditional-fields/salla-conditional-fields.d.ts +2 -0
  218. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.d.ts +10 -0
  219. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.d.ts +20 -0
  220. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.d.ts +46 -0
  221. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.d.ts +22 -0
  222. package/dist/types/components/salla-multiple-bundle-product/interfaces.d.ts +101 -0
  223. package/dist/types/components/salla-multiple-bundle-product/salla-multiple-bundle-product.d.ts +42 -0
  224. package/dist/types/components/salla-product-options/salla-product-options.d.ts +21 -1
  225. package/dist/types/components.d.ts +298 -2
  226. package/package.json +5 -5
  227. package/dist/cjs/app-globals-OVEmNa5W.js +0 -38
  228. package/dist/cjs/camera-DytepEoK.js +0 -13
  229. package/dist/cjs/minus-CCryh1qf.js +0 -21
  230. package/dist/cjs/salla-booking-field_2.cjs.entry.js +0 -280
  231. package/dist/cjs/salla-product-options.cjs.entry.js +0 -715
  232. package/dist/esm/app-globals-BKgAyoNJ.js +0 -36
  233. package/dist/esm/camera-C6jIkM-X.js +0 -11
  234. package/dist/esm/minus-DfeagqF1.js +0 -18
  235. package/dist/esm/salla-booking-field_2.entry.js +0 -277
  236. package/dist/twilight/p-19c38b4a.entry.js +0 -11
  237. package/dist/twilight/p-8272b58f.entry.js +0 -4
  238. package/dist/twilight/p-989fcbb4.entry.js +0 -4
  239. package/dist/twilight/p-9f47b72b.entry.js +0 -4
  240. package/dist/twilight/p-C6jIkM-X.js +0 -4
  241. package/dist/twilight/p-DfeagqF1.js +0 -4
  242. package/dist/twilight/p-KHt1Smzh.js +0 -4
  243. package/dist/twilight/p-b8d41065.entry.js +0 -4
  244. package/dist/twilight/p-dd9695d6.entry.js +0 -4
  245. package/dist/twilight/p-e2ebb686.entry.js +0 -4
  246. package/dist/twilight/p-e30f7c20.entry.js +0 -4
  247. package/dist/twilight/p-fcb3e719.entry.js +0 -4
@@ -1,280 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- 'use strict';
5
-
6
- var index = require('./index-DS7mXxWq.js');
7
-
8
- var BookingTime = `<!-- Generated by IcoMoon.io -->
9
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
10
- <title>calendar-time</title>
11
- <path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>
12
- </svg>
13
- `;
14
-
15
- var Calendar = `<!-- Generated by IcoMoon.io -->
16
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
17
- <title>calendar</title>
18
- <path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>
19
- </svg>
20
- `;
21
-
22
- var TimeIcon = `<!-- Generated by IcoMoon.io -->
23
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
24
- <title>time</title>
25
- <path d="M16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>
26
- </svg>
27
- `;
28
-
29
- const sallaBookingFieldCss = ":host{display:block}";
30
-
31
- const SallaBookingField = class {
32
- constructor(hostRef) {
33
- index.registerInstance(this, hostRef);
34
- this.invalidInput = index.createEvent(this, "invalidInput");
35
- this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment', 'حجز موعد');
36
- this.editLabel = salla.lang.get('pages.cart.edit_an_appointment', 'تعديل الموعد');
37
- this.bookedLabel = salla.lang.get('pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');
38
- this.selectDate = salla.lang.get('pages.cart.select_appointment_date', 'حدد تاريخ الموعد');
39
- this.bookingUrl = '';
40
- this.iframeReady = false;
41
- this.reservations = [];
42
- // Load translations
43
- salla.lang.onLoaded(() => this.setTranslations());
44
- // Register event listeners
45
- Salla.event.on('booking::open', (data) => this.handleBookingOpen(data));
46
- }
47
- async setTranslations() {
48
- const setNestedAsync = (lang, key, value) => {
49
- return new Promise((resolve) => {
50
- salla.helpers.setNested(salla.lang.messages[lang], key, value);
51
- resolve(true);
52
- });
53
- };
54
- await setNestedAsync('ar.trans', 'pages.cart.book_an_appointment', 'حجز موعد');
55
- await setNestedAsync('en.trans', 'pages.cart.book_an_appointment', 'Book an Appointment');
56
- await setNestedAsync('ar.trans', 'pages.cart.edit_an_appointment', 'تعديل الموعد');
57
- await setNestedAsync('en.trans', 'pages.cart.edit_an_appointment', 'Edit an Appointment');
58
- await setNestedAsync('ar.trans', 'pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');
59
- await setNestedAsync('en.trans', 'pages.cart.booked_successfully', 'Booked Successfully');
60
- await setNestedAsync('ar.trans', 'pages.cart.select_appointment_date', 'حدد تاريخ الموعد');
61
- await setNestedAsync('en.trans', 'pages.cart.select_appointment_date', 'Select appointment date');
62
- this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment');
63
- this.editLabel = salla.lang.get('pages.cart.edit_an_appointment');
64
- this.bookedLabel = salla.lang.get('pages.cart.booked_successfully');
65
- this.selectDate = salla.lang.get('pages.cart.select_appointment_date');
66
- }
67
- openBookingModal(event, afterReload = false) {
68
- if (afterReload && (!event.detail || typeof event.detail !== 'number' || event.detail !== this.productId)) {
69
- return;
70
- }
71
- if (salla.config.isGuest()) {
72
- this.setAfterReloadEvent('booking::open-after-reload', this.productId);
73
- salla.event.dispatch('login::open');
74
- return;
75
- }
76
- salla.booking.add(this.productId, false)
77
- .then((resp) => {
78
- if (resp.data.redirect.to !== 'booking') {
79
- throw new Error('Unexpected redirect!');
80
- }
81
- salla.event.dispatch('booking::open', { url: resp.data.redirect.url, id: this.productId });
82
- })
83
- .catch((error) => {
84
- salla.error(salla.lang.get('common.errors.error_occurred'));
85
- salla.logger.error(error.response || error);
86
- });
87
- }
88
- handleBookingOpen(data) {
89
- if (data.id !== this.productId)
90
- return;
91
- this.bookingUrl = salla.url.addParamToUrl('product_id', data.id, data.url);
92
- this.iframeReady = true;
93
- setTimeout(() => {
94
- this.modal.setTitle(this.selectDate);
95
- this.modal.open();
96
- }, 100);
97
- }
98
- setAfterReloadEvent(event, payload) {
99
- salla.storage.set('afterReloadEvent', { event, payload });
100
- }
101
- emitAfterReloadEvent() {
102
- const eventDetails = salla.storage.get('afterReloadEvent');
103
- if (eventDetails && eventDetails.event) {
104
- const customEvent = new CustomEvent(eventDetails.event, {
105
- detail: eventDetails.payload
106
- });
107
- window.dispatchEvent(customEvent);
108
- salla.storage.remove('afterReloadEvent');
109
- }
110
- }
111
- componentWillLoad() {
112
- if (this.option && this.option.details.length) {
113
- this.reservations = this.option.details;
114
- }
115
- }
116
- componentDidLoad() {
117
- window.addEventListener('booking::open-after-reload', (event) => this.openBookingModal(event, true));
118
- this.emitAfterReloadEvent();
119
- window.addEventListener('message', this.handleMessageEvent.bind(this));
120
- this.reservationsInput.addEventListener('invalid', e => this.invalidInput.emit(e));
121
- this.reservationsInput.addEventListener('input', () => {
122
- this.reservationsInput.setCustomValidity('');
123
- this.reservationsInput.reportValidity();
124
- });
125
- }
126
- handleMessageEvent(event) {
127
- if (event.data.source !== 'booking')
128
- return;
129
- const action = event.data.type;
130
- const value = event.data.message;
131
- if (localStorage.getItem('debug'))
132
- console.log(`Received an action:${action}`, event.data);
133
- if (action === 'error') {
134
- if (value.fields?.reservation) {
135
- salla.notify.error(value.fields.reservation[0]);
136
- return;
137
- }
138
- const errorList = Object.values(value.fields || [value.message]).flat().map(error => `<li>${error}</li>`).join('');
139
- salla.notify.error(`<ul>${errorList}</ul>`);
140
- }
141
- if (action === 'success') {
142
- if (Number(value.productId) !== Number(this.productId))
143
- return;
144
- this.reservations = value.data.reservations.map(schedule => {
145
- if (schedule.time && schedule.time.length > 0) {
146
- const timeSlot = schedule.time[0];
147
- return {
148
- date: schedule.date,
149
- day: schedule.day,
150
- from_timestamp: timeSlot.from,
151
- to_timestamp: timeSlot.to,
152
- };
153
- }
154
- return null;
155
- }).filter(item => item !== null);
156
- salla.notify.success(this.bookedLabel);
157
- this.modal?.close();
158
- setTimeout(() => window.location.reload());
159
- }
160
- if (action === 'height') {
161
- this.iframe.height = value?.height + 'px';
162
- }
163
- }
164
- bookingModal() {
165
- return (index.h("salla-modal", { class: "s-booking-field-modal", ref: modal => (this.modal = modal), width: "md", position: "middle", noPadding: true }, index.h("iframe", { ref: iframe => (this.iframe = iframe), src: this.bookingUrl, frameborder: "0" })));
166
- }
167
- renderReservationDate(reservation) {
168
- return (index.h("span", { class: reservation.from_timestamp ? 's-booking-field-reservations-has-time' : '' }, index.h("i", { class: "s-booking-field-reservations-icon", innerHTML: Calendar }), reservation.date));
169
- }
170
- renderReservationTime(reservation) {
171
- if (!reservation.from_timestamp)
172
- return '';
173
- return (index.h("span", { class: "s-booking-field-reservations-time" }, index.h("i", { class: "s-booking-field-reservations-icon", innerHTML: TimeIcon }), index.h("span", null, reservation.from_timestamp, " - ", reservation.to_timestamp)));
174
- }
175
- render() {
176
- return (index.h(index.Host, { key: '04c9e3dc3dc825bd6905221d858c260f7ca34748' }, index.h("div", { key: '07ec38cec1bd1798640dd7ea9592bb3b17d945c6', class: "s-booking-field-main" }, this.option.required || this.reservations.length > 0 ? index.h("div", { class: "s-booking-field-price" }, index.h("span", { innerHTML: salla.money(this.option.price) })) : '', index.h("salla-button", { key: '6b71889cfc0429d15c466a6f194df31549f09786', class: "s-booking-field-book-now", size: "small", loaderPosition: "center", fill: "outline", onClick: event => this.openBookingModal(event, false) }, index.h("span", { key: 'a16f8db6f52c7751ea605efcae04057ca0dc5b61', class: "s-booking-field-book-now-content" }, index.h("span", { key: '95f6086a599bcc620c87ece6c6ae9620dba15581', innerHTML: BookingTime }), this.reservations.length ? this.editLabel : this.bookNowLabel))), this.reservations.length > 0 && (index.h("div", { key: 'b3615100bbfff3d98d0ac99145aaf53449790c94', class: "s-booking-field-reservations" }, this.reservations.map((reservation, index$1) => (index.h("div", { key: index$1, class: "s-booking-field-reservations-item" }, this.renderReservationDate(reservation), this.renderReservationTime(reservation)))))), index.h("input", { key: '126f14f2e520b8696bc7450e209bad30b267878b', class: "s-hidden", name: this.option.name, required: this.option.required, value: JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations), ref: reservations => this.reservationsInput = reservations }), this.iframeReady && this.bookingModal()));
177
- }
178
- get host() { return index.getElement(this); }
179
- };
180
- SallaBookingField.style = sallaBookingFieldCss;
181
-
182
- const SallaConditionalFields = class {
183
- constructor(hostRef) {
184
- index.registerInstance(this, hostRef);
185
- }
186
- hideAllOptions(optionId) {
187
- this.host.querySelectorAll(`[data-show-when^="options[${optionId}"]`).forEach((field) => {
188
- field.classList.add('hidden');
189
- this.hideAllOptions(field.dataset.optionId);
190
- this.disableInputs(field);
191
- });
192
- }
193
- disableInputs(field) {
194
- field.querySelectorAll('[name]').forEach((input) => {
195
- input.setAttribute('disabled', '');
196
- input.removeAttribute('required');
197
- if (input?.tagName?.toLowerCase() === 'select') {
198
- input.value = '';
199
- }
200
- if (['checkbox'].includes(input.getAttribute('type')) && input.hasOwnProperty('checked')) {
201
- // @ts-ignore
202
- input.checked = false;
203
- }
204
- });
205
- }
206
- changeHandler(event) {
207
- salla.event.emit('salla-onditional-fields::change', event);
208
- salla.log('Received the change event: ', event);
209
- if (!event.target || !['SELECT'].includes(event.target.tagName) && !['checkbox', 'radio'].includes(event.target.getAttribute('type'))) {
210
- salla.log('Ignore the change because is not a supported input: ' + (event?.target?.tagName || 'N/A'));
211
- return;
212
- }
213
- let optionId = event.target.name.replace('[]', '');
214
- let isMultiple = event.target.getAttribute('type') === 'checkbox';
215
- let isRadio = event.target.getAttribute('type') === 'radio';
216
- salla.log('Trying to find all elements with condition:', `[data-show-when^="${optionId}"]`);
217
- this.host.querySelectorAll(`[data-show-when^="${optionId}"]`)
218
- .forEach((field) => {
219
- let isEqual = !field?.dataset.showWhen.includes('!=');
220
- let value = field?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$3').trim();
221
- let isSelected;
222
- if (isMultiple) {
223
- let selectedValues = Array.from(this.host.querySelectorAll(`input[name="${event.target.name}"]:checked`), e => e?.value);
224
- isSelected = selectedValues.includes(value.toString());
225
- }
226
- else if (isRadio) {
227
- // Handle radio inputs.
228
- isSelected = event.target.checked && event.target.value === value;
229
- }
230
- else {
231
- isSelected = value === event.target.value;
232
- }
233
- salla.log('The input is ', isMultiple ? 'Multiple' : isRadio ? 'Radio' : 'Single', ' value:', isSelected);
234
- let showTheInput = (isEqual && isSelected) || (!isEqual && !isSelected);
235
- if (showTheInput) {
236
- field.classList.remove('hidden');
237
- field.querySelectorAll('[name]').forEach((input) => {
238
- input.removeAttribute('disabled');
239
- const closestProductOption = input.closest('.s-product-options-option');
240
- if (closestProductOption.dataset.optionRequired === 'true') {
241
- input.setAttribute('required', '');
242
- }
243
- if (input.getAttribute('type') === 'checkbox') {
244
- const checkboxes = Array.from(document.querySelectorAll(`input[type="checkbox"][name="${input.getAttribute('name')}"]`));
245
- const isAnyChecked = checkboxes.some((checkbox) => checkbox.checked);
246
- if (isAnyChecked) {
247
- checkboxes.forEach((checkbox) => {
248
- checkbox.removeAttribute('required');
249
- });
250
- }
251
- }
252
- });
253
- }
254
- else {
255
- this.hideAllOptions(field.dataset.optionId);
256
- field.classList.add('hidden');
257
- this.disableInputs(field);
258
- }
259
- });
260
- }
261
- componentDidRender() {
262
- this.host.querySelectorAll(`[data-show-when]`).forEach((field) => {
263
- // @ts-ignore
264
- let optionName = field?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$1').trim();
265
- if (!optionName) {
266
- return;
267
- }
268
- this.changeHandler({
269
- target: this.host.querySelector('[name^="' + optionName + '"]')
270
- });
271
- });
272
- }
273
- render() {
274
- return (index.h(index.Host, { key: '405156ba83b8731039c2dd0ff800f617150cc722' }, index.h("slot", { key: '2bff17ce7b49fef9b028d673992d256b00e9481b' })));
275
- }
276
- get host() { return index.getElement(this); }
277
- };
278
-
279
- exports.salla_booking_field = SallaBookingField;
280
- exports.salla_conditional_fields = SallaConditionalFields;