@salla.sa/twilight-theme-engine 1.0.179 → 1.0.181
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddToCartForm-PU3HSWJ2.js → AddToCartForm-BTMREFCB.js} +3 -3
- package/dist/{AddToCartForm-PU3HSWJ2.js.map → AddToCartForm-BTMREFCB.js.map} +1 -1
- package/dist/{BlogAuthorPage-ALEAMIU3.js → BlogAuthorPage-FCT6LUO7.js} +18 -17
- package/dist/BlogAuthorPage-FCT6LUO7.js.map +1 -0
- package/dist/{BlogCategoryPage-FDRB6PXV.js → BlogCategoryPage-MIZADPR6.js} +18 -17
- package/dist/BlogCategoryPage-MIZADPR6.js.map +1 -0
- package/dist/{BlogPage-GV6MJBCC.js → BlogPage-A4NK5HKV.js} +16 -15
- package/dist/BlogPage-A4NK5HKV.js.map +1 -0
- package/dist/{BlogSinglePage-QZSUUYEP.js → BlogSinglePage-5MHRXZA4.js} +16 -15
- package/dist/BlogSinglePage-5MHRXZA4.js.map +1 -0
- package/dist/{BlogTagPage-L2ETWHOA.js → BlogTagPage-N4Z5XVQV.js} +18 -17
- package/dist/BlogTagPage-N4Z5XVQV.js.map +1 -0
- package/dist/{BrandsPage-M6H3TMAZ.js → BrandsPage-3MLX7ANQ.js} +17 -16
- package/dist/BrandsPage-3MLX7ANQ.js.map +1 -0
- package/dist/{Breadcrumb-4LL7EDJQ.js → Breadcrumb-CCTHHEQH.js} +16 -15
- package/dist/Breadcrumb-CCTHHEQH.js.map +1 -0
- package/dist/{CartItem-HSPK7FVI.js → CartItem-YCJF3HXH.js} +16 -15
- package/dist/CartItem-YCJF3HXH.js.map +1 -0
- package/dist/{CartSummary-VWQARWQZ.js → CartSummary-ZJOGWEWI.js} +16 -15
- package/dist/CartSummary-ZJOGWEWI.js.map +1 -0
- package/dist/{Copyright-OGRI3VDT.js → Copyright-ICYJGCPF.js} +3 -3
- package/dist/{Copyright-OGRI3VDT.js.map → Copyright-ICYJGCPF.js.map} +1 -1
- package/dist/{CustomerLayout-3ECGJERS.js → CustomerLayout-VRBDGYGF.js} +16 -15
- package/dist/CustomerLayout-VRBDGYGF.js.map +1 -0
- package/dist/{Footer-AV2AYONC.js → Footer-FHLO2CHL.js} +3 -3
- package/dist/{Footer-AV2AYONC.js.map → Footer-FHLO2CHL.js.map} +1 -1
- package/dist/GoogleTag-EEPZ4AH6.js +15 -0
- package/dist/{GoogleTag-QMZRHD4X.js.map → GoogleTag-EEPZ4AH6.js.map} +1 -1
- package/dist/{Header-L5KLG4MZ.js → Header-RER3EUW6.js} +8 -8
- package/dist/{Header-L5KLG4MZ.js.map → Header-RER3EUW6.js.map} +1 -1
- package/dist/{LatestProducts-JX63QU2Q.js → LatestProducts-4HNU7EXD.js} +18 -17
- package/dist/LatestProducts-4HNU7EXD.js.map +1 -0
- package/dist/{LoyaltyPage-IHDCFL76.js → LoyaltyPage-DN4JA4C5.js} +16 -15
- package/dist/LoyaltyPage-DN4JA4C5.js.map +1 -0
- package/dist/{LoyaltyPointsPage-LPROU7VQ.js → LoyaltyPointsPage-PKYAXASN.js} +6 -6
- package/dist/{LoyaltyPointsPage-LPROU7VQ.js.map → LoyaltyPointsPage-PKYAXASN.js.map} +1 -1
- package/dist/{MainMenu-BWZ23TDI.js → MainMenu-DHPNKYU5.js} +5 -5
- package/dist/{MainMenu-BWZ23TDI.js.map → MainMenu-DHPNKYU5.js.map} +1 -1
- package/dist/{MasterLayout-RPMD3PK4.js → MasterLayout-RWAUJ75I.js} +16 -15
- package/dist/{MasterLayout-RPMD3PK4.js.map → MasterLayout-RWAUJ75I.js.map} +1 -1
- package/dist/{MobileMenu-34RGWC2J.js → MobileMenu-7DV5SX7C.js} +17 -16
- package/dist/MobileMenu-7DV5SX7C.js.map +1 -0
- package/dist/{NotificationsPage-UHM2W5DB.js → NotificationsPage-CGCZOXE5.js} +16 -15
- package/dist/NotificationsPage-CGCZOXE5.js.map +1 -0
- package/dist/{OrderSinglePage-4IAJU4C3.js → OrderSinglePage-OETGEAGR.js} +17 -16
- package/dist/OrderSinglePage-OETGEAGR.js.map +1 -0
- package/dist/{OrdersPage-YXZVN2JK.js → OrdersPage-GJREHQAP.js} +16 -15
- package/dist/OrdersPage-GJREHQAP.js.map +1 -0
- package/dist/{PageSingle-Z6MD6WIR.js → PageSingle-CSRJFQPI.js} +3 -3
- package/dist/{PageSingle-Z6MD6WIR.js.map → PageSingle-CSRJFQPI.js.map} +1 -1
- package/dist/{ProductDetails-C7UP2L3R.js → ProductDetails-VV72WQTK.js} +4 -4
- package/dist/{ProductDetails-C7UP2L3R.js.map → ProductDetails-VV72WQTK.js.map} +1 -1
- package/dist/{ProfilePage-V4HJKQXY.js → ProfilePage-SKX6MBDZ.js} +16 -15
- package/dist/ProfilePage-SKX6MBDZ.js.map +1 -0
- package/dist/{ReviewsPage-CPGRNEJB.js → ReviewsPage-ADN447YV.js} +3 -3
- package/dist/{ReviewsPage-CPGRNEJB.js.map → ReviewsPage-ADN447YV.js.map} +1 -1
- package/dist/{SeoCartWidget-WKRTIIVI.js → SeoCartWidget-BMNXLYIV.js} +16 -15
- package/dist/SeoCartWidget-BMNXLYIV.js.map +1 -0
- package/dist/{SettingsPage-ZZDWJODN.js → SettingsPage-NKH24AG6.js} +16 -15
- package/dist/SettingsPage-NKH24AG6.js.map +1 -0
- package/dist/{StoreClosedNotification-PAMU72KO.js → StoreClosedNotification-HJC4PYA5.js} +17 -16
- package/dist/{StoreClosedNotification-PAMU72KO.js.map → StoreClosedNotification-HJC4PYA5.js.map} +1 -1
- package/dist/{TestimonialsPage-QQ42QDZG.js → TestimonialsPage-T56BGX7K.js} +3 -3
- package/dist/{TestimonialsPage-QQ42QDZG.js.map → TestimonialsPage-T56BGX7K.js.map} +1 -1
- package/dist/{ThankYouPage-P752YDVP.js → ThankYouPage-ATDW34LU.js} +16 -15
- package/dist/ThankYouPage-ATDW34LU.js.map +1 -0
- package/dist/{WalletPage-J4KZFZMV.js → WalletPage-BTGNWJEB.js} +17 -16
- package/dist/WalletPage-BTGNWJEB.js.map +1 -0
- package/dist/{WebMcpTools-E3LAXFWE.js → WebMcpTools-Y537MP25.js} +5 -5
- package/dist/{WebMcpTools-E3LAXFWE.js.map → WebMcpTools-Y537MP25.js.map} +1 -1
- package/dist/{WishlistPage-USYEHM3R.js → WishlistPage-5HAYJGZY.js} +18 -17
- package/dist/WishlistPage-5HAYJGZY.js.map +1 -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.d.ts +11 -5
- package/dist/api/cart.d.ts.map +1 -1
- package/dist/api/cart.js +3 -3
- package/dist/api/category.js +3 -3
- package/dist/api/client.js +1 -1
- package/dist/api/custom-url.js +2 -2
- 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/sdk-cart.d.ts +9 -0
- package/dist/api/sdk-cart.d.ts.map +1 -0
- 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-T6MGHOQP.js → chunk-2B3VPD42.js} +4 -4
- package/dist/{chunk-T6MGHOQP.js.map → chunk-2B3VPD42.js.map} +1 -1
- package/dist/chunk-4MKZ7JPZ.js +104 -0
- package/dist/chunk-4MKZ7JPZ.js.map +1 -0
- package/dist/{chunk-F2WU2SMZ.js → chunk-4NRJSPJD.js} +3 -3
- package/dist/{chunk-F2WU2SMZ.js.map → chunk-4NRJSPJD.js.map} +1 -1
- package/dist/{chunk-DAWZ264W.js → chunk-53GFVA6K.js} +3 -3
- package/dist/{chunk-DAWZ264W.js.map → chunk-53GFVA6K.js.map} +1 -1
- package/dist/{chunk-QPTKUUR4.js → chunk-5NREKFL6.js} +4 -4
- package/dist/{chunk-QPTKUUR4.js.map → chunk-5NREKFL6.js.map} +1 -1
- package/dist/{chunk-DI2J3BL6.js → chunk-7RH6YE4A.js} +3 -3
- package/dist/{chunk-DI2J3BL6.js.map → chunk-7RH6YE4A.js.map} +1 -1
- package/dist/{chunk-YJ72YQ2X.js → chunk-AOP3NGP5.js} +4 -4
- package/dist/{chunk-YJ72YQ2X.js.map → chunk-AOP3NGP5.js.map} +1 -1
- package/dist/{chunk-7YWEUCJZ.js → chunk-AQDJ5UDM.js} +3 -3
- package/dist/{chunk-7YWEUCJZ.js.map → chunk-AQDJ5UDM.js.map} +1 -1
- package/dist/{chunk-F37RZ7WN.js → chunk-BDFEI5DD.js} +14 -14
- package/dist/{chunk-F37RZ7WN.js.map → chunk-BDFEI5DD.js.map} +1 -1
- package/dist/{chunk-4BTFGO7A.js → chunk-BKTOWTO4.js} +4 -4
- package/dist/{chunk-4BTFGO7A.js.map → chunk-BKTOWTO4.js.map} +1 -1
- package/dist/{chunk-MAQZ2E43.js → chunk-CZTJ2YC2.js} +6 -6
- package/dist/{chunk-MAQZ2E43.js.map → chunk-CZTJ2YC2.js.map} +1 -1
- package/dist/{chunk-2OIMVGY7.js → chunk-EJJUUXL3.js} +5 -5
- package/dist/{chunk-2OIMVGY7.js.map → chunk-EJJUUXL3.js.map} +1 -1
- package/dist/{chunk-NOLXT5T6.js → chunk-F2DYT55P.js} +4 -4
- package/dist/{chunk-NOLXT5T6.js.map → chunk-F2DYT55P.js.map} +1 -1
- package/dist/{chunk-7GNITA3Q.js → chunk-FBAEVGER.js} +7 -7
- package/dist/{chunk-7GNITA3Q.js.map → chunk-FBAEVGER.js.map} +1 -1
- package/dist/{chunk-YS7OE5XZ.js → chunk-FRVKNJHM.js} +3 -3
- package/dist/{chunk-YS7OE5XZ.js.map → chunk-FRVKNJHM.js.map} +1 -1
- package/dist/{chunk-DE72SXU4.js → chunk-G5T6TU4H.js} +7 -7
- package/dist/{chunk-DE72SXU4.js.map → chunk-G5T6TU4H.js.map} +1 -1
- package/dist/{chunk-ULPA74VA.js → chunk-GIKIIAGI.js} +3 -3
- package/dist/{chunk-ULPA74VA.js.map → chunk-GIKIIAGI.js.map} +1 -1
- package/dist/{chunk-3CPVV6UZ.js → chunk-GO4EVN5H.js} +3 -3
- package/dist/{chunk-3CPVV6UZ.js.map → chunk-GO4EVN5H.js.map} +1 -1
- package/dist/{chunk-Q7ZDNHHF.js → chunk-GRF2ZTUB.js} +5 -5
- package/dist/{chunk-Q7ZDNHHF.js.map → chunk-GRF2ZTUB.js.map} +1 -1
- package/dist/{chunk-FQX3XITL.js → chunk-GRYATL7L.js} +4 -4
- package/dist/{chunk-FQX3XITL.js.map → chunk-GRYATL7L.js.map} +1 -1
- package/dist/{chunk-MVQZJX5I.js → chunk-LAESVQK6.js} +62 -24
- package/dist/chunk-LAESVQK6.js.map +1 -0
- package/dist/{chunk-KD6JJJFI.js → chunk-LCC7IV6O.js} +4 -4
- package/dist/{chunk-KD6JJJFI.js.map → chunk-LCC7IV6O.js.map} +1 -1
- package/dist/{chunk-PJU6QWMV.js → chunk-MKHRHWCT.js} +3 -3
- package/dist/{chunk-PJU6QWMV.js.map → chunk-MKHRHWCT.js.map} +1 -1
- package/dist/{chunk-TMVCPQMU.js → chunk-N7CPWUSY.js} +3 -3
- package/dist/{chunk-TMVCPQMU.js.map → chunk-N7CPWUSY.js.map} +1 -1
- package/dist/{chunk-CEANKKQV.js → chunk-NVQKZ2FF.js} +4 -4
- package/dist/{chunk-CEANKKQV.js.map → chunk-NVQKZ2FF.js.map} +1 -1
- package/dist/{chunk-7FV5TZOF.js → chunk-QF7HVZM5.js} +3 -3
- package/dist/{chunk-7FV5TZOF.js.map → chunk-QF7HVZM5.js.map} +1 -1
- package/dist/{chunk-6MA73U4W.js → chunk-QYWNYSCI.js} +5 -5
- package/dist/{chunk-6MA73U4W.js.map → chunk-QYWNYSCI.js.map} +1 -1
- package/dist/{chunk-KOR3BF6E.js → chunk-RD7ZPLRZ.js} +3 -3
- package/dist/{chunk-KOR3BF6E.js.map → chunk-RD7ZPLRZ.js.map} +1 -1
- package/dist/{chunk-FN4CZTDF.js → chunk-RDY5EAO3.js} +3 -3
- package/dist/{chunk-FN4CZTDF.js.map → chunk-RDY5EAO3.js.map} +1 -1
- package/dist/{chunk-COGTJFST.js → chunk-RLDBGJGY.js} +7 -7
- package/dist/{chunk-COGTJFST.js.map → chunk-RLDBGJGY.js.map} +1 -1
- package/dist/{chunk-BMLQBIGL.js → chunk-RWNWVAR3.js} +3 -3
- package/dist/{chunk-BMLQBIGL.js.map → chunk-RWNWVAR3.js.map} +1 -1
- package/dist/{chunk-WF7EFLZT.js → chunk-S4PQLNYO.js} +4 -4
- package/dist/{chunk-WF7EFLZT.js.map → chunk-S4PQLNYO.js.map} +1 -1
- package/dist/{chunk-GKYFMDKD.js → chunk-SA3UNTGI.js} +4 -4
- package/dist/{chunk-GKYFMDKD.js.map → chunk-SA3UNTGI.js.map} +1 -1
- package/dist/{chunk-XYR7EK3H.js → chunk-SCQQ67YE.js} +4 -4
- package/dist/{chunk-XYR7EK3H.js.map → chunk-SCQQ67YE.js.map} +1 -1
- package/dist/{chunk-HNM4V7E2.js → chunk-TJ7R6LJB.js} +4 -4
- package/dist/{chunk-HNM4V7E2.js.map → chunk-TJ7R6LJB.js.map} +1 -1
- package/dist/{chunk-7LJSOOVX.js → chunk-TMTJTEGN.js} +3 -3
- package/dist/{chunk-7LJSOOVX.js.map → chunk-TMTJTEGN.js.map} +1 -1
- package/dist/{chunk-5S7Q5Y7J.js → chunk-U4A66HPY.js} +3 -3
- package/dist/{chunk-5S7Q5Y7J.js.map → chunk-U4A66HPY.js.map} +1 -1
- package/dist/{chunk-DAEHJTTJ.js → chunk-UNYPBBZJ.js} +5 -5
- package/dist/{chunk-DAEHJTTJ.js.map → chunk-UNYPBBZJ.js.map} +1 -1
- package/dist/{chunk-XISVCS5S.js → chunk-UXLV3RDY.js} +3 -3
- package/dist/{chunk-XISVCS5S.js.map → chunk-UXLV3RDY.js.map} +1 -1
- package/dist/{chunk-2D52MYZ7.js → chunk-VIZE6HIA.js} +4 -4
- package/dist/{chunk-2D52MYZ7.js.map → chunk-VIZE6HIA.js.map} +1 -1
- package/dist/{chunk-222C7M7Q.js → chunk-VKKA35I2.js} +3 -3
- package/dist/{chunk-222C7M7Q.js.map → chunk-VKKA35I2.js.map} +1 -1
- package/dist/{chunk-IAMGCG7Z.js → chunk-VMANXK5R.js} +3 -3
- package/dist/{chunk-IAMGCG7Z.js.map → chunk-VMANXK5R.js.map} +1 -1
- package/dist/{chunk-BNKUNYQS.js → chunk-VND65UMT.js} +3 -3
- package/dist/{chunk-BNKUNYQS.js.map → chunk-VND65UMT.js.map} +1 -1
- package/dist/{chunk-IBGAXEPC.js → chunk-VTIXMCC2.js} +3 -3
- package/dist/{chunk-IBGAXEPC.js.map → chunk-VTIXMCC2.js.map} +1 -1
- package/dist/{chunk-CCLURCDN.js → chunk-WCYGDU5H.js} +3 -3
- package/dist/{chunk-CCLURCDN.js.map → chunk-WCYGDU5H.js.map} +1 -1
- package/dist/{chunk-EF4X2I6C.js → chunk-WGUF75EV.js} +3 -3
- package/dist/{chunk-EF4X2I6C.js.map → chunk-WGUF75EV.js.map} +1 -1
- package/dist/{chunk-LNOKDS74.js → chunk-WXQ5BNI3.js} +4 -4
- package/dist/{chunk-LNOKDS74.js.map → chunk-WXQ5BNI3.js.map} +1 -1
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/drawer/index.js +14 -13
- package/dist/components/home/index.js +19 -18
- package/dist/components/layout/index.js +4 -4
- package/dist/components/product/index.js +16 -15
- package/dist/components/store/index.js +15 -14
- package/dist/components/tracking/index.js +6 -6
- package/dist/{custom-urls-FXDCQ2LQ.js → custom-urls-Z3EPMC5B.js} +7 -7
- package/dist/{custom-urls-FXDCQ2LQ.js.map → custom-urls-Z3EPMC5B.js.map} +1 -1
- package/dist/dev/editor/index.js +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/{document-class-VID3422F.js → document-class-SYUN4GYO.js} +17 -17
- package/dist/{document-class-VID3422F.js.map → document-class-SYUN4GYO.js.map} +1 -1
- package/dist/hooks/index.js +14 -13
- package/dist/hooks/useGtm.js +14 -13
- package/dist/hooks/useMoney.js +14 -13
- package/dist/hooks/useStore.js +14 -13
- package/dist/hooks/useUser.js +3 -3
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/dist/{navigation-DM6YWYWN.js → navigation-5NG7XJSO.js} +5 -5
- package/dist/{navigation-DM6YWYWN.js.map → navigation-5NG7XJSO.js.map} +1 -1
- package/dist/{navigation-MR2UTPVO.js → navigation-F7D6JQKB.js} +4 -4
- package/dist/{navigation-MR2UTPVO.js.map → navigation-F7D6JQKB.js.map} +1 -1
- package/dist/{not-found-A7EB3S3G.js → not-found-DFW7Y4AX.js} +17 -16
- package/dist/not-found-DFW7Y4AX.js.map +1 -0
- package/dist/providers/TwilightProvider.d.ts.map +1 -1
- package/dist/providers/index.js +14 -13
- package/dist/providers/stale-cart.d.ts +11 -0
- package/dist/providers/stale-cart.d.ts.map +1 -0
- 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/CartPage.d.ts.map +1 -1
- package/dist/routes/cart.js +26 -25
- package/dist/routes/cart.js.map +1 -1
- package/dist/routes/home.js +20 -19
- package/dist/routes/index.js +8 -8
- package/dist/routes/loyalty.js +5 -5
- package/dist/routes/page.js +4 -4
- package/dist/routes/product-listing.js +40 -34
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +23 -22
- package/dist/routes/product.js.map +1 -1
- package/dist/routes/seo-redirects.js +8 -8
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +4 -4
- package/dist/skeleton.js +20 -19
- package/dist/{store-lookup-IME3XIPP.js → store-lookup-TGXQXPJL.js} +8 -8
- package/dist/{store-lookup-IME3XIPP.js.map → store-lookup-TGXQXPJL.js.map} +1 -1
- package/dist/tanstack.js +17 -17
- package/dist/types/salla-sdk.d.ts +4 -1
- package/dist/types/salla-sdk.d.ts.map +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/tailwind/routes/cart/CartPage.tsx.txt +5 -3
- package/tailwind/routes/product-listing/loader.ts.txt +25 -11
- package/dist/BlogAuthorPage-ALEAMIU3.js.map +0 -1
- package/dist/BlogCategoryPage-FDRB6PXV.js.map +0 -1
- package/dist/BlogPage-GV6MJBCC.js.map +0 -1
- package/dist/BlogSinglePage-QZSUUYEP.js.map +0 -1
- package/dist/BlogTagPage-L2ETWHOA.js.map +0 -1
- package/dist/BrandsPage-M6H3TMAZ.js.map +0 -1
- package/dist/Breadcrumb-4LL7EDJQ.js.map +0 -1
- package/dist/CartItem-HSPK7FVI.js.map +0 -1
- package/dist/CartSummary-VWQARWQZ.js.map +0 -1
- package/dist/CustomerLayout-3ECGJERS.js.map +0 -1
- package/dist/GoogleTag-QMZRHD4X.js +0 -15
- package/dist/LatestProducts-JX63QU2Q.js.map +0 -1
- package/dist/LoyaltyPage-IHDCFL76.js.map +0 -1
- package/dist/MobileMenu-34RGWC2J.js.map +0 -1
- package/dist/NotificationsPage-UHM2W5DB.js.map +0 -1
- package/dist/OrderSinglePage-4IAJU4C3.js.map +0 -1
- package/dist/OrdersPage-YXZVN2JK.js.map +0 -1
- package/dist/ProfilePage-V4HJKQXY.js.map +0 -1
- package/dist/SeoCartWidget-WKRTIIVI.js.map +0 -1
- package/dist/SettingsPage-ZZDWJODN.js.map +0 -1
- package/dist/ThankYouPage-P752YDVP.js.map +0 -1
- package/dist/WalletPage-J4KZFZMV.js.map +0 -1
- package/dist/WishlistPage-USYEHM3R.js.map +0 -1
- package/dist/chunk-MKMA2FJU.js +0 -48
- package/dist/chunk-MKMA2FJU.js.map +0 -1
- package/dist/chunk-MVQZJX5I.js.map +0 -1
- package/dist/not-found-A7EB3S3G.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/layout/lazy.ts"],"names":[],"mappings":";;;AAMO,IAAM,UAAA,GAAa,aAAA;AAAA,EAAc,MACtC,OAAO,sBAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE;AACxD;AAEO,IAAM,UAAA,GAAa,aAAA;AAAA,EAAc,MACtC,OAAO,sBAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE;AACxD;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D;AAEO,IAAM,gBAAA,GAAmB,aAAA;AAAA,EAAc,MAC5C,OAAO,4BAAgB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,YAAA,EAAa,CAAE;AACpE;AAEO,IAAM,cAAA,GAAiB,aAAA;AAAA,EAAc,MAC1C,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE;AAEO,IAAM,kBAAA,GAAqB,aAAA;AAAA,EAAc,MAC9C,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/components/layout/lazy.ts"],"names":[],"mappings":";;;AAMO,IAAM,UAAA,GAAa,aAAA;AAAA,EAAc,MACtC,OAAO,sBAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE;AACxD;AAEO,IAAM,UAAA,GAAa,aAAA;AAAA,EAAc,MACtC,OAAO,sBAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE;AACxD;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D;AAEO,IAAM,gBAAA,GAAmB,aAAA;AAAA,EAAc,MAC5C,OAAO,4BAAgB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,YAAA,EAAa,CAAE;AACpE;AAEO,IAAM,cAAA,GAAiB,aAAA;AAAA,EAAc,MAC1C,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE;AAEO,IAAM,kBAAA,GAAqB,aAAA;AAAA,EAAc,MAC9C,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE","file":"chunk-G5T6TU4H.js","sourcesContent":["import { lazyComponent } from '../../utils/lazy-component';\n\n/**\n * Lazy-loaded layout components\n * Use these for code-splitting layout sections\n */\nexport const LazyHeader = lazyComponent(() =>\n import('./Header').then((m) => ({ default: m.Header }))\n);\n\nexport const LazyFooter = lazyComponent(() =>\n import('./Footer').then((m) => ({ default: m.Footer }))\n);\n\nexport const LazyCopyright = lazyComponent(() =>\n import('./Copyright').then((m) => ({ default: m.Copyright }))\n);\n\nexport const LazyMasterLayout = lazyComponent(() =>\n import('./MasterLayout').then((m) => ({ default: m.MasterLayout }))\n);\n\nexport const LazyWidgetHead = lazyComponent(() =>\n import('./WidgetHead').then((m) => ({ default: m.WidgetHead }))\n);\n\nexport const LazyCustomerLayout = lazyComponent(() =>\n import('./CustomerLayout').then((m) => ({ default: m.CustomerLayout }))\n);\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { filesCdn, cdn } from './chunk-
|
|
1
|
+
import { filesCdn, cdn } from './chunk-VND65UMT.js';
|
|
2
2
|
import { storeTranslationsQueryKey, translationsQueryKey, composeMessages, isPlainObject } from './chunk-MWUAHDQL.js';
|
|
3
3
|
import { queryOptions } from '@tanstack/react-query';
|
|
4
4
|
|
|
@@ -126,5 +126,5 @@ var translations = {
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
export { commonTranslationsPath, storeTranslationsPath, translations };
|
|
129
|
-
//# sourceMappingURL=chunk-
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
129
|
+
//# sourceMappingURL=chunk-GIKIIAGI.js.map
|
|
130
|
+
//# sourceMappingURL=chunk-GIKIIAGI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/translations.ts"],"names":[],"mappings":";;;;AAiEA,IAAM,kBAAA,GAAqB,sBAAA;AAGpB,SAAS,uBAAuB,MAAA,EAAwB;AAC7D,EAAA,OAAO,uBAAuB,MAAM,CAAA,KAAA,CAAA;AACtC;AAWO,SAAS,qBAAA,CAAsB,SAA0B,MAAA,EAAwB;AACtF,EAAA,OAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAA,EAAI,MAAM,CAAA,KAAA,CAAA;AAC1C;AAUA,eAAe,eACb,IAAA,EACA,EAAE,aAAa,KAAA,EAAM,GAA8B,EAAC,EAC1B;AAE1B,EAAA,MAAM,UAAA,GAAa,CAAC,MAAA,EAAgB,KAAA,KAA0B;AAC5D,IAAA,IAAI,UAAA,EAAY,MAAM,IAAI,KAAA,CAAM,CAAA,eA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,qBAAqB,MAAM,CAAA;AAAA,MACrC,OAAA,EAAS,MAAM,YAAA,CAAa,GAAA,CAAI,MAAM;AAAA,KACvC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWH,OAAA,EAAS,CAAC,OAAA,EAA0B,MAAA,KAClC,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,yBAAA,CAA0B,OAAA,EAAS,MAAM,CAAA;AAAA,MACnD,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-ULPA74VA.js","sourcesContent":["/**\n * @fileoverview Where a storefront's words come from.\n *\n * Two files, merged: the platform's copy for this language, and the merchant's\n * own edits for this language and this store. Both are plain JSON objects on\n * the uploader's CDN, one per language.\n *\n * ```\n * https://cdn.files.salla.network/translations/common/<locale>.json the platform's\n * https://cdn.files.salla.network/translations/<storeId>/<locale>.json the merchant's\n * ```\n *\n * **What this replaces, and why.** Until now the engine read a single global\n * file, `cdn.salla.network/js/translations.json`, holding every language keyed\n * `\"<locale>.trans\"`. Nothing publishes that file: it is an object last written\n * on 2026-03-26, carrying only `ar` and `en` where the platform has 39 locales,\n * 405 keys behind `Languages-Module` and 959 English strings textually\n * different from it. So every React storefront has been serving copy from\n * March, and a key added since has never reached one. It also carried no\n * merchant overrides at all — a merchant editing their theme's wording in the\n * Dashboard changed nothing on a React theme.\n *\n * **Merchant overrides are read, and only when there are any.** Getting here\n * took two corrections worth keeping.\n *\n * The first is the address. A merchant's own wording lives at\n * `translations/<storeId>/<locale>.json`, keyed by `store()->getRouteKey()` —\n * the Optimus-encoded numeric id. An early version addressed it with\n * `resolveStoreIdentifier()`, on the claim that the two are the same string.\n * That is true of the `store-identifier` *header*, which accepts a host, a\n * username or an id, and false of the R2 key: on a custom domain the resolver\n * returns `reefperfumes.com` and on a shared host a username like\n * `mtgr-alaatr-2`. Both 404, both then read as \"this store has no overrides\",\n * and the merchant's wording silently never appears — so the feature would have\n * worked under `?storeId=` alone, which is preview and localhost. It is\n * `settings.store.id` now, which is known only after the settings query.\n *\n * The second is when to ask at all. Most stores have never customised a word,\n * and a miss is an uncached round trip (`cf-cache-status: DYNAMIC` on the 404)\n * on the critical path of every SSR render. So the request is made only when\n * `settings.languages[<ISO>].has_custom_translations` says there is something\n * to get — a flag `Languages-Module` writes when a merchant saves a\n * translation. A store without overrides pays nothing, which is what made this\n * shippable at all.\n *\n * ⚠️ The flag is written on save, so a store whose wording predates it reads as\n * `false` until someone edits a translation or the backfill runs. That is a\n * store keeping today's behaviour, not a regression — React themes have never\n * read merchant overrides — but it does mean the feature is only as complete as\n * the backfill.\n *\n * **Rollout is by fallback, not by flag.** `translations/common/` is written by\n * a sync in the theme build service that may not have run yet, and a hard switch\n * would leave every storefront with no platform strings at all. A missing common\n * file therefore falls back to the old global one, which is exactly today's\n * behaviour — so this is safe to ship before the bucket is populated, and stops\n * using the fallback on its own once it is.\n */\nimport { queryOptions } from '@tanstack/react-query';\nimport { cdn, filesCdn } from './client';\nimport { storeTranslationsQueryKey, translationsQueryKey } from './translations-key';\nimport { composeMessages, isPlainObject, type Messages } from './messages';\nimport type { TranslationMessages } from '../providers/I18nProvider';\n\n/** The global file this used to be the only reader of. See the file comment. */\nconst LEGACY_GLOBAL_FILE = 'js/translations.json';\n\n/** One language of platform copy, shared by every store. */\nexport function commonTranslationsPath(locale: string): string {\n return `translations/common/${locale}.json`;\n}\n\n/**\n * One language of a single merchant's own wording.\n *\n * `storeId` is `settings.store.id`, which is the value `Languages-Module` names\n * the object with (`store()->getRouteKey()`, the Optimus-encoded numeric id).\n * It is **not** `resolveStoreIdentifier()`: that returns a hostname on a custom\n * domain and a username on a shared host, both of which 404 here and would read\n * as \"this merchant has no overrides\" — silently, on every store but a preview.\n */\nexport function storeTranslationsPath(storeId: string | number, locale: string): string {\n return `translations/${storeId}/${locale}.json`;\n}\n\n/**\n * Reads one language file, or `null` when there is nothing to read.\n *\n * A 404 is the ordinary answer, not a failure: most stores have never had a\n * word customised, so their file does not exist. Distinguishing it from a real\n * error matters only for the log — both end in `null` — but a warning on every\n * page load of every uncustomised store is a warning nobody will read.\n */\nasync function readLocaleFile(\n path: string,\n { failLoudly = false }: { failLoudly?: boolean } = {}\n): Promise<Messages | null> {\n /** A 404 always means \"absent\"; everything else is a failure to read. */\n const unreadable = (reason: string, cause?: unknown): null => {\n if (failLoudly) throw new Error(`[translations] ${path}: ${reason}`, { cause });\n console.warn('[translations]', reason, path, cause ?? '');\n return null;\n };\n\n try {\n const response = await filesCdn.get(path, { throwHttpErrors: false, timeout: 5000 });\n if (response.status === 404) return null;\n\n if (!response.ok) {\n return unreadable(`answered ${response.status}`);\n }\n\n const data: unknown = await response.json();\n if (!isPlainObject(data)) {\n return unreadable('is not a JSON object');\n }\n\n return data;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith('[translations]')) throw error;\n return unreadable('could not be read', error);\n }\n}\n\n/**\n * The pre-CDN global file, sliced to one language.\n *\n * Only reached when `translations/common/<locale>.json` is missing, which is\n * the state of the bucket until the sync has run once.\n */\nasync function readLegacyGlobal(locale: string): Promise<Messages | null> {\n try {\n const data = await cdn.get(LEGACY_GLOBAL_FILE, { timeout: 5000 }).json<TranslationMessages>();\n const forLocale = data?.[`${locale}.trans`];\n return isPlainObject(forLocale) ? forLocale : null;\n } catch {\n console.warn('[translations] the legacy global file could not be read either');\n return null;\n }\n}\n\nexport const translations = {\n /**\n * The platform's copy for `locale`.\n *\n * One file, so one request. See the file comment for why the merchant's own\n * wording is not merged in here yet and what it is waiting on.\n */\n get: async (locale: string): Promise<TranslationMessages | null> => {\n const common = await readLocaleFile(commonTranslationsPath(locale));\n const base = common ?? (await readLegacyGlobal(locale));\n if (!base) return null;\n\n // Still wrapped in the `<locale>.trans` shape the rest of the engine reads.\n // `createI18nInstance` slices by that key and so does the SDK bridge in\n // `I18nProvider`; changing the envelope here would be a second change for\n // no gain, since one language is all any of them ever take out of it.\n return { [`${locale}.trans`]: base as Record<string, string> };\n },\n\n /**\n * This merchant's own wording for `locale`, or `null` if they have none.\n *\n * Only worth calling when `settings.languages[<ISO>].has_custom_translations`\n * says there is something to get. Most stores have never customised a word,\n * and a miss here is an uncached round trip — `cf-cache-status: DYNAMIC` on a\n * 404 — on the critical path of an SSR render. The flag is what makes this\n * free for everyone who does not use it.\n *\n * Returned unwrapped, unlike {@link translations.get}: this is merged into\n * that one's messages rather than handed to i18next on its own.\n */\n forStore: async (storeId: string | number, locale: string): Promise<Messages | null> =>\n // `failLoudly`, unlike the platform file: this is only ever called because\n // the settings said overrides exist, so a 500, a timeout or a body that is\n // not JSON is a failure to read them — not a store that has none. Returning\n // `null` there would cache \"no overrides\" as a success, skip the query's\n // retry, and serve Salla's wording in place of the merchant's until the\n // entry expired. A 404 still means absent, and `rootBeforeLoad` catches the\n // throw and keeps the platform copy, so the worst case is unchanged.\n readLocaleFile(storeTranslationsPath(storeId, locale), { failLoudly: true }),\n\n /**\n * The platform's copy for `locale` with this merchant's wording laid over it.\n *\n * Takes the two as values rather than fetching them, so the caller decides\n * whether the second request happens at all and both stay separately cached.\n */\n /**\n * The platform's copy for `locale` with this merchant's wording over it.\n *\n * Delegates to `composeMessages`, which every other reader of these two\n * entries also uses — see `api/messages.ts` for why there is exactly one.\n */\n merge: (\n common: TranslationMessages | null,\n overrides: Messages | null,\n locale: string\n ): TranslationMessages | null => composeMessages(common, overrides, locale) ?? null,\n\n queries: {\n /**\n * @param locale taken as an argument rather than read from the twilight\n * context, and that is load-bearing. This key is built on the server, on\n * hydration, and again lazily from the context accessor; if any of the\n * three read a locale the others had not been given yet, the hydrated page\n * would miss the dehydrated entry and refetch both files it was just\n * handed. Every caller already has the locale in hand.\n *\n * The store is deliberately **not** in the key. One document serves one\n * store — a request that names a different one is redirected with\n * `reloadDocument`, so the client never changes store under a live cache —\n * and adding a value that resolves from the request on the server and from\n * the injected env on the client is how a key stops matching across\n * hydration.\n */\n byLocale: (locale: string) =>\n queryOptions({\n queryKey: translationsQueryKey(locale),\n queryFn: () => translations.get(locale),\n }),\n\n /**\n * This merchant's overrides, cached apart from the platform's copy.\n *\n * Its own entry rather than a wider `byLocale` key, so the common file is\n * fetched and dehydrated once per language whatever the store does, and a\n * store with no overrides never has an entry at all. Both sides compute the\n * key from the settings payload, so the hydrated page finds what the server\n * dehydrated instead of refetching it.\n */\n byStore: (storeId: string | number, locale: string) =>\n queryOptions({\n queryKey: storeTranslationsQueryKey(storeId, locale),\n queryFn: () => translations.forStore(storeId, locale),\n }),\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/api/translations.ts"],"names":[],"mappings":";;;;AAiEA,IAAM,kBAAA,GAAqB,sBAAA;AAGpB,SAAS,uBAAuB,MAAA,EAAwB;AAC7D,EAAA,OAAO,uBAAuB,MAAM,CAAA,KAAA,CAAA;AACtC;AAWO,SAAS,qBAAA,CAAsB,SAA0B,MAAA,EAAwB;AACtF,EAAA,OAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAA,EAAI,MAAM,CAAA,KAAA,CAAA;AAC1C;AAUA,eAAe,eACb,IAAA,EACA,EAAE,aAAa,KAAA,EAAM,GAA8B,EAAC,EAC1B;AAE1B,EAAA,MAAM,UAAA,GAAa,CAAC,MAAA,EAAgB,KAAA,KAA0B;AAC5D,IAAA,IAAI,UAAA,EAAY,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,EAAA,EAAK,MAAM,CAAA,CAAA,EAAI,EAAE,KAAA,EAAO,CAAA;AAC9E,IAAA,OAAA,CAAQ,IAAA,CAAK,gBAAA,EAAkB,MAAA,EAAQ,IAAA,EAAM,SAAS,EAAE,CAAA;AACxD,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,QAAA,GAAW,MAAM,QAAA,CAAS,GAAA,CAAI,IAAA,EAAM,EAAE,eAAA,EAAiB,KAAA,EAAO,OAAA,EAAS,GA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KACrD;AAAA;AAEP","file":"chunk-GIKIIAGI.js","sourcesContent":["/**\n * @fileoverview Where a storefront's words come from.\n *\n * Two files, merged: the platform's copy for this language, and the merchant's\n * own edits for this language and this store. Both are plain JSON objects on\n * the uploader's CDN, one per language.\n *\n * ```\n * https://cdn.files.salla.network/translations/common/<locale>.json the platform's\n * https://cdn.files.salla.network/translations/<storeId>/<locale>.json the merchant's\n * ```\n *\n * **What this replaces, and why.** Until now the engine read a single global\n * file, `cdn.salla.network/js/translations.json`, holding every language keyed\n * `\"<locale>.trans\"`. Nothing publishes that file: it is an object last written\n * on 2026-03-26, carrying only `ar` and `en` where the platform has 39 locales,\n * 405 keys behind `Languages-Module` and 959 English strings textually\n * different from it. So every React storefront has been serving copy from\n * March, and a key added since has never reached one. It also carried no\n * merchant overrides at all — a merchant editing their theme's wording in the\n * Dashboard changed nothing on a React theme.\n *\n * **Merchant overrides are read, and only when there are any.** Getting here\n * took two corrections worth keeping.\n *\n * The first is the address. A merchant's own wording lives at\n * `translations/<storeId>/<locale>.json`, keyed by `store()->getRouteKey()` —\n * the Optimus-encoded numeric id. An early version addressed it with\n * `resolveStoreIdentifier()`, on the claim that the two are the same string.\n * That is true of the `store-identifier` *header*, which accepts a host, a\n * username or an id, and false of the R2 key: on a custom domain the resolver\n * returns `reefperfumes.com` and on a shared host a username like\n * `mtgr-alaatr-2`. Both 404, both then read as \"this store has no overrides\",\n * and the merchant's wording silently never appears — so the feature would have\n * worked under `?storeId=` alone, which is preview and localhost. It is\n * `settings.store.id` now, which is known only after the settings query.\n *\n * The second is when to ask at all. Most stores have never customised a word,\n * and a miss is an uncached round trip (`cf-cache-status: DYNAMIC` on the 404)\n * on the critical path of every SSR render. So the request is made only when\n * `settings.languages[<ISO>].has_custom_translations` says there is something\n * to get — a flag `Languages-Module` writes when a merchant saves a\n * translation. A store without overrides pays nothing, which is what made this\n * shippable at all.\n *\n * ⚠️ The flag is written on save, so a store whose wording predates it reads as\n * `false` until someone edits a translation or the backfill runs. That is a\n * store keeping today's behaviour, not a regression — React themes have never\n * read merchant overrides — but it does mean the feature is only as complete as\n * the backfill.\n *\n * **Rollout is by fallback, not by flag.** `translations/common/` is written by\n * a sync in the theme build service that may not have run yet, and a hard switch\n * would leave every storefront with no platform strings at all. A missing common\n * file therefore falls back to the old global one, which is exactly today's\n * behaviour — so this is safe to ship before the bucket is populated, and stops\n * using the fallback on its own once it is.\n */\nimport { queryOptions } from '@tanstack/react-query';\nimport { cdn, filesCdn } from './client';\nimport { storeTranslationsQueryKey, translationsQueryKey } from './translations-key';\nimport { composeMessages, isPlainObject, type Messages } from './messages';\nimport type { TranslationMessages } from '../providers/I18nProvider';\n\n/** The global file this used to be the only reader of. See the file comment. */\nconst LEGACY_GLOBAL_FILE = 'js/translations.json';\n\n/** One language of platform copy, shared by every store. */\nexport function commonTranslationsPath(locale: string): string {\n return `translations/common/${locale}.json`;\n}\n\n/**\n * One language of a single merchant's own wording.\n *\n * `storeId` is `settings.store.id`, which is the value `Languages-Module` names\n * the object with (`store()->getRouteKey()`, the Optimus-encoded numeric id).\n * It is **not** `resolveStoreIdentifier()`: that returns a hostname on a custom\n * domain and a username on a shared host, both of which 404 here and would read\n * as \"this merchant has no overrides\" — silently, on every store but a preview.\n */\nexport function storeTranslationsPath(storeId: string | number, locale: string): string {\n return `translations/${storeId}/${locale}.json`;\n}\n\n/**\n * Reads one language file, or `null` when there is nothing to read.\n *\n * A 404 is the ordinary answer, not a failure: most stores have never had a\n * word customised, so their file does not exist. Distinguishing it from a real\n * error matters only for the log — both end in `null` — but a warning on every\n * page load of every uncustomised store is a warning nobody will read.\n */\nasync function readLocaleFile(\n path: string,\n { failLoudly = false }: { failLoudly?: boolean } = {}\n): Promise<Messages | null> {\n /** A 404 always means \"absent\"; everything else is a failure to read. */\n const unreadable = (reason: string, cause?: unknown): null => {\n if (failLoudly) throw new Error(`[translations] ${path}: ${reason}`, { cause });\n console.warn('[translations]', reason, path, cause ?? '');\n return null;\n };\n\n try {\n const response = await filesCdn.get(path, { throwHttpErrors: false, timeout: 5000 });\n if (response.status === 404) return null;\n\n if (!response.ok) {\n return unreadable(`answered ${response.status}`);\n }\n\n const data: unknown = await response.json();\n if (!isPlainObject(data)) {\n return unreadable('is not a JSON object');\n }\n\n return data;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith('[translations]')) throw error;\n return unreadable('could not be read', error);\n }\n}\n\n/**\n * The pre-CDN global file, sliced to one language.\n *\n * Only reached when `translations/common/<locale>.json` is missing, which is\n * the state of the bucket until the sync has run once.\n */\nasync function readLegacyGlobal(locale: string): Promise<Messages | null> {\n try {\n const data = await cdn.get(LEGACY_GLOBAL_FILE, { timeout: 5000 }).json<TranslationMessages>();\n const forLocale = data?.[`${locale}.trans`];\n return isPlainObject(forLocale) ? forLocale : null;\n } catch {\n console.warn('[translations] the legacy global file could not be read either');\n return null;\n }\n}\n\nexport const translations = {\n /**\n * The platform's copy for `locale`.\n *\n * One file, so one request. See the file comment for why the merchant's own\n * wording is not merged in here yet and what it is waiting on.\n */\n get: async (locale: string): Promise<TranslationMessages | null> => {\n const common = await readLocaleFile(commonTranslationsPath(locale));\n const base = common ?? (await readLegacyGlobal(locale));\n if (!base) return null;\n\n // Still wrapped in the `<locale>.trans` shape the rest of the engine reads.\n // `createI18nInstance` slices by that key and so does the SDK bridge in\n // `I18nProvider`; changing the envelope here would be a second change for\n // no gain, since one language is all any of them ever take out of it.\n return { [`${locale}.trans`]: base as Record<string, string> };\n },\n\n /**\n * This merchant's own wording for `locale`, or `null` if they have none.\n *\n * Only worth calling when `settings.languages[<ISO>].has_custom_translations`\n * says there is something to get. Most stores have never customised a word,\n * and a miss here is an uncached round trip — `cf-cache-status: DYNAMIC` on a\n * 404 — on the critical path of an SSR render. The flag is what makes this\n * free for everyone who does not use it.\n *\n * Returned unwrapped, unlike {@link translations.get}: this is merged into\n * that one's messages rather than handed to i18next on its own.\n */\n forStore: async (storeId: string | number, locale: string): Promise<Messages | null> =>\n // `failLoudly`, unlike the platform file: this is only ever called because\n // the settings said overrides exist, so a 500, a timeout or a body that is\n // not JSON is a failure to read them — not a store that has none. Returning\n // `null` there would cache \"no overrides\" as a success, skip the query's\n // retry, and serve Salla's wording in place of the merchant's until the\n // entry expired. A 404 still means absent, and `rootBeforeLoad` catches the\n // throw and keeps the platform copy, so the worst case is unchanged.\n readLocaleFile(storeTranslationsPath(storeId, locale), { failLoudly: true }),\n\n /**\n * The platform's copy for `locale` with this merchant's wording laid over it.\n *\n * Takes the two as values rather than fetching them, so the caller decides\n * whether the second request happens at all and both stay separately cached.\n */\n /**\n * The platform's copy for `locale` with this merchant's wording over it.\n *\n * Delegates to `composeMessages`, which every other reader of these two\n * entries also uses — see `api/messages.ts` for why there is exactly one.\n */\n merge: (\n common: TranslationMessages | null,\n overrides: Messages | null,\n locale: string\n ): TranslationMessages | null => composeMessages(common, overrides, locale) ?? null,\n\n queries: {\n /**\n * @param locale taken as an argument rather than read from the twilight\n * context, and that is load-bearing. This key is built on the server, on\n * hydration, and again lazily from the context accessor; if any of the\n * three read a locale the others had not been given yet, the hydrated page\n * would miss the dehydrated entry and refetch both files it was just\n * handed. Every caller already has the locale in hand.\n *\n * The store is deliberately **not** in the key. One document serves one\n * store — a request that names a different one is redirected with\n * `reloadDocument`, so the client never changes store under a live cache —\n * and adding a value that resolves from the request on the server and from\n * the injected env on the client is how a key stops matching across\n * hydration.\n */\n byLocale: (locale: string) =>\n queryOptions({\n queryKey: translationsQueryKey(locale),\n queryFn: () => translations.get(locale),\n }),\n\n /**\n * This merchant's overrides, cached apart from the platform's copy.\n *\n * Its own entry rather than a wider `byLocale` key, so the common file is\n * fetched and dehydrated once per language whatever the store does, and a\n * store with no overrides never has an entry at all. Both sides compute the\n * key from the settings payload, so the hydrated page finds what the server\n * dehydrated instead of refetching it.\n */\n byStore: (storeId: string | number, locale: string) =>\n queryOptions({\n queryKey: storeTranslationsQueryKey(storeId, locale),\n queryFn: () => translations.forStore(storeId, locale),\n }),\n },\n};\n"]}
|
|
@@ -2,7 +2,7 @@ import { lazyComponent } from './chunk-VYGA5AT5.js';
|
|
|
2
2
|
|
|
3
3
|
// src/components/common/lazy.ts
|
|
4
4
|
var LazyBreadcrumb = lazyComponent(
|
|
5
|
-
() => import('./Breadcrumb-
|
|
5
|
+
() => import('./Breadcrumb-CCTHHEQH.js').then((m) => ({ default: m.Breadcrumb }))
|
|
6
6
|
);
|
|
7
7
|
var LazyNoContent = lazyComponent(
|
|
8
8
|
() => import('./NoContent-7YUWEXI2.js').then((m) => ({ default: m.NoContent }))
|
|
@@ -18,5 +18,5 @@ var LazyErrorPage = lazyComponent(
|
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
export { LazyBreadcrumb, LazyCurrencySymbol, LazyErrorPage, LazyNoContent, LazyRenderWhenVisible };
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
22
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-GO4EVN5H.js.map
|
|
22
|
+
//# sourceMappingURL=chunk-GO4EVN5H.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/common/lazy.ts"],"names":[],"mappings":";;;AASO,IAAM,cAAA,GAAiB,aAAA;AAAA,EAAc,MAC1C,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D;AAEO,IAAM,qBAAA,GAAwB,aAAA;AAAA,EAAc,MACjD,OAAO,iCAAqB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,iBAAA,EAAkB,CAAE;AAC9E;AAEO,IAAM,kBAAA,GAAqB,aAAA;AAAA,EAAc,MAC9C,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/components/common/lazy.ts"],"names":[],"mappings":";;;AASO,IAAM,cAAA,GAAiB,aAAA;AAAA,EAAc,MAC1C,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D;AAEO,IAAM,qBAAA,GAAwB,aAAA;AAAA,EAAc,MACjD,OAAO,iCAAqB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,iBAAA,EAAkB,CAAE;AAC9E;AAEO,IAAM,kBAAA,GAAqB,aAAA;AAAA,EAAc,MAC9C,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D","file":"chunk-GO4EVN5H.js","sourcesContent":["import { lazyComponent } from '../../utils/lazy-component';\n\n/**\n * Lazy-loaded common components\n * Use these for code-splitting non-critical components\n *\n * NOTE: Skeleton components are sourced from @salla.sa/twilight-components-react\n * because they must render instantly during route transitions.\n */\nexport const LazyBreadcrumb = lazyComponent(() =>\n import('./Breadcrumb').then((m) => ({ default: m.Breadcrumb }))\n);\n\nexport const LazyNoContent = lazyComponent(() =>\n import('./NoContent').then((m) => ({ default: m.NoContent }))\n);\n\nexport const LazyRenderWhenVisible = lazyComponent(() =>\n import('./RenderWhenVisible').then((m) => ({ default: m.RenderWhenVisible }))\n);\n\nexport const LazyCurrencySymbol = lazyComponent(() =>\n import('./CurrencySymbol').then((m) => ({ default: m.CurrencySymbol }))\n);\n\nexport const LazyErrorPage = lazyComponent(() =>\n import('./ErrorPage').then((m) => ({ default: m.ErrorPage }))\n);\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { customUrl } from './chunk-
|
|
2
|
-
import { store } from './chunk-
|
|
3
|
-
import { redirect } from './chunk-
|
|
1
|
+
import { customUrl } from './chunk-WGUF75EV.js';
|
|
2
|
+
import { store } from './chunk-TMTJTEGN.js';
|
|
3
|
+
import { redirect } from './chunk-7RH6YE4A.js';
|
|
4
4
|
import { isLocale } from './chunk-T72DAX7R.js';
|
|
5
5
|
|
|
6
6
|
// src/routes/custom-urls.ts
|
|
@@ -87,5 +87,5 @@ async function customUrlRedirect(pathname, search, options) {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
export { customUrlKey, customUrlPagePath, customUrlRedirect, storePathOf, withAddressQuery };
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-GRF2ZTUB.js.map
|
|
91
|
+
//# sourceMappingURL=chunk-GRF2ZTUB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/routes/custom-urls.ts"],"names":[],"mappings":";;;;;;AAiCO,SAAS,aAAa,QAAA,EAA2D;AAC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CAAa,OAAA,CAAQ,MAAM,CAAA,GACzC,OAAA,CAAQ,MAAA;AACZ,IAAA,MAAM,QAAA,CAAS,gBAAA,CAAiB,CAAA,EAAG,MAAA,GAAS,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA,GAAK,EAAE,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,MAAM,CAAA,EAAG;AAAA,MAC/E,UAAA,EAAY;AAAA,KACb,CAAA;AAAA,EACH;AACA,EAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,MAAA,CAAO,GAAG,CAAA;AAC/B,EAAA,IAAI,IAAA,EAAM;AACR,IAAA,MAAM,QAAA,CAAS,gBAAA,CAAiB,IAAA,EAAM,MAAM,CAAA,EAAG,EAAE,UAAA,EAAY,GAAA,EAAK,cAAA,EAAgB,IAAA,EAAM,CAAA;AAAA,EAC1F;AACF","file":"chunk-Q7ZDNHHF.js","sourcesContent":["/**\n * @fileoverview A merchant's custom URLs (Dashboard → SEO → custom links) on a React storefront.\n *\n * Twig answers them in the Store's catch-all, its last fallback: after every route, and after the\n * product lookups by short code (`/{code}`) and by SKU (`/{sku}-{name}`). A React theme has no\n * catch-all, so the locale layout's `beforeLoad` asks the API (Store-Module#1798, the catch-all's\n * own lookup) at the same two points:\n * - an address no page answers (`twigUrlRedirect`, after the short code);\n * - a SKU-link address whose SKU names no product (`resolveProductKeyPage`).\n *\n * It asks only on a store that lists `custom-urls` in `store.features` (the plan has it, and the\n * store has an active one), so an address no page answers costs a store without one nothing. The answer is a 302, as Twig's, because the\n * merchant can point the URL elsewhere at any time.\n */\nimport type { QueryClient } from '@tanstack/react-query';\nimport { customUrl, type CustomUrlTarget } from '../api/custom-url';\nimport { store } from '../api/store';\nimport type { StoreContext } from '../api/store';\nimport { redirect } from '../providers/NavigationProvider';\nimport { isLocale } from '../providers/locale-constants';\n\nexport interface CustomUrlRedirectOptions {\n /** The request's query client: the settings are in it already, and a lookup is shared. */\n queryClient: QueryClient;\n /** The language segment an item's page takes, given the one the address had (the locale layout's rule). */\n targetLocale?: (addressLocale: string | undefined) => Promise<string | undefined>;\n}\n\n/**\n * The path a custom URL is saved under, for an address the router hands over (the store base\n * already off): without a language segment, which the Store strips before its catch-all, and\n * without the slashes around it. `null` for a home page.\n */\nexport function customUrlKey(pathname: string): { key: string; locale?: string } | null {\n const segments = pathname.split('/').filter(Boolean);\n const locale = isLocale(segments[0]) ? segments.shift() : undefined;\n if (!segments.length) return null;\n return { key: segments.join('/'), locale };\n}\n\n/**\n * The path an item's URL has under the store root, without its language segment:\n * `https://salla.sa/dev-x/en/shoes/p1` with store URL `https://salla.sa/dev-x/` is `/shoes/p1`.\n * `null` when the URL is not on the store (another host, or outside the store's segment).\n */\nexport function storePathOf(url: string, storeUrl: string | undefined): string | null {\n let item: URL;\n let root: URL;\n try {\n item = new URL(url);\n root = new URL(storeUrl ?? '');\n } catch {\n return null;\n }\n if (item.host !== root.host) return null;\n const rootPath = root.pathname.replace(/\\/+$/, '');\n if (rootPath && item.pathname !== rootPath && !item.pathname.startsWith(`${rootPath}/`)) {\n return null;\n }\n const segments = item.pathname.slice(rootPath.length).split('/').filter(Boolean);\n if (isLocale(segments[0])) segments.shift();\n return `/${segments.join('/')}`;\n}\n\n/** Twig's brand address, `/{slug}/brand-{id}`: the engine's brand page is `/brands/{id}`. */\nconst TWIG_BRAND_PATH = /^\\/[^/]+\\/brand-(\\d+)$/;\n\n/**\n * The engine's page for the item a custom URL names, under the store root and with no language,\n * or `null` for a `custom` row or an item URL that is not on the store. The item's own address\n * is used: the engine serves Twig's product, category, tag and page addresses (and redirects a\n * hash URL itself), and only a brand is sent straight to its page, a hop shorter.\n */\nexport function customUrlPagePath(\n target: CustomUrlTarget,\n storeUrl: string | undefined\n): string | null {\n if (target.type === 'custom') return null;\n const path = storePathOf(target.url, storeUrl);\n if (!path) return null;\n const brand = TWIG_BRAND_PATH.exec(path);\n return brand ? `/brands/${brand[1]}` : path;\n}\n\n/**\n * `target` with the address's query string on it, as the Store's catch-all keeps it (an ad's\n * `utm_*`): after the target's own query, and before its fragment.\n */\nexport function withAddressQuery(target: string, search: string): string {\n const query = search.replace(/^\\?/, '');\n if (!query) return target;\n const hashAt = target.indexOf('#');\n const [head, fragment] =\n hashAt < 0 ? [target, ''] : [target.slice(0, hashAt), target.slice(hashAt)];\n return `${head}${head.includes('?') ? '&' : '?'}${query}${fragment}`;\n}\n\n/** A URL when it is http(s): the Dashboard asks for a URL, and the router refuses any other scheme. */\nfunction httpUrl(url: string): string | null {\n try {\n const { protocol } = new URL(url);\n return protocol === 'http:' || protocol === 'https:' ? url : null;\n } catch {\n return null;\n }\n}\n\n/** The settings, when they list `custom-urls` in the store's features; else `null`. */\nasync function settingsWithCustomUrls(queryClient: QueryClient): Promise<StoreContext | null> {\n try {\n const settings = await queryClient.ensureQueryData(store.queries.settings());\n return settings?.store?.features?.includes('custom-urls') ? settings : null;\n } catch {\n return null;\n }\n}\n\n/**\n * The custom URL saved for `key`, or `undefined`. Any failure counts as none: an address no page\n * answers is also every scanner's, and an API error must leave it the 404 it was, not a 500.\n */\nasync function lookup(key: string, queryClient: QueryClient): Promise<CustomUrlTarget | undefined> {\n try {\n return await queryClient.ensureQueryData(customUrl.queries.resolve(key));\n } catch {\n return undefined;\n }\n}\n\n/**\n * Sends the visitor where the custom URL saved for `pathname` leads, with the address's query, by\n * a 302; returns when there is none, and the caller answers as it would have. An item on the store\n * is reached in one hop, in the language the locale layout would give it. A `custom` row's URL,\n * or an item URL on another site, is a full page load.\n */\nexport async function customUrlRedirect(\n pathname: string,\n search: string,\n options: CustomUrlRedirectOptions\n): Promise<void> {\n const address = customUrlKey(pathname);\n if (!address) return;\n const settings = await settingsWithCustomUrls(options.queryClient);\n if (!settings) return;\n const target = await lookup(address.key, options.queryClient);\n if (!target) return;\n\n const path = customUrlPagePath(target, settings.store?.url);\n if (path) {\n const locale = options.targetLocale\n ? await options.targetLocale(address.locale)\n : address.locale;\n throw redirect(withAddressQuery(`${locale ? `/${locale}` : ''}${path}`, search), {\n statusCode: 302,\n });\n }\n const href = httpUrl(target.url);\n if (href) {\n throw redirect(withAddressQuery(href, search), { statusCode: 302, reloadDocument: true });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/routes/custom-urls.ts"],"names":[],"mappings":";;;;;;AAiCO,SAAS,aAAa,QAAA,EAA2D;AACtF,EAAA,MAAM,WAAW,QAAA,CAAS,KAAA,CAAM,GAAG,CAAA,CAAE,OAAO,OAAO,CAAA;AACnD,EAAA,MAAM,MAAA,GAAS,SAAS,QAAA,CAAS,CAAC,CAAC,CAAA,GAAI,QAAA,CAAS,OAAM,GAAI,MAAA;AAC1D,EAAA,IAAI,CAAC,QAAA,CAAS,MAAA,EAAQ,OAAO,IAAA;AAC7B,EAAA,OAAO,EAAE,GAAA,EAAK,QAAA,CAAS,IAAA,CAAK,GAAG,GAAG,MAAA,EAAO;AAC3C;AAOO,SAAS,WAAA,CAAY,KAAa,QAAA,EAA6C;AACpF,EAAA,IAAI,IAAA;AACJ,EAAA,IAAI,IAAA;AACJ,EAAA,IAAI;AACF,IAAA,IAAA,GAAO,IAAI,IAAI,GAAG,CAAA;AAClB,IAAA,IAAA,GAAO,IAAI,GAAA,CAAI,QAAA,IAAY,EAAE,CAAA;AAAA,EAC/B,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,IAAI,IAAA,CAAK,IAAA,KAAS,IAAA,CAAK,IAAA,EAAM,OAAO,IAAA;AACpC,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,QAAA,CAAS,OAAA,CAAQ,QAAQ,EAAE,CAAA;AACjD,EAAA,IAAI,QAAA,IAAY,IAAA,CAAK,QAAA,KAAa,QAAA,IAAY,CAAC,IAAA,CAAK,QAAA,CAAS,UAAA,CAAW,CAAA,EAAG,QAAQ,CAAA,CAAA,CAAG,CAAA,EAAG;AACvF,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,MAAM,QAAA,GAAW,IAAA,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,IAAI,CAAC,MAAA,EAAQ;AAEb,EAAA,MAAM,IAAA,GAAO,iBAAA,CAAkB,MAAA,EAAQ,QAAA,CAAS,OAAO,GAAG,CAAA;AAC1D,EAAA,IAAI,IAAA,EAAM;AACR,IAAA,MAAM,MAAA,GAAS,QAAQ,YAAA,GACnB,MAAM,QAAQ,YAAA,CAAa,OAAA,CAAQ,MAAM,CAAA,GACzC,OAAA,CAAQ,MAAA;AACZ,IAAA,MAAM,QAAA,CAAS,gBAAA,CAAiB,CAAA,EAAG,MAAA,GAAS,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA,GAAK,EAAE,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,MAAM,CAAA,EAAG;AAAA,MAC/E,UAAA,EAAY;AAAA,KACb,CAAA;AAAA,EACH;AACA,EAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,MAAA,CAAO,GAAG,CAAA;AAC/B,EAAA,IAAI,IAAA,EAAM;AACR,IAAA,MAAM,QAAA,CAAS,gBAAA,CAAiB,IAAA,EAAM,MAAM,CAAA,EAAG,EAAE,UAAA,EAAY,GAAA,EAAK,cAAA,EAAgB,IAAA,EAAM,CAAA;AAAA,EAC1F;AACF","file":"chunk-GRF2ZTUB.js","sourcesContent":["/**\n * @fileoverview A merchant's custom URLs (Dashboard → SEO → custom links) on a React storefront.\n *\n * Twig answers them in the Store's catch-all, its last fallback: after every route, and after the\n * product lookups by short code (`/{code}`) and by SKU (`/{sku}-{name}`). A React theme has no\n * catch-all, so the locale layout's `beforeLoad` asks the API (Store-Module#1798, the catch-all's\n * own lookup) at the same two points:\n * - an address no page answers (`twigUrlRedirect`, after the short code);\n * - a SKU-link address whose SKU names no product (`resolveProductKeyPage`).\n *\n * It asks only on a store that lists `custom-urls` in `store.features` (the plan has it, and the\n * store has an active one), so an address no page answers costs a store without one nothing. The answer is a 302, as Twig's, because the\n * merchant can point the URL elsewhere at any time.\n */\nimport type { QueryClient } from '@tanstack/react-query';\nimport { customUrl, type CustomUrlTarget } from '../api/custom-url';\nimport { store } from '../api/store';\nimport type { StoreContext } from '../api/store';\nimport { redirect } from '../providers/NavigationProvider';\nimport { isLocale } from '../providers/locale-constants';\n\nexport interface CustomUrlRedirectOptions {\n /** The request's query client: the settings are in it already, and a lookup is shared. */\n queryClient: QueryClient;\n /** The language segment an item's page takes, given the one the address had (the locale layout's rule). */\n targetLocale?: (addressLocale: string | undefined) => Promise<string | undefined>;\n}\n\n/**\n * The path a custom URL is saved under, for an address the router hands over (the store base\n * already off): without a language segment, which the Store strips before its catch-all, and\n * without the slashes around it. `null` for a home page.\n */\nexport function customUrlKey(pathname: string): { key: string; locale?: string } | null {\n const segments = pathname.split('/').filter(Boolean);\n const locale = isLocale(segments[0]) ? segments.shift() : undefined;\n if (!segments.length) return null;\n return { key: segments.join('/'), locale };\n}\n\n/**\n * The path an item's URL has under the store root, without its language segment:\n * `https://salla.sa/dev-x/en/shoes/p1` with store URL `https://salla.sa/dev-x/` is `/shoes/p1`.\n * `null` when the URL is not on the store (another host, or outside the store's segment).\n */\nexport function storePathOf(url: string, storeUrl: string | undefined): string | null {\n let item: URL;\n let root: URL;\n try {\n item = new URL(url);\n root = new URL(storeUrl ?? '');\n } catch {\n return null;\n }\n if (item.host !== root.host) return null;\n const rootPath = root.pathname.replace(/\\/+$/, '');\n if (rootPath && item.pathname !== rootPath && !item.pathname.startsWith(`${rootPath}/`)) {\n return null;\n }\n const segments = item.pathname.slice(rootPath.length).split('/').filter(Boolean);\n if (isLocale(segments[0])) segments.shift();\n return `/${segments.join('/')}`;\n}\n\n/** Twig's brand address, `/{slug}/brand-{id}`: the engine's brand page is `/brands/{id}`. */\nconst TWIG_BRAND_PATH = /^\\/[^/]+\\/brand-(\\d+)$/;\n\n/**\n * The engine's page for the item a custom URL names, under the store root and with no language,\n * or `null` for a `custom` row or an item URL that is not on the store. The item's own address\n * is used: the engine serves Twig's product, category, tag and page addresses (and redirects a\n * hash URL itself), and only a brand is sent straight to its page, a hop shorter.\n */\nexport function customUrlPagePath(\n target: CustomUrlTarget,\n storeUrl: string | undefined\n): string | null {\n if (target.type === 'custom') return null;\n const path = storePathOf(target.url, storeUrl);\n if (!path) return null;\n const brand = TWIG_BRAND_PATH.exec(path);\n return brand ? `/brands/${brand[1]}` : path;\n}\n\n/**\n * `target` with the address's query string on it, as the Store's catch-all keeps it (an ad's\n * `utm_*`): after the target's own query, and before its fragment.\n */\nexport function withAddressQuery(target: string, search: string): string {\n const query = search.replace(/^\\?/, '');\n if (!query) return target;\n const hashAt = target.indexOf('#');\n const [head, fragment] =\n hashAt < 0 ? [target, ''] : [target.slice(0, hashAt), target.slice(hashAt)];\n return `${head}${head.includes('?') ? '&' : '?'}${query}${fragment}`;\n}\n\n/** A URL when it is http(s): the Dashboard asks for a URL, and the router refuses any other scheme. */\nfunction httpUrl(url: string): string | null {\n try {\n const { protocol } = new URL(url);\n return protocol === 'http:' || protocol === 'https:' ? url : null;\n } catch {\n return null;\n }\n}\n\n/** The settings, when they list `custom-urls` in the store's features; else `null`. */\nasync function settingsWithCustomUrls(queryClient: QueryClient): Promise<StoreContext | null> {\n try {\n const settings = await queryClient.ensureQueryData(store.queries.settings());\n return settings?.store?.features?.includes('custom-urls') ? settings : null;\n } catch {\n return null;\n }\n}\n\n/**\n * The custom URL saved for `key`, or `undefined`. Any failure counts as none: an address no page\n * answers is also every scanner's, and an API error must leave it the 404 it was, not a 500.\n */\nasync function lookup(key: string, queryClient: QueryClient): Promise<CustomUrlTarget | undefined> {\n try {\n return await queryClient.ensureQueryData(customUrl.queries.resolve(key));\n } catch {\n return undefined;\n }\n}\n\n/**\n * Sends the visitor where the custom URL saved for `pathname` leads, with the address's query, by\n * a 302; returns when there is none, and the caller answers as it would have. An item on the store\n * is reached in one hop, in the language the locale layout would give it. A `custom` row's URL,\n * or an item URL on another site, is a full page load.\n */\nexport async function customUrlRedirect(\n pathname: string,\n search: string,\n options: CustomUrlRedirectOptions\n): Promise<void> {\n const address = customUrlKey(pathname);\n if (!address) return;\n const settings = await settingsWithCustomUrls(options.queryClient);\n if (!settings) return;\n const target = await lookup(address.key, options.queryClient);\n if (!target) return;\n\n const path = customUrlPagePath(target, settings.store?.url);\n if (path) {\n const locale = options.targetLocale\n ? await options.targetLocale(address.locale)\n : address.locale;\n throw redirect(withAddressQuery(`${locale ? `/${locale}` : ''}${path}`, search), {\n statusCode: 302,\n });\n }\n const href = httpUrl(target.url);\n if (href) {\n throw redirect(withAddressQuery(href, search), { statusCode: 302, reloadDocument: true });\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { orThrow } from './chunk-
|
|
2
|
-
import { getActiveScope, api } from './chunk-
|
|
1
|
+
import { orThrow } from './chunk-7RH6YE4A.js';
|
|
2
|
+
import { getActiveScope, api } from './chunk-VND65UMT.js';
|
|
3
3
|
import { queryOptions } from '@tanstack/react-query';
|
|
4
4
|
|
|
5
5
|
var category = {
|
|
@@ -26,5 +26,5 @@ var category = {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
export { category };
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-GRYATL7L.js.map
|
|
30
|
+
//# sourceMappingURL=chunk-GRYATL7L.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/category.ts"],"names":[],"mappings":";;;;AAKO,IAAM,QAAA,GAAW;AAAA,EACtB,IAAA,EAAM,OAAO,EAAA,KAAkC;AAC7C,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CAAI,IAAI,CAAA,WAAA,EAAc,EAAE,CAAA,CAAE,CAAA,CAAE,IAAA,EAAyB;AAC5E,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAAA,EAEA,aAAa,CAAC,EAAA,KAAkC,QAAQ,QAAA,CAAS,IAAA,CAAK,EAAE,CAAC,CAAA;AAAA,EAEzE,MAAM,YAAiC;AACrC,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,QAAA,EAAU,EAAE,CAAA;AAAA,MACrC,OAAA,EAAS,MAAM,QAAA,CAAS,IAAA,CAAK,EAAE;AAAA,KAChC,CAAA;AAAA,IAEH,IAAA,EAAM,MACJ,YAAA,CAAa;AAAA;AAAA,MAEX,QAAA,EAAU,CAAC,YAAA,EAAc,MAAA,EAAQ,EAAE,KAAA,EAAO,cAAA,IAAkB,CAAA;AAAA,MAC5D,OAAA,EAAS,MAAM,QAAA,CAAS,IAAA;AAAK,KAC9B;AAAA;AAEP","file":"chunk-GRYATL7L.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api, getActiveScope } from './client';\nimport type { Category } from '../types';\nimport { orThrow } from '../providers/NavigationProvider';\n\nexport const category = {\n find: async (id: string): Promise<Category> => {\n const { data } = await api.get(`categories/${id}`).json<{ data: Category }>();\n return data;\n },\n\n findOrThrow: (id: string): Promise<Category> => orThrow(category.find(id)),\n\n list: async (): Promise<Category[]> => {\n const { data } = await api.get('categories').json<{ data: Category[] }>();\n return data ?? [];\n },\n\n queries: {\n detail: (id: string) =>\n queryOptions({\n queryKey: ['categories', 'detail', id],\n queryFn: () => category.find(id),\n }),\n\n list: () =>\n queryOptions({\n // Scope (branch) varies the API response — key must include it.\n queryKey: ['categories', 'list', { scope: getActiveScope() }],\n queryFn: () => category.list(),\n }),\n },\n};\n"]}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { Footer } from './chunk-QT2D7JMW.js';
|
|
2
2
|
import { getModelContext } from './chunk-Q77J3D2W.js';
|
|
3
|
-
import { Header } from './chunk-
|
|
3
|
+
import { Header } from './chunk-CZTJ2YC2.js';
|
|
4
4
|
import { editorFrame, previewTheme, postToEditor, FRAME_LOADED_ACTION } from './chunk-YL6X3ZMG.js';
|
|
5
|
-
import { useDevSettingsOverrides, useDevReportSettingsFetchedAt } from './chunk-
|
|
6
|
-
import { resolveTwilightSdkUrl, TICKETING_SCRIPT_URL } from './chunk-
|
|
5
|
+
import { useDevSettingsOverrides, useDevReportSettingsFetchedAt } from './chunk-RD7ZPLRZ.js';
|
|
6
|
+
import { resolveTwilightSdkUrl, TICKETING_SCRIPT_URL } from './chunk-QF7HVZM5.js';
|
|
7
7
|
import { color } from './chunk-VVZNW5CB.js';
|
|
8
8
|
import { applyThemeHookSlots, installAppScope } from './chunk-QJOTD2GJ.js';
|
|
9
|
-
import { apps } from './chunk-
|
|
9
|
+
import { apps } from './chunk-VKKA35I2.js';
|
|
10
|
+
import { cart, replaceSdkCart } from './chunk-4MKZ7JPZ.js';
|
|
10
11
|
import { withOwnerMaintenanceButton, withoutMaintenanceOnPreviewHost } from './chunk-O7JTXTGP.js';
|
|
11
|
-
import { useLocation, useIsHome, NavigationInterceptor } from './chunk-
|
|
12
|
-
import { useUser } from './chunk-
|
|
12
|
+
import { useLocation, useIsHome, NavigationInterceptor } from './chunk-7RH6YE4A.js';
|
|
13
|
+
import { useUser } from './chunk-N7CPWUSY.js';
|
|
13
14
|
import { DocumentClassProvider, useDocumentClass } from './chunk-JWXJPJBO.js';
|
|
14
15
|
import { WidgetHead } from './chunk-V2ZDTY6H.js';
|
|
15
16
|
import { HookSlot } from './chunk-5XDPAKF5.js';
|
|
16
17
|
import { hookRegistry } from './chunk-GCPEMNSU.js';
|
|
17
|
-
import { getActiveCurrency, ENGINE_VERSION } from './chunk-
|
|
18
|
+
import { getActiveCurrency, ENGINE_VERSION } from './chunk-VND65UMT.js';
|
|
18
19
|
import { useTranslation, I18nProvider } from './chunk-TYNZ5B2B.js';
|
|
19
20
|
import { Toaster } from './chunk-AXX7A2JJ.js';
|
|
20
21
|
import { isNativeApp } from './chunk-BZ2QSBXM.js';
|
|
@@ -343,6 +344,42 @@ function useNativeSpaWebview() {
|
|
|
343
344
|
[]
|
|
344
345
|
);
|
|
345
346
|
}
|
|
347
|
+
|
|
348
|
+
// src/providers/stale-cart.ts
|
|
349
|
+
var THANK_YOU_PATH = /\/thankyou\/[^/]+/;
|
|
350
|
+
function isRefused(error) {
|
|
351
|
+
const status = error?.response?.status;
|
|
352
|
+
return status === 403 || status === 404;
|
|
353
|
+
}
|
|
354
|
+
function watchStaleCart() {
|
|
355
|
+
const landedOnThankYou = typeof window !== "undefined" && THANK_YOU_PATH.test(window.location.pathname);
|
|
356
|
+
let unbind;
|
|
357
|
+
const cancel = whenSallaReady((sdk) => {
|
|
358
|
+
const check = () => {
|
|
359
|
+
const cartId = sdk.storage.get("cart.id");
|
|
360
|
+
if (cartId) void cart.get(cartId).catch(() => void 0);
|
|
361
|
+
};
|
|
362
|
+
const onFetched = (response) => {
|
|
363
|
+
if (!response?.data?.cart) check();
|
|
364
|
+
};
|
|
365
|
+
const onNotFetched = (error) => {
|
|
366
|
+
if (!isRefused(error)) return;
|
|
367
|
+
if (sdk.storage.get("cart.id")) check();
|
|
368
|
+
else void replaceSdkCart();
|
|
369
|
+
};
|
|
370
|
+
if (landedOnThankYou) check();
|
|
371
|
+
sdk.event.on("cart::details.fetched", onFetched);
|
|
372
|
+
sdk.event.on("cart::details.not.fetched", onNotFetched);
|
|
373
|
+
unbind = () => {
|
|
374
|
+
sdk.event.off("cart::details.fetched", onFetched);
|
|
375
|
+
sdk.event.off("cart::details.not.fetched", onNotFetched);
|
|
376
|
+
};
|
|
377
|
+
});
|
|
378
|
+
return () => {
|
|
379
|
+
cancel();
|
|
380
|
+
unbind?.();
|
|
381
|
+
};
|
|
382
|
+
}
|
|
346
383
|
var subscribe = () => () => {
|
|
347
384
|
};
|
|
348
385
|
var getSnapshot = () => getModelContext() !== void 0;
|
|
@@ -352,16 +389,16 @@ function useWebMcpSupported() {
|
|
|
352
389
|
}
|
|
353
390
|
var navigationSetups = {
|
|
354
391
|
tanstack: lazyComponent(
|
|
355
|
-
() => import('./navigation-
|
|
392
|
+
() => import('./navigation-5NG7XJSO.js').then((m) => ({ default: m.NavigationSetup }))
|
|
356
393
|
),
|
|
357
394
|
// Not preloaded with the rest: a TanStack worker would load Next.js code it never runs.
|
|
358
|
-
nextjs: lazy(() => import('./navigation-
|
|
395
|
+
nextjs: lazy(() => import('./navigation-F7D6JQKB.js').then((m) => ({ default: m.NavigationSetup })))
|
|
359
396
|
};
|
|
360
397
|
|
|
361
398
|
// src/providers/DocumentSyncRegistry.ts
|
|
362
399
|
var routeDocumentSyncs = {
|
|
363
400
|
tanstack: lazyComponent(
|
|
364
|
-
() => import('./document-class-
|
|
401
|
+
() => import('./document-class-SYUN4GYO.js').then((m) => ({
|
|
365
402
|
default: m.TanStackDocumentSync
|
|
366
403
|
}))
|
|
367
404
|
)
|
|
@@ -604,14 +641,14 @@ function useGtm() {
|
|
|
604
641
|
[push, currency]
|
|
605
642
|
);
|
|
606
643
|
const checkout = useCallback(
|
|
607
|
-
(
|
|
644
|
+
(cart2, step = 1) => push({
|
|
608
645
|
event: "checkout",
|
|
609
646
|
ecommerce: {
|
|
610
647
|
currencyCode: currency,
|
|
611
648
|
event_id: eventId("checkout"),
|
|
612
649
|
checkout: {
|
|
613
|
-
actionField: { step, id:
|
|
614
|
-
products:
|
|
650
|
+
actionField: { step, id: cart2.id },
|
|
651
|
+
products: cart2.items.map((item) => ({
|
|
615
652
|
id: item.product_id,
|
|
616
653
|
name: item.product_name,
|
|
617
654
|
price: typeof item.price === "number" ? item.price : item.price.amount,
|
|
@@ -623,7 +660,7 @@ function useGtm() {
|
|
|
623
660
|
[push, currency]
|
|
624
661
|
);
|
|
625
662
|
const purchase = useCallback(
|
|
626
|
-
(orderId,
|
|
663
|
+
(orderId, cart2) => push({
|
|
627
664
|
event: "purchase",
|
|
628
665
|
ecommerce: {
|
|
629
666
|
currencyCode: currency,
|
|
@@ -631,11 +668,11 @@ function useGtm() {
|
|
|
631
668
|
purchase: {
|
|
632
669
|
actionField: {
|
|
633
670
|
id: orderId,
|
|
634
|
-
revenue:
|
|
635
|
-
tax:
|
|
636
|
-
coupon:
|
|
671
|
+
revenue: cart2.total,
|
|
672
|
+
tax: cart2.tax_amount,
|
|
673
|
+
coupon: cart2.coupon
|
|
637
674
|
},
|
|
638
|
-
products:
|
|
675
|
+
products: cart2.items.map((item) => ({
|
|
639
676
|
id: item.product_id,
|
|
640
677
|
name: item.product_name,
|
|
641
678
|
price: typeof item.price === "number" ? item.price : item.price.amount,
|
|
@@ -874,7 +911,7 @@ function injectFastCheckoutScript() {
|
|
|
874
911
|
document.head.appendChild(s);
|
|
875
912
|
}
|
|
876
913
|
var GoogleTagBody = lazyComponent(
|
|
877
|
-
() => import('./GoogleTag-
|
|
914
|
+
() => import('./GoogleTag-EEPZ4AH6.js').then((m) => ({ default: m.GoogleTagBody }))
|
|
878
915
|
);
|
|
879
916
|
var TwilightBundles = lazyComponent(
|
|
880
917
|
() => import('./TwilightBundles-G6GHWBID.js').then((m) => ({ default: m.TwilightBundles }))
|
|
@@ -883,7 +920,7 @@ var LazySiftSnippet = lazyComponent(
|
|
|
883
920
|
() => import('./SiftSnippet-5FCU6TR6.js').then((m) => ({ default: m.SiftSnippet }))
|
|
884
921
|
);
|
|
885
922
|
var LazyStoreClosedNotification = lazyComponent(
|
|
886
|
-
() => import('./StoreClosedNotification-
|
|
923
|
+
() => import('./StoreClosedNotification-HJC4PYA5.js').then((m) => ({
|
|
887
924
|
default: m.StoreClosedNotification
|
|
888
925
|
}))
|
|
889
926
|
);
|
|
@@ -1129,7 +1166,7 @@ function SallaSdkScripts({ settings }) {
|
|
|
1129
1166
|
|
|
1130
1167
|
// src/components/store/lazy.ts
|
|
1131
1168
|
var LazyStoreClosedNotification2 = lazyComponent(
|
|
1132
|
-
() => import('./StoreClosedNotification-
|
|
1169
|
+
() => import('./StoreClosedNotification-HJC4PYA5.js').then((m) => ({
|
|
1133
1170
|
default: m.StoreClosedNotification
|
|
1134
1171
|
}))
|
|
1135
1172
|
);
|
|
@@ -1199,7 +1236,7 @@ function LiveEditor() {
|
|
|
1199
1236
|
if (!frame) return null;
|
|
1200
1237
|
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyLiveEditorBar, { origin: frame.origin, dev: frame.dev }) });
|
|
1201
1238
|
}
|
|
1202
|
-
var LazyWebMcpTools = React2.lazy(() => import('./WebMcpTools-
|
|
1239
|
+
var LazyWebMcpTools = React2.lazy(() => import('./WebMcpTools-Y537MP25.js'));
|
|
1203
1240
|
function WebMcpMount() {
|
|
1204
1241
|
if (!useWebMcpSupported()) return null;
|
|
1205
1242
|
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyWebMcpTools, {}) });
|
|
@@ -1316,6 +1353,7 @@ function TwilightProvider({
|
|
|
1316
1353
|
unbind?.();
|
|
1317
1354
|
};
|
|
1318
1355
|
}, []);
|
|
1356
|
+
useEffect(() => watchStaleCart(), []);
|
|
1319
1357
|
const { isReady, storeData, setStoreData, themeData, currency, isMobileWebview } = useTwilightInit({
|
|
1320
1358
|
debug,
|
|
1321
1359
|
initialData,
|
|
@@ -1490,5 +1528,5 @@ function useStore() {
|
|
|
1490
1528
|
}
|
|
1491
1529
|
|
|
1492
1530
|
export { LazyMaintenancePage, LazyStoreClosedNotification2 as LazyStoreClosedNotification, MasterLayout, TwilightProvider, fastCheckoutScript, registerDefaultHooks, registerDocumentSync, routeDocumentSyncs, useBreadcrumbs, useDate, useGtm, useMoney, useNumber, useOpeningHours, usePageConfig, useStore };
|
|
1493
|
-
//# sourceMappingURL=chunk-
|
|
1494
|
-
//# sourceMappingURL=chunk-
|
|
1531
|
+
//# sourceMappingURL=chunk-LAESVQK6.js.map
|
|
1532
|
+
//# sourceMappingURL=chunk-LAESVQK6.js.map
|