@salla.sa/twilight-theme-engine 1.0.146 → 1.0.148
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.
- package/dist/{AddToCartForm-ZZMT3ZRO.js → AddToCartForm-WY5QEHJ4.js} +3 -3
- package/dist/{AddToCartForm-ZZMT3ZRO.js.map → AddToCartForm-WY5QEHJ4.js.map} +1 -1
- package/dist/{BlogAuthorPage-LVRGWFOC.js → BlogAuthorPage-E2WXK6HD.js} +17 -17
- package/dist/{BlogAuthorPage-LVRGWFOC.js.map → BlogAuthorPage-E2WXK6HD.js.map} +1 -1
- package/dist/{BlogCategoryPage-CONL6QSN.js → BlogCategoryPage-B2JEB33A.js} +17 -17
- package/dist/{BlogCategoryPage-CONL6QSN.js.map → BlogCategoryPage-B2JEB33A.js.map} +1 -1
- package/dist/{BlogPage-6ZA474IU.js → BlogPage-CSNI6SS5.js} +15 -15
- package/dist/{BlogPage-6ZA474IU.js.map → BlogPage-CSNI6SS5.js.map} +1 -1
- package/dist/{BlogSinglePage-W7WYKP7W.js → BlogSinglePage-5ZY5EB6H.js} +15 -15
- package/dist/{BlogSinglePage-W7WYKP7W.js.map → BlogSinglePage-5ZY5EB6H.js.map} +1 -1
- package/dist/{BlogTagPage-G5JX7FSN.js → BlogTagPage-QFS7AKNK.js} +17 -17
- package/dist/{BlogTagPage-G5JX7FSN.js.map → BlogTagPage-QFS7AKNK.js.map} +1 -1
- package/dist/{BrandsPage-TB5NDSGL.js → BrandsPage-QBA2WQHF.js} +16 -16
- package/dist/{BrandsPage-TB5NDSGL.js.map → BrandsPage-QBA2WQHF.js.map} +1 -1
- package/dist/{Breadcrumb-EVZDJG7H.js → Breadcrumb-CH35WQ6M.js} +15 -15
- package/dist/{Breadcrumb-EVZDJG7H.js.map → Breadcrumb-CH35WQ6M.js.map} +1 -1
- package/dist/{CartItem-D2LJIFGL.js → CartItem-NBM3KRUH.js} +15 -15
- package/dist/{CartItem-D2LJIFGL.js.map → CartItem-NBM3KRUH.js.map} +1 -1
- package/dist/{CartSummary-V4HYUEPB.js → CartSummary-OD2IJTTA.js} +15 -15
- package/dist/{CartSummary-V4HYUEPB.js.map → CartSummary-OD2IJTTA.js.map} +1 -1
- package/dist/{Copyright-JLIFLENS.js → Copyright-7EC2FQUB.js} +3 -3
- package/dist/{Copyright-JLIFLENS.js.map → Copyright-7EC2FQUB.js.map} +1 -1
- package/dist/{CustomerLayout-JSIYPWY4.js → CustomerLayout-7GEOMQ3Z.js} +15 -15
- package/dist/{CustomerLayout-JSIYPWY4.js.map → CustomerLayout-7GEOMQ3Z.js.map} +1 -1
- package/dist/{Footer-BNIVXKRM.js → Footer-JTQIMWSF.js} +4 -4
- package/dist/{Footer-BNIVXKRM.js.map → Footer-JTQIMWSF.js.map} +1 -1
- package/dist/{Header-DI3OK5TC.js → Header-4ZW5UVTX.js} +8 -8
- package/dist/{Header-DI3OK5TC.js.map → Header-4ZW5UVTX.js.map} +1 -1
- package/dist/{LatestProducts-PEIN355E.js → LatestProducts-VHN2P5TE.js} +17 -17
- package/dist/{LatestProducts-PEIN355E.js.map → LatestProducts-VHN2P5TE.js.map} +1 -1
- package/dist/{LoyaltyPage-GV6WMYVE.js → LoyaltyPage-PVK7FBFE.js} +15 -15
- package/dist/{LoyaltyPage-GV6WMYVE.js.map → LoyaltyPage-PVK7FBFE.js.map} +1 -1
- package/dist/{LoyaltyPointsPage-QNOVSCKB.js → LoyaltyPointsPage-WYCO453U.js} +6 -6
- package/dist/{LoyaltyPointsPage-QNOVSCKB.js.map → LoyaltyPointsPage-WYCO453U.js.map} +1 -1
- package/dist/{MainMenu-IN5HUX3U.js → MainMenu-Y2PAFESM.js} +5 -5
- package/dist/{MainMenu-IN5HUX3U.js.map → MainMenu-Y2PAFESM.js.map} +1 -1
- package/dist/{MasterLayout-GHAXKYOR.js → MasterLayout-EBLVT53G.js} +15 -15
- package/dist/{MasterLayout-GHAXKYOR.js.map → MasterLayout-EBLVT53G.js.map} +1 -1
- package/dist/{MobileMenu-XU45EZMG.js → MobileMenu-YIL4MEWX.js} +16 -16
- package/dist/{MobileMenu-XU45EZMG.js.map → MobileMenu-YIL4MEWX.js.map} +1 -1
- package/dist/{NotificationsPage-AMY7TARF.js → NotificationsPage-K2CJOV2N.js} +15 -15
- package/dist/{NotificationsPage-AMY7TARF.js.map → NotificationsPage-K2CJOV2N.js.map} +1 -1
- package/dist/{OrderSinglePage-L2E6YH3Z.js → OrderSinglePage-T7S7KXJ3.js} +16 -16
- package/dist/{OrderSinglePage-L2E6YH3Z.js.map → OrderSinglePage-T7S7KXJ3.js.map} +1 -1
- package/dist/{OrdersPage-76ORWMJY.js → OrdersPage-WAW3NS2E.js} +15 -15
- package/dist/{OrdersPage-76ORWMJY.js.map → OrdersPage-WAW3NS2E.js.map} +1 -1
- package/dist/{PageSingle-D7I6EHBF.js → PageSingle-L5EBQGWS.js} +3 -3
- package/dist/{PageSingle-D7I6EHBF.js.map → PageSingle-L5EBQGWS.js.map} +1 -1
- package/dist/{ProductDetails-BZVRXSCD.js → ProductDetails-4E46ZCMQ.js} +5 -5
- package/dist/{ProductDetails-BZVRXSCD.js.map → ProductDetails-4E46ZCMQ.js.map} +1 -1
- package/dist/{ProfilePage-65NYRBON.js → ProfilePage-KN7BWYFZ.js} +15 -15
- package/dist/{ProfilePage-65NYRBON.js.map → ProfilePage-KN7BWYFZ.js.map} +1 -1
- package/dist/{ReviewsPage-C7NSCMBE.js → ReviewsPage-CCTPJN76.js} +3 -3
- package/dist/{ReviewsPage-C7NSCMBE.js.map → ReviewsPage-CCTPJN76.js.map} +1 -1
- package/dist/{SeoCartWidget-GK3KC2M3.js → SeoCartWidget-Q5XK5MEW.js} +15 -15
- package/dist/{SeoCartWidget-GK3KC2M3.js.map → SeoCartWidget-Q5XK5MEW.js.map} +1 -1
- package/dist/{SettingsPage-7VGJBA5K.js → SettingsPage-DQAAMJE5.js} +15 -15
- package/dist/{SettingsPage-7VGJBA5K.js.map → SettingsPage-DQAAMJE5.js.map} +1 -1
- package/dist/{StoreClosedNotification-44JN2FZV.js → StoreClosedNotification-ZSDPBM3L.js} +16 -16
- package/dist/{StoreClosedNotification-44JN2FZV.js.map → StoreClosedNotification-ZSDPBM3L.js.map} +1 -1
- package/dist/{TestimonialsPage-KGCGTUJQ.js → TestimonialsPage-6LGQSJSQ.js} +3 -3
- package/dist/{TestimonialsPage-KGCGTUJQ.js.map → TestimonialsPage-6LGQSJSQ.js.map} +1 -1
- package/dist/ThankYouPage-ZI6NEGN3.js +187 -0
- package/dist/ThankYouPage-ZI6NEGN3.js.map +1 -0
- package/dist/{WalletPage-J3CX6MLS.js → WalletPage-R6G5BQAI.js} +16 -16
- package/dist/{WalletPage-J3CX6MLS.js.map → WalletPage-R6G5BQAI.js.map} +1 -1
- package/dist/{WebMcpTools-3MV53OMT.js → WebMcpTools-2NWIVDL2.js} +5 -5
- package/dist/{WebMcpTools-3MV53OMT.js.map → WebMcpTools-2NWIVDL2.js.map} +1 -1
- package/dist/{WishlistPage-HHX3OVOF.js → WishlistPage-CQ62GPLC.js} +17 -17
- package/dist/{WishlistPage-HHX3OVOF.js.map → WishlistPage-CQ62GPLC.js.map} +1 -1
- package/dist/ambient/salla-components.d.ts +42 -0
- package/dist/api/advertisement.js +2 -2
- package/dist/api/apps.js +2 -2
- package/dist/api/blog.js +3 -3
- package/dist/api/brands.js +3 -3
- package/dist/api/cart.js +3 -3
- package/dist/api/category.js +3 -3
- package/dist/api/client.js +1 -1
- package/dist/api/home.js +2 -2
- package/dist/api/loyalty.js +3 -3
- package/dist/api/menu.js +2 -2
- package/dist/api/notification.js +2 -2
- package/dist/api/order.js +3 -3
- package/dist/api/page.js +3 -3
- package/dist/api/product.js +3 -3
- package/dist/api/profile.js +1 -1
- package/dist/api/store.js +2 -2
- package/dist/api/translations.js +2 -2
- package/dist/api/user.js +2 -2
- package/dist/api/wallet.js +2 -2
- package/dist/api/wishlist.js +4 -4
- package/dist/{chunk-VNHYMLGK.js → chunk-23OJW6CK.js} +3 -3
- package/dist/{chunk-VNHYMLGK.js.map → chunk-23OJW6CK.js.map} +1 -1
- package/dist/{chunk-O6RZ6AWT.js → chunk-33327CFA.js} +4 -4
- package/dist/{chunk-O6RZ6AWT.js.map → chunk-33327CFA.js.map} +1 -1
- package/dist/{chunk-VDY3VY7S.js → chunk-3AIK4QGW.js} +3 -3
- package/dist/{chunk-VDY3VY7S.js.map → chunk-3AIK4QGW.js.map} +1 -1
- package/dist/{chunk-5EN3XZ32.js → chunk-3BDSQIYZ.js} +3 -3
- package/dist/{chunk-5EN3XZ32.js.map → chunk-3BDSQIYZ.js.map} +1 -1
- package/dist/{chunk-C6PNF2OT.js → chunk-3WA5RJGC.js} +3 -3
- package/dist/{chunk-C6PNF2OT.js.map → chunk-3WA5RJGC.js.map} +1 -1
- package/dist/{chunk-X6WDFQYL.js → chunk-4FFABE3P.js} +3 -3
- package/dist/{chunk-X6WDFQYL.js.map → chunk-4FFABE3P.js.map} +1 -1
- package/dist/{chunk-F7S2QA3D.js → chunk-5ABT7QLS.js} +7 -7
- package/dist/{chunk-F7S2QA3D.js.map → chunk-5ABT7QLS.js.map} +1 -1
- package/dist/chunk-5PMEGLR6.js +75 -0
- package/dist/chunk-5PMEGLR6.js.map +1 -0
- package/dist/{chunk-PCYZMJUC.js → chunk-6T4HGLQM.js} +3 -3
- package/dist/{chunk-PCYZMJUC.js.map → chunk-6T4HGLQM.js.map} +1 -1
- package/dist/{chunk-MVT5AF2A.js → chunk-6T55LXJL.js} +3 -2
- package/dist/chunk-6T55LXJL.js.map +1 -0
- package/dist/chunk-7R43CIG7.js +90 -0
- package/dist/chunk-7R43CIG7.js.map +1 -0
- package/dist/{chunk-3O6BB7SI.js → chunk-BAJBKIGI.js} +3 -3
- package/dist/{chunk-3O6BB7SI.js.map → chunk-BAJBKIGI.js.map} +1 -1
- package/dist/{chunk-C5P2C2NR.js → chunk-C7LAIXEO.js} +3 -3
- package/dist/{chunk-C5P2C2NR.js.map → chunk-C7LAIXEO.js.map} +1 -1
- package/dist/{chunk-JOHFXU4C.js → chunk-CAAIQPEN.js} +4 -4
- package/dist/{chunk-JOHFXU4C.js.map → chunk-CAAIQPEN.js.map} +1 -1
- package/dist/{chunk-QXWCIK6D.js → chunk-CNTXY27A.js} +4 -4
- package/dist/{chunk-QXWCIK6D.js.map → chunk-CNTXY27A.js.map} +1 -1
- package/dist/{chunk-YDRURQ2W.js → chunk-CUURFACL.js} +3 -3
- package/dist/{chunk-YDRURQ2W.js.map → chunk-CUURFACL.js.map} +1 -1
- package/dist/{chunk-2DUN6DZK.js → chunk-CXKA35FJ.js} +3 -3
- package/dist/{chunk-2DUN6DZK.js.map → chunk-CXKA35FJ.js.map} +1 -1
- package/dist/{chunk-K4YRFOFA.js → chunk-DQEJV5SR.js} +7 -7
- package/dist/{chunk-K4YRFOFA.js.map → chunk-DQEJV5SR.js.map} +1 -1
- package/dist/{chunk-Z4EQHB26.js → chunk-ELYKF67K.js} +5 -5
- package/dist/{chunk-Z4EQHB26.js.map → chunk-ELYKF67K.js.map} +1 -1
- package/dist/{chunk-T2O2IQJQ.js → chunk-F3QHKYS3.js} +4 -4
- package/dist/{chunk-T2O2IQJQ.js.map → chunk-F3QHKYS3.js.map} +1 -1
- package/dist/{chunk-A4Y5BVJN.js → chunk-GBJK6KKM.js} +3 -3
- package/dist/{chunk-A4Y5BVJN.js.map → chunk-GBJK6KKM.js.map} +1 -1
- package/dist/{chunk-BKSVKSAW.js → chunk-HPK6GB7G.js} +15 -15
- package/dist/{chunk-BKSVKSAW.js.map → chunk-HPK6GB7G.js.map} +1 -1
- package/dist/{chunk-CFG6PGUZ.js → chunk-IFKCPNDF.js} +4 -4
- package/dist/{chunk-CFG6PGUZ.js.map → chunk-IFKCPNDF.js.map} +1 -1
- package/dist/{chunk-HZWTDQVJ.js → chunk-JDCZWE7N.js} +5 -5
- package/dist/{chunk-HZWTDQVJ.js.map → chunk-JDCZWE7N.js.map} +1 -1
- package/dist/{chunk-7ZTSYUCJ.js → chunk-JZ54GDXO.js} +4 -4
- package/dist/{chunk-7ZTSYUCJ.js.map → chunk-JZ54GDXO.js.map} +1 -1
- package/dist/{chunk-TQQN5AE2.js → chunk-KUQQJTFA.js} +3 -3
- package/dist/{chunk-TQQN5AE2.js.map → chunk-KUQQJTFA.js.map} +1 -1
- package/dist/{chunk-YEBA44IV.js → chunk-LILNJBFU.js} +3 -3
- package/dist/{chunk-YEBA44IV.js.map → chunk-LILNJBFU.js.map} +1 -1
- package/dist/{chunk-DMGSEY7F.js → chunk-MA3R5QON.js} +3 -3
- package/dist/{chunk-DMGSEY7F.js.map → chunk-MA3R5QON.js.map} +1 -1
- package/dist/{chunk-VEVFVWF3.js → chunk-MJHYLDXL.js} +3 -3
- package/dist/{chunk-VEVFVWF3.js.map → chunk-MJHYLDXL.js.map} +1 -1
- package/dist/{chunk-AECYX56P.js → chunk-NRMAYV4G.js} +4 -4
- package/dist/{chunk-AECYX56P.js.map → chunk-NRMAYV4G.js.map} +1 -1
- package/dist/{chunk-PBT52UWY.js → chunk-NWQUPGB4.js} +4 -4
- package/dist/{chunk-PBT52UWY.js.map → chunk-NWQUPGB4.js.map} +1 -1
- package/dist/{chunk-VQO4TTPE.js → chunk-QOC7HUYN.js} +4 -4
- package/dist/{chunk-VQO4TTPE.js.map → chunk-QOC7HUYN.js.map} +1 -1
- package/dist/{chunk-7PPNAVBF.js → chunk-R72B5P4R.js} +4 -4
- package/dist/{chunk-7PPNAVBF.js.map → chunk-R72B5P4R.js.map} +1 -1
- package/dist/{chunk-BEYWTFOR.js → chunk-SCWUJ5PP.js} +3 -3
- package/dist/{chunk-BEYWTFOR.js.map → chunk-SCWUJ5PP.js.map} +1 -1
- package/dist/{chunk-DHKZCR6U.js → chunk-T55MRK24.js} +5 -5
- package/dist/{chunk-DHKZCR6U.js.map → chunk-T55MRK24.js.map} +1 -1
- package/dist/{chunk-ZSEECSDV.js → chunk-V6IKYNU6.js} +7 -7
- package/dist/{chunk-ZSEECSDV.js.map → chunk-V6IKYNU6.js.map} +1 -1
- package/dist/{chunk-FTH3XLIN.js → chunk-W2A5AWNA.js} +3 -3
- package/dist/{chunk-FTH3XLIN.js.map → chunk-W2A5AWNA.js.map} +1 -1
- package/dist/{chunk-FXW6H6J3.js → chunk-W3QKGF2O.js} +3 -3
- package/dist/{chunk-FXW6H6J3.js.map → chunk-W3QKGF2O.js.map} +1 -1
- package/dist/{chunk-EF3PLLLA.js → chunk-WH73HWTE.js} +7 -7
- package/dist/{chunk-EF3PLLLA.js.map → chunk-WH73HWTE.js.map} +1 -1
- package/dist/{chunk-3QOALQQJ.js → chunk-WPRJVK7K.js} +4 -4
- package/dist/{chunk-3QOALQQJ.js.map → chunk-WPRJVK7K.js.map} +1 -1
- package/dist/{chunk-B36NISD2.js → chunk-X5W7HZNX.js} +4 -4
- package/dist/{chunk-B36NISD2.js.map → chunk-X5W7HZNX.js.map} +1 -1
- package/dist/{chunk-3G4YCXOR.js → chunk-ZXEJ46OF.js} +87 -23
- package/dist/chunk-ZXEJ46OF.js.map +1 -0
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/drawer/index.js +13 -13
- package/dist/components/home/index.js +18 -18
- package/dist/components/layout/index.js +4 -4
- package/dist/components/product/index.js +15 -15
- package/dist/components/store/index.js +14 -14
- package/dist/dev/editor/index.js +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/{document-class-SWL4NCC6.js → document-class-B57F7JZW.js} +12 -11
- package/dist/{document-class-SWL4NCC6.js.map → document-class-B57F7JZW.js.map} +1 -1
- package/dist/hooks/index.js +13 -13
- package/dist/hooks/useGtm.js +13 -13
- package/dist/hooks/useMoney.js +13 -13
- package/dist/hooks/useStore.js +13 -13
- package/dist/hooks/useUser.js +3 -3
- package/dist/index.js +13 -13
- package/dist/{navigation-7V4CSVG5.js → navigation-N3WBAE74.js} +5 -5
- package/dist/{navigation-7V4CSVG5.js.map → navigation-N3WBAE74.js.map} +1 -1
- package/dist/{navigation-VMR4V27L.js → navigation-VJBIYPFD.js} +4 -4
- package/dist/{navigation-VMR4V27L.js.map → navigation-VJBIYPFD.js.map} +1 -1
- package/dist/{not-found-S33EUV2Q.js → not-found-KDDMHTAU.js} +16 -16
- package/dist/{not-found-S33EUV2Q.js.map → not-found-KDDMHTAU.js.map} +1 -1
- package/dist/providers/index.js +13 -13
- package/dist/routes/account/orders.js +4 -4
- package/dist/routes/account.js +13 -13
- package/dist/routes/blog.js +8 -8
- package/dist/routes/brands.js +4 -4
- package/dist/routes/cart.js +22 -22
- package/dist/routes/home.js +19 -19
- package/dist/routes/index.js +3 -3
- package/dist/routes/loyalty.js +5 -5
- package/dist/routes/page.js +4 -4
- package/dist/routes/product-listing/ProductListPage.d.ts.map +1 -1
- package/dist/routes/product-listing/useAppliedFilters.d.ts.map +1 -1
- package/dist/routes/product-listing.js +27 -86
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +18 -18
- package/dist/routes/seo-redirects.js +3 -3
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you/ThankYouPage.d.ts +2 -1
- package/dist/routes/thank-you/ThankYouPage.d.ts.map +1 -1
- package/dist/routes/thank-you/loader.d.ts +5 -1
- package/dist/routes/thank-you/loader.d.ts.map +1 -1
- package/dist/routes/thank-you/types.d.ts +23 -1
- package/dist/routes/thank-you/types.d.ts.map +1 -1
- package/dist/routes/thank-you.js +79 -15
- package/dist/routes/thank-you.js.map +1 -1
- package/dist/skeleton.js +19 -19
- package/dist/{store-lookup-D5C2LNXK.js → store-lookup-WBKOYMDU.js} +8 -8
- package/dist/{store-lookup-D5C2LNXK.js.map → store-lookup-WBKOYMDU.js.map} +1 -1
- package/dist/tanstack/router.d.ts.map +1 -1
- package/dist/tanstack.js +12 -11
- package/dist/tanstack.js.map +1 -1
- package/dist/types/hooks.d.ts +1 -0
- package/dist/types/hooks.d.ts.map +1 -1
- package/dist/types/hooks.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/salla-sdk.d.ts +4 -0
- package/dist/types/salla-sdk.d.ts.map +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/sdk-events.d.ts +32 -1
- package/dist/utils/sdk-events.d.ts.map +1 -1
- package/dist/vite/index.js +1 -0
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/plugins/best-practices/hooks-registry.d.ts.map +1 -1
- package/package.json +1 -1
- package/tailwind/routes/product-listing/ProductListPage.tsx.txt +3 -1
- package/tailwind/routes/product-listing/useAppliedFilters.ts.txt +5 -1
- package/tailwind/routes/thank-you/ThankYouPage.tsx.txt +124 -209
- package/tailwind/routes/thank-you/index.tsx.txt +1 -1
- package/tailwind/routes/thank-you/loader.ts.txt +112 -14
- package/tailwind/routes/thank-you/types.ts.txt +24 -1
- package/dist/ThankYouPage-XWB4X236.js +0 -267
- package/dist/ThankYouPage-XWB4X236.js.map +0 -1
- package/dist/chunk-3G4YCXOR.js.map +0 -1
- package/dist/chunk-MVT5AF2A.js.map +0 -1
- package/dist/chunk-QBVXQHVJ.js +0 -40
- package/dist/chunk-QBVXQHVJ.js.map +0 -1
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import { usePageConfig } from './chunk-BKSVKSAW.js';
|
|
2
|
-
import './chunk-Q77J3D2W.js';
|
|
3
|
-
import './chunk-F7S2QA3D.js';
|
|
4
|
-
import './chunk-PCYZMJUC.js';
|
|
5
|
-
import './chunk-5V4W3GBI.js';
|
|
6
|
-
import './chunk-X55R4VVK.js';
|
|
7
|
-
import './chunk-YL6X3ZMG.js';
|
|
8
|
-
import './chunk-YEBA44IV.js';
|
|
9
|
-
import './chunk-OXMUPNMH.js';
|
|
10
|
-
import './chunk-5EN3XZ32.js';
|
|
11
|
-
import './chunk-VVZNW5CB.js';
|
|
12
|
-
import './chunk-EGI7F57E.js';
|
|
13
|
-
import './chunk-GD26FI4J.js';
|
|
14
|
-
import './chunk-SLBO4SEE.js';
|
|
15
|
-
import './chunk-MGG4XAJ5.js';
|
|
16
|
-
import './chunk-VEVFVWF3.js';
|
|
17
|
-
import './chunk-OUW6WESU.js';
|
|
18
|
-
import './chunk-IHOUADLX.js';
|
|
19
|
-
import './chunk-HI5V5X3S.js';
|
|
20
|
-
import './chunk-3O6BB7SI.js';
|
|
21
|
-
import './chunk-A4Y5BVJN.js';
|
|
22
|
-
import './chunk-MVT5AF2A.js';
|
|
23
|
-
import './chunk-Z653O7MX.js';
|
|
24
|
-
import './chunk-ZCH7W7DZ.js';
|
|
25
|
-
import './chunk-H7LRGY7U.js';
|
|
26
|
-
import './chunk-JWXJPJBO.js';
|
|
27
|
-
import './chunk-CW625T2E.js';
|
|
28
|
-
import './chunk-7V36I5GT.js';
|
|
29
|
-
import './chunk-6WI7R2BD.js';
|
|
30
|
-
import './chunk-M5WTY3EH.js';
|
|
31
|
-
import './chunk-OAMIDZKW.js';
|
|
32
|
-
import './chunk-YDRURQ2W.js';
|
|
33
|
-
import './chunk-OQIIJRAS.js';
|
|
34
|
-
import './chunk-V2ZDTY6H.js';
|
|
35
|
-
import './chunk-VDY3VY7S.js';
|
|
36
|
-
import { HookSlot } from './chunk-5XDPAKF5.js';
|
|
37
|
-
import './chunk-GCPEMNSU.js';
|
|
38
|
-
import './chunk-2DUN6DZK.js';
|
|
39
|
-
import './chunk-Z5M4YYWT.js';
|
|
40
|
-
import { useTranslation } from './chunk-TYNZ5B2B.js';
|
|
41
|
-
import './chunk-FTH3XLIN.js';
|
|
42
|
-
import { Link } from './chunk-AXW67SY7.js';
|
|
43
|
-
import './chunk-BYMOPN2S.js';
|
|
44
|
-
import './chunk-SKLEJJ6M.js';
|
|
45
|
-
import './chunk-6BZ5TKEV.js';
|
|
46
|
-
import './chunk-FZKRSGLP.js';
|
|
47
|
-
import './chunk-KYMWEUN2.js';
|
|
48
|
-
import './chunk-YA6ABQB7.js';
|
|
49
|
-
import './chunk-QMWP2ZP6.js';
|
|
50
|
-
import './chunk-6TFM3UTF.js';
|
|
51
|
-
import { onSallaEvent } from './chunk-XMRNYUQY.js';
|
|
52
|
-
import './chunk-T2752RH7.js';
|
|
53
|
-
import './chunk-6K34BCUP.js';
|
|
54
|
-
import './chunk-T72DAX7R.js';
|
|
55
|
-
import { useTwilight } from './chunk-DF6FBKDN.js';
|
|
56
|
-
import './chunk-VYGA5AT5.js';
|
|
57
|
-
import './chunk-DGUM43GV.js';
|
|
58
|
-
import { useState, useEffect } from 'react';
|
|
59
|
-
import { useCopyToClipboard } from '@uidotdev/usehooks';
|
|
60
|
-
import { SallaButton } from '@salla.sa/twilight-components-react/button';
|
|
61
|
-
import { SallaNextOrderCoupon } from '@salla.sa/twilight-components-react/next-order-coupon';
|
|
62
|
-
import { SallaOrderBranch } from '@salla.sa/twilight-components-react/order-branch';
|
|
63
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
64
|
-
|
|
65
|
-
// src/routes/thank-you/confetti.svg
|
|
66
|
-
var confetti_default = 'data:image/svg+xml,<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="137.613" height="140" viewBox="0 0 137.613 140" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<g id="confetti 1">%0A<path id="Vector" d="M67.8356 58.1608C85.9143 40.0847 105.738 30.5988 112.114 36.9733C112.814 37.7062 113.329 38.5951 113.617 39.5669L113.719 39.4643L119.809 64.421L125.874 89.303L133.062 118.766L137.613 137.425L110.671 127.23L76.4026 114.264L49.0641 103.92L49.0968 103.888C48.1816 103.596 47.3443 103.101 46.6477 102.439C40.2709 96.0623 49.7569 76.2392 67.8356 58.1608Z" fill="%23DD1C4B"/>%0A<path id="Vector_2" d="M67.8363 58.1525C85.9143 40.0747 105.738 30.5885 112.114 36.9645C118.49 43.3404 109.004 63.1641 90.926 81.2419C72.848 99.3196 53.024 108.806 46.648 102.43C40.2719 96.0539 49.7583 76.2302 67.8363 58.1525Z" fill="%23D1E3EE"/>%0A<path id="Vector_3" d="M51.5459 104.727C54.8101 104.785 58.0487 104.142 61.0435 102.843L83.3882 111.298L117.668 124.252L136.05 131.207L137.613 137.614L110.671 127.419L76.4026 114.453L51.3126 104.961L51.5459 104.727Z" fill="%23B21D48"/>%0A<g id="Group">%0A<path id="Vector_4" d="M23.3174 86.3002C23.5967 86.2994 23.8736 86.2495 24.136 86.1533C35.9769 81.7173 48.7764 80.4736 61.2497 82.5474L69.5812 83.9352C70.8564 84.1171 72.0378 83.2308 72.2197 81.9555C72.3955 80.7235 71.5731 79.5704 70.3509 79.3357L62.0171 77.9362C48.7356 75.7295 35.1075 77.0528 22.4987 81.773C21.2864 82.2086 20.6569 83.5445 21.0925 84.7568C21.429 85.6932 22.3223 86.3131 23.3174 86.3002Z" fill="%23FFBF41"/>%0A<path id="Vector_5" d="M65.3016 72.308C66.5896 72.3004 67.6279 71.25 67.6203 69.9619C67.615 69.0727 67.1048 68.2639 66.3045 67.8764L17.3234 44.5524C16.1601 43.9985 14.7682 44.4924 14.2143 45.6557C13.6603 46.8189 14.1542 48.2108 15.3175 48.7647L64.2986 72.0888C64.6123 72.2354 64.9549 72.3103 65.3016 72.308Z" fill="%23FFBF41"/>%0A<path id="Vector_6" d="M92.5786 67.6415C92.8862 67.6421 93.1909 67.5812 93.4743 67.4619C94.6633 66.966 95.2251 65.6004 94.7291 64.4114V64.4111L91.3378 56.2734C86.1198 43.8053 84.9032 30.0243 87.8555 16.8348C88.1581 15.5826 87.3881 14.3225 86.1362 14.0199C84.8839 13.7173 83.6238 14.4873 83.3212 15.7392C83.3145 15.7669 83.3084 15.7946 83.3026 15.8226C80.1398 29.9514 81.4439 44.7137 87.0344 58.0693L90.4281 66.2071C90.7902 67.075 91.6381 67.6406 92.5786 67.6415Z" fill="%23FFBF41"/>%0A</g>%0A<path id="Vector_7" d="M11.6626 95.6294C9.08629 95.6294 6.99776 93.5409 6.99776 90.9646C6.99776 88.3883 9.08629 86.2998 11.6626 86.2998C14.239 86.2998 16.3275 88.3883 16.3275 90.9646C16.3275 93.5409 14.239 95.6294 11.6626 95.6294Z" fill="%23D5557E"/>%0A<path id="Vector_8" d="M67.6372 30.3208C65.0609 30.3208 62.9724 28.2323 62.9724 25.656C62.9724 23.0797 65.0609 20.9912 67.6372 20.9912C70.2136 20.9912 72.3021 23.0797 72.3021 25.656C72.3021 28.2323 70.2136 30.3208 67.6372 30.3208Z" fill="%23DD95C1"/>%0A<path id="Vector_9" d="M88.6314 9.32961C91.2078 9.32961 93.2962 7.24123 93.2962 4.6648C93.2962 2.08837 91.2078 0 88.6314 0C86.0549 0 83.9665 2.08837 83.9665 4.6648C83.9665 7.24123 86.0549 9.32961 88.6314 9.32961Z" fill="%237FCCCB"/>%0A<g id="Group_2">%0A<path id="Vector_10" d="M23.3213 18.6594C24.6094 18.6594 25.6537 17.615 25.6537 16.327V13.9946C25.6537 12.7065 24.6094 11.6622 23.3213 11.6622C22.0332 11.6622 20.9889 12.7065 20.9889 13.9946V16.327C20.9889 17.615 22.0329 18.6594 23.3213 18.6594Z" fill="%232276BB"/>%0A<path id="Vector_11" d="M23.3213 6.99736C24.6094 6.99736 25.6537 5.95303 25.6537 4.66496V2.33256C25.6537 1.04449 24.6094 0.00015833 23.3213 0.00015833C22.0332 0.00015833 20.9889 1.04449 20.9889 2.33256V4.66496C20.9889 5.95303 22.0329 6.99736 23.3213 6.99736Z" fill="%232276BB"/>%0A<path id="Vector_12" d="M16.3246 11.6619H18.657C19.9451 11.6619 20.9895 10.6176 20.9895 9.32953C20.9895 8.04146 19.9451 6.99712 18.657 6.99712H16.3246C15.0365 6.99712 13.9922 8.04146 13.9922 9.32953C13.9922 10.6176 15.0362 11.6619 16.3246 11.6619Z" fill="%232276BB"/>%0A<path id="Vector_13" d="M27.9886 11.6618H30.321C31.6091 11.6618 32.6535 10.6175 32.6535 9.32938C32.6535 8.04132 31.6091 6.99698 30.321 6.99698H27.9886C26.7005 6.99698 25.6562 8.04132 25.6562 9.32938C25.6562 10.6175 26.7002 11.6618 27.9886 11.6618Z" fill="%232276BB"/>%0A</g>%0A<path id="Vector_14" d="M119.099 67.6395C119.36 66.6413 119.593 65.6337 119.81 64.6074L125.874 89.4895L125.408 95.1782C124.391 107.306 119.181 118.701 110.674 127.405L76.4034 114.451C76.59 114.393 76.7836 114.351 76.9702 114.288C97.7508 106.496 113.458 89.1038 119.099 67.6395Z" fill="white"/>%0A<path id="Vector_15" d="M76.402 114.452C76.5886 114.394 76.7822 114.352 76.9687 114.289C79.2137 113.439 81.4126 112.471 83.5555 111.389L114.423 123.068C113.253 124.586 112 126.038 110.67 127.418L76.402 114.452Z" fill="%23F6F6E7"/>%0A<path id="Vector_16" d="M39.6476 27.9414V39.6524H51.3587V27.9414H39.6476Z" fill="%23C9DA53"/>%0A<path id="Vector_17" d="M81.6324 69.9723C82.9204 69.972 83.9645 68.9274 83.9642 67.6393C83.9639 66.9787 83.6837 66.3492 83.1928 65.9069L59.8684 44.9153C58.8943 44.0725 57.4214 44.1789 56.5785 45.1529C55.759 46.0999 55.8336 47.525 56.7476 48.3813L80.072 69.3729C80.5 69.7586 81.056 69.972 81.6324 69.9723Z" fill="%23FFBF41"/>%0A<g id="Group_3">%0A<path id="Vector_18" d="M13.993 60.6428C15.2811 60.6428 16.3254 59.5984 16.3254 58.3104V55.978C16.3254 54.6899 15.2811 53.6456 13.993 53.6456C12.7049 53.6456 11.6605 54.6899 11.6605 55.978V58.3104C11.6605 59.5984 12.7046 60.6428 13.993 60.6428Z" fill="%23FFDB43"/>%0A<path id="Vector_19" d="M5.74562 57.2266C6.36459 57.2283 6.95849 56.9822 7.39465 56.5432L9.04369 54.8942C9.93847 53.9676 9.9131 52.4909 8.98654 51.5961C8.08272 50.7232 6.64973 50.7232 5.74562 51.5961L4.0966 53.2451C3.18578 54.1562 3.18607 55.6329 4.09718 56.5437C4.53422 56.9808 5.12723 57.2266 5.74562 57.2266Z" fill="%23FFDB43"/>%0A<path id="Vector_20" d="M2.33243 48.9803H4.66487C5.95295 48.9803 6.9973 47.936 6.9973 46.6479C6.9973 45.3598 5.95295 44.3155 4.66487 44.3155H2.33243C1.04435 44.3155 2.38419e-07 45.3598 2.38419e-07 46.6479C2.38419e-07 47.936 1.04406 48.9803 2.33243 48.9803Z" fill="%23FFDB43"/>%0A<path id="Vector_21" d="M7.392 42.384C8.68009 42.3837 9.72415 41.3394 9.72385 40.051C9.72385 39.4326 9.47807 38.8396 9.04103 38.4026L7.392 36.7536C6.46544 35.8585 4.98901 35.8842 4.09394 36.8107C3.22103 37.7145 3.22103 39.1475 4.09394 40.0516L5.74297 41.7006C6.1803 42.1379 6.77332 42.384 7.392 42.384Z" fill="%23FFDB43"/>%0A<path id="Vector_22" d="M13.993 39.6506C15.2811 39.6506 16.3254 38.6062 16.3254 37.3182V34.9858C16.3254 33.6977 15.2811 32.6534 13.993 32.6534C12.7049 32.6534 11.6605 33.6977 11.6605 34.9858V37.3182C11.6605 38.6062 12.7046 39.6506 13.993 39.6506Z" fill="%23FFDB43"/>%0A<path id="Vector_23" d="M20.5933 42.3838C21.212 42.3838 21.805 42.1377 22.2423 41.7004L23.8913 40.0514C24.7861 39.1248 24.7608 37.6481 23.8342 36.7534C22.9304 35.8805 21.4974 35.8805 20.5933 36.7534L18.9442 38.4024C18.0334 39.3135 18.0337 40.7902 18.9448 41.701C19.3819 42.138 19.9749 42.3838 20.5933 42.3838Z" fill="%23FFDB43"/>%0A<path id="Vector_24" d="M125.95 2.33203L122.347 9.63478L114.288 10.8056L120.119 16.4897L118.743 24.5155L125.95 20.7254L133.158 24.5155L131.782 16.4897L137.613 10.8056L129.554 9.63478L125.95 2.33203Z" fill="%23FFDB43"/>%0A</g>%0A<path id="Vector_25" d="M0.734678 126.338C1.84404 122.407 4.39835 119.04 7.88592 116.913L8.84688 115.472C14.2351 107.414 22.708 101.935 32.2668 100.327C33.5421 100.145 34.7235 101.032 34.9054 102.307C35.0812 103.539 34.2587 104.692 33.0365 104.927C26.1419 106.097 19.8586 109.6 15.2377 114.849C19.1227 115.548 22.5205 117.881 24.5675 121.256C27.0795 125.755 25.4687 131.438 20.9697 133.95C16.4707 136.462 10.7875 134.851 8.27544 130.352C7.31593 128.5 6.79784 126.451 6.76168 124.365C4.27998 127.97 4.08143 132.677 6.25089 136.477C6.90805 137.585 6.54273 139.016 5.43482 139.673C4.32692 140.33 2.89597 139.965 2.23881 138.857C2.21781 138.822 2.1977 138.786 2.17845 138.749C0.0594376 134.971 -0.460402 130.502 0.734678 126.338ZM12.3432 128.076C13.5881 130.332 16.4258 131.151 18.6813 129.906C20.937 128.661 21.7563 125.823 20.5114 123.568C20.5044 123.555 20.4974 123.543 20.4904 123.53C19.114 121.276 16.7923 119.766 14.1742 119.42C13.7686 119.409 13.3671 119.503 13.0079 119.691C11.0394 120.79 10.9344 125.552 12.3432 128.076Z" fill="%232BB3CE"/>%0A</g>%0A</svg>%0A';
|
|
67
|
-
var EMPTY_MESSAGES = [];
|
|
68
|
-
function ThankYouPage({
|
|
69
|
-
page,
|
|
70
|
-
order,
|
|
71
|
-
thank_you_title,
|
|
72
|
-
messages = EMPTY_MESSAGES
|
|
73
|
-
}) {
|
|
74
|
-
const { store } = useTwilight();
|
|
75
|
-
const { t } = useTranslation();
|
|
76
|
-
usePageConfig(page);
|
|
77
|
-
const title = thank_you_title ?? t("pages.thank_you.hero_title", "Thank you for shopping with us! \u{1F60A}");
|
|
78
|
-
const [invoiceSent, setInvoiceSent] = useState(order?.email_sent ?? false);
|
|
79
|
-
const [invoiceMessage, setInvoiceMessage] = useState(null);
|
|
80
|
-
const [, copyToClipboard] = useCopyToClipboard();
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
const handleInvoiceSent = (res) => {
|
|
83
|
-
setInvoiceMessage(
|
|
84
|
-
res.data?.message || t("pages.thank_you.invoice_sent_success", "Invoice sent successfully")
|
|
85
|
-
);
|
|
86
|
-
setInvoiceSent(true);
|
|
87
|
-
};
|
|
88
|
-
const listener = handleInvoiceSent;
|
|
89
|
-
return onSallaEvent("order::invoice.sent", listener);
|
|
90
|
-
}, [t]);
|
|
91
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
92
|
-
/* @__PURE__ */ jsx(HookSlot, { name: "thank-you:start" }),
|
|
93
|
-
/* @__PURE__ */ jsx("div", { className: "h-52 -mb-52 w-full bg-primary rtl:right-0 ltr:left-0 relative -z-1", children: /* @__PURE__ */ jsx(
|
|
94
|
-
"svg",
|
|
95
|
-
{
|
|
96
|
-
className: "text-primary absolute top-full",
|
|
97
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
98
|
-
viewBox: "0 0 1440 320",
|
|
99
|
-
children: /* @__PURE__ */ jsx(
|
|
100
|
-
"path",
|
|
101
|
-
{
|
|
102
|
-
className: "fill-current",
|
|
103
|
-
fillOpacity: "1",
|
|
104
|
-
d: "M0,96L120,112C240,128,480,160,720,165.3C960,171,1200,149,1320,138.7L1440,128L1440,0L1320,0C1200,0,960,0,720,0C480,0,240,0,120,0L0,0Z"
|
|
105
|
-
}
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
) }),
|
|
109
|
-
/* @__PURE__ */ jsxs("div", { className: "container mb-20", children: [
|
|
110
|
-
/* @__PURE__ */ jsx("nav", { className: "w-full py-5", children: /* @__PURE__ */ jsxs("ol", { className: "list-reset flex items-center text-sm text-primary-reverse", children: [
|
|
111
|
-
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/", className: "fix-align text-primary-reverse", children: t("common.titles.home", "Home") }) }),
|
|
112
|
-
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("i", { className: "sicon-keyboard_arrow_left mx-2" }) }),
|
|
113
|
-
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("span", { className: "fix-align", children: title }) })
|
|
114
|
-
] }) }),
|
|
115
|
-
/* @__PURE__ */ jsxs("div", { className: "bg-white p-4 md:p-8 rounded-md mb-6 md:mb-8", children: [
|
|
116
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center pt-16 pb-10", children: [
|
|
117
|
-
/* @__PURE__ */ jsx("img", { src: confetti_default, alt: title, className: "size-[140px] mb-8" }),
|
|
118
|
-
/* @__PURE__ */ jsx("h1", { className: "font-bold text-lg mb-2.5", children: title }),
|
|
119
|
-
/* @__PURE__ */ jsx("p", { className: "text-gray-500 max-w-xs text-center text-sm leading-6 mb-2.5", children: t(
|
|
120
|
-
"pages.thank_you.description",
|
|
121
|
-
"Your order has been received and will be reviewed and confirmed shortly."
|
|
122
|
-
) }),
|
|
123
|
-
order && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
124
|
-
/* @__PURE__ */ jsxs("p", { className: "text-gray-500 max-w-xs text-center text-sm leading-6 mb-6", children: [
|
|
125
|
-
t("pages.thank_you.order_id_label", "Order ID"),
|
|
126
|
-
" ",
|
|
127
|
-
/* @__PURE__ */ jsxs(
|
|
128
|
-
SallaButton,
|
|
129
|
-
{
|
|
130
|
-
className: "relative",
|
|
131
|
-
onClick: () => copyToClipboard(String(order.reference_id)),
|
|
132
|
-
color: "dark",
|
|
133
|
-
shape: "link",
|
|
134
|
-
children: [
|
|
135
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
136
|
-
"#",
|
|
137
|
-
order.reference_id
|
|
138
|
-
] }),
|
|
139
|
-
/* @__PURE__ */ jsx("i", { className: "copy-icon sicon-swap-stroke pointer-events-none rtl:mr-1 ltr:ml-1" })
|
|
140
|
-
]
|
|
141
|
-
}
|
|
142
|
-
)
|
|
143
|
-
] }),
|
|
144
|
-
/* @__PURE__ */ jsxs(
|
|
145
|
-
Link,
|
|
146
|
-
{
|
|
147
|
-
to: `/account/orders/${order.id}`,
|
|
148
|
-
className: "bg-primary text-white text-sm font-bold h-10 px-4 rounded-md flex items-center justify-center gap-1.5",
|
|
149
|
-
children: [
|
|
150
|
-
/* @__PURE__ */ jsx("i", { className: "sicon-newspaper rtl:ml-1 ltr:mr-1" }),
|
|
151
|
-
t("pages.thank_you.view_order_details", "View Order Details")
|
|
152
|
-
]
|
|
153
|
-
}
|
|
154
|
-
)
|
|
155
|
-
] })
|
|
156
|
-
] }),
|
|
157
|
-
order?.instructions && /* @__PURE__ */ jsx(
|
|
158
|
-
"article",
|
|
159
|
-
{
|
|
160
|
-
className: "article article--main article--small text-center",
|
|
161
|
-
dangerouslySetInnerHTML: {
|
|
162
|
-
__html: order.instructions ?? ""
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
),
|
|
166
|
-
messages.map((message) => /* @__PURE__ */ jsx(
|
|
167
|
-
"div",
|
|
168
|
-
{
|
|
169
|
-
className: "flex flex-col items-center pt-1 pb-10 justify-start rtl:space-x-reverse space-x-2",
|
|
170
|
-
children: /* @__PURE__ */ jsx("span", { className: "font-bold", children: message })
|
|
171
|
-
},
|
|
172
|
-
message
|
|
173
|
-
)),
|
|
174
|
-
/* @__PURE__ */ jsx(HookSlot, { name: "thank-you:items.start" }),
|
|
175
|
-
/* @__PURE__ */ jsx(HookSlot, { name: "thank-you:items.end" })
|
|
176
|
-
] }),
|
|
177
|
-
/* @__PURE__ */ jsx(SallaNextOrderCoupon, {}),
|
|
178
|
-
/* @__PURE__ */ jsx(SallaOrderBranch, {}),
|
|
179
|
-
/* @__PURE__ */ jsxs("div", { className: "lg:flex rtl:space-x-reverse lg:space-x-8", children: [
|
|
180
|
-
invoiceSent ? /* @__PURE__ */ jsxs("div", { className: "duration-500 hover:shadow-default flex-1 bg-white p-8 rounded-md mb-6 md:mb-10 flex flex-col items-center justify-center", children: [
|
|
181
|
-
/* @__PURE__ */ jsx("div", { className: "bg-gray-100 rounded-icon w-12 h-12 mb-2.5", children: /* @__PURE__ */ jsx("i", { className: "sicon-newspaper-alt text-xl" }) }),
|
|
182
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm mb-2.5", children: t("pages.thank_you.email_sent_to", "Email sent to") }),
|
|
183
|
-
/* @__PURE__ */ jsx("b", { className: "text-sm", children: order?.customer?.email }),
|
|
184
|
-
invoiceMessage && /* @__PURE__ */ jsx("p", { className: "text-sm text-green-600 mt-2", children: invoiceMessage })
|
|
185
|
-
] }) : /* @__PURE__ */ jsx(
|
|
186
|
-
"div",
|
|
187
|
-
{
|
|
188
|
-
id: "invoice-form",
|
|
189
|
-
className: invoiceMessage ? "thankyou-block sent" : "thankyou-block",
|
|
190
|
-
children: invoiceMessage ? /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
191
|
-
/* @__PURE__ */ jsx("div", { className: "bg-gray-100 rounded-icon w-12 h-12 mb-2.5 mx-auto", children: /* @__PURE__ */ jsx("i", { className: "sicon-newspaper-alt text-xl" }) }),
|
|
192
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm", dangerouslySetInnerHTML: { __html: invoiceMessage } })
|
|
193
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
194
|
-
/* @__PURE__ */ jsx("div", { className: "bg-gray-100 rounded-icon w-12 h-12 mb-2.5", children: /* @__PURE__ */ jsx("i", { className: "sicon-newspaper-alt text-xl" }) }),
|
|
195
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm mb-2.5", children: t("pages.thank_you.resend_invoice", "Resend invoice email") }),
|
|
196
|
-
/* @__PURE__ */ jsx(
|
|
197
|
-
"form",
|
|
198
|
-
{
|
|
199
|
-
onSubmit: (e) => {
|
|
200
|
-
e.preventDefault();
|
|
201
|
-
window.salla?.form.onSubmit("order.sendInvoice", e);
|
|
202
|
-
},
|
|
203
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex max-w-3xl w-full", children: [
|
|
204
|
-
/* @__PURE__ */ jsx(
|
|
205
|
-
"input",
|
|
206
|
-
{
|
|
207
|
-
type: "email",
|
|
208
|
-
className: "form-input rtl:rounded-l-none ltr:rounded-r-none rtl:border-l-0 ltr:border-r-0 !w-[160px] sm:!w-[220px]",
|
|
209
|
-
placeholder: "your@email.com",
|
|
210
|
-
required: true,
|
|
211
|
-
name: "email"
|
|
212
|
-
}
|
|
213
|
-
),
|
|
214
|
-
/* @__PURE__ */ jsx(
|
|
215
|
-
SallaButton,
|
|
216
|
-
{
|
|
217
|
-
type: "submit",
|
|
218
|
-
loaderPosition: "center",
|
|
219
|
-
className: "rtl:rounded-r-none ltr:rounded-l-none lg:w-24 h-10",
|
|
220
|
-
children: /* @__PURE__ */ jsx("span", { className: "btn__text", children: t("pages.thank_you.send", "Send") })
|
|
221
|
-
}
|
|
222
|
-
)
|
|
223
|
-
] })
|
|
224
|
-
}
|
|
225
|
-
)
|
|
226
|
-
] })
|
|
227
|
-
}
|
|
228
|
-
),
|
|
229
|
-
/* @__PURE__ */ jsxs("div", { className: "thankyou-block", children: [
|
|
230
|
-
/* @__PURE__ */ jsx("div", { className: "bg-gray-100 rounded-icon w-12 h-12 mb-2.5", children: /* @__PURE__ */ jsx("i", { className: "sicon-mail-letter text-xl" }) }),
|
|
231
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm mb-2.5", children: t("pages.thank_you.support", "Support") }),
|
|
232
|
-
/* @__PURE__ */ jsxs("div", { className: "flex rtl:space-x-reverse space-x-6", children: [
|
|
233
|
-
store.contacts.mobile && /* @__PURE__ */ jsxs("div", { className: "text-sm unicode flex items-center", children: [
|
|
234
|
-
/* @__PURE__ */ jsx("i", { className: "sicon-phone" }),
|
|
235
|
-
/* @__PURE__ */ jsx(
|
|
236
|
-
"a",
|
|
237
|
-
{
|
|
238
|
-
href: `tel:${store.contacts.mobile}`,
|
|
239
|
-
className: "hover:text-primary transition",
|
|
240
|
-
children: /* @__PURE__ */ jsx("b", { className: "unicode mx-1.5", children: store.contacts.mobile })
|
|
241
|
-
}
|
|
242
|
-
)
|
|
243
|
-
] }),
|
|
244
|
-
store.contacts.whatsapp && /* @__PURE__ */ jsxs("div", { className: "text-sm unicode flex items-center", children: [
|
|
245
|
-
/* @__PURE__ */ jsx("i", { className: "sicon-whatsapp" }),
|
|
246
|
-
/* @__PURE__ */ jsx(
|
|
247
|
-
"a",
|
|
248
|
-
{
|
|
249
|
-
href: `https://wa.me/${store.contacts.whatsapp.replace(/[\s+-]/g, "")}`,
|
|
250
|
-
className: "hover:text-primary transition",
|
|
251
|
-
target: "_blank",
|
|
252
|
-
rel: "noopener noreferrer",
|
|
253
|
-
children: /* @__PURE__ */ jsx("b", { className: "unicode mx-1.5", children: store.contacts.whatsapp })
|
|
254
|
-
}
|
|
255
|
-
)
|
|
256
|
-
] })
|
|
257
|
-
] })
|
|
258
|
-
] })
|
|
259
|
-
] }),
|
|
260
|
-
/* @__PURE__ */ jsx(HookSlot, { name: "thank-you:end" })
|
|
261
|
-
] })
|
|
262
|
-
] });
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
export { ThankYouPage };
|
|
266
|
-
//# sourceMappingURL=ThankYouPage-XWB4X236.js.map
|
|
267
|
-
//# sourceMappingURL=ThankYouPage-XWB4X236.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/routes/thank-you/ThankYouPage.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAM,iBAA6D,EAAC;AAE7D,SAAS,YAAA,CAAa;AAAA,EAC3B,IAAA;AAAA,EACA,KAAA;AAAA,EACA,eAAA;AAAA,EACA,QAAA,GAAW;AACb,CAAA,EAAsB;AACpB,EAAA,MAAM,EAAE,KAAA,EAAM,GAAI,WAAA,EAAY;AAC9B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,cAAA,EAAe;AAE7B,EAAA,aAAA,CAAc,IAAI,CAAA;AAClB,EAAA,MAAM,KAAA,GACJ,eAAA,IAAmB,CAAA,CAAE,4BAAA,EAA8B,2CAAoC,CAAA;AACzF,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,IAAI,QAAA,CAAS,KAAA,EAAO,cAAc,KAAK,CAAA;AACzE,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,SAAwB,IAAI,CAAA;AACxE,EAAA,MAAM,GAAG,eAAe,CAAA,GAAI,kBAAA,EAAmB;AAG/C,EAAA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AE,SAAA,EAAU,gBAAA,EAAkB,QAAA,EAAA,KAAA,CAAM,SAAS,QAAA,EAAS;AAAA;AAAA;AACzD,aAAA,EACF;AAAA,WAAA,EAEJ;AAAA,SAAA,EACF;AAAA,OAAA,EACF,CAAA;AAAA,sBAEA,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAK,eAAA,EAAgB;AAAA,KAAA,EACjC;AAAA,GAAA,EACF,CAAA;AAEJ","file":"ThankYouPage-XWB4X236.js","sourcesContent":["import { useState, useEffect } from 'react';\nimport { useCopyToClipboard } from '@uidotdev/usehooks';\nimport { SallaButton } from '@salla.sa/twilight-components-react/button';\nimport { SallaNextOrderCoupon } from '@salla.sa/twilight-components-react/next-order-coupon';\nimport { SallaOrderBranch } from '@salla.sa/twilight-components-react/order-branch';\nimport { Link } from '../../components/common';\nimport { HookSlot, usePageConfig } from '../../hooks';\nimport type { ThankYouPageProps } from './types';\nimport { useTwilight } from '../../providers/twilight-context';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport confettiImage from './confetti.svg';\nimport { onSallaEvent } from '../../utils/sdk-helpers';\n\nconst EMPTY_MESSAGES: NonNullable<ThankYouPageProps['messages']> = [];\n\nexport function ThankYouPage({\n page,\n order,\n thank_you_title,\n messages = EMPTY_MESSAGES,\n}: ThankYouPageProps) {\n const { store } = useTwilight();\n const { t } = useTranslation();\n // `<salla-order-branch>` reads the order id from `salla.config.page.id` (see OrderSinglePage).\n usePageConfig(page);\n const title =\n thank_you_title ?? t('pages.thank_you.hero_title', 'Thank you for shopping with us! 😊');\n const [invoiceSent, setInvoiceSent] = useState(order?.email_sent ?? false);\n const [invoiceMessage, setInvoiceMessage] = useState<string | null>(null);\n const [, copyToClipboard] = useCopyToClipboard();\n\n // Listen for invoice sent event (matches thankyou.js)\n useEffect(() => {\n const handleInvoiceSent = (res: { data?: { message?: string } }) => {\n setInvoiceMessage(\n res.data?.message || t('pages.thank_you.invoice_sent_success', 'Invoice sent successfully')\n );\n setInvoiceSent(true);\n };\n const listener = handleInvoiceSent as (...args: unknown[]) => void;\n\n return onSallaEvent('order::invoice.sent', listener);\n }, [t]);\n\n return (\n <>\n <HookSlot name=\"thank-you:start\" />\n\n <div className=\"h-52 -mb-52 w-full bg-primary rtl:right-0 ltr:left-0 relative -z-1\">\n <svg\n className=\"text-primary absolute top-full\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 1440 320\"\n >\n <path\n className=\"fill-current\"\n fillOpacity=\"1\"\n d=\"M0,96L120,112C240,128,480,160,720,165.3C960,171,1200,149,1320,138.7L1440,128L1440,0L1320,0C1200,0,960,0,720,0C480,0,240,0,120,0L0,0Z\"\n ></path>\n </svg>\n </div>\n\n <div className=\"container mb-20\">\n <nav className=\"w-full py-5\">\n <ol className=\"list-reset flex items-center text-sm text-primary-reverse\">\n <li>\n <Link to=\"/\" className=\"fix-align text-primary-reverse\">\n {t('common.titles.home', 'Home')}\n </Link>\n </li>\n <li>\n <i className=\"sicon-keyboard_arrow_left mx-2\"></i>\n </li>\n <li>\n <span className=\"fix-align\">{title}</span>\n </li>\n </ol>\n </nav>\n\n <div className=\"bg-white p-4 md:p-8 rounded-md mb-6 md:mb-8\">\n <div className=\"flex flex-col items-center pt-16 pb-10\">\n <img src={confettiImage} alt={title} className=\"size-[140px] mb-8\" />\n <h1 className=\"font-bold text-lg mb-2.5\">{title}</h1>\n <p className=\"text-gray-500 max-w-xs text-center text-sm leading-6 mb-2.5\">\n {t(\n 'pages.thank_you.description',\n 'Your order has been received and will be reviewed and confirmed shortly.'\n )}\n </p>\n {order && (\n <>\n <p className=\"text-gray-500 max-w-xs text-center text-sm leading-6 mb-6\">\n {t('pages.thank_you.order_id_label', 'Order ID')}{' '}\n <SallaButton\n className=\"relative\"\n onClick={() => copyToClipboard(String(order.reference_id))}\n color=\"dark\"\n shape=\"link\"\n >\n <span>#{order.reference_id}</span>\n <i className=\"copy-icon sicon-swap-stroke pointer-events-none rtl:mr-1 ltr:ml-1\"></i>\n </SallaButton>\n </p>\n <Link\n to={`/account/orders/${order.id}`}\n className=\"bg-primary text-white text-sm font-bold h-10 px-4 rounded-md flex items-center justify-center gap-1.5\"\n >\n <i className=\"sicon-newspaper rtl:ml-1 ltr:mr-1\"></i>\n {t('pages.thank_you.view_order_details', 'View Order Details')}\n </Link>\n </>\n )}\n </div>\n\n {(order as { instructions?: string } | undefined)?.instructions && (\n <article\n className=\"article article--main article--small text-center\"\n dangerouslySetInnerHTML={{\n __html: (order as { instructions?: string }).instructions ?? '',\n }}\n />\n )}\n\n {messages.map((message) => (\n <div\n key={message}\n className=\"flex flex-col items-center pt-1 pb-10 justify-start rtl:space-x-reverse space-x-2\"\n >\n <span className=\"font-bold\">{message}</span>\n </div>\n ))}\n\n <HookSlot name=\"thank-you:items.start\" />\n <HookSlot name=\"thank-you:items.end\" />\n </div>\n\n {/* Next-order coupon and pickup branch — each renders nothing when it doesn't apply */}\n <SallaNextOrderCoupon />\n <SallaOrderBranch />\n\n <div className=\"lg:flex rtl:space-x-reverse lg:space-x-8\">\n {invoiceSent ? (\n <div className=\"duration-500 hover:shadow-default flex-1 bg-white p-8 rounded-md mb-6 md:mb-10 flex flex-col items-center justify-center\">\n <div className=\"bg-gray-100 rounded-icon w-12 h-12 mb-2.5\">\n <i className=\"sicon-newspaper-alt text-xl\"></i>\n </div>\n <p className=\"text-sm mb-2.5\">\n {t('pages.thank_you.email_sent_to', 'Email sent to')}\n </p>\n <b className=\"text-sm\">{order?.customer?.email}</b>\n {invoiceMessage && <p className=\"text-sm text-green-600 mt-2\">{invoiceMessage}</p>}\n </div>\n ) : (\n <div\n id=\"invoice-form\"\n className={invoiceMessage ? 'thankyou-block sent' : 'thankyou-block'}\n >\n {invoiceMessage ? (\n <div className=\"text-center\">\n <div className=\"bg-gray-100 rounded-icon w-12 h-12 mb-2.5 mx-auto\">\n <i className=\"sicon-newspaper-alt text-xl\"></i>\n </div>\n <p className=\"text-sm\" dangerouslySetInnerHTML={{ __html: invoiceMessage }} />\n </div>\n ) : (\n <>\n <div className=\"bg-gray-100 rounded-icon w-12 h-12 mb-2.5\">\n <i className=\"sicon-newspaper-alt text-xl\"></i>\n </div>\n <p className=\"text-sm mb-2.5\">\n {t('pages.thank_you.resend_invoice', 'Resend invoice email')}\n </p>\n <form\n onSubmit={(e) => {\n e.preventDefault();\n window.salla?.form.onSubmit('order.sendInvoice', e);\n }}\n >\n <div className=\"flex max-w-3xl w-full\">\n <input\n type=\"email\"\n className=\"form-input rtl:rounded-l-none ltr:rounded-r-none rtl:border-l-0 ltr:border-r-0 !w-[160px] sm:!w-[220px]\"\n placeholder=\"your@email.com\"\n required\n name=\"email\"\n />\n <SallaButton\n type=\"submit\"\n loaderPosition=\"center\"\n className=\"rtl:rounded-r-none ltr:rounded-l-none lg:w-24 h-10\"\n >\n <span className=\"btn__text\">{t('pages.thank_you.send', 'Send')}</span>\n </SallaButton>\n </div>\n </form>\n </>\n )}\n </div>\n )}\n\n <div className=\"thankyou-block\">\n <div className=\"bg-gray-100 rounded-icon w-12 h-12 mb-2.5\">\n <i className=\"sicon-mail-letter text-xl\"></i>\n </div>\n <p className=\"text-sm mb-2.5\">{t('pages.thank_you.support', 'Support')}</p>\n\n <div className=\"flex rtl:space-x-reverse space-x-6\">\n {store.contacts.mobile && (\n <div className=\"text-sm unicode flex items-center\">\n <i className=\"sicon-phone\"></i>\n <a\n href={`tel:${store.contacts.mobile}`}\n className=\"hover:text-primary transition\"\n >\n <b className=\"unicode mx-1.5\">{store.contacts.mobile}</b>\n </a>\n </div>\n )}\n\n {store.contacts.whatsapp && (\n <div className=\"text-sm unicode flex items-center\">\n <i className=\"sicon-whatsapp\"></i>\n <a\n href={`https://wa.me/${store.contacts.whatsapp.replace(/[\\s+-]/g, '')}`}\n className=\"hover:text-primary transition\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <b className=\"unicode mx-1.5\">{store.contacts.whatsapp}</b>\n </a>\n </div>\n )}\n </div>\n </div>\n </div>\n\n <HookSlot name=\"thank-you:end\" />\n </div>\n </>\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tanstack/search.ts","../src/routes/root/beforeLoad.ts","../src/tanstack/store-base.ts","../src/tanstack/router.tsx","../src/tanstack/document-class.ts"],"names":["tanstackNotFound","createTanStackRouter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,MAAA,GAAS,CAAC,CAAC,GAAA,EAAK,KAAK,CAAA,KAAyB,GAAA,CAAI,QAAA,CAAS,IAAI,CAAA,IAAK,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA;AAGtF,SAAS,gBAAgB,MAAA,EAAyC;AACvE,EAAA,MAAM,OAAA,GAAU,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA;AACrC,EAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,MAAA,CAAO,MAAM,CAAA;AACnC,EAAA,IAAI,CAAC,KAAA,CAAM,MAAA,EAAQ,OAAO,uBAAuB,MAAM,CAAA;AAEvD,EAAA,MAAM,IAAA,GAAO,sBAAA;AAAA,IACX,MAAA,CAAO,WAAA,CAAY,OAAA,CAAQ,MAAA,CAAO,CAAC,UAAU,CAAC,MAAA,CAAO,KAAK,CAAC,CAAC;AAAA,GAC9D;AACA,EAAA,MAAM,WAAW,KAAA,CAAM,OAAA;AAAA,IAAQ,CAAC,CAAC,GAAA,EAAK,MAAM,MAC1C,MAAA,CAAO,GAAA;AAAA,MACL,CAAC,KAAA,KACC,CAAA,EAAG,kBAAA,CAAmB,GAAG,CAAC,CAAA,CAAA,EAAI,kBAAA,CAAmB,OAAO,KAAA,KAAU,WAAW,KAAA,GAAQ,IAAA,CAAK,SAAA,CAAU,KAAK,CAAC,CAAC,CAAA;AAAA;AAC/G,GACF;AACA,EAAA,OAAO,CAAA,EAAG,IAAA,IAAQ,GAAG,CAAA,EAAG,IAAA,GAAO,GAAA,GAAM,EAAE,CAAA,EAAG,QAAA,CAAS,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,UAAA,EAAmD,IAAA;AAAA,MACrF;AAAA,KACF;AACA,IAAA,IAAI,IAAA,EAAM,qBAAA,CAAsB,EAAE,IAAA,EAAM,CAAA;AAAA,EAC1C;AAEA,EAAA,MAAM,UAAA,GAAa,aAAa,OAAO,CAAA;AAEvC,EAAA,gBAAA,CAAiB,UAAA,GAAa,EAAE,IAAA,EAAM,EAAE,OAAO,UAAA,EAAW,EAAE,GAAI,EAAE,CAAA;AAClE,EAAA,OAAO,IAAA;AACT;AA0BO,SAAS,wBAAA,GAGd;AACA,EAAA,MAAM,OAAA,GAAU,eAAe,EAAE,MAAA,EAAQ,CAAC,CAAA,KAAM,CAAA,CAAE,SAAS,CAAA;AAE3D,EAAA,MAAM,kBAAkB,OAAA,CAAQ,GAAA;AAAA,IAC9B,CAAC,CAAA,KAAO,CAAA,CAAE,UAAA,EAAoD,aAAA,EAAe,QAAQ;AAAC,GACxF;AACA,EAAA,MAAM,kBAAkB,OAAA,CAAQ,GAAA;AAAA,IAC9B,CAAC,CAAA,KAAO,CAAA,CAAE,UAAA,EAAoD,aAAA,EAAe,QAAQ;AAAC,GACxF;AAEA,EAAA,OAAO;AAAA,IACL,SAAA,EAAW,YAAA,CAAa,iBAAA,CAAkB,eAAe,CAAC,CAAA;AAAA,IAC1D,SAAA,EAAW,YAAA,CAAa,iBAAA,CAAkB,eAAe,CAAC;AAAA,GAC5D;AACF;AAKO,SAAS,wBAAwB,UAAA,EAGtC;AACA,EAAA,OAAO;AAAA,IACL,SAAA,EAAW,aAAa,iBAAA,CAAkB,CAAC,WAAW,IAAA,IAAQ,EAAE,CAAC,CAAC,CAAA;AAAA,IAClE,SAAA,EAAW,aAAa,iBAAA,CAAkB,CAAC,WAAW,IAAA,IAAQ,EAAE,CAAC,CAAC;AAAA,GACpE;AACF","file":"chunk-3G4YCXOR.js","sourcesContent":["import { defaultStringifySearch } from '@tanstack/react-router';\n\nconst isList = ([key, value]: [string, unknown]) => key.endsWith('[]') && Array.isArray(value);\n\n/** The router's query serialiser, writing `[]` keys back as repeated keys, as `<salla-filters>` does. */\nexport function stringifySearch(search: Record<string, unknown>): string {\n const entries = Object.entries(search);\n const lists = entries.filter(isList) as [string, unknown[]][];\n if (!lists.length) return defaultStringifySearch(search);\n\n const rest = defaultStringifySearch(\n Object.fromEntries(entries.filter((entry) => !isList(entry)))\n );\n const repeated = lists.flatMap(([key, values]) =>\n values.map(\n (value) =>\n `${encodeURIComponent(key)}=${encodeURIComponent(typeof value === 'string' ? value : JSON.stringify(value))}`\n )\n );\n return `${rest || '?'}${rest ? '&' : ''}${repeated.join('&')}`;\n}\n","import type { QueryClient } from '@tanstack/react-query';\nimport { redirect } from '@tanstack/react-router';\nimport { createIsomorphicFn } from '@tanstack/react-start';\nimport {\n getCookie,\n getRequestHeader,\n getRequestUrl,\n setCookie,\n} from '@tanstack/react-start/server';\nimport type { StoreContext } from '../../api/store';\nimport { store as storeApi } from '../../api/store';\nimport { apps, type AppSnippet, type AppSettings } from '../../api/apps';\nimport { translations } from '../../api/translations';\nimport { advertisement } from '../../api/advertisement';\nimport { FALLBACK_LOCALE, getLanguageInfo, isLocale } from '../../providers/locale-constants';\nimport { createI18nInstance } from '../../providers/i18n-factory';\nimport type { TwilightLocation } from '../../twilight/context';\nimport { getTwilightContext, updateTwilightContext } from '../../twilight/context';\nimport {\n AUTH_TOKEN_COOKIE_NAME,\n extractScopeFromCookies,\n extractScopeFromUrl,\n extractTokenFromCookies,\n resolveRequestScope,\n sameScope,\n SCOPE_COOKIE_MAX_AGE,\n SCOPE_COOKIE_NAME,\n syncScopeCookie,\n type ActiveScope,\n} from '../../utils/cookies';\nimport { syncSdkLocale, syncSdkThemeVersion } from '../../utils/sdk-helpers';\nimport { SettingsError } from '../../utils/errors';\nimport {\n currentHost,\n resolveStoreBase,\n resolveStoreBaseFollowsLocale,\n resolveStoreBaseRedirect,\n resolveStoppedDomainRedirect,\n} from '../../utils/store-identity';\nimport { persistLanguageCookie, readCookieHeader } from '../../utils/language-cookie';\nimport { decideSharedHostLanguage } from '../../utils/shared-host-language';\nimport { prefixStoreBase } from '../../utils/store-base';\nimport { preloadServerComponents } from '../../utils/lazy-component';\nimport {\n ownerCookieMatches,\n ownerLinkMatches,\n showsMaintenancePage,\n VIEW_AS_OWNER_COOKIE_NAME,\n} from '../../utils/maintenance';\n\n// Reads the `token` cookie from the incoming request on the SERVER. twilightMiddleware\n// extracts the same cookie into a custom ALS, but that ALS does NOT propagate to the\n// route's beforeLoad / React SSR render (they run in a different async scope), so the\n// token must be read again here from the framework's own request context. On the client\n// this is a no-op (the cookie is read from document.cookie below instead). The server\n// import is stripped from the client bundle by createIsomorphicFn.\nconst readServerCookieToken = createIsomorphicFn()\n .server((): string | null => {\n try {\n return getCookie(AUTH_TOKEN_COOKIE_NAME) ?? null;\n } catch {\n return null;\n }\n })\n .client((): string | null => null);\n\n/**\n * The market the settings were answered for, when the request asked with another one and\n * its address did not switch market; null otherwise.\n *\n * That is a market's own domain (`us.store.com`): the API serves the market the domain is\n * pinned to, whatever the `scope` cookie remembers from an earlier visit. The page has to\n * take that market over, or the SDK keeps sending the remembered one and creates the\n * guest's cart in it, which every request answered for the domain's market then refuses\n * (TD-17588). A request that asked with no scope has nothing stale to correct. The branch\n * is dropped with the market it belonged to; the type is store-wide, so it is the\n * answer's, else the requested one.\n */\nexport function hostPinnedScope(\n url: string,\n requested: ActiveScope | null,\n settings: StoreContext\n): ActiveScope | null {\n if (!requested || extractScopeFromUrl(url)) return null;\n const answered = settings.store?.scope;\n if (answered?.id == null || String(answered.id) === requested.id) return null;\n const type = answered.type ?? requested.type;\n return type ? { id: String(answered.id), type } : { id: String(answered.id) };\n}\n\n/**\n * The scope to write to the `scope` cookie for this request, or null to leave the cookie\n * as it is.\n *\n * The market a market's own domain answered with, over a remembered one; see\n * {@link hostPinnedScope}.\n *\n * Otherwise only for a market a `?scope=` URL switched to, and only when the settings were\n * answered for it: the API falls back to another market when it does not accept the\n * requested one, and Twig keeps the previous choice then too, rather than recording one\n * the page is not showing. Its type is the one the settings answered with: a URL names\n * only the id, and the store-wide type is assumed until the answer says otherwise (a\n * store browsing by branch or city), so later requests send the type the API matches\n * against.\n */\nexport function scopeCookieUpdate(\n url: string,\n cookieHeader: string | null,\n settings: StoreContext\n): ActiveScope | null {\n const pinned = hostPinnedScope(url, extractScopeFromCookies(cookieHeader), settings);\n if (pinned) return pinned;\n if (!extractScopeFromUrl(url)) return null;\n const scope = resolveRequestScope(url, cookieHeader);\n const answered = settings.store?.scope;\n if (!scope || answered?.id == null || String(answered.id) !== scope.id) return null;\n const typed = answered.type ? { ...scope, type: answered.type } : scope;\n return sameScope(extractScopeFromCookies(cookieHeader), typed) ? null : typed;\n}\n\n/** The request's scope with the type its settings answered with, or null when that changes nothing. */\nfunction withAnsweredType(scope: ActiveScope | null, settings: StoreContext): ActiveScope | null {\n const answered = settings.store?.scope;\n if (!scope || !answered?.type || String(answered.id) !== scope.id) return null;\n return answered.type === scope.type ? null : { ...scope, type: answered.type };\n}\n\n/**\n * Gives the request the scope its settings answered with, for the rest of this render:\n * the market a market's own domain is pinned to when the request asked with another (see\n * {@link hostPinnedScope}; only with the page `url`), else the same scope with the type\n * the answer named. Files the settings and ads under the key the corrected scope makes, so\n * the browser — which reads the corrected scope from the cookie (see\n * {@link scopeCookieUpdate}) — finds them dehydrated instead of fetching them again. The\n * entry under the assumed scope's key is removed, so the page carries them once.\n * Server-only; a no-op when there is nothing to correct.\n */\nexport function alignRequestScope(\n queryClient: QueryClient,\n settings: StoreContext,\n url?: string\n): void {\n let scope: ActiveScope | null;\n try {\n scope = getTwilightContext().scope;\n } catch {\n return;\n }\n const aligned =\n (url === undefined ? null : hostPinnedScope(url, scope, settings)) ??\n withAnsweredType(scope, settings);\n if (!aligned) return;\n const assumedKey = storeApi.queries.settings().queryKey;\n const assumedAdsKey = advertisement.queries.list().queryKey;\n updateTwilightContext({ scope: aligned });\n queryClient.setQueryData(storeApi.queries.settings().queryKey, settings);\n // Moved, not copied: both would be dehydrated, sending the settings twice.\n queryClient.removeQueries({ queryKey: assumedKey, exact: true });\n const ads = queryClient.getQueryData(assumedAdsKey);\n if (ads) queryClient.setQueryData(advertisement.queries.list().queryKey, ads);\n queryClient.removeQueries({ queryKey: assumedAdsKey, exact: true });\n}\n\n/**\n * Writes {@link scopeCookieUpdate} to the response. Read from the request itself rather\n * than the middleware's context, for the same reason as {@link readServerCookieToken}.\n * Server-only.\n */\nexport const persistRequestScope = createIsomorphicFn()\n .server((settings: StoreContext): void => {\n let scope: ActiveScope | null;\n try {\n scope = scopeCookieUpdate(\n String(getRequestUrl()),\n getRequestHeader('cookie') ?? null,\n settings\n );\n } catch {\n // Outside a request (prerender): there is no response to write to.\n return;\n }\n if (!scope) return;\n setCookie(SCOPE_COOKIE_NAME, JSON.stringify(scope), {\n path: '/',\n maxAge: SCOPE_COOKIE_MAX_AGE,\n sameSite: 'lax',\n });\n })\n .client((): void => {});\n\n/** The request's cookie header: the framework's on the server, the document's in the browser. */\nconst requestCookies = createIsomorphicFn()\n .server((): string | null => {\n try {\n return getRequestHeader('cookie') ?? null;\n } catch {\n return null;\n }\n })\n .client((): string | null => (typeof document !== 'undefined' ? document.cookie : null));\n\n/** Remembers the owner view for the rest of this browser session; see {@link VIEW_AS_OWNER_COOKIE_NAME}. */\nconst rememberOwnerView = createIsomorphicFn()\n .server((storeId: string): void => {\n try {\n setCookie(VIEW_AS_OWNER_COOKIE_NAME, storeId, { path: '/', sameSite: 'lax' });\n } catch {\n // Outside a request (prerender): there is no response to write to.\n }\n })\n .client((storeId: string): void => {\n document.cookie = `${VIEW_AS_OWNER_COOKIE_NAME}=${storeId}; path=/; SameSite=Lax`;\n });\n\n/**\n * Whether this visitor sees the maintenance page instead of the store, deciding and\n * remembering the merchant's owner view on the way.\n *\n * Twig's backend lets the merchant into their closed store when the dashboard's link\n * brings them (`?utm_source=dashboard&identifier=<store id>`), and keeps that in the\n * session. Here the link grants a session cookie, and the cookie or the link is the\n * owner view. A customer gets the maintenance page, and `twilightMiddleware` turns the\n * render into a 503 (see `withMaintenanceStatus`).\n *\n * The preview host is let through whoever is looking, so the dashboard's theme editor\n * renders a closed or not-yet-launched store; see {@link showsMaintenancePage}. The host\n * is the request's on the server and the browser's own in the browser, so a navigation\n * inside the editor's frame, which carries no owner link, is decided the same way as the\n * first load.\n */\nexport function resolveMaintenance(href: string, settings: StoreContext): boolean {\n const fromLink = ownerLinkMatches(href, settings);\n const storeId = settings.store?.id;\n if (fromLink && storeId != null) rememberOwnerView(String(storeId));\n const viewAsOwner = fromLink || ownerCookieMatches(requestCookies(), settings);\n return showsMaintenancePage(settings, viewAsOwner, currentHost());\n}\n\n/** The URL of the request being rendered; null outside one (a prerender) and in the browser. */\nconst serverRequestUrl = createIsomorphicFn()\n .server((): string | null => {\n try {\n return String(getRequestUrl());\n } catch {\n return null;\n }\n })\n .client((): string | null => null);\n\n/** On the server, once the settings are in: {@link alignRequestScope}, then {@link persistRequestScope}. */\nfunction settleRequestScope(queryClient: QueryClient, settings: StoreContext): void {\n if (typeof window !== 'undefined') return;\n alignRequestScope(queryClient, settings, serverRequestUrl() ?? undefined);\n persistRequestScope(settings);\n}\n\n/**\n * On a Salla shared host the address carries no language, so `locale` here is a virtual\n * one (`?lang=`, then the `s-lang` cookie, then the fallback). Once the settings say what\n * the store offers: remembers a language `?lang=` asked for, takes `?lang=` off the URL, and\n * sends a visitor whose language the store does not offer to the store's default. A full\n * load, because the router handling this request resolved its locale before it knew. See\n * `decideSharedHostLanguage` for the rules, and why none of them can loop.\n *\n * A no-op everywhere else.\n */\nfunction settleSharedHostLanguage(\n settings: StoreContext,\n locale: string,\n location: TwilightLocation\n): void {\n const base = resolveStoreBase();\n if (!base || !resolveStoreBaseFollowsLocale()) return;\n\n // The router's href has the virtual locale in it and no store segment; the browser's has\n // the store segment and no locale.\n const url = new URL(location.href, 'http://shared-host.invalid');\n const decision = decideSharedHostLanguage({\n settings,\n locale,\n href: `${prefixStoreBase(url.pathname, base, true)}${url.search}${url.hash}`,\n cookieHeader: readCookieHeader(),\n });\n\n if (decision.cookie) persistLanguageCookie(decision.cookie);\n if (decision.redirectTo) {\n throw redirect({ href: decision.redirectTo, reloadDocument: true, replace: true });\n }\n}\n\n/**\n * Sends the request elsewhere, now that the settings say where the store is served.\n *\n * On a host where the store is the root of every URL, a page has one address:\n * `/<username>/…`. A request that found its store some other way (`?storeId=`, the preview\n * cookie, `VITE_STORE_DOMAIN`) is sent there now that the settings say what the username is.\n *\n * A basic-plan store is not served on its own domain: Twig's `checkUsername` sends any page\n * of it to the Store's \"this domain is stopped\" page, with a 302.\n *\n * Full loads rather than client navigations: the router handling this request was built\n * without that root, and the stopped page is the Store's.\n */\nfunction settleStoreAddress(settings: StoreContext, href: string): void {\n const storeBaseHref = resolveStoreBaseRedirect(settings.store?.username, href);\n if (storeBaseHref) {\n throw redirect({ href: storeBaseHref, reloadDocument: true, replace: true });\n }\n\n const stoppedHref = resolveStoppedDomainRedirect(settings.store);\n if (stoppedHref) {\n throw redirect({ href: stoppedHref, statusCode: 302, reloadDocument: true, replace: true });\n }\n}\n\nexport interface BeforeLoadResult {\n settings: StoreContext;\n locale: string;\n /**\n * Whether this page is on a Salla shared host, where the address carries no language.\n * The generated locale layout reads it: it must not redirect between locale-less and\n * locale-bearing paths there, because the router strips the locale from every address.\n */\n storeBaseFollowsLocale: boolean;\n dir: 'ltr' | 'rtl';\n authToken: string | null;\n /** Installed apps' snippets, threaded through the beforeLoad context (and recovered on the\n * client via ensureTwilightContextFromMatches) so AppsSnippets can render CDN tags in SSR. */\n appsSnippets?: AppSnippet[];\n /** Per-app public `app.*` buckets, threaded the same way so rootHead can install the\n * `Salla.appScope` factory inline in the SSR head. */\n appsSettings?: AppSettings;\n /** This visitor sees the maintenance page, not the store; see {@link resolveMaintenance}. */\n maintenance: boolean;\n}\n\n/**\n * The platform's copy for `locale`, with this merchant's own wording over it.\n *\n * Returns the platform's copy untouched — and makes no request — unless the\n * settings say this language has overrides. That gate is the whole reason this\n * is affordable: the object 404s for most stores, uncached, on the critical\n * path of an SSR render.\n *\n * The entry is found by ISO code rather than by index or key. The API sends\n * `languages` as an object keyed by **upper-case** ISO, and `storeApi` converts\n * it to an array on the way through (`languagesToArray`), so neither the\n * upper-case key nor a position is available here — and matching case-sensitively\n * on `code` would be a lookup that misses silently, leaving the flag absent and\n * the feature simply never running.\n *\n * Nothing about this is fatal. A failed override read leaves the platform's\n * copy in place, which is a storefront in the words Salla ships rather than a\n * storefront that did not render.\n */\nasync function withMerchantTranslations(\n queryClient: QueryClient,\n settings: StoreContext,\n locale: string,\n common: Awaited<ReturnType<typeof translations.get>>\n): Promise<Awaited<ReturnType<typeof translations.get>>> {\n const wanted = locale.toLowerCase();\n const language = settings.languages?.find(\n (entry) => (entry.iso_code ?? entry.code)?.toLowerCase() === wanted\n );\n const storeId = settings.store?.id;\n\n if (!language?.has_custom_translations || !storeId) return common;\n\n try {\n const overrides = await queryClient.ensureQueryData(\n translations.queries.byStore(storeId, locale)\n );\n\n return translations.merge(common, overrides, locale);\n } catch (error) {\n console.warn('[salla] merchant translations could not be read; using the platform copy', error);\n return common;\n }\n}\n\n/**\n * What the root route throws when the settings did not load: their own failure, which\n * says why. When it says no store has this identifier, that is recorded first, and\n * `twilightMiddleware` answers with Twig's 410 page instead of the render.\n */\nfunction settingsFailureToThrow(failure: unknown): SettingsError {\n if (!(failure instanceof SettingsError)) return new SettingsError();\n if (failure.reason === 'not-found') updateTwilightContext({ storeNotFound: true });\n return failure;\n}\n\nexport async function rootBeforeLoad(ctx: {\n params: Record<string, string>;\n location: TwilightLocation;\n context: {\n queryClient: QueryClient;\n setLocation?: (location: Partial<TwilightLocation>) => void;\n };\n serverContext?: {\n authToken?: string | null;\n };\n}): Promise<BeforeLoadResult> {\n // Not every value here is a language. A link with `to=\"#\"` on a page with no language in its\n // path resolves to `/#`, and hovering it preloads this route with `#` as the locale.\n const locale = isLocale(ctx.params.locale) ? ctx.params.locale : FALLBACK_LOCALE;\n const { dir } = getLanguageInfo(locale);\n\n if (ctx.context.setLocation) {\n ctx.context.setLocation(ctx.location);\n }\n\n // Set locale in context before any API calls so interceptor uses correct locale\n updateTwilightContext({ locale });\n\n // Re-assert the locale on the Salla SDK on every navigation. The SDK's axios\n // accept-language header drifts off the route locale (navigator.language default,\n // account-language override on profile fetch — see syncSdkLocale), which makes\n // SDK API calls (e.g. the cart's salla.api.cart.details) return wrong-locale data.\n syncSdkLocale(locale);\n\n // Mirror the SDK's selected branch into the `scope` cookie. The SDK persists the\n // selection in localStorage ONLY, so the server — which can only see cookies —\n // would otherwise compute scope=null for every visitor who picked a branch, and\n // the dehydrated settings query (keyed on the scope) would never match on the\n // client. No-op on the server and while the SDK storage API is still hydrating.\n syncScopeCookie();\n\n // On the server, the lazy components load beside the requests below, so none suspends in\n // the render: a fresh isolate otherwise streamed every block after the shell.\n const componentsLoaded = preloadServerComponents();\n\n // Kept until the rest have settled, as a missing answer always was, then thrown:\n // it says why the store did not load.\n let settingsFailure: unknown;\n const [settingsResult, translationsResult, snippetsResult, appSettingsResult] = await Promise.all(\n [\n ctx.context.queryClient.ensureQueryData(storeApi.queries.settings()).catch((error): null => {\n settingsFailure = error;\n return null;\n }),\n ctx.context.queryClient.ensureQueryData(translations.queries.byLocale(locale)),\n // Snippets → SSR CDN <script> tags (AppsSnippets.ssrCdnScripts). Non-fatal + logged:\n // on failure AppsSnippets falls back to its own client-side query for the same data,\n // so the tags render a paint later instead of being lost for the page load.\n ctx.context.queryClient.ensureQueryData(apps.queries.snippets()).catch((error): undefined => {\n console.warn('[salla] apps/snippets prefetch failed; rendering no CDN snippet tags', error);\n return undefined;\n }),\n // Buckets → rootHead installs `Salla.appScope` inline in the SSR head (before any snippet\n // onReady runs). Non-fatal + logged: the head installs the factory either way, and the\n // client query seeds the buckets into that install once it resolves.\n ctx.context.queryClient.ensureQueryData(apps.queries.settings()).catch((error): undefined => {\n console.warn(\n '[salla] apps/snippets/settings prefetch failed; appScope buckets unseeded',\n error\n );\n return undefined;\n }),\n // Ads → the header's announcement bar renders on the server, so it no longer pushes the\n // page down when it arrives. Non-fatal: the bar then loads on the client, as before.\n ctx.context.queryClient\n .ensureQueryData(advertisement.queries.list())\n .catch((error): undefined => {\n console.warn('[salla] advertisements prefetch failed; the ad bar loads late', error);\n return undefined;\n }),\n ]\n );\n\n await componentsLoaded;\n if (!settingsResult) throw settingsFailureToThrow(settingsFailure);\n\n // Settings answered for another market name another theme version; the SDK only\n // read its `s-version-id` at init — see syncSdkThemeVersion.\n syncSdkThemeVersion(settingsResult.headers);\n\n settleRequestScope(ctx.context.queryClient, settingsResult);\n\n settleStoreAddress(settingsResult, ctx.location.href);\n\n // Before the maintenance decision: its redirect keeps every other query parameter, so the\n // owner link (`?utm_source=dashboard&identifier=`) still reaches the request that follows.\n settleSharedHostLanguage(settingsResult, locale, ctx.location);\n\n const maintenance = resolveMaintenance(ctx.location.href, settingsResult);\n\n // The merchant's own wording, laid over the platform's — but only when the\n // settings say this language has any.\n //\n // Sequenced after the `Promise.all` on purpose: the object is keyed by\n // `settings.store.id`, which the settings query is what produces, so this\n // cannot join the batch above. The cost of a second round trip is why it is\n // gated rather than always fetched — see `api/translations.ts` for the two\n // corrections that shape led to.\n const messages = await withMerchantTranslations(\n ctx.context.queryClient,\n settingsResult,\n locale,\n translationsResult\n );\n\n // Create i18n instance with loaded translations\n const i18n = createI18nInstance(locale, messages ?? undefined);\n\n // Resolve authToken with fallback chain:\n // 1. SSR context (from middleware extracting cookies on server)\n // 2. The twilight context token. On the SERVER this is the token twilightMiddleware\n // extracted from the `token` cookie into the request ALS — reading it here is\n // essential, otherwise this loader's updateTwilightContext() below would\n // overwrite the middleware's token with null and every SSR render (e.g. the\n // account hub) would be unauthenticated. On the CLIENT it's the clientStore\n // token from hydration or a previous navigation.\n // 3. The `token` cookie read directly — client fallback when clientStore is empty\n // and salla.storage hasn't hydrated yet.\n // 4. Salla SDK storage (salla.storage.get('token'))\n let existingToken: string | null = null;\n try {\n existingToken = getTwilightContext().authToken;\n } catch {\n // No request context (e.g. server call outside the middleware ALS) — fall through.\n existingToken = null;\n }\n const cookieToken =\n typeof document !== 'undefined'\n ? extractTokenFromCookies(document.cookie, AUTH_TOKEN_COOKIE_NAME)\n : null;\n const sallaToken =\n typeof window !== 'undefined' && typeof window.salla?.storage?.get === 'function'\n ? (window.salla.storage.get(AUTH_TOKEN_COOKIE_NAME) as string | null)\n : null;\n const serverCookieToken = readServerCookieToken();\n const authToken =\n ctx.serverContext?.authToken ??\n serverCookieToken ??\n existingToken ??\n cookieToken ??\n sallaToken ??\n null;\n\n updateTwilightContext({\n queryClient: ctx.context.queryClient,\n settings: settingsResult,\n locale,\n location: ctx.location,\n i18n,\n authToken,\n appsSnippets: snippetsResult,\n appsSettings: appSettingsResult,\n maintenance,\n });\n\n return {\n settings: settingsResult,\n locale,\n storeBaseFollowsLocale: resolveStoreBaseFollowsLocale(),\n dir,\n authToken,\n appsSnippets: snippetsResult,\n appsSettings: appSettingsResult,\n maintenance,\n };\n}\n","/**\n * @fileoverview The store segment, carried by the router instead of the route tree.\n *\n * TanStack Router rewrites every location it reads and every one it writes:\n * `input` runs before a URL is matched, and `output` before an href is rendered,\n * pushed to history or sent as a redirect's `Location`. So on a host where the\n * store is the root, the route tree stays `/{-$locale}/cart` and\n * `<Link to=\"/cart\">` renders `/mtgr-alaatr-2/cart` by itself.\n *\n * Why not the router's `basepath`: TanStack Start overwrites it from the build on\n * both sides (`router.update({ basepath })` per request on the server, and in\n * `hydrateStart` on the client). `rewrite` is a separate option that the router\n * composes with that basepath, so it survives. Server functions are dispatched on\n * the raw URL before the router runs, and assets are root-absolute, so neither\n * moves. See `docs/store-base-path.md`.\n */\nimport type { LocationRewrite } from '@tanstack/react-router';\nimport { isLocale } from '../providers/locale-constants';\nimport { readCookieHeader, readPageSearch } from '../utils/language-cookie';\nimport { hasLanguageParam, virtualLocale, withLanguageParam } from '../utils/shared-host-language';\nimport { prefixStoreBase, stripStoreBase } from '../utils/store-base';\n\n/**\n * A rewrite that serves the application from `/<base>`.\n *\n * With `followsLocale` (a Salla shared host) the address carries no language, but the\n * route tree still has its `/{-$locale}` segment, so the language is a *virtual* one:\n * `input` puts it in front of the path (`/dev-x/cart` → `/ar/cart`, from `?lang=`, then\n * the `s-lang` cookie, then the fallback) and `output` takes it off again. The old\n * address, `/ar/dev-x/cart`, is still understood and keeps its own language.\n *\n * A link keeps `?lang=` for as long as the page it is on carries one (see `output`), so a\n * visitor whose browser blocks the cookie does not lose the language on the next page.\n */\nexport function storeBaseRewrite(base: string, followsLocale = false): LocationRewrite {\n return {\n input: ({ url }) => {\n if (!followsLocale) {\n url.pathname = stripStoreBase(url.pathname, base);\n return url;\n }\n\n const [, first, second] = url.pathname.split('/');\n if (isLocale(first) && second === base) {\n url.pathname = stripStoreBase(url.pathname, base, true);\n return url;\n }\n\n const stripped = stripStoreBase(url.pathname, base);\n // Not under the store segment: nothing to put a language in front of.\n if (stripped === url.pathname) return url;\n\n const locale = virtualLocale(url.search, readCookieHeader());\n url.pathname = stripped === '/' ? `/${locale}` : `/${locale}${stripped}`;\n return url;\n },\n output: ({ url }) => {\n if (!followsLocale) {\n url.pathname = prefixStoreBase(url.pathname, base);\n return url;\n }\n\n const [, leading] = url.pathname.split('/');\n url.pathname = prefixStoreBase(url.pathname, base, true);\n\n // While the page's own address still carries `?lang=`, the cookie has not been confirmed\n // (a browser that blocks it never does), so a link that dropped its language would open in\n // another one. Such a link keeps naming its language, until a request arrives with the\n // cookie and `rootBeforeLoad` takes `?lang=` off the address.\n const page = readPageSearch();\n if (hasLanguageParam(page) && !hasLanguageParam(url.search)) {\n url.search = withLanguageParam(\n url.search,\n isLocale(leading) ? leading : virtualLocale(page, null)\n );\n }\n return url;\n },\n };\n}\n","import type { ReactNode } from 'react';\nimport { Suspense } from 'react';\nimport {\n createRouter as createTanStackRouter,\n createRootRouteWithContext,\n notFound as tanstackNotFound,\n} from '@tanstack/react-router';\nimport type { AnyRoute, BlockerFn, HistoryLocation, RouterHistory } from '@tanstack/react-router';\nimport { QueryClient } from '@tanstack/react-query';\nimport { shouldDehydrateQuery } from '../api/product';\nimport { PageSkeleton } from '@salla.sa/twilight-components-react/skeletons';\nimport { setHeadAdapter } from '../utils/head';\nimport { tanstackHeadAdapter } from './head';\nimport { stringifySearch } from './search';\nimport {\n updateTwilightContext,\n type PageContext,\n type TwilightLocation,\n} from '../twilight/context';\nimport type { Product } from '../types';\nimport { dispatchProductViewed, dispatchRouteChanged } from '../utils/sdk-events';\nimport { needsDocumentLoad, subscribeSnippetPageTargets } from '../utils/snippet-page-compat';\nimport { rootBeforeLoad, type BeforeLoadResult } from '../routes/root/beforeLoad';\nimport { rootHead } from '../routes/root/head';\nimport { setupRouterSsrQueryIntegration } from '@tanstack/react-router-ssr-query';\nimport type { AnyRouter } from '@tanstack/react-router';\nimport { RouteId, type RouteIdType } from '../router/route-ids';\nimport {\n UnauthorizedError,\n NotFoundError,\n RedirectError,\n isMissingResource,\n responseStatusOf,\n} from '../providers/NavigationProvider';\nimport { ErrorPage } from '../components/common/ErrorPage';\nimport type { StoreContext } from '../api/store';\nimport type { AppSnippet, AppSettings } from '../api/apps';\nimport { createI18nInstance } from '../providers/i18n-factory';\nimport { messagesForLocale } from '../api/messages';\nimport { resolveStoreBase, resolveStoreBaseFollowsLocale } from '../utils/store-identity';\nimport { storeBaseRewrite } from './store-base';\nimport { lazyComponent } from '../utils/lazy-component';\n\n/**\n * Initial router context passed from createRouter to beforeLoad.\n */\nexport interface RouterInitialContext {\n queryClient: QueryClient;\n setLocation: (_location: Partial<TwilightLocation>) => void;\n}\n\n/**\n * TanStack Router ID Mapping\n *\n * Maps TanStack's auto-generated path-based route IDs to semantic RouteId constants.\n * This mapping is TanStack-specific because different frameworks generate route IDs differently:\n *\n * - TanStack: Uses file path as ID (e.g., '/{-$locale}/cart')\n * - Next.js: Uses file path without locale (e.g., '/cart')\n *\n * The mapping enables hooks like useIsHome(), useIsProduct() to work consistently\n * across frameworks while each framework has its own ID generation strategy.\n */\nexport const TANSTACK_ROUTE_ID_MAP: Record<string, RouteIdType> = {\n '/{-$locale}/': RouteId.INDEX,\n '/{-$locale}/cart': RouteId.CART,\n '/{-$locale}/search': RouteId.SEARCH,\n\n '/{-$locale}/latest-products': RouteId.PRODUCT_INDEX_LATEST,\n '/{-$locale}/most-sales-products': RouteId.PRODUCT_INDEX_SALES,\n '/{-$locale}/offers': RouteId.PRODUCT_INDEX_OFFERS,\n '/{-$locale}/products': RouteId.PRODUCT_INDEX,\n\n '/{-$locale}/$slug/c{$id}': RouteId.PRODUCT_INDEX,\n '/{-$locale}/$slug/p{$id}': RouteId.PRODUCT_SINGLE,\n '/{-$locale}/$slug/brand-{$id}': RouteId.BRANDS_SINGLE,\n '/{-$locale}/$slug/tag-{$id}': RouteId.PRODUCT_INDEX_TAG,\n '/{-$locale}/$slug/page-{$id}': RouteId.PAGE_SINGLE,\n\n '/{-$locale}/blog': RouteId.BLOG_INDEX,\n '/{-$locale}/blog/$slug/a-{$id}': RouteId.BLOG_SINGLE,\n '/{-$locale}/blog/$slug/c-{$id}': RouteId.BLOG_INDEX_CATEGORY,\n '/{-$locale}/blog/$slug/tag-{$id}': RouteId.BLOG_INDEX_TAG,\n '/{-$locale}/blog/author/$id': RouteId.BLOG_INDEX_AUTHOR,\n\n '/{-$locale}/brands': RouteId.BRANDS_INDEX,\n '/{-$locale}/brands/$id': RouteId.BRANDS_SINGLE,\n '/{-$locale}/tags/$id': RouteId.PRODUCT_INDEX_TAG,\n\n '/{-$locale}/profile': RouteId.CUSTOMER_PROFILE,\n '/{-$locale}/wishlist': RouteId.CUSTOMER_WISHLIST,\n '/{-$locale}/wallet': RouteId.CUSTOMER_WALLET,\n '/{-$locale}/notifications': RouteId.CUSTOMER_NOTIFICATIONS,\n '/{-$locale}/settings': RouteId.CUSTOMER_SETTINGS,\n '/{-$locale}/orders': RouteId.CUSTOMER_ORDERS_INDEX,\n '/{-$locale}/order/$id': RouteId.CUSTOMER_ORDERS_SINGLE,\n '/{-$locale}/pending-orders': RouteId.CUSTOMER_ORDERS_INDEX_PENDING,\n '/{-$locale}/account/pending_orders': RouteId.CUSTOMER_ORDERS_INDEX_PENDING,\n '/{-$locale}/account/rating': RouteId.CUSTOMER_ORDERS_INDEX,\n\n '/{-$locale}/logout': RouteId.LOGOUT,\n '/{-$locale}/loyalty': RouteId.LOYALTY,\n '/{-$locale}/loyalty_points': RouteId.CUSTOMER_LOYALTY_POINTS,\n '/{-$locale}/testimonials': RouteId.TESTIMONIALS,\n '/{-$locale}/reviews': RouteId.REVIEWS,\n '/{-$locale}/thankyou/$orderId': RouteId.THANK_YOU,\n};\n\n/**\n * Resolves a TanStack route ID to a semantic RouteId constant.\n * Falls back to the original ID if no mapping exists.\n * @internal Exported for testing\n */\nexport function resolveRouteId(tanstackId: string): string {\n return TANSTACK_ROUTE_ID_MAP[tanstackId] ?? tanstackId;\n}\n\n// Lazy load NotFoundPage for code splitting\nconst LazyNotFoundPage = lazyComponent(() =>\n import('../routes/not-found').then((m) => ({ default: m.NotFoundPage }))\n);\n\n/**\n * Error component shown when the root route fails to load.\n * This renders a minimal HTML page with error details.\n */\nfunction StoreUnavailablePage() {\n return (\n <>\n <div\n style={{\n position: 'fixed',\n inset: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: '#f9fafb',\n }}\n >\n <div style={{ textAlign: 'center', padding: '2rem' }}>\n <h1 style={{ fontSize: '1.5rem', marginBottom: '0.5rem' }}>\n Store is temporarily unavailable\n </h1>\n <p style={{ color: '#6b7280' }}>\n We're having trouble loading the store. Please try again in a moment.\n </p>\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n style={{\n marginTop: '1rem',\n padding: '0.75rem 1.5rem',\n fontSize: '1rem',\n border: 'none',\n borderRadius: '0.5rem',\n background: '#111827',\n color: '#fff',\n cursor: 'pointer',\n }}\n >\n Retry\n </button>\n </div>\n </div>\n </>\n );\n}\n\nfunction RootErrorComponent({ error: _error }: { error: Error }) {\n return (\n <html lang=\"ar\" dir=\"rtl\">\n <head>\n <meta charSet=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>Store Unavailable</title>\n </head>\n <body style={{ margin: 0, fontFamily: 'sans-serif' }}>\n <StoreUnavailablePage />\n </body>\n </html>\n );\n}\n\n/**\n * Creates the root route pre-configured with RouterInitialContext.\n * beforeLoad will fetch settings/translations, loader returns serializable data.\n *\n * @example\n * ```ts\n * export const Route = createTwilightRootRoute()({ shellComponent });\n * ```\n */\nexport function createTwilightRootRoute() {\n const factory = createRootRouteWithContext<RouterInitialContext>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- TanStack Router factory expects `any` for spread options\n return (options: any) =>\n factory({\n beforeLoad: rootBeforeLoad,\n head: rootHead,\n errorComponent: RootErrorComponent,\n ...options,\n });\n}\n\n/**\n * Default error component for route-level errors.\n */\nexport function DefaultErrorComponent({ error }: { error: unknown }) {\n if (error instanceof RedirectError) {\n return null;\n }\n\n if (error instanceof NotFoundError) {\n return <ErrorPage code={404} message={error.message} />;\n }\n\n if (error instanceof UnauthorizedError) {\n return <ErrorPage code={401} message={error.message} showAction={false} />;\n }\n\n const message =\n error instanceof Error\n ? error.message\n : error &&\n typeof error === 'object' &&\n 'message' in error &&\n typeof error.message === 'string'\n ? error.message\n : undefined;\n\n if (error && typeof error === 'object' && 'response' in error) {\n return responseErrorPage(error, message);\n }\n\n return <ErrorPage code={500} message={message} />;\n}\n\n/**\n * An error that carries an HTTP response. ky's own message names the API request\n * (\"Request failed with status code 410 Gone: GET https://api.salla.dev/…\"), which\n * is not a shopper's to read; an error a theme or the SDK made itself keeps its\n * message.\n */\nfunction responseErrorPage(error: object, message: string | undefined) {\n if (isMissingResource(error)) return <ErrorPage code={404} />;\n if (isHttpError(error)) {\n return <ErrorPage code={(responseStatusOf(error) ?? 500) >= 500 ? 500 : 400} />;\n }\n return <ErrorPage code={400} message={message} />;\n}\n\n/** An error ky threw for a non-2xx answer, as opposed to one carrying a response for its own reasons. */\nfunction isHttpError(error: object): boolean {\n return (error as { name?: unknown }).name === 'HTTPError';\n}\n\nconst MISSING_AS_NOT_FOUND = Symbol.for('salla.twilight.missingResourceAsNotFound');\n\ntype MarkedOnError = ((error: unknown) => void) & { [MISSING_AS_NOT_FOUND]?: true };\n\n/**\n * Every route but the root answers an API 404/410 its `loader` or `beforeLoad` let\n * escape with the not-found page and a 404, instead of the error page and a 500.\n *\n * The engine's own loaders already say so through `orThrow`; a theme's need not. Theme\n * 427703943 fetches `category.queries.detail` in its own `/category/$id` loader, so a\n * deleted category was a 500 that printed the API URL. TanStack hands a loader's error\n * to the route's `onError` and honours a `notFound()` thrown from there, on the server\n * (the status follows) and in the browser alike; the router has no default for it, so\n * each route gets one, after its own.\n *\n * The root is left alone: its `beforeLoad` failing means the store cannot be served at\n * all (\"Store Unavailable\", or Twig's 410 page when no store has the identifier).\n * Routes are built once per isolate and `createRouter` runs per request, hence the mark.\n */\nexport function answerMissingResourcesWithNotFound(router: AnyRouter): void {\n for (const route of Object.values(router.routesById) as AnyRoute[]) {\n if (route.isRoot) continue;\n const own = route.options.onError as MarkedOnError | undefined;\n if (own?.[MISSING_AS_NOT_FOUND]) continue;\n\n const onError: MarkedOnError = (error) => {\n own?.(error);\n if (isMissingResource(error)) throw tanstackNotFound();\n };\n onError[MISSING_AS_NOT_FOUND] = true;\n route.options.onError = onError;\n }\n}\n\n/**\n * SSR integration for Twilight context — mirrors TanStack Query's\n * `setupRouterSsrQueryIntegration` pattern.\n *\n * On the **server**: wraps `router.options.dehydrate` to include twilight\n * context data (settings, locale, location, authToken) alongside the router state.\n *\n * On the **client**: wraps `router.options.hydrate` to populate the module-level\n * store from the root match's `__beforeLoadContext` BEFORE head functions re-run.\n * TanStack's `hydrate()` calls `router.options.hydrate()` at line 114 of\n * `ssr-client.ts`, right before it re-evaluates head functions (line 120+).\n * By populating the store here, `getTwilightContext().settings` is available\n * to `rootHead()` and all child head functions during client hydration.\n */\nfunction setupTwilightSsrIntegration(router: AnyRouter, queryClient: QueryClient): void {\n if (typeof window === 'undefined') {\n // Server: also populate twilightCtx from root match context on dehydrate\n return;\n }\n\n // Client: hook into router.options.hydrate to populate the module store\n // from the root match's __beforeLoadContext (set by rootBeforeLoad on the server)\n const ogHydrate = router.options.hydrate;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n router.options.hydrate = async (dehydratedData: any) => {\n await ogHydrate?.(dehydratedData);\n hydrateTwilightContext(router, queryClient);\n };\n}\n\nfunction warnHydrationBail(reason: string): void {\n // Silent failure here is what blanks the storefront: every head function that\n // runs next reads `getTwilightContext().settings`, which throws when the store\n // is empty. `ensureTwilightContextFromMatches` recovers at the point of use,\n // but the bail still signals a regression worth seeing in dev.\n if (import.meta.env?.DEV) {\n console.warn(`[Twilight] Could not hydrate twilight context: ${reason}`);\n }\n}\n\nfunction routerLocation(router: AnyRouter): TwilightLocation | undefined {\n const loc = router.state?.location;\n if (!loc) return undefined;\n return {\n href: loc.href,\n pathname: loc.pathname,\n search: loc.search as Record<string, unknown>,\n searchStr: loc.searchStr,\n state: loc.state as unknown as Record<string, unknown>,\n hash: loc.hash,\n };\n}\n\nfunction hydrateTwilightContext(router: AnyRouter, queryClient: QueryClient): void {\n const location = routerLocation(router);\n // A direct load can hydrate before its matches exist.\n if (location) updateTwilightContext({ location });\n\n const rootMatch = router.state?.matches?.[0];\n if (!rootMatch) {\n warnHydrationBail('no root match in router state');\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const beforeLoadCtx = (rootMatch as any).__beforeLoadContext as BeforeLoadResult | undefined;\n const matchCtx = rootMatch.context as Record<string, unknown> | undefined;\n\n const settings = (beforeLoadCtx?.settings ?? matchCtx?.settings) as StoreContext | undefined;\n const locale = (beforeLoadCtx?.locale ?? matchCtx?.locale) as string | undefined;\n const authToken = (beforeLoadCtx?.authToken ?? matchCtx?.authToken) as string | null;\n // Recover snippets here too: this is the primary hydration pass and populates settings, so the\n // best-effort ensureTwilightContextFromMatches fallback then short-circuits — if we skipped\n // appsSnippets here it would never reach the client store, and AppsSnippets' SSR-rendered CDN\n // tags would mismatch on hydration.\n const appsSnippets =\n beforeLoadCtx?.appsSnippets ?? (matchCtx?.appsSnippets as AppSnippet[] | undefined);\n // Recover appScope buckets too (like appsSnippets): this primary pass populates settings, so the\n // ensure-context fallback short-circuits — keep the client store in parity for head/install.\n const appsSettings =\n beforeLoadCtx?.appsSettings ?? (matchCtx?.appsSettings as AppSettings | undefined);\n // The maintenance decision too, for the same parity: the server rendered the maintenance\n // page from it, and the provider reads it on the client.\n const maintenance = (beforeLoadCtx?.maintenance ?? matchCtx?.maintenance) === true;\n\n if (!settings || !locale) {\n warnHydrationBail(\n `root match carried no ${!settings ? 'settings' : 'locale'} (beforeLoadContext and context both empty)`\n );\n return;\n }\n\n // Composed by the shared helper rather than read straight off one key.\n // There are two entries now — the platform's copy and this merchant's — and\n // reading only the first is how the server rendered the merchant's wording\n // and hydration replaced it with Salla's (Greptile's P1 on #366).\n const i18n = createI18nInstance(locale, messagesForLocale(queryClient, locale));\n\n const matches = router.state?.matches;\n const page = matches?.reduceRight(\n (found, m) => found ?? ((m as any).loaderData?.page ? (m as any).loaderData.page : null),\n null as any\n );\n\n // Resolve routeId on the initial load too — `onResolved` only fires on later\n // navigations, so without this the store keeps the empty default until the\n // first SPA navigation (breaks useRouteId/useIsHome on first paint/refresh).\n const leafMatch = matches?.[matches.length - 1];\n const routeId = leafMatch?.routeId ? resolveRouteId(leafMatch.routeId as string) : undefined;\n\n updateTwilightContext({\n queryClient,\n settings,\n locale,\n i18n,\n authToken,\n location,\n page,\n routeId,\n appsSnippets,\n appsSettings,\n maintenance,\n });\n}\n\ninterface PageLoaderData {\n page?: PageContext;\n product?: Product;\n}\n\n/** The navigation that last reported a product view: onLoad and onRendered both sync each one. */\nlet lastProductView: string | undefined;\n\n/** Publishes the deepest match's loader `page` to the twilight context and `salla.config`. */\nfunction syncPageFromMatches(router: AnyRouter): void {\n const matches = router.state?.matches;\n if (!matches) return;\n const data = matches.reduceRight<PageLoaderData | null>((found, m) => {\n const loaderData = (m as { loaderData?: PageLoaderData }).loaderData;\n return found ?? (loaderData?.page ? loaderData : null);\n }, null);\n const page = data?.page;\n if (!page) return;\n updateTwilightContext({ page });\n const sdkPage = {\n ...page,\n url: page.url ?? router.state.location.pathname + router.state.location.searchStr,\n };\n const push = () => window.salla?.config?.set?.('page', sdkPage);\n // The SDK script can run after hydration; it must have the page before it is ready.\n if (window.salla?.config?.set) push();\n else window.addEventListener('salla::created', push, { once: true });\n\n const view = router.state.location.state?.key ?? router.state.location.href;\n if (page.slug !== RouteId.PRODUCT_SINGLE || !data.product) {\n lastProductView = undefined;\n } else if (view !== lastProductView) {\n lastProductView = view;\n dispatchProductViewed(data.product);\n }\n}\n\n/** `/products` picks its list from `?source=`, the latest by default; as the listing loader names its page. */\nconst PRODUCTS_SOURCE_SLUGS: Record<string, string> = {\n latest: RouteId.PRODUCT_INDEX_LATEST,\n sales: RouteId.PRODUCT_INDEX_SALES,\n offers: RouteId.PRODUCT_INDEX_OFFERS,\n reorder: RouteId.PRODUCT_INDEX,\n};\n\n/** The page slug a history location renders: its route's semantic id, as `page.slug` reads. */\nfunction slugFor(router: AnyRouter, location: HistoryLocation): string | undefined {\n const { pathname, search } = router.parseLocation(location);\n const [, , found] = router.getMatchedRoutes(pathname);\n if (!found) return undefined;\n if (found.id === '/{-$locale}/products') {\n return PRODUCTS_SOURCE_SLUGS[String(search?.source)] ?? RouteId.PRODUCT_INDEX_LATEST;\n }\n return resolveRouteId(found.id);\n}\n\n/**\n * Compatibility mode for Twig-era app snippets (see `snippet-page-compat`): a navigation that\n * enters or leaves a page one of them targets loads the document fully instead of rendering in\n * place, so the snippet runs on the page it was written for. Query-only changes (filters, sort)\n * stay in place, as they did on Twig, unless the query picks another page (`/products?source=`).\n */\nfunction blockForSnippetPages(router: AnyRouter): void {\n const blockerFn: BlockerFn = ({ currentLocation, nextLocation, action }) => {\n const from = slugFor(router, currentLocation);\n const to = slugFor(router, nextLocation);\n if (currentLocation.pathname === nextLocation.pathname && from === to) return false;\n if (!needsDocumentLoad(from, to)) return false;\n if (action === 'PUSH' || action === 'REPLACE') {\n // The router's own navigation, so a path on this store; checked anyway, so the browser is\n // never sent off the store's origin.\n const url = new URL(nextLocation.href, window.location.origin);\n if (url.origin !== window.location.origin) return false;\n // Blocked: the router stays put, and the browser loads the address instead.\n if (action === 'PUSH') window.location.assign(url.href);\n else window.location.replace(url.href);\n return true;\n }\n // Back/forward: the address bar already shows the target (a block would step it back),\n // so load it, and hold the router until the document goes.\n window.location.reload();\n return new Promise<never>(() => {});\n };\n // Only while some snippet needs it: a blocker makes every history push wait a tick.\n let unblock: (() => void) | undefined;\n subscribeSnippetPageTargets((active) => {\n if (active && !unblock) {\n unblock = router.history.block({ blockerFn, enableBeforeUnload: false });\n } else if (!active && unblock) {\n unblock();\n unblock = undefined;\n }\n });\n}\n\n/**\n * Options for creating the TanStack Router instance.\n */\nexport interface CreateRouterOptions {\n defaultPendingComponent?: (() => ReactNode) | false;\n defaultPendingMs?: number;\n defaultPendingMinMs?: number;\n defaultStaleTime?: number;\n history?: RouterHistory;\n}\n\n/**\n * Creates and configures the TanStack Router instance for the Twilight theme.\n *\n * This router is pre-configured with:\n * - Route tree generated by the TanStack Router plugin\n * - Intent-based preload for better performance\n * - Scroll restoration for better UX\n * - Locale-aware default NotFoundPage (redirects `/cart` → `/ar/cart`)\n * - Trailing slash normalization for consistent URL handling\n * - Page skeleton shown during route transitions (via `defaultPendingComponent`)\n * - SSR query integration for Cloudflare compatibility\n *\n * @param routeTree - The generated route tree from the consuming project\n * @param options - Optional overrides for pending component behavior\n * @returns Configured TanStack Router instance\n */\nexport function createRouter(routeTree: any, options?: CreateRouterOptions) {\n setHeadAdapter(tanstackHeadAdapter);\n\n const {\n defaultPendingComponent: pendingOpt,\n defaultPendingMs = 100,\n defaultPendingMinMs = 200,\n defaultStaleTime = Infinity,\n history,\n } = options ?? {};\n\n const pendingComponent =\n pendingOpt === false ? undefined : (pendingOpt ?? (() => <PageSkeleton />));\n\n const queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 60_000,\n gcTime: 5 * 60_000,\n retry: 1,\n refetchOnWindowFocus: false,\n },\n mutations: {\n retry: 0,\n },\n dehydrate: {\n shouldDehydrateQuery,\n },\n },\n });\n\n // Store queryClient in the holder for access by loaders via getTwilightContext()\n updateTwilightContext({ queryClient });\n\n // On a host that serves many stores, the store is a segment of every URL: the\n // first one on the preview host, the one after the locale on a Salla shared\n // host. The router carries it instead of the route tree: it is stripped before\n // matching and added to every href the router builds. Decided per request on\n // the server, and taken from what SSR published in the browser.\n const storeBase = resolveStoreBase();\n\n const router = createTanStackRouter({\n routeTree,\n ...(history ? { history } : {}),\n ...(storeBase ? { rewrite: storeBaseRewrite(storeBase, resolveStoreBaseFollowsLocale()) } : {}),\n context: {\n queryClient,\n setLocation: (location: Partial<TwilightLocation>) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n updateTwilightContext({ location } as any);\n },\n },\n defaultPreload: 'intent',\n scrollRestoration: true,\n scrollRestorationBehavior: 'instant',\n trailingSlash: 'never',\n stringifySearch,\n defaultStaleTime,\n defaultNotFoundComponent: () => (\n <Suspense fallback={<PageSkeleton />}>\n <LazyNotFoundPage />\n </Suspense>\n ),\n defaultPendingComponent: pendingComponent,\n defaultPendingMs,\n defaultPendingMinMs,\n defaultErrorComponent: DefaultErrorComponent,\n });\n\n answerMissingResourcesWithNotFound(router);\n\n // Setup SSR query integration (native, with incremental streaming)\n setupRouterSsrQueryIntegration({ router, queryClient });\n\n // Setup Twilight SSR integration — populates the module store from\n // dehydrated match context BEFORE head functions re-run on the client.\n // This mirrors how setupRouterSsrQueryIntegration hydrates QueryClient.\n setupTwilightSsrIntegration(router, queryClient);\n\n // Subscribe to navigation events to sync location and routeId\n function syncNavigationState() {\n const state = router?.state;\n if (!state?.location) return;\n\n const loc = state.location;\n updateTwilightContext({\n location: {\n href: loc.href,\n pathname: loc.pathname,\n search: loc.search as Record<string, unknown>,\n searchStr: loc.searchStr,\n state: loc.state as unknown as Record<string, unknown>,\n hash: loc.hash,\n },\n });\n\n const matches = state.matches;\n const leafMatch = matches[matches.length - 1];\n if (leafMatch?.routeId) {\n const semanticId = resolveRouteId(leafMatch.routeId as string);\n updateTwilightContext({ routeId: semanticId });\n }\n\n const rootMatch = state.matches[0];\n if (rootMatch?.context) {\n const ctx = rootMatch.context as BeforeLoadResult;\n if (ctx?.settings) {\n updateTwilightContext({ settings: ctx.settings, locale: ctx.locale });\n }\n }\n }\n\n // Extract page from matches as soon as loaders complete (before components mount),\n // so useTwilightInit's useEffect sees page data when it calls sdk.init().\n router.subscribe('onLoad', () => syncPageFromMatches(router));\n // A direct load resolves through hydration, which emits no onLoad; its first render does emit onRendered.\n router.subscribe('onRendered', () => syncPageFromMatches(router));\n\n if (typeof window !== 'undefined') blockForSnippetPages(router);\n\n // Sync location, routeId, and settings after navigation fully resolves\n router.subscribe('onResolved', () => {\n syncNavigationState();\n dispatchRouteChanged();\n });\n\n return router;\n}\n\ndeclare module '@tanstack/react-router' {\n interface Register {\n router: ReturnType<typeof createRouter>;\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- Required by TanStack Router module augmentation pattern\n interface RouterContext extends RouterInitialContext {}\n}\n","import { useRouterState } from '@tanstack/react-router';\nimport {\n mergeElementAttrs,\n toReactProps,\n type DocumentElementDescriptor,\n} from '../utils/document-class';\nimport { useDocumentClass } from '../hooks/useDocumentClass';\nimport { updateTwilightContext, type PageContext } from '../twilight/context';\nimport { resolveRouteId } from './router';\n\n// ============================================================================\n// Route → body class map (mirrors PHP Route2Class::generateClassString)\n// Keyed by TanStack Router route ID (the path passed to createFileRoute).\n// null = intentionally classless (e.g. root layout routes).\n// ============================================================================\n\nconst ROUTE_CLASS_MAP: Record<string, string | null> = {\n '/{-$locale}/': 'index',\n '/{-$locale}/cart': 'cart',\n '/{-$locale}/$slug/c{$id}': 'product-index',\n '/{-$locale}/offers': 'product-index-offers',\n '/{-$locale}/products': 'product-index',\n '/{-$locale}/latest-products': 'product-index-latest',\n '/{-$locale}/most-sales-products': 'product-index-sales',\n '/{-$locale}/search': 'product-index-search',\n '/{-$locale}/$slug/tag-{$id}': 'product-index-tag',\n '/{-$locale}/tags/$id': 'product-index-tag',\n '/{-$locale}/$slug/p{$id}': 'product-single',\n '/{-$locale}/$slug/page-{$id}': 'page-single',\n '/{-$locale}/page/$slug': 'page-single',\n '/{-$locale}/p/$slug': 'page-single',\n '/{-$locale}/thankyou/$orderId': 'thank-you',\n '/{-$locale}/orders': 'customer-orders-index',\n '/{-$locale}/pending-orders': 'customer-orders-index-pending', // redirect to /account/orders?status=pending\n '/{-$locale}/account/pending_orders': 'customer-orders-index-pending',\n '/{-$locale}/account/rating': 'customer-orders-index', // redirect to /account/orders\n '/{-$locale}/order/$id': 'customer-orders-single',\n '/{-$locale}/profile': 'customer-profile',\n '/{-$locale}/wallet': 'customer-wallet',\n '/{-$locale}/wishlist': 'customer-wishlist',\n '/{-$locale}/notifications': 'customer-notifications',\n '/{-$locale}/testimonials': 'testimonials',\n '/{-$locale}/reviews': 'reviews',\n '/{-$locale}/brands': 'brands-index',\n '/{-$locale}/brands/$id': 'brands-single',\n '/{-$locale}/$slug/brand-{$id}': 'brands-single',\n '/{-$locale}/blog': 'blog-index',\n '/{-$locale}/blog/$slug/a-{$id}': 'blog-single',\n '/{-$locale}/blog/$slug/c-{$id}': 'blog-index-category',\n '/{-$locale}/blog/$slug/tag-{$id}': 'blog-index-tag',\n '/{-$locale}/blog/author/$id': 'blog-index-author',\n '/{-$locale}/loyalty': 'loyalty',\n '/{-$locale}/loyalty_points': 'customer-loyalty-points',\n};\n\n/** `/products?source=` keeps the Twig class of the old listing URL. */\nconst PRODUCTS_SOURCE_CLASS: Record<string, string> = {\n latest: 'product-index-latest',\n sales: 'product-index-sales',\n offers: 'product-index-offers',\n};\n\nfunction routeClassOf(matches: Array<{ routeId: string; search?: unknown }>): string | null {\n for (let i = matches.length - 1; i >= 0; i--) {\n const { routeId, search } = matches[i];\n if (routeId === '/{-$locale}/products') {\n const source = (search as { source?: unknown } | undefined)?.source;\n return typeof source === 'string' && Object.hasOwn(PRODUCTS_SOURCE_CLASS, source)\n ? PRODUCTS_SOURCE_CLASS[source]\n : 'product-index';\n }\n if (routeId in ROUTE_CLASS_MAP) return ROUTE_CLASS_MAP[routeId];\n }\n return null;\n}\n\n// ============================================================================\n// RouteDocumentSync — resolves body class from active route ID at runtime.\n// ============================================================================\n\n/**\n * Applies the per-route body class by looking up the deepest active route ID\n * in the built-in route→class map.\n *\n * For custom routes not in the built-in map, use `useDocumentClass` directly\n * inside your route component.\n *\n * Note: This will throw if rendered outside a TanStack Router context.\n * Use TanStackDocumentSync for safe usage inside TwilightProvider.\n */\nexport function RouteDocumentSync(): null {\n const matches = useRouterState({ select: (s) => s.matches });\n\n const routeClass = routeClassOf(matches);\n\n useDocumentClass(routeClass ? { body: { class: routeClass } } : {});\n return null;\n}\n\n/**\n * Safe version of RouteDocumentSync for use in TwilightProvider.\n * Handles being rendered outside a TanStack Router context gracefully.\n * Uses a wrapper component pattern to conditionally render hooks.\n */\nexport function TanStackDocumentSync(): null {\n const matches = useRouterState({ select: (s) => s.matches }) || [];\n\n // On the server routeId is never synced (onResolved is client-only), so useIsHome()\n // etc. disagree with the client and cause hydration mismatches. Sync it here — this\n // renders before the layout. Client already has it from onResolved.\n if (typeof window === 'undefined') {\n const leaf = matches[matches.length - 1];\n if (leaf?.routeId) {\n updateTwilightContext({ routeId: resolveRouteId(leaf.routeId as string) });\n }\n // The deepest loader's page, which the client syncs on load (`syncPageFromMatches`).\n const page = matches.reduceRight<PageContext | undefined>(\n (found, match) => found ?? (match.loaderData as { page?: PageContext } | undefined)?.page,\n undefined\n );\n if (page) updateTwilightContext({ page });\n }\n\n const routeClass = routeClassOf(matches);\n\n useDocumentClass(routeClass ? { body: { class: routeClass } } : {});\n return null;\n}\n\n// ============================================================================\n// Type augmentation — extend TanStack Router's staticData type\n// ============================================================================\n\ndeclare module '@tanstack/react-router' {\n interface StaticDataRouteOption {\n documentAttrs?: DocumentElementDescriptor;\n }\n}\n\nexport interface TanstackRouteStaticData {\n documentAttrs?: DocumentElementDescriptor;\n}\n\n// ============================================================================\n// useTanstackDocumentAttrs — for TanStack Start SSR root layouts\n// ============================================================================\n\n/**\n * Read and merge `<body>` / `<html>` attributes from all currently active\n * route matches (via `staticData.documentAttrs`).\n *\n * Returns React-ready prop objects ready to spread onto `<html>` and `<body>`.\n */\nexport function useTanstackDocumentAttrs(): {\n bodyAttrs: Record<string, string>;\n htmlAttrs: Record<string, string>;\n} {\n const matches = useRouterState({ select: (s) => s.matches });\n\n const bodyDescriptors = matches.map(\n (m) => (m.staticData as TanstackRouteStaticData | undefined)?.documentAttrs?.body ?? {}\n );\n const htmlDescriptors = matches.map(\n (m) => (m.staticData as TanstackRouteStaticData | undefined)?.documentAttrs?.html ?? {}\n );\n\n return {\n bodyAttrs: toReactProps(mergeElementAttrs(bodyDescriptors)),\n htmlAttrs: toReactProps(mergeElementAttrs(htmlDescriptors)),\n };\n}\n\n/**\n * Pure adapter: converts a `DocumentElementDescriptor` to React-ready props.\n */\nexport function tanstackDocumentAdapter(descriptor: DocumentElementDescriptor): {\n bodyAttrs: Record<string, string>;\n htmlAttrs: Record<string, string>;\n} {\n return {\n bodyAttrs: toReactProps(mergeElementAttrs([descriptor.body ?? {}])),\n htmlAttrs: toReactProps(mergeElementAttrs([descriptor.html ?? {}])),\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/hooks.ts"],"names":["HookName"],"mappings":";AAYO,IAAK,QAAA,qBAAAA,SAAAA,KAAL;AAEL,EAAAA,UAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,UAAA,UAAA,CAAA,GAAW,UAAA;AACX,EAAAA,UAAA,YAAA,CAAA,GAAa,YAA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AA,UAAA,kCAAA,CAAA,GAAmC,kCAAA;AACnC,EAAAA,UAAA,eAAA,CAAA,GAAgB,eAAA;AAChB,EAAAA,UAAA,aAAA,CAAA,GAAc,aAAA;AAzGJ,EAAA,OAAAA,SAAAA;AAAA,CAAA,EAAA,QAAA,IAAA,EAAA","file":"chunk-MVT5AF2A.js","sourcesContent":["import type { ReactNode } from 'react';\n\n/**\n * Predefined hook names for type-safe hook registration.\n *\n * @example\n * ```tsx\n * import { HookName, hookRegistry } from '@salla.sa/twilight-theme-engine';\n *\n * hookRegistry.register(HookName.BODY_END, () => <MyComponent />);\n * ```\n */\nexport enum HookName {\n // Global - Body\n BODY_START = 'body:start',\n BODY_END = 'body:end',\n BODY_INNER = 'body:inner',\n // Global - Head\n HEAD_START = 'head:start',\n HEAD_END = 'head:end',\n HEAD_INNER = 'head:inner',\n // Header\n HEADER_START = 'header:start',\n HEADER_END = 'header:end',\n // Footer\n FOOTER_START = 'footer:start',\n FOOTER_END = 'footer:end',\n // Product\n PRODUCT_DESCRIPTION_START = 'product:single.description.start',\n PRODUCT_DESCRIPTION = 'product:single.description',\n PRODUCT_DESCRIPTION_END = 'product:single.description.end',\n PRODUCT_FORM_START = 'product:single.form.start',\n PRODUCT_FORM_END = 'product:single.form.end',\n // Cart\n CART_ITEMS_START = 'cart:items.start',\n CART_ITEMS_END = 'cart:items.end',\n CART_SUMMARY_START = 'cart:summary.start',\n CART_SUMMARY_END = 'cart:summary.end',\n // Search\n SEARCH_START = 'search:start',\n SEARCH_ITEMS_START = 'search:items.start',\n SEARCH_ITEMS_END = 'search:items.end',\n SEARCH_END = 'search:end',\n // Homepage\n HOMEPAGE_SLIDER = 'homepage:slider',\n HOMEPAGE_BANNERS = 'homepage:banners',\n HOMEPAGE_FEATURED = 'homepage:featured',\n // Global - Head (bare slot rendered by WidgetHead between head:start and head:end)\n HEAD = 'head',\n // Footer\n COPYRIGHT = 'copyright',\n // Home page\n HOME_START = 'home:start',\n HOME_CONTENT = 'home:content',\n HOME_END = 'home:end',\n // Not found page\n NOTFOUND_START = 'notfound:start',\n NOTFOUND_CONTENT = 'notfound:content',\n NOTFOUND_END = 'notfound:end',\n // Product page\n PRODUCT_START = 'product:start',\n PRODUCT_DETAILS_START = 'product:details.start',\n PRODUCT_DETAILS_END = 'product:details.end',\n PRODUCT_RELATED_START = 'product:related.start',\n PRODUCT_RELATED_END = 'product:related.end',\n PRODUCT_END = 'product:end',\n // Product listing page\n PRODUCT_LIST_START = 'product:list.start',\n PRODUCT_LIST_ITEMS_START = 'product:list.items.start',\n PRODUCT_LIST_ITEMS_END = 'product:list.items.end',\n PRODUCT_LIST_END = 'product:list.end',\n // Cart page\n CART_START = 'cart:start',\n CART_END = 'cart:end',\n CART_SUBMIT_START = 'cart:submit.start',\n CART_SUBMIT_END = 'cart:submit.end',\n // Thank-you page\n THANK_YOU_START = 'thank-you:start',\n THANK_YOU_ITEMS_START = 'thank-you:items.start',\n THANK_YOU_ITEMS_END = 'thank-you:items.end',\n THANK_YOU_END = 'thank-you:end',\n // Brands page\n BRANDS_INDEX_ITEMS_START = 'brands:index.items.start',\n BRANDS_INDEX_ITEMS_END = 'brands:index.items.end',\n // Blog\n BLOG_START = 'blog:start',\n BLOG_ITEMS_START = 'blog:items.start',\n BLOG_ITEMS_END = 'blog:items.end',\n BLOG_END = 'blog:end',\n BLOG_SINGLE_START = 'blog:single.start',\n BLOG_SINGLE_END = 'blog:single.end',\n BLOG_SINGLE_RELATED_START = 'blog:single.related.start',\n BLOG_SINGLE_RELATED_END = 'blog:single.related.end',\n BLOG_CATEGORY_START = 'blog:category.start',\n BLOG_CATEGORY_END = 'blog:category.end',\n BLOG_TAG_START = 'blog:tag.start',\n BLOG_TAG_END = 'blog:tag.end',\n BLOG_AUTHOR_START = 'blog:author.start',\n BLOG_AUTHOR_END = 'blog:author.end',\n // Customer account\n CUSTOMER_PROFILE_START = 'customer:profile.start',\n CUSTOMER_PROFILE_FORM_START = 'customer:profile.form.start',\n CUSTOMER_PROFILE_FORM_END = 'customer:profile.form.end',\n CUSTOMER_PROFILE_END = 'customer:profile.end',\n CUSTOMER_SETTINGS_START = 'customer:settings.start',\n CUSTOMER_SETTINGS_END = 'customer:settings.end',\n CUSTOMER_ORDERS_ITEMS_START = 'customer:orders.index.items.start',\n CUSTOMER_ORDERS_ITEMS_END = 'customer:orders.index.items.end',\n CUSTOMER_ORDER_DETAILS_START = 'customer:orders.single.details.start',\n CUSTOMER_ORDER_DETAILS_END = 'customer:orders.single.details.end',\n CUSTOMER_WALLET_TRANSACTIONS_START = 'customer:wallet.transactions.start',\n CUSTOMER_WALLET_TRANSACTIONS_END = 'customer:wallet.transactions.end',\n CUSTOMER_WISHLIST_ITEMS_START = 'customer:wishlist.items.start',\n CUSTOMER_WISHLIST_ITEMS_END = 'customer:wishlist.items.end',\n CUSTOMER_NOTIFICATIONS_ITEMS_START = 'customer:notifications.items.start',\n CUSTOMER_NOTIFICATIONS_ITEMS_END = 'customer:notifications.items.end',\n LOYALTY_START = 'loyalty:start',\n LOYALTY_END = 'loyalty:end',\n}\n\n/**\n * Hook handler function type.\n */\nexport type HookHandler<T = Record<string, unknown>> = (context: T) => ReactNode;\n\n/**\n * Hook definition with handler and priority.\n */\nexport interface HookDefinition {\n id: number;\n handler: HookHandler;\n priority: number;\n}\n\n/**\n * Hook handlers map for bulk registration.\n */\nexport type HookHandlers = Record<\n string,\n | HookHandler\n | Array<{\n priority?: number;\n handler: HookHandler;\n }>\n>;\n"]}
|