@salla.sa/twilight-theme-engine 1.0.63 → 1.0.65

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 (223) hide show
  1. package/dist/{AddToCartForm-365O6IQY.js → AddToCartForm-NKXOZ6TW.js} +3 -3
  2. package/dist/{AddToCartForm-365O6IQY.js.map → AddToCartForm-NKXOZ6TW.js.map} +1 -1
  3. package/dist/{BlogAuthorPage-QIII3YRK.js → BlogAuthorPage-GQPWTGT2.js} +9 -9
  4. package/dist/{BlogAuthorPage-QIII3YRK.js.map → BlogAuthorPage-GQPWTGT2.js.map} +1 -1
  5. package/dist/{BlogCategoryPage-HNGWYTN6.js → BlogCategoryPage-LTSZDBIZ.js} +9 -9
  6. package/dist/{BlogCategoryPage-HNGWYTN6.js.map → BlogCategoryPage-LTSZDBIZ.js.map} +1 -1
  7. package/dist/{BlogPage-7NGO5VLL.js → BlogPage-QN7QL562.js} +7 -7
  8. package/dist/{BlogPage-7NGO5VLL.js.map → BlogPage-QN7QL562.js.map} +1 -1
  9. package/dist/{BlogSinglePage-Y42LPA2L.js → BlogSinglePage-7GVVVVBL.js} +7 -7
  10. package/dist/{BlogSinglePage-Y42LPA2L.js.map → BlogSinglePage-7GVVVVBL.js.map} +1 -1
  11. package/dist/{BlogTagPage-ZCFYLXH6.js → BlogTagPage-QKYXFRET.js} +9 -9
  12. package/dist/{BlogTagPage-ZCFYLXH6.js.map → BlogTagPage-QKYXFRET.js.map} +1 -1
  13. package/dist/{BrandsPage-PPJVASUW.js → BrandsPage-LF5NVBUE.js} +8 -8
  14. package/dist/{BrandsPage-PPJVASUW.js.map → BrandsPage-LF5NVBUE.js.map} +1 -1
  15. package/dist/{Breadcrumb-4DUAJK3V.js → Breadcrumb-E7KDHZX4.js} +7 -7
  16. package/dist/{Breadcrumb-4DUAJK3V.js.map → Breadcrumb-E7KDHZX4.js.map} +1 -1
  17. package/dist/{CartItem-T4N3HMXU.js → CartItem-RB5CTJT6.js} +7 -7
  18. package/dist/{CartItem-T4N3HMXU.js.map → CartItem-RB5CTJT6.js.map} +1 -1
  19. package/dist/{CartSummary-Z25JDFWN.js → CartSummary-JCYQ2SQD.js} +12 -7
  20. package/dist/CartSummary-JCYQ2SQD.js.map +1 -0
  21. package/dist/{Copyright-WNJIDKSR.js → Copyright-XXSKQ3TB.js} +3 -3
  22. package/dist/{Copyright-WNJIDKSR.js.map → Copyright-XXSKQ3TB.js.map} +1 -1
  23. package/dist/{CustomerLayout-A6DVYYC3.js → CustomerLayout-CBFF4QEB.js} +27 -11
  24. package/dist/CustomerLayout-CBFF4QEB.js.map +1 -0
  25. package/dist/{Footer-3YBOSAO5.js → Footer-NFN2EMI2.js} +7 -7
  26. package/dist/{Footer-3YBOSAO5.js.map → Footer-NFN2EMI2.js.map} +1 -1
  27. package/dist/{Header-6M7TVMSW.js → Header-THQIZ2IR.js} +5 -5
  28. package/dist/{Header-6M7TVMSW.js.map → Header-THQIZ2IR.js.map} +1 -1
  29. package/dist/{LoyaltyPage-XQJ6RDT6.js → LoyaltyPage-5SLR7TJX.js} +7 -7
  30. package/dist/{LoyaltyPage-XQJ6RDT6.js.map → LoyaltyPage-5SLR7TJX.js.map} +1 -1
  31. package/dist/{LoyaltyPointsPage-K75LJNNP.js → LoyaltyPointsPage-HSXFTJUH.js} +3 -3
  32. package/dist/{LoyaltyPointsPage-K75LJNNP.js.map → LoyaltyPointsPage-HSXFTJUH.js.map} +1 -1
  33. package/dist/{MainMenu-V7GPKDTU.js → MainMenu-7SVMOZ6P.js} +3 -3
  34. package/dist/{MainMenu-V7GPKDTU.js.map → MainMenu-7SVMOZ6P.js.map} +1 -1
  35. package/dist/{MasterLayout-MBQ4JM3D.js → MasterLayout-7IHDLNPZ.js} +7 -7
  36. package/dist/{MasterLayout-MBQ4JM3D.js.map → MasterLayout-7IHDLNPZ.js.map} +1 -1
  37. package/dist/{MobileMenu-UFX4ZHW7.js → MobileMenu-7HKRWQBQ.js} +7 -7
  38. package/dist/{MobileMenu-UFX4ZHW7.js.map → MobileMenu-7HKRWQBQ.js.map} +1 -1
  39. package/dist/{NotificationsPage-M3YK2HRM.js → NotificationsPage-4JX7GFXF.js} +7 -7
  40. package/dist/{NotificationsPage-M3YK2HRM.js.map → NotificationsPage-4JX7GFXF.js.map} +1 -1
  41. package/dist/OrderSinglePage-B7TBZ7TX.js +719 -0
  42. package/dist/OrderSinglePage-B7TBZ7TX.js.map +1 -0
  43. package/dist/OrdersPage-XZ2DAJYB.js +68 -0
  44. package/dist/OrdersPage-XZ2DAJYB.js.map +1 -0
  45. package/dist/{PageSingle-HRMSVNHN.js → PageSingle-QWT77P4S.js} +3 -3
  46. package/dist/{PageSingle-HRMSVNHN.js.map → PageSingle-QWT77P4S.js.map} +1 -1
  47. package/dist/{ProductDetails-GAC3NYQM.js → ProductDetails-5IQHNQPS.js} +3 -3
  48. package/dist/{ProductDetails-GAC3NYQM.js.map → ProductDetails-5IQHNQPS.js.map} +1 -1
  49. package/dist/{ProfilePage-33I2XTJ6.js → ProfilePage-R2JDY6BF.js} +7 -7
  50. package/dist/{ProfilePage-33I2XTJ6.js.map → ProfilePage-R2JDY6BF.js.map} +1 -1
  51. package/dist/{SeoCartWidget-AEG2YLEF.js → SeoCartWidget-I2FBWKI4.js} +7 -7
  52. package/dist/{SeoCartWidget-AEG2YLEF.js.map → SeoCartWidget-I2FBWKI4.js.map} +1 -1
  53. package/dist/{SettingsPage-N3M677LP.js → SettingsPage-7X5YPAXL.js} +7 -7
  54. package/dist/{SettingsPage-N3M677LP.js.map → SettingsPage-7X5YPAXL.js.map} +1 -1
  55. package/dist/{StoreClosedNotification-5MTDRRC3.js → StoreClosedNotification-5F4I3N27.js} +8 -8
  56. package/dist/{StoreClosedNotification-5MTDRRC3.js.map → StoreClosedNotification-5F4I3N27.js.map} +1 -1
  57. package/dist/{TestimonialsPage-Z64P6MZX.js → TestimonialsPage-7YXSU33Z.js} +3 -3
  58. package/dist/{TestimonialsPage-Z64P6MZX.js.map → TestimonialsPage-7YXSU33Z.js.map} +1 -1
  59. package/dist/{ThankYouPage-ZXQZMWCX.js → ThankYouPage-7BN53JTK.js} +7 -7
  60. package/dist/{ThankYouPage-ZXQZMWCX.js.map → ThankYouPage-7BN53JTK.js.map} +1 -1
  61. package/dist/{WalletPage-557AU5GH.js → WalletPage-JKXQSYPX.js} +7 -7
  62. package/dist/{WalletPage-557AU5GH.js.map → WalletPage-JKXQSYPX.js.map} +1 -1
  63. package/dist/{WishlistPage-HTDQW2N2.js → WishlistPage-CSFHKERP.js} +9 -9
  64. package/dist/{WishlistPage-HTDQW2N2.js.map → WishlistPage-CSFHKERP.js.map} +1 -1
  65. package/dist/api/brands.js +2 -2
  66. package/dist/api/cart.d.ts +5 -0
  67. package/dist/api/cart.d.ts.map +1 -1
  68. package/dist/api/cart.js +2 -2
  69. package/dist/api/category.js +2 -2
  70. package/dist/api/loyalty.js +2 -2
  71. package/dist/api/order.d.ts +22 -0
  72. package/dist/api/order.d.ts.map +1 -1
  73. package/dist/api/order.js +2 -2
  74. package/dist/api/page.js +2 -2
  75. package/dist/api/product.js +2 -2
  76. package/dist/api/wishlist.js +3 -3
  77. package/dist/{chunk-Q5UYV2EN.js → chunk-24QOBDMC.js} +8 -4
  78. package/dist/chunk-24QOBDMC.js.map +1 -0
  79. package/dist/{chunk-KILNHLWE.js → chunk-2BRCE7MK.js} +4 -4
  80. package/dist/{chunk-KILNHLWE.js.map → chunk-2BRCE7MK.js.map} +1 -1
  81. package/dist/{chunk-YEY3SO23.js → chunk-2QNDO2OY.js} +12 -3
  82. package/dist/chunk-2QNDO2OY.js.map +1 -0
  83. package/dist/{chunk-LUTMPFRW.js → chunk-347K33DP.js} +3 -3
  84. package/dist/{chunk-LUTMPFRW.js.map → chunk-347K33DP.js.map} +1 -1
  85. package/dist/{chunk-KHRIGLYL.js → chunk-43XFO6KF.js} +3 -3
  86. package/dist/{chunk-KHRIGLYL.js.map → chunk-43XFO6KF.js.map} +1 -1
  87. package/dist/{chunk-EIJXSBL6.js → chunk-55VTMG2H.js} +31 -51
  88. package/dist/chunk-55VTMG2H.js.map +1 -0
  89. package/dist/{chunk-UFPZXWGM.js → chunk-65JM62NV.js} +4 -4
  90. package/dist/{chunk-UFPZXWGM.js.map → chunk-65JM62NV.js.map} +1 -1
  91. package/dist/{chunk-HSVGQ2DV.js → chunk-6AV7RQ6H.js} +27 -21
  92. package/dist/chunk-6AV7RQ6H.js.map +1 -0
  93. package/dist/{chunk-KWHCKGLL.js → chunk-A6SKDX5E.js} +3 -3
  94. package/dist/{chunk-KWHCKGLL.js.map → chunk-A6SKDX5E.js.map} +1 -1
  95. package/dist/chunk-D5UIBY3V.js +47 -0
  96. package/dist/chunk-D5UIBY3V.js.map +1 -0
  97. package/dist/{chunk-Y7HKVYDG.js → chunk-EBMMJWX6.js} +7 -7
  98. package/dist/{chunk-Y7HKVYDG.js.map → chunk-EBMMJWX6.js.map} +1 -1
  99. package/dist/{chunk-YLPI4HDD.js → chunk-FY573DJA.js} +6 -6
  100. package/dist/{chunk-YLPI4HDD.js.map → chunk-FY573DJA.js.map} +1 -1
  101. package/dist/{chunk-EXKTSWBC.js → chunk-GRV7ELSP.js} +5 -5
  102. package/dist/{chunk-EXKTSWBC.js.map → chunk-GRV7ELSP.js.map} +1 -1
  103. package/dist/{chunk-PE3LLBNR.js → chunk-GXDBY4WB.js} +3 -3
  104. package/dist/{chunk-PE3LLBNR.js.map → chunk-GXDBY4WB.js.map} +1 -1
  105. package/dist/{chunk-I62RENKM.js → chunk-KBQXQKPZ.js} +14 -2
  106. package/dist/chunk-KBQXQKPZ.js.map +1 -0
  107. package/dist/{chunk-IC7YN4OQ.js → chunk-OJPJP7ML.js} +3 -3
  108. package/dist/{chunk-IC7YN4OQ.js.map → chunk-OJPJP7ML.js.map} +1 -1
  109. package/dist/{chunk-VLBQPVHM.js → chunk-P6DV6EHM.js} +3 -3
  110. package/dist/{chunk-VLBQPVHM.js.map → chunk-P6DV6EHM.js.map} +1 -1
  111. package/dist/{chunk-NPEI4SAZ.js → chunk-PDMVQCEV.js} +3 -3
  112. package/dist/{chunk-NPEI4SAZ.js.map → chunk-PDMVQCEV.js.map} +1 -1
  113. package/dist/{chunk-W66OHTSM.js → chunk-QYUYQPXN.js} +3 -3
  114. package/dist/{chunk-W66OHTSM.js.map → chunk-QYUYQPXN.js.map} +1 -1
  115. package/dist/{chunk-XFCJM6RN.js → chunk-RWTZH6G3.js} +16 -12
  116. package/dist/chunk-RWTZH6G3.js.map +1 -0
  117. package/dist/{chunk-OBSAH7K6.js → chunk-SVPXQCOA.js} +12 -4
  118. package/dist/chunk-SVPXQCOA.js.map +1 -0
  119. package/dist/{chunk-4KTY2FT6.js → chunk-UEKIAED3.js} +6 -6
  120. package/dist/{chunk-4KTY2FT6.js.map → chunk-UEKIAED3.js.map} +1 -1
  121. package/dist/{chunk-UH5ZXDEO.js → chunk-WF7DYPR6.js} +3 -3
  122. package/dist/{chunk-UH5ZXDEO.js.map → chunk-WF7DYPR6.js.map} +1 -1
  123. package/dist/chunk-XMZPFHE7.js +14 -0
  124. package/dist/{chunk-JKT44Y2M.js.map → chunk-XMZPFHE7.js.map} +1 -1
  125. package/dist/{chunk-S3CC2YGF.js → chunk-ZBARSETM.js} +3 -3
  126. package/dist/{chunk-S3CC2YGF.js.map → chunk-ZBARSETM.js.map} +1 -1
  127. package/dist/components/cart/CartSummary.d.ts.map +1 -1
  128. package/dist/components/cart/index.js +1 -1
  129. package/dist/components/common/index.js +1 -1
  130. package/dist/components/drawer/index.js +5 -5
  131. package/dist/components/home/index.js +8 -8
  132. package/dist/components/layout/CustomerLayout.d.ts.map +1 -1
  133. package/dist/components/layout/index.js +1 -1
  134. package/dist/components/product/index.js +6 -6
  135. package/dist/components/store/index.js +7 -7
  136. package/dist/components/toast/Toaster.d.ts.map +1 -1
  137. package/dist/components/toast/index.js +1 -1
  138. package/dist/{document-class-SKCL6IJF.js → document-class-ZLPAWZEX.js} +5 -5
  139. package/dist/{document-class-SKCL6IJF.js.map → document-class-ZLPAWZEX.js.map} +1 -1
  140. package/dist/hooks/index.js +5 -5
  141. package/dist/hooks/useGtm.js +5 -5
  142. package/dist/hooks/useMoney.d.ts +3 -3
  143. package/dist/hooks/useMoney.d.ts.map +1 -1
  144. package/dist/hooks/useMoney.js +5 -5
  145. package/dist/hooks/useStore.js +5 -5
  146. package/dist/index.js +5 -5
  147. package/dist/{navigation-YKRXGGSL.js → navigation-DU3BF72V.js} +3 -3
  148. package/dist/{navigation-YKRXGGSL.js.map → navigation-DU3BF72V.js.map} +1 -1
  149. package/dist/{navigation-ESPAHRXM.js → navigation-WB75NC6Y.js} +4 -4
  150. package/dist/{navigation-ESPAHRXM.js.map → navigation-WB75NC6Y.js.map} +1 -1
  151. package/dist/{not-found-KBOXJ3AG.js → not-found-MA54AXJB.js} +8 -8
  152. package/dist/{not-found-KBOXJ3AG.js.map → not-found-MA54AXJB.js.map} +1 -1
  153. package/dist/providers/NavigationProvider.d.ts.map +1 -1
  154. package/dist/providers/index.js +5 -5
  155. package/dist/providers/twilight-init.d.ts.map +1 -1
  156. package/dist/routes/account/notifications/loader.d.ts.map +1 -1
  157. package/dist/routes/account/orders/OrderSinglePage.d.ts +7 -1
  158. package/dist/routes/account/orders/OrderSinglePage.d.ts.map +1 -1
  159. package/dist/routes/account/orders/OrdersPage.d.ts +2 -1
  160. package/dist/routes/account/orders/OrdersPage.d.ts.map +1 -1
  161. package/dist/routes/account/orders/loader.d.ts.map +1 -1
  162. package/dist/routes/account/orders/single/OrderActions.d.ts +7 -0
  163. package/dist/routes/account/orders/single/OrderActions.d.ts.map +1 -0
  164. package/dist/routes/account/orders/single/OrderHeader.d.ts +8 -0
  165. package/dist/routes/account/orders/single/OrderHeader.d.ts.map +1 -0
  166. package/dist/routes/account/orders/single/OrderItemRow.d.ts +9 -0
  167. package/dist/routes/account/orders/single/OrderItemRow.d.ts.map +1 -0
  168. package/dist/routes/account/orders/single/OrderSections.d.ts +23 -0
  169. package/dist/routes/account/orders/single/OrderSections.d.ts.map +1 -0
  170. package/dist/routes/account/orders/single/types.d.ts +53 -0
  171. package/dist/routes/account/orders/single/types.d.ts.map +1 -0
  172. package/dist/routes/account/orders/types.d.ts +3 -0
  173. package/dist/routes/account/orders/types.d.ts.map +1 -1
  174. package/dist/routes/account/orders.js +3 -3
  175. package/dist/routes/account/profile/loader.d.ts.map +1 -1
  176. package/dist/routes/account/settings/loader.d.ts.map +1 -1
  177. package/dist/routes/account/wallet/loader.d.ts.map +1 -1
  178. package/dist/routes/account/wishlist/loader.d.ts.map +1 -1
  179. package/dist/routes/account.js +16 -15
  180. package/dist/routes/account.js.map +1 -1
  181. package/dist/routes/blog.js +7 -7
  182. package/dist/routes/brands.js +3 -3
  183. package/dist/routes/cart/CartPage.d.ts.map +1 -1
  184. package/dist/routes/cart.js +14 -18
  185. package/dist/routes/cart.js.map +1 -1
  186. package/dist/routes/home.js +9 -9
  187. package/dist/routes/index.js +2 -2
  188. package/dist/routes/loyalty.js +4 -4
  189. package/dist/routes/page.js +3 -3
  190. package/dist/routes/product-listing.js +12 -11
  191. package/dist/routes/product-listing.js.map +1 -1
  192. package/dist/routes/product.js +8 -8
  193. package/dist/routes/seo-redirects.d.ts +4 -0
  194. package/dist/routes/seo-redirects.d.ts.map +1 -1
  195. package/dist/routes/seo-redirects.js +2 -2
  196. package/dist/routes/testimonials.js +1 -1
  197. package/dist/routes/thank-you.js +3 -3
  198. package/dist/skeleton.js +9 -9
  199. package/dist/tanstack/document-class.d.ts.map +1 -1
  200. package/dist/tanstack/router.d.ts.map +1 -1
  201. package/dist/tanstack.js +6 -6
  202. package/dist/types/salla-sdk.d.ts +1 -1
  203. package/dist/types/salla-sdk.d.ts.map +1 -1
  204. package/dist/vite/adapters/tanstack.adapter.d.ts.map +1 -1
  205. package/dist/vite/index.js +12 -2
  206. package/dist/vite/index.js.map +1 -1
  207. package/package.json +1 -1
  208. package/dist/CartSummary-Z25JDFWN.js.map +0 -1
  209. package/dist/CustomerLayout-A6DVYYC3.js.map +0 -1
  210. package/dist/OrderSinglePage-7LIUMNRB.js +0 -502
  211. package/dist/OrderSinglePage-7LIUMNRB.js.map +0 -1
  212. package/dist/OrdersPage-WI4OSGBF.js +0 -252
  213. package/dist/OrdersPage-WI4OSGBF.js.map +0 -1
  214. package/dist/chunk-EIJXSBL6.js.map +0 -1
  215. package/dist/chunk-HSVGQ2DV.js.map +0 -1
  216. package/dist/chunk-I62RENKM.js.map +0 -1
  217. package/dist/chunk-IIYK56TI.js +0 -29
  218. package/dist/chunk-IIYK56TI.js.map +0 -1
  219. package/dist/chunk-JKT44Y2M.js +0 -14
  220. package/dist/chunk-OBSAH7K6.js.map +0 -1
  221. package/dist/chunk-Q5UYV2EN.js.map +0 -1
  222. package/dist/chunk-XFCJM6RN.js.map +0 -1
  223. package/dist/chunk-YEY3SO23.js.map +0 -1
@@ -0,0 +1,719 @@
1
+ import { order } from './chunk-2QNDO2OY.js';
2
+ import { usePageConfig, useMoney, useDate, useNumber } from './chunk-55VTMG2H.js';
3
+ import './chunk-UEKIAED3.js';
4
+ import './chunk-JKIRRMBU.js';
5
+ import './chunk-2JV6WZ6O.js';
6
+ import './chunk-UIOLSYKV.js';
7
+ import './chunk-VVZNW5CB.js';
8
+ import './chunk-2XGQSJKH.js';
9
+ import { useNavigate, useLocation } from './chunk-KBQXQKPZ.js';
10
+ import './chunk-ZGHRSRDO.js';
11
+ import './chunk-GOPUP26T.js';
12
+ import './chunk-C5X6CVXC.js';
13
+ import { useUser } from './chunk-UZKTK6YV.js';
14
+ import './chunk-5X2UFNKY.js';
15
+ import './chunk-P3OPJL6I.js';
16
+ import './chunk-WY4IYO3G.js';
17
+ import './chunk-TYLKNVQA.js';
18
+ import './chunk-SR4OTLTJ.js';
19
+ import './chunk-N2S25NXP.js';
20
+ import './chunk-TP3LCGE7.js';
21
+ import './chunk-Z653O7MX.js';
22
+ import './chunk-ZCH7W7DZ.js';
23
+ import './chunk-PWBMSGMU.js';
24
+ import './chunk-JWXJPJBO.js';
25
+ import './chunk-CW625T2E.js';
26
+ import './chunk-7V36I5GT.js';
27
+ import './chunk-BVSJPBJ6.js';
28
+ import './chunk-GBWCXUPD.js';
29
+ import './chunk-OAMIDZKW.js';
30
+ import { useTranslation } from './chunk-TYNZ5B2B.js';
31
+ import './chunk-T72DAX7R.js';
32
+ import './chunk-RJPPO3ET.js';
33
+ import { HookSlot, useIsClient } from './chunk-Q7VWURUR.js';
34
+ import './chunk-GU2KUQVD.js';
35
+ import './chunk-WF7DYPR6.js';
36
+ import './chunk-AXW67SY7.js';
37
+ import './chunk-BYMOPN2S.js';
38
+ import './chunk-SKLEJJ6M.js';
39
+ import { useAsyncFn } from './chunk-6BZ5TKEV.js';
40
+ import './chunk-FZKRSGLP.js';
41
+ import './chunk-CUG6VOLM.js';
42
+ import './chunk-HX3YKS5W.js';
43
+ import './chunk-SVPXQCOA.js';
44
+ import { useTwilight } from './chunk-DF6FBKDN.js';
45
+ import './chunk-DGUM43GV.js';
46
+ import { SallaButton } from '@salla.sa/twilight-components-react/button';
47
+ import { SallaRatingModal } from '@salla.sa/twilight-components-react/rating-modal';
48
+ import { SallaEditOrderButton } from '@salla.sa/twilight-components-react/edit-order-button';
49
+ import { SallaOrderBranch } from '@salla.sa/twilight-components-react/order-branch';
50
+ import { SallaOrderTotalsCard } from '@salla.sa/twilight-components-react/order-totals-card';
51
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
52
+ import { createElement, useState } from 'react';
53
+ import { SallaOrderDetails } from '@salla.sa/twilight-components-react/order-details';
54
+ import { SallaModal } from '@salla.sa/twilight-components-react/modal';
55
+ import { SallaRatingStars } from '@salla.sa/twilight-components-react/rating-stars';
56
+ import { useQuery } from '@tanstack/react-query';
57
+
58
+ var PRINT_WINDOW = "toolbar=yes, scrollbars=yes, resizable=yes, width=900, height=700";
59
+ function OrderStatus({ order: order2, paymentExpired }) {
60
+ const { t } = useTranslation();
61
+ if (paymentExpired) {
62
+ return /* @__PURE__ */ jsx("span", { className: "text-red-500", children: t("pages.orders.pending_payment_expired") });
63
+ }
64
+ return /* @__PURE__ */ jsxs(
65
+ "span",
66
+ {
67
+ className: "text-primary inline-flex items-center rtl:space-x-reverse space-x-1",
68
+ style: { color: order2.status.color },
69
+ children: [
70
+ /* @__PURE__ */ jsx("i", { className: `mt-1 ${order2.status.icon}` }),
71
+ /* @__PURE__ */ jsxs("span", { children: [
72
+ " ",
73
+ order2.status.name
74
+ ] })
75
+ ]
76
+ }
77
+ );
78
+ }
79
+ function OrderHeader({
80
+ order: order2,
81
+ links,
82
+ paymentExpired
83
+ }) {
84
+ const { t, direction } = useTranslation();
85
+ const { format: formatDate } = useDate();
86
+ const { format: formatNumber } = useNumber();
87
+ return /* @__PURE__ */ jsx("table", { className: "min-w-full rounded-md overflow-hidden", children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsxs("tr", { className: "bg-white overflow-hidden flex md:table-row flex-row md:flex-row flex-wrap md:flex-no-wrap py-1.5 md:py-0", children: [
88
+ /* @__PURE__ */ jsxs(
89
+ "td",
90
+ {
91
+ "data-testid": "store-order-status",
92
+ className: "single-order-header-item w-full md:w-auto px-3 md:px-6 py-2 md:py-4 md:h-20 whitespace-nowrap text-sm ",
93
+ children: [
94
+ /* @__PURE__ */ jsx("div", { className: "rtl:ml-2 ltr:mr-2 font-normal text-gray-400", children: t("pages.orders.date") }),
95
+ /* @__PURE__ */ jsx("b", { children: formatNumber(formatDate(order2.created_at.date)) })
96
+ ]
97
+ }
98
+ ),
99
+ /* @__PURE__ */ jsxs("td", { className: "single-order-header-item flex justify-between items-center w-full md:w-auto px-3 md:px-6 py-2 md:py-4 md:h-20 whitespace-nowrap text-sm ", children: [
100
+ /* @__PURE__ */ jsx(OrderStatus, { order: order2, paymentExpired }),
101
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
102
+ order2.type === "quote" && /* @__PURE__ */ jsx("span", { className: "text-red-500 ml-4", children: t("pages.orders.your_order_is_under_review") }),
103
+ !!links?.length && /* @__PURE__ */ jsx("div", { className: "flex space-x-2 rtl:space-x-reverse text-start flex-none px-2", children: links.map((link) => /* @__PURE__ */ jsxs(
104
+ "a",
105
+ {
106
+ href: link.url,
107
+ className: "text-primary-reverse bg-primary px-4 py-2 rounded",
108
+ target: "_blank",
109
+ rel: "noreferrer",
110
+ children: [
111
+ link.label,
112
+ " ",
113
+ /* @__PURE__ */ jsx(
114
+ "i",
115
+ {
116
+ className: direction === "rtl" ? "sicon-arrow-up-left" : "sicon-arrow-up-right"
117
+ }
118
+ )
119
+ ]
120
+ },
121
+ link.url
122
+ )) }),
123
+ order2.urls.receipt && /* @__PURE__ */ jsxs(
124
+ SallaButton,
125
+ {
126
+ fill: "outline",
127
+ size: "small",
128
+ onClick: () => window.open(order2.urls.receipt, "_blank", PRINT_WINDOW),
129
+ children: [
130
+ /* @__PURE__ */ jsx("i", { className: "sicon-printer2 v-align" }),
131
+ " ",
132
+ t("pages.orders.print")
133
+ ]
134
+ }
135
+ )
136
+ ] })
137
+ ] })
138
+ ] }) }) });
139
+ }
140
+ function ItemAttachments({ item }) {
141
+ const { t } = useTranslation();
142
+ if (!item.attachments?.length) return null;
143
+ return /* @__PURE__ */ jsx("div", { className: "flow-root rounded-md px-4 border border-gray-200", children: /* @__PURE__ */ jsx("dl", { className: "text-sm text-dark divide-y divide-border-color", children: item.attachments.map((attachment) => /* @__PURE__ */ jsxs(
144
+ "div",
145
+ {
146
+ className: "py-3.5 md:flex items-center justify-between",
147
+ children: [
148
+ /* @__PURE__ */ jsx("dt", { className: "mb-2 md:mb-0", children: t("pages.products.attachments") }),
149
+ /* @__PURE__ */ jsx(
150
+ "dd",
151
+ {
152
+ className: `font-medium ${attachment.type === "image" ? "text-gray-900" : "text-xs"}`,
153
+ children: attachment.type === "image" ? /* @__PURE__ */ jsx("div", { className: "flex rtl:space-x-reverse space-x-2.5", children: /* @__PURE__ */ jsx("a", { href: attachment.url, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ jsx(
154
+ "img",
155
+ {
156
+ className: "h-7 w-7 object-cover rounded-md",
157
+ src: attachment.url,
158
+ alt: item.name
159
+ }
160
+ ) }) }) : /* @__PURE__ */ jsx("a", { href: attachment.url, children: t("pages.orders.file_url") })
161
+ }
162
+ )
163
+ ]
164
+ },
165
+ `${attachment.type}:${attachment.url}`
166
+ )) }) });
167
+ }
168
+ function calendarDay(day) {
169
+ const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(day));
170
+ return match ? new Date(+match[1], +match[2] - 1, +match[3]) : String(day);
171
+ }
172
+ function ItemReservations({ item, productType }) {
173
+ const { t } = useTranslation();
174
+ const { format: formatDate } = useDate();
175
+ const { format: formatNumber, useArabicNumerals } = useNumber();
176
+ const reservations = item.product_reservations ?? [];
177
+ if (productType !== "booking" || !reservations.length) return null;
178
+ const time = (value) => useArabicNumerals ? formatNumber(String(value)).replace(/PM/g, "\u0645").replace(/AM/g, "\u0635") : String(value);
179
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
180
+ item.booking_location && /* @__PURE__ */ jsx("ul", { className: "font-medium text-xs text-gray-600", children: /* @__PURE__ */ jsxs("li", { className: "py-1 flex justify-between items-baseline", children: [
181
+ /* @__PURE__ */ jsx("span", { className: "mt-5 mb-3.5 text-sm font-bold", children: t("common.elements.location") }),
182
+ /* @__PURE__ */ jsx("span", { className: "text-unicode", children: item.booking_location })
183
+ ] }) }),
184
+ /* @__PURE__ */ jsx("h2", { className: "mt-5 mb-3.5 text-sm font-bold", children: reservations.length > 1 ? t("pages.cart.reservations") : t("pages.cart.item_options") }),
185
+ /* @__PURE__ */ jsx("div", { className: "rounded-md p-4 border border-gray-200 mb-2", children: /* @__PURE__ */ jsx("ul", { className: "font-medium text-xs text-gray-600", children: reservations.map((reservation) => /* @__PURE__ */ jsx("li", { className: "py-1", children: /* @__PURE__ */ jsxs("span", { className: "text-unicode", children: [
186
+ formatNumber(formatDate(calendarDay(reservation.day))),
187
+ reservation.from_timestamp ? ` (${time(reservation.from)} - ${time(reservation.to)})` : ""
188
+ ] }) }, `${reservation.day}:${reservation.from}`)) }) })
189
+ ] });
190
+ }
191
+ function ItemSummary({
192
+ item,
193
+ twigItem,
194
+ money,
195
+ currency
196
+ }) {
197
+ const { t } = useTranslation();
198
+ const product = twigItem?.product;
199
+ const image = product?.image?.url || item.image || item.thumbnail;
200
+ const price = item.amounts.amount ?? { amount: 0, currency };
201
+ const priceText = money(price.amount, price.currency);
202
+ const total = item.amounts.total ?? { amount: 0, currency };
203
+ return /* @__PURE__ */ jsxs("div", { className: "mb-5 last:mb-0", children: [
204
+ product ? /* @__PURE__ */ jsxs("div", { className: "flex rtl:space-x-reverse space-x-5 mb-4", children: [
205
+ /* @__PURE__ */ jsx("a", { href: product.url, className: "shrink-0", children: /* @__PURE__ */ jsx(
206
+ "img",
207
+ {
208
+ src: image || "/images/placeholder.png",
209
+ alt: item.name,
210
+ className: `w-18 h-14 object-${image ? "cover" : "contain"} rounded-md`
211
+ }
212
+ ) }),
213
+ /* @__PURE__ */ jsxs("div", { children: [
214
+ /* @__PURE__ */ jsx(
215
+ "a",
216
+ {
217
+ href: product.url,
218
+ className: "block leading-5 mb-1.5 md:text-base font-semibold transition-colors text-gray-500 hover:text-primary",
219
+ children: item.name
220
+ }
221
+ ),
222
+ /* @__PURE__ */ jsx("b", { children: priceText })
223
+ ] })
224
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "w-full flex justify-between text-sm py-2.5", children: [
225
+ /* @__PURE__ */ jsx("span", { className: "w-40 inline-block font-normal", children: item.name }),
226
+ /* @__PURE__ */ jsx("b", { children: priceText })
227
+ ] }),
228
+ /* @__PURE__ */ jsxs("div", { className: "w-full flex justify-between text-sm py-2.5", children: [
229
+ /* @__PURE__ */ jsx("span", { className: "w-40 inline-block font-normal", children: t("pages.products.quantity") }),
230
+ /* @__PURE__ */ jsx("b", { children: item.quantity })
231
+ ] }),
232
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm py-2.5", children: [
233
+ /* @__PURE__ */ jsx("span", { className: " w-40 inline-block font-normal", children: t("pages.products.price") }),
234
+ /* @__PURE__ */ jsx("b", { children: priceText })
235
+ ] }),
236
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm py-2.5", children: [
237
+ /* @__PURE__ */ jsx("span", { className: "w-40 inline-block font-normal", children: t("pages.orders.total") }),
238
+ /* @__PURE__ */ jsx("b", { children: money(total.amount, total.currency) })
239
+ ] })
240
+ ] });
241
+ }
242
+ function OrderItemRow({
243
+ item,
244
+ twigItem,
245
+ money,
246
+ currency
247
+ }) {
248
+ const { t } = useTranslation();
249
+ const productId = twigItem?.product?.id;
250
+ return /* @__PURE__ */ jsxs(
251
+ "div",
252
+ {
253
+ "data-testid": `store-order-item-${item.id}`,
254
+ "data-order-item-id": item.id,
255
+ "data-order-item-product-id": productId,
256
+ className: "order-item bg-white p-5 border-b border-gray-100 first:rounded-t-md last:rounded-b-md last:border-none",
257
+ children: [
258
+ /* @__PURE__ */ jsx(ItemSummary, { item, twigItem, money, currency }),
259
+ item.availability_date && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 text-sm py-2.5 text-blue-500", children: [
260
+ /* @__PURE__ */ jsx("i", { className: "sicon-info" }),
261
+ /* @__PURE__ */ jsxs("span", { children: [
262
+ t("pages.products.expected_to_be"),
263
+ ":",
264
+ " ",
265
+ /* @__PURE__ */ jsx("b", { children: String(item.availability_date).slice(0, 10) })
266
+ ] })
267
+ ] }),
268
+ /* @__PURE__ */ jsx(ItemReservations, { item, productType: twigItem?.product?.type ?? item.product?.type }),
269
+ /* @__PURE__ */ jsx(SallaOrderDetails, { orderDetails: JSON.stringify(twigItem ?? item) }),
270
+ item.note && /* @__PURE__ */ jsxs("p", { className: "mt-3 text-sm text-gray-500", children: [
271
+ /* @__PURE__ */ jsxs("span", { children: [
272
+ t("common.elements.note"),
273
+ " : "
274
+ ] }),
275
+ item.note
276
+ ] }),
277
+ /* @__PURE__ */ jsx(ItemAttachments, { item }),
278
+ productId && createElement("salla-review-order-item", {
279
+ "product-id": productId,
280
+ suppressHydrationWarning: true
281
+ })
282
+ ]
283
+ }
284
+ );
285
+ }
286
+ function ConfirmModal({
287
+ visible,
288
+ onVisibleChange,
289
+ title,
290
+ subTitle,
291
+ iconStyle,
292
+ confirmColor,
293
+ onConfirm,
294
+ busy
295
+ }) {
296
+ const { t } = useTranslation();
297
+ const isClient = useIsClient();
298
+ if (!isClient) return null;
299
+ return /* @__PURE__ */ jsx(
300
+ SallaModal,
301
+ {
302
+ width: "sm",
303
+ visible,
304
+ onModalVisibilityChanged: (e) => onVisibleChange(Boolean(e.detail)),
305
+ ...{ "modal-title": title },
306
+ subTitle,
307
+ iconStyle,
308
+ children: /* @__PURE__ */ jsxs("div", { slot: "footer", className: "grid grid-cols-2 gap-3", children: [
309
+ /* @__PURE__ */ jsx(
310
+ SallaButton,
311
+ {
312
+ width: "wide",
313
+ color: confirmColor,
314
+ className: "w-full cursor-pointer",
315
+ onClick: onConfirm,
316
+ disabled: busy,
317
+ children: t("common.elements.ok")
318
+ }
319
+ ),
320
+ /* @__PURE__ */ jsx(
321
+ SallaButton,
322
+ {
323
+ className: "w-full",
324
+ fill: "outline",
325
+ color: "light",
326
+ onClick: () => onVisibleChange(false),
327
+ disabled: busy,
328
+ children: t("common.elements.cancel")
329
+ }
330
+ )
331
+ ] })
332
+ }
333
+ );
334
+ }
335
+ function PaymentOrReorder({
336
+ order: order2,
337
+ paymentExpired,
338
+ canReorder,
339
+ onReorder,
340
+ busy
341
+ }) {
342
+ const { t } = useTranslation();
343
+ if (order2.actions.payable) {
344
+ return paymentExpired || !order2.urls.checkout ? /* @__PURE__ */ jsx("span", { className: "text-red-500", children: t("pages.orders.pending_payment_expired") }) : /* @__PURE__ */ jsxs(SallaButton, { width: "wide", href: order2.urls.checkout, children: [
345
+ /* @__PURE__ */ jsx("i", { className: "sicon sicon-wallet rtl:ml-2 ltr:mr-2" }),
346
+ /* @__PURE__ */ jsx("span", { children: t("pages.orders.finish_payment") })
347
+ ] });
348
+ }
349
+ if (!canReorder) return null;
350
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
351
+ /* @__PURE__ */ jsxs("div", { className: "text-sm", children: [
352
+ /* @__PURE__ */ jsx("h3", { className: "font-bold text-lg leading-none mb-1", children: t("pages.orders.reorder") }),
353
+ /* @__PURE__ */ jsx("p", { className: "text-gray-500", children: t("pages.orders.reorder_description") })
354
+ ] }),
355
+ /* @__PURE__ */ jsxs(
356
+ SallaButton,
357
+ {
358
+ "data-testid": "store-order-reorder-btn",
359
+ shape: "link",
360
+ onClick: onReorder,
361
+ disabled: busy,
362
+ children: [
363
+ /* @__PURE__ */ jsx("i", { className: "sicon sicon-rotate rtl:ml-2 ltr:mr-2" }),
364
+ /* @__PURE__ */ jsx("span", { children: t("pages.orders.reorder") })
365
+ ]
366
+ }
367
+ )
368
+ ] });
369
+ }
370
+ function OrderActions({ order: order2, paymentExpired }) {
371
+ const { t } = useTranslation();
372
+ const { isLoggedIn } = useUser();
373
+ const navigate = useNavigate();
374
+ const location = useLocation();
375
+ const [showReorder, setShowReorder] = useState(false);
376
+ const [showCancel, setShowCancel] = useState(false);
377
+ const { reorderable, cancellable, payable } = order2.actions;
378
+ const canReorder = isLoggedIn && reorderable;
379
+ const [reorderState, handleReorder] = useAsyncFn(async () => {
380
+ await window.salla?.order.createCartFromOrder(Number(order2.id));
381
+ setShowReorder(false);
382
+ navigate("/cart");
383
+ }, [navigate, order2.id]);
384
+ const [cancelState, handleCancel] = useAsyncFn(async () => {
385
+ await window.salla?.order.cancel(Number(order2.id));
386
+ setShowCancel(false);
387
+ navigate(location.pathname, { replace: true });
388
+ }, [navigate, order2.id, location.pathname]);
389
+ if (!reorderable && !cancellable && !payable) return null;
390
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
391
+ /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-md p-5 divide-y divide-border-color space-y-4", children: [
392
+ (reorderable || payable) && /* @__PURE__ */ jsx("div", { className: payable ? "flex-center" : "center-between", children: /* @__PURE__ */ jsx(
393
+ PaymentOrReorder,
394
+ {
395
+ order: order2,
396
+ paymentExpired,
397
+ canReorder: !!canReorder,
398
+ onReorder: () => setShowReorder(true),
399
+ busy: reorderState.loading
400
+ }
401
+ ) }),
402
+ cancellable && /* @__PURE__ */ jsxs("div", { className: "center-between pt-4", children: [
403
+ /* @__PURE__ */ jsxs("div", { className: "text-sm", children: [
404
+ /* @__PURE__ */ jsx("h3", { className: "font-bold text-lg leading-none mb-1", children: t("pages.orders.cancel") }),
405
+ /* @__PURE__ */ jsx("p", { className: "text-gray-500", children: t("pages.order.order_cancelation_desc") })
406
+ ] }),
407
+ /* @__PURE__ */ jsxs(
408
+ SallaButton,
409
+ {
410
+ "data-testid": "store-order-cancel-btn",
411
+ shape: "link",
412
+ color: "danger",
413
+ onClick: () => setShowCancel(true),
414
+ disabled: cancelState.loading,
415
+ children: [
416
+ /* @__PURE__ */ jsx("i", { className: "sicon sicon-cancel-circle rtl:ml-2 ltr:mr-2" }),
417
+ /* @__PURE__ */ jsx("span", { children: t("pages.orders.cancel") })
418
+ ]
419
+ }
420
+ )
421
+ ] })
422
+ ] }),
423
+ canReorder && /* @__PURE__ */ jsx(
424
+ ConfirmModal,
425
+ {
426
+ visible: showReorder,
427
+ onVisibleChange: setShowReorder,
428
+ title: t("pages.orders.reorder"),
429
+ subTitle: t("pages.orders.reorder_confirmation"),
430
+ iconStyle: "success",
431
+ onConfirm: handleReorder,
432
+ busy: reorderState.loading
433
+ }
434
+ ),
435
+ cancellable && /* @__PURE__ */ jsx(
436
+ ConfirmModal,
437
+ {
438
+ visible: showCancel,
439
+ onVisibleChange: setShowCancel,
440
+ title: t("common.elements.warning"),
441
+ subTitle: t("pages.orders.cancel_confirmation"),
442
+ iconStyle: "error",
443
+ confirmColor: "danger",
444
+ onConfirm: handleCancel,
445
+ busy: cancelState.loading
446
+ }
447
+ )
448
+ ] });
449
+ }
450
+ function RatingAction({
451
+ disabled,
452
+ endedKey,
453
+ color,
454
+ fill,
455
+ icon,
456
+ onClick
457
+ }) {
458
+ const { t } = useTranslation();
459
+ return /* @__PURE__ */ jsxs("div", { className: "tooltip-toggle tooltip-toggle--hover icon-trigger mobile-shifted", children: [
460
+ disabled && /* @__PURE__ */ jsx("div", { className: "tooltip-content shadow-md rounded", children: /* @__PURE__ */ jsxs("small", { children: [
461
+ " ",
462
+ t(endedKey),
463
+ "."
464
+ ] }) }),
465
+ /* @__PURE__ */ jsx(
466
+ SallaButton,
467
+ {
468
+ loaderPosition: "center",
469
+ disabled,
470
+ shape: "icon",
471
+ fill,
472
+ color,
473
+ size: "medium",
474
+ onClick: disabled ? void 0 : onClick,
475
+ children: /* @__PURE__ */ jsx("i", { className: `${icon} text-xl` })
476
+ }
477
+ )
478
+ ] });
479
+ }
480
+ function RatingSection({
481
+ title,
482
+ rating,
483
+ type,
484
+ allowUpdate
485
+ }) {
486
+ const dispatch = (event, payload) => window.salla?.event?.dispatch(event, payload);
487
+ const locked = !rating.can_update;
488
+ return /* @__PURE__ */ jsxs("section", { className: "flex justify-between items-start bg-white p-5 rounded-md", children: [
489
+ /* @__PURE__ */ jsxs("div", { children: [
490
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-bold mb-5", children: title }),
491
+ /* @__PURE__ */ jsx("p", { className: "mb-2", children: rating.content }),
492
+ /* @__PURE__ */ jsx(SallaRatingStars, { withLabel: true, value: rating.stars })
493
+ ] }),
494
+ /* @__PURE__ */ jsx("div", { className: "rating-actions", children: allowUpdate && /* @__PURE__ */ jsxs(Fragment, { children: [
495
+ /* @__PURE__ */ jsx(
496
+ RatingAction,
497
+ {
498
+ disabled: locked,
499
+ endedKey: "pages.order.edit_period_ended",
500
+ color: "dark",
501
+ fill: "outline",
502
+ icon: "sicon-format-border-color",
503
+ onClick: () => dispatch("rating::edit", { type, feedback_id: String(rating.id) })
504
+ }
505
+ ),
506
+ /* @__PURE__ */ jsx(
507
+ RatingAction,
508
+ {
509
+ disabled: locked,
510
+ endedKey: "pages.order.delete_period_ended",
511
+ color: "danger",
512
+ fill: "outline",
513
+ icon: "sicon-trash-2",
514
+ onClick: () => dispatch("rating::delete", { feedback_id: String(rating.id) })
515
+ }
516
+ )
517
+ ] }) })
518
+ ] });
519
+ }
520
+ function ShippingRow({ shipment }) {
521
+ const { t } = useTranslation();
522
+ const hasNumber = !!shipment.number && shipment.number !== "0";
523
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col md:flex-row justify-between md:items-center bg-white px-5 py-3 border-b border-gray-100 rounded-t-md text-sm space-y-4 md:space-y-0", children: [
524
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 rtl:space-x-reverse", children: [
525
+ shipment.logo && /* @__PURE__ */ jsx("img", { src: shipment.logo, className: "max-w-16 max-h-8", alt: shipment.name }),
526
+ /* @__PURE__ */ jsx("span", { children: shipment.name })
527
+ ] }),
528
+ /* @__PURE__ */ jsxs("div", { className: "flex space-x-5 rtl:space-x-reverse", children: [
529
+ hasNumber && /* @__PURE__ */ jsxs("span", { children: [
530
+ t("pages.orders.shipment_no"),
531
+ ": ",
532
+ /* @__PURE__ */ jsx("span", { className: "font-bold", children: shipment.number })
533
+ ] }),
534
+ shipment.tracking && /* @__PURE__ */ jsxs(
535
+ "a",
536
+ {
537
+ className: "font-bold text-primary hover:opacity-80 flex items-center",
538
+ href: shipment.tracking,
539
+ target: "_blank",
540
+ rel: "noreferrer",
541
+ children: [
542
+ /* @__PURE__ */ jsx("span", { className: "sicon-shipping rtl:ml-1 ltr:mr-1" }),
543
+ t("pages.orders.tracking_url")
544
+ ]
545
+ }
546
+ )
547
+ ] })
548
+ ] });
549
+ }
550
+ function ShippingHeader({ twig, order: order2 }) {
551
+ const { data } = useQuery({
552
+ ...order.queries.shipments(String(order2.id)),
553
+ enabled: order2.features.shippable && !twig.is_pickable
554
+ });
555
+ if (twig.is_pickable) return null;
556
+ const shipments = data?.length ? data.map((shipment) => ({ ...shipment, tracking: shipment.tracking_url })) : twig.shipping ? [{ ...twig.shipping, tracking: twig.shipping.tracing_link }] : [];
557
+ return /* @__PURE__ */ jsx(Fragment, { children: shipments.map((shipment) => /* @__PURE__ */ jsx(ShippingRow, { shipment }, shipment.id ?? shipment.name)) });
558
+ }
559
+ var optionPrice = (price) => typeof price === "number" ? price : price?.amount ?? 0;
560
+ function OrderOptionsTable({
561
+ options,
562
+ money,
563
+ currency
564
+ }) {
565
+ const { t } = useTranslation();
566
+ return /* @__PURE__ */ jsxs("div", { className: "bg-white p-5 rounded-md", children: [
567
+ /* @__PURE__ */ jsx("h2", { className: "mb-3.5 text-sm font-bold", children: t("pages.checkout.cart_options_title") }),
568
+ /* @__PURE__ */ jsxs("table", { className: "table-fixed w-full border border-gray-200", children: [
569
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b border-gray-200", children: [
570
+ /* @__PURE__ */ jsx("th", { scope: "col", className: "p-3 text-start text-sm", children: t("pages.order.option_name") }),
571
+ /* @__PURE__ */ jsx("th", { scope: "col", className: "p-3 text-sm", children: t("pages.order.option_content") }),
572
+ /* @__PURE__ */ jsx("th", { scope: "col", className: "p-3 rtl:text-left ltr:text-right text-sm", children: t("pages.products.price") })
573
+ ] }) }),
574
+ /* @__PURE__ */ jsx("tbody", { children: options.flatMap(
575
+ (option) => (option.options ?? []).map((value) => /* @__PURE__ */ jsxs(
576
+ "tr",
577
+ {
578
+ className: "border-b last:border-b-0 border-gray-200",
579
+ children: [
580
+ /* @__PURE__ */ jsxs("td", { className: "text-sm p-3", children: [
581
+ value.name,
582
+ " :"
583
+ ] }),
584
+ /* @__PURE__ */ jsx("td", { className: "text-center p-3 font-medium text-xs", children: value.value }),
585
+ /* @__PURE__ */ jsx("td", { className: "rtl:text-start ltr:text-end p-3 font-medium text-xs", children: /* @__PURE__ */ jsx("strong", { children: money(optionPrice(value.price), currency) }) })
586
+ ]
587
+ },
588
+ `${value.name}:${value.value}`
589
+ ))
590
+ ) })
591
+ ] })
592
+ ] });
593
+ }
594
+ function TitleRow({ order: order2 }) {
595
+ const { t } = useTranslation();
596
+ return /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
597
+ order2.type === "buy_as_gift" || order2.source?.type === "buy_as_gift" ? /* @__PURE__ */ jsxs("span", { className: "inline-block text-primary", children: [
598
+ /* @__PURE__ */ jsx("i", { className: "sicon-gift-sharing" }),
599
+ "\xA0",
600
+ t("pages.orders.gift_tag")
601
+ ] }) : /* @__PURE__ */ jsx("span", {}),
602
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 flex-wrap", children: /* @__PURE__ */ jsx(SallaEditOrderButton, { "data-testid": "store-order-edit-btn", orderId: String(order2.id) }) })
603
+ ] });
604
+ }
605
+ function RefundMessage({ message }) {
606
+ if (!message) return null;
607
+ return /* @__PURE__ */ jsx("div", { className: "min-w-full rounded-md overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "bg-white flex items-center gap-1 rounded-md px-3 py-5 md:px-5", children: [
608
+ /* @__PURE__ */ jsx("i", { className: "sicon-refund h-6 w-6" }),
609
+ /* @__PURE__ */ jsx("p", { className: "font-medium text-base", dangerouslySetInnerHTML: { __html: message } })
610
+ ] }) });
611
+ }
612
+ function RatingNotices({ twig }) {
613
+ const { t } = useTranslation();
614
+ const { store } = useTwilight();
615
+ const settings = store?.settings?.rating;
616
+ const rated = !!twig.rating && !Array.isArray(twig.rating);
617
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
618
+ settings?.allow_update && rated && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 bg-blue-50 border border-blue-200 text-blue-500 px-2 py-3 rounded-md text-sm", children: [
619
+ /* @__PURE__ */ jsx("i", { className: "sicon-info" }),
620
+ /* @__PURE__ */ jsxs("p", { children: [
621
+ t("pages.order.can_edit_or_delete_your_review_within"),
622
+ " ",
623
+ settings.update_period,
624
+ " ",
625
+ t("pages.order.days_since_added"),
626
+ "."
627
+ ] })
628
+ ] }),
629
+ twig.can_rate && /* @__PURE__ */ jsxs("div", { className: "rating-header gradient-bg center-between", children: [
630
+ /* @__PURE__ */ jsxs("div", { children: [
631
+ /* @__PURE__ */ jsx("h2", { className: "font-bold mb-1", children: t("pages.order.order_rating_title") }),
632
+ /* @__PURE__ */ jsx("p", { className: "text-sm", children: t("pages.order.order_rating_message") })
633
+ ] }),
634
+ /* @__PURE__ */ jsx(
635
+ SallaButton,
636
+ {
637
+ "data-testid": "store-order-rate-btn",
638
+ color: "light",
639
+ className: "btn--rounded-full !text-primary",
640
+ onClick: () => window.salla?.event?.dispatch("rating::open"),
641
+ children: t("pages.rating.rate")
642
+ }
643
+ )
644
+ ] })
645
+ ] });
646
+ }
647
+ function OrderRatings({ twig }) {
648
+ const { t } = useTranslation();
649
+ const { store } = useTwilight();
650
+ const allowUpdate = !!store?.settings?.rating?.allow_update;
651
+ const rating = Array.isArray(twig.rating) ? void 0 : twig.rating;
652
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
653
+ rating?.store?.stars ? /* @__PURE__ */ jsx(
654
+ RatingSection,
655
+ {
656
+ title: t("pages.rating.rate_the_store"),
657
+ rating: rating.store,
658
+ type: "store",
659
+ allowUpdate
660
+ }
661
+ ) : null,
662
+ rating?.shipping?.stars ? /* @__PURE__ */ jsx(
663
+ RatingSection,
664
+ {
665
+ title: t("pages.rating.rate_shipping"),
666
+ rating: rating.shipping,
667
+ type: "shipping",
668
+ allowUpdate
669
+ }
670
+ ) : null
671
+ ] });
672
+ }
673
+ function OrderSinglePage({ order: order2, page, componentsOrder }) {
674
+ usePageConfig(page);
675
+ const { store } = useTwilight();
676
+ const { format } = useMoney();
677
+ const twig = componentsOrder ?? { items: [] };
678
+ const paymentExpired = order2.actions.payable && (order2.payment?.pending_payment_ends_at ?? 0) === 0;
679
+ const money = (amount, currency) => format(amount, { currency });
680
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
681
+ /* @__PURE__ */ jsx(TitleRow, { order: order2 }),
682
+ /* @__PURE__ */ jsx(HookSlot, { name: "customer:orders.single.details.start" }),
683
+ /* @__PURE__ */ jsx(OrderHeader, { order: order2, links: twig.links, paymentExpired }),
684
+ twig.is_pickable && /* @__PURE__ */ jsx(SallaOrderBranch, { "data-testid": "store-order-branch", stackCards: true }),
685
+ /* @__PURE__ */ jsx(RefundMessage, { message: order2.refund_message }),
686
+ /* @__PURE__ */ jsx(RatingNotices, { twig }),
687
+ /* @__PURE__ */ jsxs("div", { className: "overflow-hidden space-y-5", children: [
688
+ /* @__PURE__ */ jsxs("div", { className: "shipping-orders", children: [
689
+ /* @__PURE__ */ jsx(ShippingHeader, { twig, order: order2 }),
690
+ order2.items.map((item, index) => /* @__PURE__ */ jsx(
691
+ OrderItemRow,
692
+ {
693
+ item,
694
+ twigItem: twig.items[index],
695
+ money,
696
+ currency: order2.currency
697
+ },
698
+ item.id
699
+ ))
700
+ ] }),
701
+ !!twig.options?.length && /* @__PURE__ */ jsx(OrderOptionsTable, { options: twig.options, money, currency: order2.currency })
702
+ ] }),
703
+ componentsOrder && /* @__PURE__ */ jsx(
704
+ SallaOrderTotalsCard,
705
+ {
706
+ "data-testid": "store-order-totals",
707
+ order: JSON.stringify(componentsOrder)
708
+ }
709
+ ),
710
+ /* @__PURE__ */ jsx(OrderActions, { order: order2, paymentExpired }),
711
+ /* @__PURE__ */ jsx(OrderRatings, { twig }),
712
+ /* @__PURE__ */ jsx(HookSlot, { name: "customer:orders.single.details.end" }),
713
+ (twig.can_rate || store?.settings?.rating?.allow_update) && /* @__PURE__ */ jsx(SallaRatingModal, { "data-testid": "store-order-rating-modal" })
714
+ ] });
715
+ }
716
+
717
+ export { OrderSinglePage };
718
+ //# sourceMappingURL=OrderSinglePage-B7TBZ7TX.js.map
719
+ //# sourceMappingURL=OrderSinglePage-B7TBZ7TX.js.map