@salla.sa/twilight-theme-engine 1.0.180 → 1.0.181

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 (237) hide show
  1. package/dist/{AddToCartForm-OZGZROUJ.js → AddToCartForm-BTMREFCB.js} +3 -3
  2. package/dist/{AddToCartForm-OZGZROUJ.js.map → AddToCartForm-BTMREFCB.js.map} +1 -1
  3. package/dist/{BlogAuthorPage-Y4PJPT7L.js → BlogAuthorPage-FCT6LUO7.js} +18 -18
  4. package/dist/{BlogAuthorPage-Y4PJPT7L.js.map → BlogAuthorPage-FCT6LUO7.js.map} +1 -1
  5. package/dist/{BlogCategoryPage-4J335KY4.js → BlogCategoryPage-MIZADPR6.js} +18 -18
  6. package/dist/{BlogCategoryPage-4J335KY4.js.map → BlogCategoryPage-MIZADPR6.js.map} +1 -1
  7. package/dist/{BlogPage-MUIHZYXB.js → BlogPage-A4NK5HKV.js} +16 -16
  8. package/dist/{BlogPage-MUIHZYXB.js.map → BlogPage-A4NK5HKV.js.map} +1 -1
  9. package/dist/{BlogSinglePage-4JOY3UVT.js → BlogSinglePage-5MHRXZA4.js} +16 -16
  10. package/dist/{BlogSinglePage-4JOY3UVT.js.map → BlogSinglePage-5MHRXZA4.js.map} +1 -1
  11. package/dist/{BlogTagPage-M7ZQFHUT.js → BlogTagPage-N4Z5XVQV.js} +18 -18
  12. package/dist/{BlogTagPage-M7ZQFHUT.js.map → BlogTagPage-N4Z5XVQV.js.map} +1 -1
  13. package/dist/{BrandsPage-BC4BMJG4.js → BrandsPage-3MLX7ANQ.js} +17 -17
  14. package/dist/{BrandsPage-BC4BMJG4.js.map → BrandsPage-3MLX7ANQ.js.map} +1 -1
  15. package/dist/{Breadcrumb-V2URFP4B.js → Breadcrumb-CCTHHEQH.js} +16 -16
  16. package/dist/{Breadcrumb-V2URFP4B.js.map → Breadcrumb-CCTHHEQH.js.map} +1 -1
  17. package/dist/{CartItem-3AMNNBOL.js → CartItem-YCJF3HXH.js} +16 -16
  18. package/dist/{CartItem-3AMNNBOL.js.map → CartItem-YCJF3HXH.js.map} +1 -1
  19. package/dist/{CartSummary-KSVVKDUG.js → CartSummary-ZJOGWEWI.js} +16 -16
  20. package/dist/{CartSummary-KSVVKDUG.js.map → CartSummary-ZJOGWEWI.js.map} +1 -1
  21. package/dist/{Copyright-NUPXDALZ.js → Copyright-ICYJGCPF.js} +3 -3
  22. package/dist/{Copyright-NUPXDALZ.js.map → Copyright-ICYJGCPF.js.map} +1 -1
  23. package/dist/{CustomerLayout-R3L5PIOS.js → CustomerLayout-VRBDGYGF.js} +16 -16
  24. package/dist/{CustomerLayout-R3L5PIOS.js.map → CustomerLayout-VRBDGYGF.js.map} +1 -1
  25. package/dist/{Footer-KMBA7SPY.js → Footer-FHLO2CHL.js} +3 -3
  26. package/dist/{Footer-KMBA7SPY.js.map → Footer-FHLO2CHL.js.map} +1 -1
  27. package/dist/GoogleTag-EEPZ4AH6.js +15 -0
  28. package/dist/{GoogleTag-NWYDC6WD.js.map → GoogleTag-EEPZ4AH6.js.map} +1 -1
  29. package/dist/{Header-2XH6SHUO.js → Header-RER3EUW6.js} +8 -8
  30. package/dist/{Header-2XH6SHUO.js.map → Header-RER3EUW6.js.map} +1 -1
  31. package/dist/{LatestProducts-57JGQJVN.js → LatestProducts-4HNU7EXD.js} +18 -18
  32. package/dist/{LatestProducts-57JGQJVN.js.map → LatestProducts-4HNU7EXD.js.map} +1 -1
  33. package/dist/{LoyaltyPage-WPQ34KLX.js → LoyaltyPage-DN4JA4C5.js} +16 -16
  34. package/dist/{LoyaltyPage-WPQ34KLX.js.map → LoyaltyPage-DN4JA4C5.js.map} +1 -1
  35. package/dist/{LoyaltyPointsPage-RSSXJM6I.js → LoyaltyPointsPage-PKYAXASN.js} +6 -6
  36. package/dist/{LoyaltyPointsPage-RSSXJM6I.js.map → LoyaltyPointsPage-PKYAXASN.js.map} +1 -1
  37. package/dist/{MainMenu-LB3XL25D.js → MainMenu-DHPNKYU5.js} +5 -5
  38. package/dist/{MainMenu-LB3XL25D.js.map → MainMenu-DHPNKYU5.js.map} +1 -1
  39. package/dist/{MasterLayout-KGUQ4N2G.js → MasterLayout-RWAUJ75I.js} +16 -16
  40. package/dist/{MasterLayout-KGUQ4N2G.js.map → MasterLayout-RWAUJ75I.js.map} +1 -1
  41. package/dist/{MobileMenu-ZAFU2ZN6.js → MobileMenu-7DV5SX7C.js} +17 -17
  42. package/dist/{MobileMenu-ZAFU2ZN6.js.map → MobileMenu-7DV5SX7C.js.map} +1 -1
  43. package/dist/{NotificationsPage-D7ZTDST7.js → NotificationsPage-CGCZOXE5.js} +16 -16
  44. package/dist/{NotificationsPage-D7ZTDST7.js.map → NotificationsPage-CGCZOXE5.js.map} +1 -1
  45. package/dist/{OrderSinglePage-FT5NO5M4.js → OrderSinglePage-OETGEAGR.js} +17 -17
  46. package/dist/{OrderSinglePage-FT5NO5M4.js.map → OrderSinglePage-OETGEAGR.js.map} +1 -1
  47. package/dist/{OrdersPage-CHH2UX5S.js → OrdersPage-GJREHQAP.js} +16 -16
  48. package/dist/{OrdersPage-CHH2UX5S.js.map → OrdersPage-GJREHQAP.js.map} +1 -1
  49. package/dist/{PageSingle-5ZX3FUBB.js → PageSingle-CSRJFQPI.js} +3 -3
  50. package/dist/{PageSingle-5ZX3FUBB.js.map → PageSingle-CSRJFQPI.js.map} +1 -1
  51. package/dist/{ProductDetails-6HTLTQBT.js → ProductDetails-VV72WQTK.js} +4 -4
  52. package/dist/{ProductDetails-6HTLTQBT.js.map → ProductDetails-VV72WQTK.js.map} +1 -1
  53. package/dist/{ProfilePage-2YWL4JWQ.js → ProfilePage-SKX6MBDZ.js} +16 -16
  54. package/dist/{ProfilePage-2YWL4JWQ.js.map → ProfilePage-SKX6MBDZ.js.map} +1 -1
  55. package/dist/{ReviewsPage-ADWCW5P6.js → ReviewsPage-ADN447YV.js} +3 -3
  56. package/dist/{ReviewsPage-ADWCW5P6.js.map → ReviewsPage-ADN447YV.js.map} +1 -1
  57. package/dist/{SeoCartWidget-FFZXG7GS.js → SeoCartWidget-BMNXLYIV.js} +16 -16
  58. package/dist/{SeoCartWidget-FFZXG7GS.js.map → SeoCartWidget-BMNXLYIV.js.map} +1 -1
  59. package/dist/{SettingsPage-O5E4SCHB.js → SettingsPage-NKH24AG6.js} +16 -16
  60. package/dist/{SettingsPage-O5E4SCHB.js.map → SettingsPage-NKH24AG6.js.map} +1 -1
  61. package/dist/{StoreClosedNotification-4HPWJKWS.js → StoreClosedNotification-HJC4PYA5.js} +17 -17
  62. package/dist/{StoreClosedNotification-4HPWJKWS.js.map → StoreClosedNotification-HJC4PYA5.js.map} +1 -1
  63. package/dist/{TestimonialsPage-YAXINHYG.js → TestimonialsPage-T56BGX7K.js} +3 -3
  64. package/dist/{TestimonialsPage-YAXINHYG.js.map → TestimonialsPage-T56BGX7K.js.map} +1 -1
  65. package/dist/{ThankYouPage-DCQZVYIA.js → ThankYouPage-ATDW34LU.js} +16 -16
  66. package/dist/{ThankYouPage-DCQZVYIA.js.map → ThankYouPage-ATDW34LU.js.map} +1 -1
  67. package/dist/{WalletPage-NPBCYOBS.js → WalletPage-BTGNWJEB.js} +17 -17
  68. package/dist/{WalletPage-NPBCYOBS.js.map → WalletPage-BTGNWJEB.js.map} +1 -1
  69. package/dist/{WebMcpTools-VNHKJNI7.js → WebMcpTools-Y537MP25.js} +5 -5
  70. package/dist/{WebMcpTools-VNHKJNI7.js.map → WebMcpTools-Y537MP25.js.map} +1 -1
  71. package/dist/{WishlistPage-ISSKWME2.js → WishlistPage-5HAYJGZY.js} +18 -18
  72. package/dist/{WishlistPage-ISSKWME2.js.map → WishlistPage-5HAYJGZY.js.map} +1 -1
  73. package/dist/api/advertisement.js +2 -2
  74. package/dist/api/apps.js +2 -2
  75. package/dist/api/blog.js +3 -3
  76. package/dist/api/brands.js +3 -3
  77. package/dist/api/cart.js +3 -3
  78. package/dist/api/category.js +3 -3
  79. package/dist/api/client.js +1 -1
  80. package/dist/api/custom-url.js +2 -2
  81. package/dist/api/home.js +2 -2
  82. package/dist/api/loyalty.js +3 -3
  83. package/dist/api/menu.js +2 -2
  84. package/dist/api/notification.js +2 -2
  85. package/dist/api/order.js +3 -3
  86. package/dist/api/page.js +3 -3
  87. package/dist/api/product.js +3 -3
  88. package/dist/api/profile.js +1 -1
  89. package/dist/api/store.js +2 -2
  90. package/dist/api/translations.js +2 -2
  91. package/dist/api/user.js +2 -2
  92. package/dist/api/wallet.js +2 -2
  93. package/dist/api/wishlist.js +4 -4
  94. package/dist/{chunk-IHHJGUI3.js → chunk-2B3VPD42.js} +4 -4
  95. package/dist/{chunk-IHHJGUI3.js.map → chunk-2B3VPD42.js.map} +1 -1
  96. package/dist/{chunk-AWOMNZIJ.js → chunk-4MKZ7JPZ.js} +4 -4
  97. package/dist/{chunk-AWOMNZIJ.js.map → chunk-4MKZ7JPZ.js.map} +1 -1
  98. package/dist/{chunk-ZWX33T7S.js → chunk-4NRJSPJD.js} +3 -3
  99. package/dist/{chunk-ZWX33T7S.js.map → chunk-4NRJSPJD.js.map} +1 -1
  100. package/dist/{chunk-I7LWEJDL.js → chunk-53GFVA6K.js} +3 -3
  101. package/dist/{chunk-I7LWEJDL.js.map → chunk-53GFVA6K.js.map} +1 -1
  102. package/dist/{chunk-H22ABA6K.js → chunk-5NREKFL6.js} +4 -4
  103. package/dist/{chunk-H22ABA6K.js.map → chunk-5NREKFL6.js.map} +1 -1
  104. package/dist/{chunk-WLRNZYCA.js → chunk-7RH6YE4A.js} +3 -3
  105. package/dist/{chunk-WLRNZYCA.js.map → chunk-7RH6YE4A.js.map} +1 -1
  106. package/dist/{chunk-6MTG5HRF.js → chunk-AOP3NGP5.js} +4 -4
  107. package/dist/{chunk-6MTG5HRF.js.map → chunk-AOP3NGP5.js.map} +1 -1
  108. package/dist/{chunk-PGX4SXVF.js → chunk-AQDJ5UDM.js} +3 -3
  109. package/dist/{chunk-PGX4SXVF.js.map → chunk-AQDJ5UDM.js.map} +1 -1
  110. package/dist/{chunk-O6KQRFTR.js → chunk-BDFEI5DD.js} +14 -14
  111. package/dist/{chunk-O6KQRFTR.js.map → chunk-BDFEI5DD.js.map} +1 -1
  112. package/dist/{chunk-DASAKSKN.js → chunk-BKTOWTO4.js} +4 -4
  113. package/dist/{chunk-DASAKSKN.js.map → chunk-BKTOWTO4.js.map} +1 -1
  114. package/dist/{chunk-BTQ2SAMS.js → chunk-CZTJ2YC2.js} +6 -6
  115. package/dist/{chunk-BTQ2SAMS.js.map → chunk-CZTJ2YC2.js.map} +1 -1
  116. package/dist/{chunk-YEVLRCSL.js → chunk-EJJUUXL3.js} +5 -5
  117. package/dist/{chunk-YEVLRCSL.js.map → chunk-EJJUUXL3.js.map} +1 -1
  118. package/dist/{chunk-UYY5FXLW.js → chunk-F2DYT55P.js} +4 -4
  119. package/dist/{chunk-UYY5FXLW.js.map → chunk-F2DYT55P.js.map} +1 -1
  120. package/dist/{chunk-EOZAJ6SP.js → chunk-FBAEVGER.js} +7 -7
  121. package/dist/{chunk-EOZAJ6SP.js.map → chunk-FBAEVGER.js.map} +1 -1
  122. package/dist/{chunk-YA4O3EZC.js → chunk-FRVKNJHM.js} +3 -3
  123. package/dist/{chunk-YA4O3EZC.js.map → chunk-FRVKNJHM.js.map} +1 -1
  124. package/dist/{chunk-AY2XD3S2.js → chunk-G5T6TU4H.js} +7 -7
  125. package/dist/{chunk-AY2XD3S2.js.map → chunk-G5T6TU4H.js.map} +1 -1
  126. package/dist/{chunk-CB473WUX.js → chunk-GIKIIAGI.js} +3 -3
  127. package/dist/{chunk-CB473WUX.js.map → chunk-GIKIIAGI.js.map} +1 -1
  128. package/dist/{chunk-YZDL6GF7.js → chunk-GO4EVN5H.js} +3 -3
  129. package/dist/{chunk-YZDL6GF7.js.map → chunk-GO4EVN5H.js.map} +1 -1
  130. package/dist/{chunk-DCDWTP6S.js → chunk-GRF2ZTUB.js} +5 -5
  131. package/dist/{chunk-DCDWTP6S.js.map → chunk-GRF2ZTUB.js.map} +1 -1
  132. package/dist/{chunk-NQXXID34.js → chunk-GRYATL7L.js} +4 -4
  133. package/dist/{chunk-NQXXID34.js.map → chunk-GRYATL7L.js.map} +1 -1
  134. package/dist/{chunk-5MUY4AUU.js → chunk-LAESVQK6.js} +17 -17
  135. package/dist/{chunk-5MUY4AUU.js.map → chunk-LAESVQK6.js.map} +1 -1
  136. package/dist/{chunk-QPRU3PVD.js → chunk-LCC7IV6O.js} +4 -4
  137. package/dist/{chunk-QPRU3PVD.js.map → chunk-LCC7IV6O.js.map} +1 -1
  138. package/dist/{chunk-QRG7YWRL.js → chunk-MKHRHWCT.js} +3 -3
  139. package/dist/{chunk-QRG7YWRL.js.map → chunk-MKHRHWCT.js.map} +1 -1
  140. package/dist/{chunk-Z5LSS25A.js → chunk-N7CPWUSY.js} +3 -3
  141. package/dist/{chunk-Z5LSS25A.js.map → chunk-N7CPWUSY.js.map} +1 -1
  142. package/dist/{chunk-UD4NGJML.js → chunk-NVQKZ2FF.js} +4 -4
  143. package/dist/{chunk-UD4NGJML.js.map → chunk-NVQKZ2FF.js.map} +1 -1
  144. package/dist/{chunk-F6MAM7HZ.js → chunk-QF7HVZM5.js} +3 -3
  145. package/dist/{chunk-F6MAM7HZ.js.map → chunk-QF7HVZM5.js.map} +1 -1
  146. package/dist/{chunk-TUM4ABEA.js → chunk-QYWNYSCI.js} +5 -5
  147. package/dist/{chunk-TUM4ABEA.js.map → chunk-QYWNYSCI.js.map} +1 -1
  148. package/dist/{chunk-WHNF7WBH.js → chunk-RD7ZPLRZ.js} +3 -3
  149. package/dist/{chunk-WHNF7WBH.js.map → chunk-RD7ZPLRZ.js.map} +1 -1
  150. package/dist/{chunk-D4ACJS2K.js → chunk-RDY5EAO3.js} +3 -3
  151. package/dist/{chunk-D4ACJS2K.js.map → chunk-RDY5EAO3.js.map} +1 -1
  152. package/dist/{chunk-5ZVKOLFZ.js → chunk-RLDBGJGY.js} +7 -7
  153. package/dist/{chunk-5ZVKOLFZ.js.map → chunk-RLDBGJGY.js.map} +1 -1
  154. package/dist/{chunk-IAVHDEMZ.js → chunk-RWNWVAR3.js} +3 -3
  155. package/dist/{chunk-IAVHDEMZ.js.map → chunk-RWNWVAR3.js.map} +1 -1
  156. package/dist/{chunk-OP7DHR4L.js → chunk-S4PQLNYO.js} +4 -4
  157. package/dist/{chunk-OP7DHR4L.js.map → chunk-S4PQLNYO.js.map} +1 -1
  158. package/dist/{chunk-PFUDIAWY.js → chunk-SA3UNTGI.js} +4 -4
  159. package/dist/{chunk-PFUDIAWY.js.map → chunk-SA3UNTGI.js.map} +1 -1
  160. package/dist/{chunk-UA6LTD55.js → chunk-SCQQ67YE.js} +4 -4
  161. package/dist/{chunk-UA6LTD55.js.map → chunk-SCQQ67YE.js.map} +1 -1
  162. package/dist/{chunk-P6FREDWL.js → chunk-TJ7R6LJB.js} +4 -4
  163. package/dist/{chunk-P6FREDWL.js.map → chunk-TJ7R6LJB.js.map} +1 -1
  164. package/dist/{chunk-K6AQYYJR.js → chunk-TMTJTEGN.js} +3 -3
  165. package/dist/{chunk-K6AQYYJR.js.map → chunk-TMTJTEGN.js.map} +1 -1
  166. package/dist/{chunk-M4GK6JZO.js → chunk-U4A66HPY.js} +3 -3
  167. package/dist/{chunk-M4GK6JZO.js.map → chunk-U4A66HPY.js.map} +1 -1
  168. package/dist/{chunk-X4VIKIQM.js → chunk-UNYPBBZJ.js} +5 -5
  169. package/dist/{chunk-X4VIKIQM.js.map → chunk-UNYPBBZJ.js.map} +1 -1
  170. package/dist/{chunk-CRXXKAFW.js → chunk-UXLV3RDY.js} +3 -3
  171. package/dist/{chunk-CRXXKAFW.js.map → chunk-UXLV3RDY.js.map} +1 -1
  172. package/dist/{chunk-RKSWLLP7.js → chunk-VIZE6HIA.js} +4 -4
  173. package/dist/{chunk-RKSWLLP7.js.map → chunk-VIZE6HIA.js.map} +1 -1
  174. package/dist/{chunk-VY2TPXFO.js → chunk-VKKA35I2.js} +3 -3
  175. package/dist/{chunk-VY2TPXFO.js.map → chunk-VKKA35I2.js.map} +1 -1
  176. package/dist/{chunk-OAH2JE3U.js → chunk-VMANXK5R.js} +3 -3
  177. package/dist/{chunk-OAH2JE3U.js.map → chunk-VMANXK5R.js.map} +1 -1
  178. package/dist/{chunk-BSWV7U3V.js → chunk-VND65UMT.js} +3 -3
  179. package/dist/{chunk-BSWV7U3V.js.map → chunk-VND65UMT.js.map} +1 -1
  180. package/dist/{chunk-VXTPMEFC.js → chunk-VTIXMCC2.js} +3 -3
  181. package/dist/{chunk-VXTPMEFC.js.map → chunk-VTIXMCC2.js.map} +1 -1
  182. package/dist/{chunk-XEGALTQJ.js → chunk-WCYGDU5H.js} +3 -3
  183. package/dist/{chunk-XEGALTQJ.js.map → chunk-WCYGDU5H.js.map} +1 -1
  184. package/dist/{chunk-KAQV2WZ6.js → chunk-WGUF75EV.js} +3 -3
  185. package/dist/{chunk-KAQV2WZ6.js.map → chunk-WGUF75EV.js.map} +1 -1
  186. package/dist/{chunk-6UUBYWC4.js → chunk-WXQ5BNI3.js} +4 -4
  187. package/dist/{chunk-6UUBYWC4.js.map → chunk-WXQ5BNI3.js.map} +1 -1
  188. package/dist/components/cart/index.js +1 -1
  189. package/dist/components/common/index.js +1 -1
  190. package/dist/components/drawer/index.js +14 -14
  191. package/dist/components/home/index.js +19 -19
  192. package/dist/components/layout/index.js +4 -4
  193. package/dist/components/product/index.js +16 -16
  194. package/dist/components/store/index.js +15 -15
  195. package/dist/components/tracking/index.js +6 -6
  196. package/dist/{custom-urls-SNKCSUFH.js → custom-urls-Z3EPMC5B.js} +7 -7
  197. package/dist/{custom-urls-SNKCSUFH.js.map → custom-urls-Z3EPMC5B.js.map} +1 -1
  198. package/dist/dev/editor/index.js +1 -1
  199. package/dist/dev/index.js +1 -1
  200. package/dist/{document-class-GMZDY55X.js → document-class-SYUN4GYO.js} +17 -17
  201. package/dist/{document-class-GMZDY55X.js.map → document-class-SYUN4GYO.js.map} +1 -1
  202. package/dist/hooks/index.js +14 -14
  203. package/dist/hooks/useGtm.js +14 -14
  204. package/dist/hooks/useMoney.js +14 -14
  205. package/dist/hooks/useStore.js +14 -14
  206. package/dist/hooks/useUser.js +3 -3
  207. package/dist/index.js +14 -14
  208. package/dist/{navigation-PVCAQHKP.js → navigation-5NG7XJSO.js} +5 -5
  209. package/dist/{navigation-PVCAQHKP.js.map → navigation-5NG7XJSO.js.map} +1 -1
  210. package/dist/{navigation-MEWHF2SI.js → navigation-F7D6JQKB.js} +4 -4
  211. package/dist/{navigation-MEWHF2SI.js.map → navigation-F7D6JQKB.js.map} +1 -1
  212. package/dist/{not-found-AWSO6GKQ.js → not-found-DFW7Y4AX.js} +17 -17
  213. package/dist/{not-found-AWSO6GKQ.js.map → not-found-DFW7Y4AX.js.map} +1 -1
  214. package/dist/providers/index.js +14 -14
  215. package/dist/routes/account/orders.js +4 -4
  216. package/dist/routes/account.js +13 -13
  217. package/dist/routes/blog.js +8 -8
  218. package/dist/routes/brands.js +4 -4
  219. package/dist/routes/cart.js +22 -22
  220. package/dist/routes/home.js +20 -20
  221. package/dist/routes/index.js +8 -8
  222. package/dist/routes/loyalty.js +5 -5
  223. package/dist/routes/page.js +4 -4
  224. package/dist/routes/product-listing.js +40 -35
  225. package/dist/routes/product-listing.js.map +1 -1
  226. package/dist/routes/product.js +23 -23
  227. package/dist/routes/seo-redirects.js +8 -8
  228. package/dist/routes/testimonials.js +2 -2
  229. package/dist/routes/thank-you.js +4 -4
  230. package/dist/skeleton.js +20 -20
  231. package/dist/{store-lookup-GPDB2LWO.js → store-lookup-TGXQXPJL.js} +8 -8
  232. package/dist/{store-lookup-GPDB2LWO.js.map → store-lookup-TGXQXPJL.js.map} +1 -1
  233. package/dist/tanstack.js +17 -17
  234. package/dist/utils/index.js +2 -2
  235. package/package.json +1 -1
  236. package/tailwind/routes/product-listing/loader.ts.txt +25 -11
  237. package/dist/GoogleTag-NWYDC6WD.js +0 -15
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/layout/lazy.ts"],"names":[],"mappings":";;;AAMO,IAAM,UAAA,GAAa,aAAA;AAAA,EAAc,MACtC,OAAO,sBAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE;AACxD;AAEO,IAAM,UAAA,GAAa,aAAA;AAAA,EAAc,MACtC,OAAO,sBAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE;AACxD;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D;AAEO,IAAM,gBAAA,GAAmB,aAAA;AAAA,EAAc,MAC5C,OAAO,4BAAgB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,YAAA,EAAa,CAAE;AACpE;AAEO,IAAM,cAAA,GAAiB,aAAA;AAAA,EAAc,MAC1C,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE;AAEO,IAAM,kBAAA,GAAqB,aAAA;AAAA,EAAc,MAC9C,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE","file":"chunk-AY2XD3S2.js","sourcesContent":["import { lazyComponent } from '../../utils/lazy-component';\n\n/**\n * Lazy-loaded layout components\n * Use these for code-splitting layout sections\n */\nexport const LazyHeader = lazyComponent(() =>\n import('./Header').then((m) => ({ default: m.Header }))\n);\n\nexport const LazyFooter = lazyComponent(() =>\n import('./Footer').then((m) => ({ default: m.Footer }))\n);\n\nexport const LazyCopyright = lazyComponent(() =>\n import('./Copyright').then((m) => ({ default: m.Copyright }))\n);\n\nexport const LazyMasterLayout = lazyComponent(() =>\n import('./MasterLayout').then((m) => ({ default: m.MasterLayout }))\n);\n\nexport const LazyWidgetHead = lazyComponent(() =>\n import('./WidgetHead').then((m) => ({ default: m.WidgetHead }))\n);\n\nexport const LazyCustomerLayout = lazyComponent(() =>\n import('./CustomerLayout').then((m) => ({ default: m.CustomerLayout }))\n);\n"]}
1
+ {"version":3,"sources":["../src/components/layout/lazy.ts"],"names":[],"mappings":";;;AAMO,IAAM,UAAA,GAAa,aAAA;AAAA,EAAc,MACtC,OAAO,sBAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE;AACxD;AAEO,IAAM,UAAA,GAAa,aAAA;AAAA,EAAc,MACtC,OAAO,sBAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE;AACxD;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D;AAEO,IAAM,gBAAA,GAAmB,aAAA;AAAA,EAAc,MAC5C,OAAO,4BAAgB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,YAAA,EAAa,CAAE;AACpE;AAEO,IAAM,cAAA,GAAiB,aAAA;AAAA,EAAc,MAC1C,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE;AAEO,IAAM,kBAAA,GAAqB,aAAA;AAAA,EAAc,MAC9C,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE","file":"chunk-G5T6TU4H.js","sourcesContent":["import { lazyComponent } from '../../utils/lazy-component';\n\n/**\n * Lazy-loaded layout components\n * Use these for code-splitting layout sections\n */\nexport const LazyHeader = lazyComponent(() =>\n import('./Header').then((m) => ({ default: m.Header }))\n);\n\nexport const LazyFooter = lazyComponent(() =>\n import('./Footer').then((m) => ({ default: m.Footer }))\n);\n\nexport const LazyCopyright = lazyComponent(() =>\n import('./Copyright').then((m) => ({ default: m.Copyright }))\n);\n\nexport const LazyMasterLayout = lazyComponent(() =>\n import('./MasterLayout').then((m) => ({ default: m.MasterLayout }))\n);\n\nexport const LazyWidgetHead = lazyComponent(() =>\n import('./WidgetHead').then((m) => ({ default: m.WidgetHead }))\n);\n\nexport const LazyCustomerLayout = lazyComponent(() =>\n import('./CustomerLayout').then((m) => ({ default: m.CustomerLayout }))\n);\n"]}
@@ -1,4 +1,4 @@
1
- import { filesCdn, cdn } from './chunk-BSWV7U3V.js';
1
+ import { filesCdn, cdn } from './chunk-VND65UMT.js';
2
2
  import { storeTranslationsQueryKey, translationsQueryKey, composeMessages, isPlainObject } from './chunk-MWUAHDQL.js';
3
3
  import { queryOptions } from '@tanstack/react-query';
4
4
 
@@ -126,5 +126,5 @@ var translations = {
126
126
  };
127
127
 
128
128
  export { commonTranslationsPath, storeTranslationsPath, translations };
129
- //# sourceMappingURL=chunk-CB473WUX.js.map
130
- //# sourceMappingURL=chunk-CB473WUX.js.map
129
+ //# sourceMappingURL=chunk-GIKIIAGI.js.map
130
+ //# sourceMappingURL=chunk-GIKIIAGI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/translations.ts"],"names":[],"mappings":";;;;AAiEA,IAAM,kBAAA,GAAqB,sBAAA;AAGpB,SAAS,uBAAuB,MAAA,EAAwB;AAC7D,EAAA,OAAO,uBAAuB,MAAM,CAAA,KAAA,CAAA;AACtC;AAWO,SAAS,qBAA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AA;AAAA;AAAA,EAc7E,KAAA,EAAO,CACL,MAAA,EACA,SAAA,EACA,WAC+B,eAAA,CAAgB,MAAA,EAAQ,SAAA,EAAW,MAAM,CAAA,IAAK,IAAA;AAAA,EAE/E,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBP,QAAA,EAAU,CAAC,MAAA,KACT,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,qBAAqB,MAAM,CAAA;AAAA,MACrC,OAAA,EAAS,MAAM,YAAA,CAAa,GAAA,CAAI,MAAM;AAAA,KACvC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWH,OAAA,EAAS,CAAC,OAAA,EAA0B,MAAA,KAClC,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,yBAAA,CAA0B,OAAA,EAAS,MAAM,CAAA;AAAA,MACnD,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-CB473WUX.js","sourcesContent":["/**\n * @fileoverview Where a storefront's words come from.\n *\n * Two files, merged: the platform's copy for this language, and the merchant's\n * own edits for this language and this store. Both are plain JSON objects on\n * the uploader's CDN, one per language.\n *\n * ```\n * https://cdn.files.salla.network/translations/common/<locale>.json the platform's\n * https://cdn.files.salla.network/translations/<storeId>/<locale>.json the merchant's\n * ```\n *\n * **What this replaces, and why.** Until now the engine read a single global\n * file, `cdn.salla.network/js/translations.json`, holding every language keyed\n * `\"<locale>.trans\"`. Nothing publishes that file: it is an object last written\n * on 2026-03-26, carrying only `ar` and `en` where the platform has 39 locales,\n * 405 keys behind `Languages-Module` and 959 English strings textually\n * different from it. So every React storefront has been serving copy from\n * March, and a key added since has never reached one. It also carried no\n * merchant overrides at all — a merchant editing their theme's wording in the\n * Dashboard changed nothing on a React theme.\n *\n * **Merchant overrides are read, and only when there are any.** Getting here\n * took two corrections worth keeping.\n *\n * The first is the address. A merchant's own wording lives at\n * `translations/<storeId>/<locale>.json`, keyed by `store()->getRouteKey()` —\n * the Optimus-encoded numeric id. An early version addressed it with\n * `resolveStoreIdentifier()`, on the claim that the two are the same string.\n * That is true of the `store-identifier` *header*, which accepts a host, a\n * username or an id, and false of the R2 key: on a custom domain the resolver\n * returns `reefperfumes.com` and on a shared host a username like\n * `mtgr-alaatr-2`. Both 404, both then read as \"this store has no overrides\",\n * and the merchant's wording silently never appears — so the feature would have\n * worked under `?storeId=` alone, which is preview and localhost. It is\n * `settings.store.id` now, which is known only after the settings query.\n *\n * The second is when to ask at all. Most stores have never customised a word,\n * and a miss is an uncached round trip (`cf-cache-status: DYNAMIC` on the 404)\n * on the critical path of every SSR render. So the request is made only when\n * `settings.languages[<ISO>].has_custom_translations` says there is something\n * to get — a flag `Languages-Module` writes when a merchant saves a\n * translation. A store without overrides pays nothing, which is what made this\n * shippable at all.\n *\n * ⚠️ The flag is written on save, so a store whose wording predates it reads as\n * `false` until someone edits a translation or the backfill runs. That is a\n * store keeping today's behaviour, not a regression — React themes have never\n * read merchant overrides — but it does mean the feature is only as complete as\n * the backfill.\n *\n * **Rollout is by fallback, not by flag.** `translations/common/` is written by\n * a sync in the theme build service that may not have run yet, and a hard switch\n * would leave every storefront with no platform strings at all. A missing common\n * file therefore falls back to the old global one, which is exactly today's\n * behaviour — so this is safe to ship before the bucket is populated, and stops\n * using the fallback on its own once it is.\n */\nimport { queryOptions } from '@tanstack/react-query';\nimport { cdn, filesCdn } from './client';\nimport { storeTranslationsQueryKey, translationsQueryKey } from './translations-key';\nimport { composeMessages, isPlainObject, type Messages } from './messages';\nimport type { TranslationMessages } from '../providers/I18nProvider';\n\n/** The global file this used to be the only reader of. See the file comment. */\nconst LEGACY_GLOBAL_FILE = 'js/translations.json';\n\n/** One language of platform copy, shared by every store. */\nexport function commonTranslationsPath(locale: string): string {\n return `translations/common/${locale}.json`;\n}\n\n/**\n * One language of a single merchant's own wording.\n *\n * `storeId` is `settings.store.id`, which is the value `Languages-Module` names\n * the object with (`store()->getRouteKey()`, the Optimus-encoded numeric id).\n * It is **not** `resolveStoreIdentifier()`: that returns a hostname on a custom\n * domain and a username on a shared host, both of which 404 here and would read\n * as \"this merchant has no overrides\" — silently, on every store but a preview.\n */\nexport function storeTranslationsPath(storeId: string | number, locale: string): string {\n return `translations/${storeId}/${locale}.json`;\n}\n\n/**\n * Reads one language file, or `null` when there is nothing to read.\n *\n * A 404 is the ordinary answer, not a failure: most stores have never had a\n * word customised, so their file does not exist. Distinguishing it from a real\n * error matters only for the log — both end in `null` — but a warning on every\n * page load of every uncustomised store is a warning nobody will read.\n */\nasync function readLocaleFile(\n path: string,\n { failLoudly = false }: { failLoudly?: boolean } = {}\n): Promise<Messages | null> {\n /** A 404 always means \"absent\"; everything else is a failure to read. */\n const unreadable = (reason: string, cause?: unknown): null => {\n if (failLoudly) throw new Error(`[translations] ${path}: ${reason}`, { cause });\n console.warn('[translations]', reason, path, cause ?? '');\n return null;\n };\n\n try {\n const response = await filesCdn.get(path, { throwHttpErrors: false, timeout: 5000 });\n if (response.status === 404) return null;\n\n if (!response.ok) {\n return unreadable(`answered ${response.status}`);\n }\n\n const data: unknown = await response.json();\n if (!isPlainObject(data)) {\n return unreadable('is not a JSON object');\n }\n\n return data;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith('[translations]')) throw error;\n return unreadable('could not be read', error);\n }\n}\n\n/**\n * The pre-CDN global file, sliced to one language.\n *\n * Only reached when `translations/common/<locale>.json` is missing, which is\n * the state of the bucket until the sync has run once.\n */\nasync function readLegacyGlobal(locale: string): Promise<Messages | null> {\n try {\n const data = await cdn.get(LEGACY_GLOBAL_FILE, { timeout: 5000 }).json<TranslationMessages>();\n const forLocale = data?.[`${locale}.trans`];\n return isPlainObject(forLocale) ? forLocale : null;\n } catch {\n console.warn('[translations] the legacy global file could not be read either');\n return null;\n }\n}\n\nexport const translations = {\n /**\n * The platform's copy for `locale`.\n *\n * One file, so one request. See the file comment for why the merchant's own\n * wording is not merged in here yet and what it is waiting on.\n */\n get: async (locale: string): Promise<TranslationMessages | null> => {\n const common = await readLocaleFile(commonTranslationsPath(locale));\n const base = common ?? (await readLegacyGlobal(locale));\n if (!base) return null;\n\n // Still wrapped in the `<locale>.trans` shape the rest of the engine reads.\n // `createI18nInstance` slices by that key and so does the SDK bridge in\n // `I18nProvider`; changing the envelope here would be a second change for\n // no gain, since one language is all any of them ever take out of it.\n return { [`${locale}.trans`]: base as Record<string, string> };\n },\n\n /**\n * This merchant's own wording for `locale`, or `null` if they have none.\n *\n * Only worth calling when `settings.languages[<ISO>].has_custom_translations`\n * says there is something to get. Most stores have never customised a word,\n * and a miss here is an uncached round trip — `cf-cache-status: DYNAMIC` on a\n * 404 — on the critical path of an SSR render. The flag is what makes this\n * free for everyone who does not use it.\n *\n * Returned unwrapped, unlike {@link translations.get}: this is merged into\n * that one's messages rather than handed to i18next on its own.\n */\n forStore: async (storeId: string | number, locale: string): Promise<Messages | null> =>\n // `failLoudly`, unlike the platform file: this is only ever called because\n // the settings said overrides exist, so a 500, a timeout or a body that is\n // not JSON is a failure to read them — not a store that has none. Returning\n // `null` there would cache \"no overrides\" as a success, skip the query's\n // retry, and serve Salla's wording in place of the merchant's until the\n // entry expired. A 404 still means absent, and `rootBeforeLoad` catches the\n // throw and keeps the platform copy, so the worst case is unchanged.\n readLocaleFile(storeTranslationsPath(storeId, locale), { failLoudly: true }),\n\n /**\n * The platform's copy for `locale` with this merchant's wording laid over it.\n *\n * Takes the two as values rather than fetching them, so the caller decides\n * whether the second request happens at all and both stay separately cached.\n */\n /**\n * The platform's copy for `locale` with this merchant's wording over it.\n *\n * Delegates to `composeMessages`, which every other reader of these two\n * entries also uses — see `api/messages.ts` for why there is exactly one.\n */\n merge: (\n common: TranslationMessages | null,\n overrides: Messages | null,\n locale: string\n ): TranslationMessages | null => composeMessages(common, overrides, locale) ?? null,\n\n queries: {\n /**\n * @param locale taken as an argument rather than read from the twilight\n * context, and that is load-bearing. This key is built on the server, on\n * hydration, and again lazily from the context accessor; if any of the\n * three read a locale the others had not been given yet, the hydrated page\n * would miss the dehydrated entry and refetch both files it was just\n * handed. Every caller already has the locale in hand.\n *\n * The store is deliberately **not** in the key. One document serves one\n * store — a request that names a different one is redirected with\n * `reloadDocument`, so the client never changes store under a live cache —\n * and adding a value that resolves from the request on the server and from\n * the injected env on the client is how a key stops matching across\n * hydration.\n */\n byLocale: (locale: string) =>\n queryOptions({\n queryKey: translationsQueryKey(locale),\n queryFn: () => translations.get(locale),\n }),\n\n /**\n * This merchant's overrides, cached apart from the platform's copy.\n *\n * Its own entry rather than a wider `byLocale` key, so the common file is\n * fetched and dehydrated once per language whatever the store does, and a\n * store with no overrides never has an entry at all. Both sides compute the\n * key from the settings payload, so the hydrated page finds what the server\n * dehydrated instead of refetching it.\n */\n byStore: (storeId: string | number, locale: string) =>\n queryOptions({\n queryKey: storeTranslationsQueryKey(storeId, locale),\n queryFn: () => translations.forStore(storeId, locale),\n }),\n },\n};\n"]}
1
+ {"version":3,"sources":["../src/api/translations.ts"],"names":[],"mappings":";;;;AAiEA,IAAM,kBAAA,GAAqB,sBAAA;AAGpB,SAAS,uBAAuB,MAAA,EAAwB;AAC7D,EAAA,OAAO,uBAAuB,MAAM,CAAA,KAAA,CAAA;AACtC;AAWO,SAAS,qBAAA,CAAsB,SAA0B,MAAA,EAAwB;AACtF,EAAA,OAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAA,EAAI,MAAM,CAAA,KAAA,CAAA;AAC1C;AAUA,eAAe,eACb,IAAA,EACA,EAAE,aAAa,KAAA,EAAM,GAA8B,EAAC,EAC1B;AAE1B,EAAA,MAAM,UAAA,GAAa,CAAC,MAAA,EAAgB,KAAA,KAA0B;AAC5D,IAAA,IAAI,UAAA,EAAY,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,EAAA,EAAK,MAAM,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AAS,MAAM,YAAA,CAAa,GAAA,CAAI,MAAM;AAAA,KACvC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWH,OAAA,EAAS,CAAC,OAAA,EAA0B,MAAA,KAClC,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,yBAAA,CAA0B,OAAA,EAAS,MAAM,CAAA;AAAA,MACnD,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-GIKIIAGI.js","sourcesContent":["/**\n * @fileoverview Where a storefront's words come from.\n *\n * Two files, merged: the platform's copy for this language, and the merchant's\n * own edits for this language and this store. Both are plain JSON objects on\n * the uploader's CDN, one per language.\n *\n * ```\n * https://cdn.files.salla.network/translations/common/<locale>.json the platform's\n * https://cdn.files.salla.network/translations/<storeId>/<locale>.json the merchant's\n * ```\n *\n * **What this replaces, and why.** Until now the engine read a single global\n * file, `cdn.salla.network/js/translations.json`, holding every language keyed\n * `\"<locale>.trans\"`. Nothing publishes that file: it is an object last written\n * on 2026-03-26, carrying only `ar` and `en` where the platform has 39 locales,\n * 405 keys behind `Languages-Module` and 959 English strings textually\n * different from it. So every React storefront has been serving copy from\n * March, and a key added since has never reached one. It also carried no\n * merchant overrides at all — a merchant editing their theme's wording in the\n * Dashboard changed nothing on a React theme.\n *\n * **Merchant overrides are read, and only when there are any.** Getting here\n * took two corrections worth keeping.\n *\n * The first is the address. A merchant's own wording lives at\n * `translations/<storeId>/<locale>.json`, keyed by `store()->getRouteKey()` —\n * the Optimus-encoded numeric id. An early version addressed it with\n * `resolveStoreIdentifier()`, on the claim that the two are the same string.\n * That is true of the `store-identifier` *header*, which accepts a host, a\n * username or an id, and false of the R2 key: on a custom domain the resolver\n * returns `reefperfumes.com` and on a shared host a username like\n * `mtgr-alaatr-2`. Both 404, both then read as \"this store has no overrides\",\n * and the merchant's wording silently never appears — so the feature would have\n * worked under `?storeId=` alone, which is preview and localhost. It is\n * `settings.store.id` now, which is known only after the settings query.\n *\n * The second is when to ask at all. Most stores have never customised a word,\n * and a miss is an uncached round trip (`cf-cache-status: DYNAMIC` on the 404)\n * on the critical path of every SSR render. So the request is made only when\n * `settings.languages[<ISO>].has_custom_translations` says there is something\n * to get — a flag `Languages-Module` writes when a merchant saves a\n * translation. A store without overrides pays nothing, which is what made this\n * shippable at all.\n *\n * ⚠️ The flag is written on save, so a store whose wording predates it reads as\n * `false` until someone edits a translation or the backfill runs. That is a\n * store keeping today's behaviour, not a regression — React themes have never\n * read merchant overrides — but it does mean the feature is only as complete as\n * the backfill.\n *\n * **Rollout is by fallback, not by flag.** `translations/common/` is written by\n * a sync in the theme build service that may not have run yet, and a hard switch\n * would leave every storefront with no platform strings at all. A missing common\n * file therefore falls back to the old global one, which is exactly today's\n * behaviour — so this is safe to ship before the bucket is populated, and stops\n * using the fallback on its own once it is.\n */\nimport { queryOptions } from '@tanstack/react-query';\nimport { cdn, filesCdn } from './client';\nimport { storeTranslationsQueryKey, translationsQueryKey } from './translations-key';\nimport { composeMessages, isPlainObject, type Messages } from './messages';\nimport type { TranslationMessages } from '../providers/I18nProvider';\n\n/** The global file this used to be the only reader of. See the file comment. */\nconst LEGACY_GLOBAL_FILE = 'js/translations.json';\n\n/** One language of platform copy, shared by every store. */\nexport function commonTranslationsPath(locale: string): string {\n return `translations/common/${locale}.json`;\n}\n\n/**\n * One language of a single merchant's own wording.\n *\n * `storeId` is `settings.store.id`, which is the value `Languages-Module` names\n * the object with (`store()->getRouteKey()`, the Optimus-encoded numeric id).\n * It is **not** `resolveStoreIdentifier()`: that returns a hostname on a custom\n * domain and a username on a shared host, both of which 404 here and would read\n * as \"this merchant has no overrides\" — silently, on every store but a preview.\n */\nexport function storeTranslationsPath(storeId: string | number, locale: string): string {\n return `translations/${storeId}/${locale}.json`;\n}\n\n/**\n * Reads one language file, or `null` when there is nothing to read.\n *\n * A 404 is the ordinary answer, not a failure: most stores have never had a\n * word customised, so their file does not exist. Distinguishing it from a real\n * error matters only for the log — both end in `null` — but a warning on every\n * page load of every uncustomised store is a warning nobody will read.\n */\nasync function readLocaleFile(\n path: string,\n { failLoudly = false }: { failLoudly?: boolean } = {}\n): Promise<Messages | null> {\n /** A 404 always means \"absent\"; everything else is a failure to read. */\n const unreadable = (reason: string, cause?: unknown): null => {\n if (failLoudly) throw new Error(`[translations] ${path}: ${reason}`, { cause });\n console.warn('[translations]', reason, path, cause ?? '');\n return null;\n };\n\n try {\n const response = await filesCdn.get(path, { throwHttpErrors: false, timeout: 5000 });\n if (response.status === 404) return null;\n\n if (!response.ok) {\n return unreadable(`answered ${response.status}`);\n }\n\n const data: unknown = await response.json();\n if (!isPlainObject(data)) {\n return unreadable('is not a JSON object');\n }\n\n return data;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith('[translations]')) throw error;\n return unreadable('could not be read', error);\n }\n}\n\n/**\n * The pre-CDN global file, sliced to one language.\n *\n * Only reached when `translations/common/<locale>.json` is missing, which is\n * the state of the bucket until the sync has run once.\n */\nasync function readLegacyGlobal(locale: string): Promise<Messages | null> {\n try {\n const data = await cdn.get(LEGACY_GLOBAL_FILE, { timeout: 5000 }).json<TranslationMessages>();\n const forLocale = data?.[`${locale}.trans`];\n return isPlainObject(forLocale) ? forLocale : null;\n } catch {\n console.warn('[translations] the legacy global file could not be read either');\n return null;\n }\n}\n\nexport const translations = {\n /**\n * The platform's copy for `locale`.\n *\n * One file, so one request. See the file comment for why the merchant's own\n * wording is not merged in here yet and what it is waiting on.\n */\n get: async (locale: string): Promise<TranslationMessages | null> => {\n const common = await readLocaleFile(commonTranslationsPath(locale));\n const base = common ?? (await readLegacyGlobal(locale));\n if (!base) return null;\n\n // Still wrapped in the `<locale>.trans` shape the rest of the engine reads.\n // `createI18nInstance` slices by that key and so does the SDK bridge in\n // `I18nProvider`; changing the envelope here would be a second change for\n // no gain, since one language is all any of them ever take out of it.\n return { [`${locale}.trans`]: base as Record<string, string> };\n },\n\n /**\n * This merchant's own wording for `locale`, or `null` if they have none.\n *\n * Only worth calling when `settings.languages[<ISO>].has_custom_translations`\n * says there is something to get. Most stores have never customised a word,\n * and a miss here is an uncached round trip — `cf-cache-status: DYNAMIC` on a\n * 404 — on the critical path of an SSR render. The flag is what makes this\n * free for everyone who does not use it.\n *\n * Returned unwrapped, unlike {@link translations.get}: this is merged into\n * that one's messages rather than handed to i18next on its own.\n */\n forStore: async (storeId: string | number, locale: string): Promise<Messages | null> =>\n // `failLoudly`, unlike the platform file: this is only ever called because\n // the settings said overrides exist, so a 500, a timeout or a body that is\n // not JSON is a failure to read them — not a store that has none. Returning\n // `null` there would cache \"no overrides\" as a success, skip the query's\n // retry, and serve Salla's wording in place of the merchant's until the\n // entry expired. A 404 still means absent, and `rootBeforeLoad` catches the\n // throw and keeps the platform copy, so the worst case is unchanged.\n readLocaleFile(storeTranslationsPath(storeId, locale), { failLoudly: true }),\n\n /**\n * The platform's copy for `locale` with this merchant's wording laid over it.\n *\n * Takes the two as values rather than fetching them, so the caller decides\n * whether the second request happens at all and both stay separately cached.\n */\n /**\n * The platform's copy for `locale` with this merchant's wording over it.\n *\n * Delegates to `composeMessages`, which every other reader of these two\n * entries also uses — see `api/messages.ts` for why there is exactly one.\n */\n merge: (\n common: TranslationMessages | null,\n overrides: Messages | null,\n locale: string\n ): TranslationMessages | null => composeMessages(common, overrides, locale) ?? null,\n\n queries: {\n /**\n * @param locale taken as an argument rather than read from the twilight\n * context, and that is load-bearing. This key is built on the server, on\n * hydration, and again lazily from the context accessor; if any of the\n * three read a locale the others had not been given yet, the hydrated page\n * would miss the dehydrated entry and refetch both files it was just\n * handed. Every caller already has the locale in hand.\n *\n * The store is deliberately **not** in the key. One document serves one\n * store — a request that names a different one is redirected with\n * `reloadDocument`, so the client never changes store under a live cache —\n * and adding a value that resolves from the request on the server and from\n * the injected env on the client is how a key stops matching across\n * hydration.\n */\n byLocale: (locale: string) =>\n queryOptions({\n queryKey: translationsQueryKey(locale),\n queryFn: () => translations.get(locale),\n }),\n\n /**\n * This merchant's overrides, cached apart from the platform's copy.\n *\n * Its own entry rather than a wider `byLocale` key, so the common file is\n * fetched and dehydrated once per language whatever the store does, and a\n * store with no overrides never has an entry at all. Both sides compute the\n * key from the settings payload, so the hydrated page finds what the server\n * dehydrated instead of refetching it.\n */\n byStore: (storeId: string | number, locale: string) =>\n queryOptions({\n queryKey: storeTranslationsQueryKey(storeId, locale),\n queryFn: () => translations.forStore(storeId, locale),\n }),\n },\n};\n"]}
@@ -2,7 +2,7 @@ import { lazyComponent } from './chunk-VYGA5AT5.js';
2
2
 
3
3
  // src/components/common/lazy.ts
4
4
  var LazyBreadcrumb = lazyComponent(
5
- () => import('./Breadcrumb-V2URFP4B.js').then((m) => ({ default: m.Breadcrumb }))
5
+ () => import('./Breadcrumb-CCTHHEQH.js').then((m) => ({ default: m.Breadcrumb }))
6
6
  );
7
7
  var LazyNoContent = lazyComponent(
8
8
  () => import('./NoContent-7YUWEXI2.js').then((m) => ({ default: m.NoContent }))
@@ -18,5 +18,5 @@ var LazyErrorPage = lazyComponent(
18
18
  );
19
19
 
20
20
  export { LazyBreadcrumb, LazyCurrencySymbol, LazyErrorPage, LazyNoContent, LazyRenderWhenVisible };
21
- //# sourceMappingURL=chunk-YZDL6GF7.js.map
22
- //# sourceMappingURL=chunk-YZDL6GF7.js.map
21
+ //# sourceMappingURL=chunk-GO4EVN5H.js.map
22
+ //# sourceMappingURL=chunk-GO4EVN5H.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/common/lazy.ts"],"names":[],"mappings":";;;AASO,IAAM,cAAA,GAAiB,aAAA;AAAA,EAAc,MAC1C,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D;AAEO,IAAM,qBAAA,GAAwB,aAAA;AAAA,EAAc,MACjD,OAAO,iCAAqB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,iBAAA,EAAkB,CAAE;AAC9E;AAEO,IAAM,kBAAA,GAAqB,aAAA;AAAA,EAAc,MAC9C,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D","file":"chunk-YZDL6GF7.js","sourcesContent":["import { lazyComponent } from '../../utils/lazy-component';\n\n/**\n * Lazy-loaded common components\n * Use these for code-splitting non-critical components\n *\n * NOTE: Skeleton components are sourced from @salla.sa/twilight-components-react\n * because they must render instantly during route transitions.\n */\nexport const LazyBreadcrumb = lazyComponent(() =>\n import('./Breadcrumb').then((m) => ({ default: m.Breadcrumb }))\n);\n\nexport const LazyNoContent = lazyComponent(() =>\n import('./NoContent').then((m) => ({ default: m.NoContent }))\n);\n\nexport const LazyRenderWhenVisible = lazyComponent(() =>\n import('./RenderWhenVisible').then((m) => ({ default: m.RenderWhenVisible }))\n);\n\nexport const LazyCurrencySymbol = lazyComponent(() =>\n import('./CurrencySymbol').then((m) => ({ default: m.CurrencySymbol }))\n);\n\nexport const LazyErrorPage = lazyComponent(() =>\n import('./ErrorPage').then((m) => ({ default: m.ErrorPage }))\n);\n"]}
1
+ {"version":3,"sources":["../src/components/common/lazy.ts"],"names":[],"mappings":";;;AASO,IAAM,cAAA,GAAiB,aAAA;AAAA,EAAc,MAC1C,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D;AAEO,IAAM,qBAAA,GAAwB,aAAA;AAAA,EAAc,MACjD,OAAO,iCAAqB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,iBAAA,EAAkB,CAAE;AAC9E;AAEO,IAAM,kBAAA,GAAqB,aAAA;AAAA,EAAc,MAC9C,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D","file":"chunk-GO4EVN5H.js","sourcesContent":["import { lazyComponent } from '../../utils/lazy-component';\n\n/**\n * Lazy-loaded common components\n * Use these for code-splitting non-critical components\n *\n * NOTE: Skeleton components are sourced from @salla.sa/twilight-components-react\n * because they must render instantly during route transitions.\n */\nexport const LazyBreadcrumb = lazyComponent(() =>\n import('./Breadcrumb').then((m) => ({ default: m.Breadcrumb }))\n);\n\nexport const LazyNoContent = lazyComponent(() =>\n import('./NoContent').then((m) => ({ default: m.NoContent }))\n);\n\nexport const LazyRenderWhenVisible = lazyComponent(() =>\n import('./RenderWhenVisible').then((m) => ({ default: m.RenderWhenVisible }))\n);\n\nexport const LazyCurrencySymbol = lazyComponent(() =>\n import('./CurrencySymbol').then((m) => ({ default: m.CurrencySymbol }))\n);\n\nexport const LazyErrorPage = lazyComponent(() =>\n import('./ErrorPage').then((m) => ({ default: m.ErrorPage }))\n);\n"]}
@@ -1,6 +1,6 @@
1
- import { customUrl } from './chunk-KAQV2WZ6.js';
2
- import { store } from './chunk-K6AQYYJR.js';
3
- import { redirect } from './chunk-WLRNZYCA.js';
1
+ import { customUrl } from './chunk-WGUF75EV.js';
2
+ import { store } from './chunk-TMTJTEGN.js';
3
+ import { redirect } from './chunk-7RH6YE4A.js';
4
4
  import { isLocale } from './chunk-T72DAX7R.js';
5
5
 
6
6
  // src/routes/custom-urls.ts
@@ -87,5 +87,5 @@ async function customUrlRedirect(pathname, search, options) {
87
87
  }
88
88
 
89
89
  export { customUrlKey, customUrlPagePath, customUrlRedirect, storePathOf, withAddressQuery };
90
- //# sourceMappingURL=chunk-DCDWTP6S.js.map
91
- //# sourceMappingURL=chunk-DCDWTP6S.js.map
90
+ //# sourceMappingURL=chunk-GRF2ZTUB.js.map
91
+ //# sourceMappingURL=chunk-GRF2ZTUB.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/routes/custom-urls.ts"],"names":[],"mappings":";;;;;;AAiCO,SAAS,aAAa,QAAA,EAA2D;AACtF,EAAA,MAAM,WAAW,QAAA,CAAS,KAAA,CAAM,GAAG,CAAA,CAAE,OAAO,OAAO,CAAA;AACnD,EAAA,MAAM,MAAA,GAAS,SAAS,QAAA,CAAS,CAAC,CAAC,CAAA,GAAI,QAAA,CAAS,OAAM,GAAI,MAAA;AAC1D,EAAA,IAAI,CAAC,QAAA,CAAS,MAAA,EAAQ,OAAO,IAAA;AAC7B,EAAA,OAAO,EAAE,GAAA,EAAK,QAAA,CAAS,IAAA,CAAK,GAAG,GAAG,MAAA,EAAO;AAC3C;AAOO,SAAS,WAAA,CAAY,KAAa,QAAA,EAA6C;AACpF,EAAA,IAAI,IAAA;AACJ,EAAA,IAAI,IAAA;AACJ,EAAA,IAAI;AACF,IAAA,IAAA,GAAO,IAAI,IAAI,GAAG,CAAA;AAClB,IAAA,IAA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;AAAA,EAC1F;AACF","file":"chunk-DCDWTP6S.js","sourcesContent":["/**\n * @fileoverview A merchant's custom URLs (Dashboard → SEO → custom links) on a React storefront.\n *\n * Twig answers them in the Store's catch-all, its last fallback: after every route, and after the\n * product lookups by short code (`/{code}`) and by SKU (`/{sku}-{name}`). A React theme has no\n * catch-all, so the locale layout's `beforeLoad` asks the API (Store-Module#1798, the catch-all's\n * own lookup) at the same two points:\n * - an address no page answers (`twigUrlRedirect`, after the short code);\n * - a SKU-link address whose SKU names no product (`resolveProductKeyPage`).\n *\n * It asks only on a store that lists `custom-urls` in `store.features` (the plan has it, and the\n * store has an active one), so an address no page answers costs a store without one nothing. The answer is a 302, as Twig's, because the\n * merchant can point the URL elsewhere at any time.\n */\nimport type { QueryClient } from '@tanstack/react-query';\nimport { customUrl, type CustomUrlTarget } from '../api/custom-url';\nimport { store } from '../api/store';\nimport type { StoreContext } from '../api/store';\nimport { redirect } from '../providers/NavigationProvider';\nimport { isLocale } from '../providers/locale-constants';\n\nexport interface CustomUrlRedirectOptions {\n /** The request's query client: the settings are in it already, and a lookup is shared. */\n queryClient: QueryClient;\n /** The language segment an item's page takes, given the one the address had (the locale layout's rule). */\n targetLocale?: (addressLocale: string | undefined) => Promise<string | undefined>;\n}\n\n/**\n * The path a custom URL is saved under, for an address the router hands over (the store base\n * already off): without a language segment, which the Store strips before its catch-all, and\n * without the slashes around it. `null` for a home page.\n */\nexport function customUrlKey(pathname: string): { key: string; locale?: string } | null {\n const segments = pathname.split('/').filter(Boolean);\n const locale = isLocale(segments[0]) ? segments.shift() : undefined;\n if (!segments.length) return null;\n return { key: segments.join('/'), locale };\n}\n\n/**\n * The path an item's URL has under the store root, without its language segment:\n * `https://salla.sa/dev-x/en/shoes/p1` with store URL `https://salla.sa/dev-x/` is `/shoes/p1`.\n * `null` when the URL is not on the store (another host, or outside the store's segment).\n */\nexport function storePathOf(url: string, storeUrl: string | undefined): string | null {\n let item: URL;\n let root: URL;\n try {\n item = new URL(url);\n root = new URL(storeUrl ?? '');\n } catch {\n return null;\n }\n if (item.host !== root.host) return null;\n const rootPath = root.pathname.replace(/\\/+$/, '');\n if (rootPath && item.pathname !== rootPath && !item.pathname.startsWith(`${rootPath}/`)) {\n return null;\n }\n const segments = item.pathname.slice(rootPath.length).split('/').filter(Boolean);\n if (isLocale(segments[0])) segments.shift();\n return `/${segments.join('/')}`;\n}\n\n/** Twig's brand address, `/{slug}/brand-{id}`: the engine's brand page is `/brands/{id}`. */\nconst TWIG_BRAND_PATH = /^\\/[^/]+\\/brand-(\\d+)$/;\n\n/**\n * The engine's page for the item a custom URL names, under the store root and with no language,\n * or `null` for a `custom` row or an item URL that is not on the store. The item's own address\n * is used: the engine serves Twig's product, category, tag and page addresses (and redirects a\n * hash URL itself), and only a brand is sent straight to its page, a hop shorter.\n */\nexport function customUrlPagePath(\n target: CustomUrlTarget,\n storeUrl: string | undefined\n): string | null {\n if (target.type === 'custom') return null;\n const path = storePathOf(target.url, storeUrl);\n if (!path) return null;\n const brand = TWIG_BRAND_PATH.exec(path);\n return brand ? `/brands/${brand[1]}` : path;\n}\n\n/**\n * `target` with the address's query string on it, as the Store's catch-all keeps it (an ad's\n * `utm_*`): after the target's own query, and before its fragment.\n */\nexport function withAddressQuery(target: string, search: string): string {\n const query = search.replace(/^\\?/, '');\n if (!query) return target;\n const hashAt = target.indexOf('#');\n const [head, fragment] =\n hashAt < 0 ? [target, ''] : [target.slice(0, hashAt), target.slice(hashAt)];\n return `${head}${head.includes('?') ? '&' : '?'}${query}${fragment}`;\n}\n\n/** A URL when it is http(s): the Dashboard asks for a URL, and the router refuses any other scheme. */\nfunction httpUrl(url: string): string | null {\n try {\n const { protocol } = new URL(url);\n return protocol === 'http:' || protocol === 'https:' ? url : null;\n } catch {\n return null;\n }\n}\n\n/** The settings, when they list `custom-urls` in the store's features; else `null`. */\nasync function settingsWithCustomUrls(queryClient: QueryClient): Promise<StoreContext | null> {\n try {\n const settings = await queryClient.ensureQueryData(store.queries.settings());\n return settings?.store?.features?.includes('custom-urls') ? settings : null;\n } catch {\n return null;\n }\n}\n\n/**\n * The custom URL saved for `key`, or `undefined`. Any failure counts as none: an address no page\n * answers is also every scanner's, and an API error must leave it the 404 it was, not a 500.\n */\nasync function lookup(key: string, queryClient: QueryClient): Promise<CustomUrlTarget | undefined> {\n try {\n return await queryClient.ensureQueryData(customUrl.queries.resolve(key));\n } catch {\n return undefined;\n }\n}\n\n/**\n * Sends the visitor where the custom URL saved for `pathname` leads, with the address's query, by\n * a 302; returns when there is none, and the caller answers as it would have. An item on the store\n * is reached in one hop, in the language the locale layout would give it. A `custom` row's URL,\n * or an item URL on another site, is a full page load.\n */\nexport async function customUrlRedirect(\n pathname: string,\n search: string,\n options: CustomUrlRedirectOptions\n): Promise<void> {\n const address = customUrlKey(pathname);\n if (!address) return;\n const settings = await settingsWithCustomUrls(options.queryClient);\n if (!settings) return;\n const target = await lookup(address.key, options.queryClient);\n if (!target) return;\n\n const path = customUrlPagePath(target, settings.store?.url);\n if (path) {\n const locale = options.targetLocale\n ? await options.targetLocale(address.locale)\n : address.locale;\n throw redirect(withAddressQuery(`${locale ? `/${locale}` : ''}${path}`, search), {\n statusCode: 302,\n });\n }\n const href = httpUrl(target.url);\n if (href) {\n throw redirect(withAddressQuery(href, search), { statusCode: 302, reloadDocument: true });\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/routes/custom-urls.ts"],"names":[],"mappings":";;;;;;AAiCO,SAAS,aAAa,QAAA,EAA2D;AACtF,EAAA,MAAM,WAAW,QAAA,CAAS,KAAA,CAAM,GAAG,CAAA,CAAE,OAAO,OAAO,CAAA;AACnD,EAAA,MAAM,MAAA,GAAS,SAAS,QAAA,CAAS,CAAC,CAAC,CAAA,GAAI,QAAA,CAAS,OAAM,GAAI,MAAA;AAC1D,EAAA,IAAI,CAAC,QAAA,CAAS,MAAA,EAAQ,OAAO,IAAA;AAC7B,EAAA,OAAO,EAAE,GAAA,EAAK,QAAA,CAAS,IAAA,CAAK,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,OAAA,CAAQ,MAAA,CAAO,GAAG,CAAA;AAC/B,EAAA,IAAI,IAAA,EAAM;AACR,IAAA,MAAM,QAAA,CAAS,gBAAA,CAAiB,IAAA,EAAM,MAAM,CAAA,EAAG,EAAE,UAAA,EAAY,GAAA,EAAK,cAAA,EAAgB,IAAA,EAAM,CAAA;AAAA,EAC1F;AACF","file":"chunk-GRF2ZTUB.js","sourcesContent":["/**\n * @fileoverview A merchant's custom URLs (Dashboard → SEO → custom links) on a React storefront.\n *\n * Twig answers them in the Store's catch-all, its last fallback: after every route, and after the\n * product lookups by short code (`/{code}`) and by SKU (`/{sku}-{name}`). A React theme has no\n * catch-all, so the locale layout's `beforeLoad` asks the API (Store-Module#1798, the catch-all's\n * own lookup) at the same two points:\n * - an address no page answers (`twigUrlRedirect`, after the short code);\n * - a SKU-link address whose SKU names no product (`resolveProductKeyPage`).\n *\n * It asks only on a store that lists `custom-urls` in `store.features` (the plan has it, and the\n * store has an active one), so an address no page answers costs a store without one nothing. The answer is a 302, as Twig's, because the\n * merchant can point the URL elsewhere at any time.\n */\nimport type { QueryClient } from '@tanstack/react-query';\nimport { customUrl, type CustomUrlTarget } from '../api/custom-url';\nimport { store } from '../api/store';\nimport type { StoreContext } from '../api/store';\nimport { redirect } from '../providers/NavigationProvider';\nimport { isLocale } from '../providers/locale-constants';\n\nexport interface CustomUrlRedirectOptions {\n /** The request's query client: the settings are in it already, and a lookup is shared. */\n queryClient: QueryClient;\n /** The language segment an item's page takes, given the one the address had (the locale layout's rule). */\n targetLocale?: (addressLocale: string | undefined) => Promise<string | undefined>;\n}\n\n/**\n * The path a custom URL is saved under, for an address the router hands over (the store base\n * already off): without a language segment, which the Store strips before its catch-all, and\n * without the slashes around it. `null` for a home page.\n */\nexport function customUrlKey(pathname: string): { key: string; locale?: string } | null {\n const segments = pathname.split('/').filter(Boolean);\n const locale = isLocale(segments[0]) ? segments.shift() : undefined;\n if (!segments.length) return null;\n return { key: segments.join('/'), locale };\n}\n\n/**\n * The path an item's URL has under the store root, without its language segment:\n * `https://salla.sa/dev-x/en/shoes/p1` with store URL `https://salla.sa/dev-x/` is `/shoes/p1`.\n * `null` when the URL is not on the store (another host, or outside the store's segment).\n */\nexport function storePathOf(url: string, storeUrl: string | undefined): string | null {\n let item: URL;\n let root: URL;\n try {\n item = new URL(url);\n root = new URL(storeUrl ?? '');\n } catch {\n return null;\n }\n if (item.host !== root.host) return null;\n const rootPath = root.pathname.replace(/\\/+$/, '');\n if (rootPath && item.pathname !== rootPath && !item.pathname.startsWith(`${rootPath}/`)) {\n return null;\n }\n const segments = item.pathname.slice(rootPath.length).split('/').filter(Boolean);\n if (isLocale(segments[0])) segments.shift();\n return `/${segments.join('/')}`;\n}\n\n/** Twig's brand address, `/{slug}/brand-{id}`: the engine's brand page is `/brands/{id}`. */\nconst TWIG_BRAND_PATH = /^\\/[^/]+\\/brand-(\\d+)$/;\n\n/**\n * The engine's page for the item a custom URL names, under the store root and with no language,\n * or `null` for a `custom` row or an item URL that is not on the store. The item's own address\n * is used: the engine serves Twig's product, category, tag and page addresses (and redirects a\n * hash URL itself), and only a brand is sent straight to its page, a hop shorter.\n */\nexport function customUrlPagePath(\n target: CustomUrlTarget,\n storeUrl: string | undefined\n): string | null {\n if (target.type === 'custom') return null;\n const path = storePathOf(target.url, storeUrl);\n if (!path) return null;\n const brand = TWIG_BRAND_PATH.exec(path);\n return brand ? `/brands/${brand[1]}` : path;\n}\n\n/**\n * `target` with the address's query string on it, as the Store's catch-all keeps it (an ad's\n * `utm_*`): after the target's own query, and before its fragment.\n */\nexport function withAddressQuery(target: string, search: string): string {\n const query = search.replace(/^\\?/, '');\n if (!query) return target;\n const hashAt = target.indexOf('#');\n const [head, fragment] =\n hashAt < 0 ? [target, ''] : [target.slice(0, hashAt), target.slice(hashAt)];\n return `${head}${head.includes('?') ? '&' : '?'}${query}${fragment}`;\n}\n\n/** A URL when it is http(s): the Dashboard asks for a URL, and the router refuses any other scheme. */\nfunction httpUrl(url: string): string | null {\n try {\n const { protocol } = new URL(url);\n return protocol === 'http:' || protocol === 'https:' ? url : null;\n } catch {\n return null;\n }\n}\n\n/** The settings, when they list `custom-urls` in the store's features; else `null`. */\nasync function settingsWithCustomUrls(queryClient: QueryClient): Promise<StoreContext | null> {\n try {\n const settings = await queryClient.ensureQueryData(store.queries.settings());\n return settings?.store?.features?.includes('custom-urls') ? settings : null;\n } catch {\n return null;\n }\n}\n\n/**\n * The custom URL saved for `key`, or `undefined`. Any failure counts as none: an address no page\n * answers is also every scanner's, and an API error must leave it the 404 it was, not a 500.\n */\nasync function lookup(key: string, queryClient: QueryClient): Promise<CustomUrlTarget | undefined> {\n try {\n return await queryClient.ensureQueryData(customUrl.queries.resolve(key));\n } catch {\n return undefined;\n }\n}\n\n/**\n * Sends the visitor where the custom URL saved for `pathname` leads, with the address's query, by\n * a 302; returns when there is none, and the caller answers as it would have. An item on the store\n * is reached in one hop, in the language the locale layout would give it. A `custom` row's URL,\n * or an item URL on another site, is a full page load.\n */\nexport async function customUrlRedirect(\n pathname: string,\n search: string,\n options: CustomUrlRedirectOptions\n): Promise<void> {\n const address = customUrlKey(pathname);\n if (!address) return;\n const settings = await settingsWithCustomUrls(options.queryClient);\n if (!settings) return;\n const target = await lookup(address.key, options.queryClient);\n if (!target) return;\n\n const path = customUrlPagePath(target, settings.store?.url);\n if (path) {\n const locale = options.targetLocale\n ? await options.targetLocale(address.locale)\n : address.locale;\n throw redirect(withAddressQuery(`${locale ? `/${locale}` : ''}${path}`, search), {\n statusCode: 302,\n });\n }\n const href = httpUrl(target.url);\n if (href) {\n throw redirect(withAddressQuery(href, search), { statusCode: 302, reloadDocument: true });\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { orThrow } from './chunk-WLRNZYCA.js';
2
- import { getActiveScope, api } from './chunk-BSWV7U3V.js';
1
+ import { orThrow } from './chunk-7RH6YE4A.js';
2
+ import { getActiveScope, api } from './chunk-VND65UMT.js';
3
3
  import { queryOptions } from '@tanstack/react-query';
4
4
 
5
5
  var category = {
@@ -26,5 +26,5 @@ var category = {
26
26
  };
27
27
 
28
28
  export { category };
29
- //# sourceMappingURL=chunk-NQXXID34.js.map
30
- //# sourceMappingURL=chunk-NQXXID34.js.map
29
+ //# sourceMappingURL=chunk-GRYATL7L.js.map
30
+ //# sourceMappingURL=chunk-GRYATL7L.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/category.ts"],"names":[],"mappings":";;;;AAKO,IAAM,QAAA,GAAW;AAAA,EACtB,IAAA,EAAM,OAAO,EAAA,KAAkC;AAC7C,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CAAI,IAAI,CAAA,WAAA,EAAc,EAAE,CAAA,CAAE,CAAA,CAAE,IAAA,EAAyB;AAC5E,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAAA,EAEA,aAAa,CAAC,EAAA,KAAkC,QAAQ,QAAA,CAAS,IAAA,CAAK,EAAE,CAAC,CAAA;AAAA,EAEzE,MAAM,YAAiC;AACrC,IAAA,MAAM,EAAE,MAAK,GAAI,MAAM,IAAI,GAAA,CAAI,YAAY,EAAE,IAAA,EAA2B;AACxE,IAAA,OAAO,QAAQ,EAAC;AAAA,EAClB,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,MAAA,EAAQ,CAAC,EAAA,KACP,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,YAAA,EAAc,QAAA,EAAU,EAAE,CAAA;AAAA,MACrC,OAAA,EAAS,MAAM,QAAA,CAAS,IAAA,CAAK,EAAE;AAAA,KAChC,CAAA;AAAA,IAEH,IAAA,EAAM,MACJ,YAAA,CAAa;AAAA;AAAA,MAEX,QAAA,EAAU,CAAC,YAAA,EAAc,MAAA,EAAQ,EAAE,KAAA,EAAO,cAAA,IAAkB,CAAA;AAAA,MAC5D,OAAA,EAAS,MAAM,QAAA,CAAS,IAAA;AAAK,KAC9B;AAAA;AAEP","file":"chunk-NQXXID34.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api, getActiveScope } from './client';\nimport type { Category } from '../types';\nimport { orThrow } from '../providers/NavigationProvider';\n\nexport const category = {\n find: async (id: string): Promise<Category> => {\n const { data } = await api.get(`categories/${id}`).json<{ data: Category }>();\n return data;\n },\n\n findOrThrow: (id: string): Promise<Category> => orThrow(category.find(id)),\n\n list: async (): Promise<Category[]> => {\n const { data } = await api.get('categories').json<{ data: Category[] }>();\n return data ?? [];\n },\n\n queries: {\n detail: (id: string) =>\n queryOptions({\n queryKey: ['categories', 'detail', id],\n queryFn: () => category.find(id),\n }),\n\n list: () =>\n queryOptions({\n // Scope (branch) varies the API response — key must include it.\n queryKey: ['categories', 'list', { scope: getActiveScope() }],\n queryFn: () => category.list(),\n }),\n },\n};\n"]}
1
+ {"version":3,"sources":["../src/api/category.ts"],"names":[],"mappings":";;;;AAKO,IAAM,QAAA,GAAW;AAAA,EACtB,IAAA,EAAM,OAAO,EAAA,KAAkC;AAC7C,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CAAI,IAAI,CAAA,WAAA,EAAc,EAAE,CAAA,CAAE,CAAA,CAAE,IAAA,EAAyB;AAC5E,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAAA,EAEA,aAAa,CAAC,EAAA,KAAkC,QAAQ,QAAA,CAAS,IAAA,CAAK,EAAE,CAAC,CAAA;AAAA,EAEzE,MAAM,YAAiC;AACrC,IAAA,MAAM,EAAE,MAAK,GAAI,MAAM,IAAI,GAAA,CAAI,YAAY,EAAE,IAAA,EAA2B;AACxE,IAAA,OAAO,QAAQ,EAAC;AAAA,EAClB,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,MAAA,EAAQ,CAAC,EAAA,KACP,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,YAAA,EAAc,QAAA,EAAU,EAAE,CAAA;AAAA,MACrC,OAAA,EAAS,MAAM,QAAA,CAAS,IAAA,CAAK,EAAE;AAAA,KAChC,CAAA;AAAA,IAEH,IAAA,EAAM,MACJ,YAAA,CAAa;AAAA;AAAA,MAEX,QAAA,EAAU,CAAC,YAAA,EAAc,MAAA,EAAQ,EAAE,KAAA,EAAO,cAAA,IAAkB,CAAA;AAAA,MAC5D,OAAA,EAAS,MAAM,QAAA,CAAS,IAAA;AAAK,KAC9B;AAAA;AAEP","file":"chunk-GRYATL7L.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api, getActiveScope } from './client';\nimport type { Category } from '../types';\nimport { orThrow } from '../providers/NavigationProvider';\n\nexport const category = {\n find: async (id: string): Promise<Category> => {\n const { data } = await api.get(`categories/${id}`).json<{ data: Category }>();\n return data;\n },\n\n findOrThrow: (id: string): Promise<Category> => orThrow(category.find(id)),\n\n list: async (): Promise<Category[]> => {\n const { data } = await api.get('categories').json<{ data: Category[] }>();\n return data ?? [];\n },\n\n queries: {\n detail: (id: string) =>\n queryOptions({\n queryKey: ['categories', 'detail', id],\n queryFn: () => category.find(id),\n }),\n\n list: () =>\n queryOptions({\n // Scope (branch) varies the API response — key must include it.\n queryKey: ['categories', 'list', { scope: getActiveScope() }],\n queryFn: () => category.list(),\n }),\n },\n};\n"]}
@@ -1,21 +1,21 @@
1
1
  import { Footer } from './chunk-QT2D7JMW.js';
2
2
  import { getModelContext } from './chunk-Q77J3D2W.js';
3
- import { Header } from './chunk-BTQ2SAMS.js';
3
+ import { Header } from './chunk-CZTJ2YC2.js';
4
4
  import { editorFrame, previewTheme, postToEditor, FRAME_LOADED_ACTION } from './chunk-YL6X3ZMG.js';
5
- import { useDevSettingsOverrides, useDevReportSettingsFetchedAt } from './chunk-WHNF7WBH.js';
6
- import { resolveTwilightSdkUrl, TICKETING_SCRIPT_URL } from './chunk-F6MAM7HZ.js';
5
+ import { useDevSettingsOverrides, useDevReportSettingsFetchedAt } from './chunk-RD7ZPLRZ.js';
6
+ import { resolveTwilightSdkUrl, TICKETING_SCRIPT_URL } from './chunk-QF7HVZM5.js';
7
7
  import { color } from './chunk-VVZNW5CB.js';
8
8
  import { applyThemeHookSlots, installAppScope } from './chunk-QJOTD2GJ.js';
9
- import { apps } from './chunk-VY2TPXFO.js';
10
- import { cart, replaceSdkCart } from './chunk-AWOMNZIJ.js';
9
+ import { apps } from './chunk-VKKA35I2.js';
10
+ import { cart, replaceSdkCart } from './chunk-4MKZ7JPZ.js';
11
11
  import { withOwnerMaintenanceButton, withoutMaintenanceOnPreviewHost } from './chunk-O7JTXTGP.js';
12
- import { useLocation, useIsHome, NavigationInterceptor } from './chunk-WLRNZYCA.js';
13
- import { useUser } from './chunk-Z5LSS25A.js';
12
+ import { useLocation, useIsHome, NavigationInterceptor } from './chunk-7RH6YE4A.js';
13
+ import { useUser } from './chunk-N7CPWUSY.js';
14
14
  import { DocumentClassProvider, useDocumentClass } from './chunk-JWXJPJBO.js';
15
15
  import { WidgetHead } from './chunk-V2ZDTY6H.js';
16
16
  import { HookSlot } from './chunk-5XDPAKF5.js';
17
17
  import { hookRegistry } from './chunk-GCPEMNSU.js';
18
- import { getActiveCurrency, ENGINE_VERSION } from './chunk-BSWV7U3V.js';
18
+ import { getActiveCurrency, ENGINE_VERSION } from './chunk-VND65UMT.js';
19
19
  import { useTranslation, I18nProvider } from './chunk-TYNZ5B2B.js';
20
20
  import { Toaster } from './chunk-AXX7A2JJ.js';
21
21
  import { isNativeApp } from './chunk-BZ2QSBXM.js';
@@ -389,16 +389,16 @@ function useWebMcpSupported() {
389
389
  }
390
390
  var navigationSetups = {
391
391
  tanstack: lazyComponent(
392
- () => import('./navigation-PVCAQHKP.js').then((m) => ({ default: m.NavigationSetup }))
392
+ () => import('./navigation-5NG7XJSO.js').then((m) => ({ default: m.NavigationSetup }))
393
393
  ),
394
394
  // Not preloaded with the rest: a TanStack worker would load Next.js code it never runs.
395
- nextjs: lazy(() => import('./navigation-MEWHF2SI.js').then((m) => ({ default: m.NavigationSetup })))
395
+ nextjs: lazy(() => import('./navigation-F7D6JQKB.js').then((m) => ({ default: m.NavigationSetup })))
396
396
  };
397
397
 
398
398
  // src/providers/DocumentSyncRegistry.ts
399
399
  var routeDocumentSyncs = {
400
400
  tanstack: lazyComponent(
401
- () => import('./document-class-GMZDY55X.js').then((m) => ({
401
+ () => import('./document-class-SYUN4GYO.js').then((m) => ({
402
402
  default: m.TanStackDocumentSync
403
403
  }))
404
404
  )
@@ -911,7 +911,7 @@ function injectFastCheckoutScript() {
911
911
  document.head.appendChild(s);
912
912
  }
913
913
  var GoogleTagBody = lazyComponent(
914
- () => import('./GoogleTag-NWYDC6WD.js').then((m) => ({ default: m.GoogleTagBody }))
914
+ () => import('./GoogleTag-EEPZ4AH6.js').then((m) => ({ default: m.GoogleTagBody }))
915
915
  );
916
916
  var TwilightBundles = lazyComponent(
917
917
  () => import('./TwilightBundles-G6GHWBID.js').then((m) => ({ default: m.TwilightBundles }))
@@ -920,7 +920,7 @@ var LazySiftSnippet = lazyComponent(
920
920
  () => import('./SiftSnippet-5FCU6TR6.js').then((m) => ({ default: m.SiftSnippet }))
921
921
  );
922
922
  var LazyStoreClosedNotification = lazyComponent(
923
- () => import('./StoreClosedNotification-4HPWJKWS.js').then((m) => ({
923
+ () => import('./StoreClosedNotification-HJC4PYA5.js').then((m) => ({
924
924
  default: m.StoreClosedNotification
925
925
  }))
926
926
  );
@@ -1166,7 +1166,7 @@ function SallaSdkScripts({ settings }) {
1166
1166
 
1167
1167
  // src/components/store/lazy.ts
1168
1168
  var LazyStoreClosedNotification2 = lazyComponent(
1169
- () => import('./StoreClosedNotification-4HPWJKWS.js').then((m) => ({
1169
+ () => import('./StoreClosedNotification-HJC4PYA5.js').then((m) => ({
1170
1170
  default: m.StoreClosedNotification
1171
1171
  }))
1172
1172
  );
@@ -1236,7 +1236,7 @@ function LiveEditor() {
1236
1236
  if (!frame) return null;
1237
1237
  return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyLiveEditorBar, { origin: frame.origin, dev: frame.dev }) });
1238
1238
  }
1239
- var LazyWebMcpTools = React2.lazy(() => import('./WebMcpTools-VNHKJNI7.js'));
1239
+ var LazyWebMcpTools = React2.lazy(() => import('./WebMcpTools-Y537MP25.js'));
1240
1240
  function WebMcpMount() {
1241
1241
  if (!useWebMcpSupported()) return null;
1242
1242
  return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyWebMcpTools, {}) });
@@ -1528,5 +1528,5 @@ function useStore() {
1528
1528
  }
1529
1529
 
1530
1530
  export { LazyMaintenancePage, LazyStoreClosedNotification2 as LazyStoreClosedNotification, MasterLayout, TwilightProvider, fastCheckoutScript, registerDefaultHooks, registerDocumentSync, routeDocumentSyncs, useBreadcrumbs, useDate, useGtm, useMoney, useNumber, useOpeningHours, usePageConfig, useStore };
1531
- //# sourceMappingURL=chunk-5MUY4AUU.js.map
1532
- //# sourceMappingURL=chunk-5MUY4AUU.js.map
1531
+ //# sourceMappingURL=chunk-LAESVQK6.js.map
1532
+ //# sourceMappingURL=chunk-LAESVQK6.js.map