@salla.sa/twilight-theme-engine 1.0.120 → 1.0.122
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-3JMN4PL4.js → AddToCartForm-4Z6BBSU4.js} +3 -3
- package/dist/{AddToCartForm-3JMN4PL4.js.map → AddToCartForm-4Z6BBSU4.js.map} +1 -1
- package/dist/{BlogAuthorPage-HRPTZ6KW.js → BlogAuthorPage-GIQL4YX6.js} +17 -16
- package/dist/BlogAuthorPage-GIQL4YX6.js.map +1 -0
- package/dist/{BlogCategoryPage-2NNWTOTW.js → BlogCategoryPage-UELJFSB2.js} +17 -16
- package/dist/BlogCategoryPage-UELJFSB2.js.map +1 -0
- package/dist/{BlogPage-JMVHQBYK.js → BlogPage-G6LPLQRM.js} +15 -14
- package/dist/BlogPage-G6LPLQRM.js.map +1 -0
- package/dist/{BlogSinglePage-Y6V66JG6.js → BlogSinglePage-SVTO3C5D.js} +15 -14
- package/dist/BlogSinglePage-SVTO3C5D.js.map +1 -0
- package/dist/{BlogTagPage-B4NJLSQ7.js → BlogTagPage-CFXXPULN.js} +17 -16
- package/dist/BlogTagPage-CFXXPULN.js.map +1 -0
- package/dist/{BrandsPage-NBVF64JF.js → BrandsPage-IC26RKIG.js} +16 -15
- package/dist/BrandsPage-IC26RKIG.js.map +1 -0
- package/dist/{Breadcrumb-JYGYQJLB.js → Breadcrumb-OI2H6GVZ.js} +15 -14
- package/dist/Breadcrumb-OI2H6GVZ.js.map +1 -0
- package/dist/{CartItem-B3GIVKO6.js → CartItem-HTEPMUDS.js} +15 -14
- package/dist/CartItem-HTEPMUDS.js.map +1 -0
- package/dist/{CartSummary-KYDOZM5M.js → CartSummary-OKLYOGJ3.js} +15 -14
- package/dist/CartSummary-OKLYOGJ3.js.map +1 -0
- package/dist/{Copyright-EODCFCIG.js → Copyright-EJW3DGP7.js} +3 -3
- package/dist/{Copyright-EODCFCIG.js.map → Copyright-EJW3DGP7.js.map} +1 -1
- package/dist/{CustomerLayout-76NGJTMK.js → CustomerLayout-YADC5GF7.js} +15 -14
- package/dist/CustomerLayout-YADC5GF7.js.map +1 -0
- package/dist/{Footer-JKHEL74P.js → Footer-XJJIN5T3.js} +4 -4
- package/dist/{Footer-JKHEL74P.js.map → Footer-XJJIN5T3.js.map} +1 -1
- package/dist/{Header-WJAMZDMT.js → Header-WCRFWQIF.js} +8 -8
- package/dist/{Header-WJAMZDMT.js.map → Header-WCRFWQIF.js.map} +1 -1
- package/dist/LiveEditorBar-6SKEWJOX.js +338 -0
- package/dist/LiveEditorBar-6SKEWJOX.js.map +1 -0
- package/dist/{LoyaltyPage-JPZEXI2N.js → LoyaltyPage-CVNIZVMT.js} +15 -14
- package/dist/LoyaltyPage-CVNIZVMT.js.map +1 -0
- package/dist/{LoyaltyPointsPage-C4IZPAOG.js → LoyaltyPointsPage-UZT7LR5E.js} +6 -6
- package/dist/{LoyaltyPointsPage-C4IZPAOG.js.map → LoyaltyPointsPage-UZT7LR5E.js.map} +1 -1
- package/dist/{MainMenu-EIK6QDPF.js → MainMenu-T2OXHLEM.js} +5 -5
- package/dist/{MainMenu-EIK6QDPF.js.map → MainMenu-T2OXHLEM.js.map} +1 -1
- package/dist/{MasterLayout-IVOF3YTF.js → MasterLayout-MLEDURJK.js} +15 -14
- package/dist/{MasterLayout-IVOF3YTF.js.map → MasterLayout-MLEDURJK.js.map} +1 -1
- package/dist/{MobileMenu-5PNZNRXJ.js → MobileMenu-RYICFJPO.js} +16 -15
- package/dist/MobileMenu-RYICFJPO.js.map +1 -0
- package/dist/{NotificationsPage-LO74N5F7.js → NotificationsPage-J2YNZPAN.js} +15 -14
- package/dist/NotificationsPage-J2YNZPAN.js.map +1 -0
- package/dist/{OrderSinglePage-6PYW65SG.js → OrderSinglePage-IIC6JKFX.js} +16 -15
- package/dist/OrderSinglePage-IIC6JKFX.js.map +1 -0
- package/dist/{OrdersPage-KTZJCAXM.js → OrdersPage-FPUE5T6O.js} +15 -14
- package/dist/OrdersPage-FPUE5T6O.js.map +1 -0
- package/dist/{PageSingle-2IY5TNSQ.js → PageSingle-BOZFETZ5.js} +3 -3
- package/dist/{PageSingle-2IY5TNSQ.js.map → PageSingle-BOZFETZ5.js.map} +1 -1
- package/dist/{ProductDetails-EXHNDRRN.js → ProductDetails-ERSDEM5Z.js} +4 -4
- package/dist/{ProductDetails-EXHNDRRN.js.map → ProductDetails-ERSDEM5Z.js.map} +1 -1
- package/dist/{ProfilePage-4W6ZGYOE.js → ProfilePage-MP4PE2LF.js} +15 -14
- package/dist/ProfilePage-MP4PE2LF.js.map +1 -0
- package/dist/{RenderWhenVisible-KWAXEJOJ.js → RenderWhenVisible-BQ7KVPHK.js} +5 -3
- package/dist/RenderWhenVisible-BQ7KVPHK.js.map +1 -0
- package/dist/{ReviewsPage-P6UX4LHI.js → ReviewsPage-5L6DLPN2.js} +3 -3
- package/dist/{ReviewsPage-P6UX4LHI.js.map → ReviewsPage-5L6DLPN2.js.map} +1 -1
- package/dist/{SeoCartWidget-2WHHI6QF.js → SeoCartWidget-XU5LKBMF.js} +15 -14
- package/dist/SeoCartWidget-XU5LKBMF.js.map +1 -0
- package/dist/{SettingsPage-U2B5JI5K.js → SettingsPage-A2AI5CWI.js} +15 -14
- package/dist/SettingsPage-A2AI5CWI.js.map +1 -0
- package/dist/{StoreClosedNotification-MJQT66GR.js → StoreClosedNotification-C6EZSOQF.js} +16 -15
- package/dist/{StoreClosedNotification-MJQT66GR.js.map → StoreClosedNotification-C6EZSOQF.js.map} +1 -1
- package/dist/{TestimonialsPage-BGJND2VC.js → TestimonialsPage-ZO6OIZMX.js} +3 -3
- package/dist/{TestimonialsPage-BGJND2VC.js.map → TestimonialsPage-ZO6OIZMX.js.map} +1 -1
- package/dist/{ThankYouPage-B3KOZKMZ.js → ThankYouPage-RZFWZZXI.js} +15 -14
- package/dist/ThankYouPage-RZFWZZXI.js.map +1 -0
- package/dist/{WalletPage-KVG6MYQ4.js → WalletPage-BDMVFQ4G.js} +16 -15
- package/dist/WalletPage-BDMVFQ4G.js.map +1 -0
- package/dist/{WishlistPage-ZAXYF5WP.js → WishlistPage-3OFBHANB.js} +17 -16
- package/dist/WishlistPage-3OFBHANB.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.js +3 -3
- package/dist/api/category.js +3 -3
- package/dist/api/client.d.ts.map +1 -1
- 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-3IBJ5QUW.js +14 -0
- package/dist/{chunk-TM5MVVTX.js.map → chunk-3IBJ5QUW.js.map} +1 -1
- package/dist/{chunk-B6JTC5R6.js → chunk-3PS2WFNQ.js} +4 -4
- package/dist/{chunk-B6JTC5R6.js.map → chunk-3PS2WFNQ.js.map} +1 -1
- package/dist/{chunk-4GWHDLUF.js → chunk-3VOJOKQI.js} +6 -6
- package/dist/{chunk-4GWHDLUF.js.map → chunk-3VOJOKQI.js.map} +1 -1
- package/dist/{chunk-JHTTTXTI.js → chunk-4IBG3GR6.js} +4 -4
- package/dist/{chunk-JHTTTXTI.js.map → chunk-4IBG3GR6.js.map} +1 -1
- package/dist/{chunk-3WGZZD2Y.js → chunk-5K53BZIN.js} +4 -4
- package/dist/{chunk-3WGZZD2Y.js.map → chunk-5K53BZIN.js.map} +1 -1
- package/dist/{chunk-PFAPRJVF.js → chunk-6BQN4JKH.js} +13 -4
- package/dist/chunk-6BQN4JKH.js.map +1 -0
- package/dist/{chunk-PRA6E6SQ.js → chunk-6F6VACX5.js} +4 -4
- package/dist/{chunk-PRA6E6SQ.js.map → chunk-6F6VACX5.js.map} +1 -1
- package/dist/{chunk-VI2WHQDR.js → chunk-6JS7UZ3S.js} +3 -3
- package/dist/{chunk-VI2WHQDR.js.map → chunk-6JS7UZ3S.js.map} +1 -1
- package/dist/{chunk-ULPH6647.js → chunk-7IQCF6GU.js} +7 -7
- package/dist/{chunk-ULPH6647.js.map → chunk-7IQCF6GU.js.map} +1 -1
- package/dist/{chunk-VSK2WS4G.js → chunk-ABDYSBBY.js} +3 -3
- package/dist/{chunk-VSK2WS4G.js.map → chunk-ABDYSBBY.js.map} +1 -1
- package/dist/{chunk-EFT442TN.js → chunk-ALHMPT6S.js} +3 -3
- package/dist/{chunk-EFT442TN.js.map → chunk-ALHMPT6S.js.map} +1 -1
- package/dist/{chunk-TI6S5KW3.js → chunk-BHCKUER2.js} +4 -4
- package/dist/{chunk-TI6S5KW3.js.map → chunk-BHCKUER2.js.map} +1 -1
- package/dist/{chunk-4EATTQQA.js → chunk-DEIABJV4.js} +3 -3
- package/dist/{chunk-4EATTQQA.js.map → chunk-DEIABJV4.js.map} +1 -1
- package/dist/{chunk-5QYNHHPE.js → chunk-E5OVMQIA.js} +4 -4
- package/dist/{chunk-5QYNHHPE.js.map → chunk-E5OVMQIA.js.map} +1 -1
- package/dist/{chunk-EFCIK5NI.js → chunk-EA334DDV.js} +3 -3
- package/dist/{chunk-EFCIK5NI.js.map → chunk-EA334DDV.js.map} +1 -1
- package/dist/{chunk-XMFVSBEO.js → chunk-EL6IDB5U.js} +3 -3
- package/dist/{chunk-XMFVSBEO.js.map → chunk-EL6IDB5U.js.map} +1 -1
- package/dist/{chunk-MQALPNFL.js → chunk-ESYRKX7T.js} +4 -4
- package/dist/{chunk-MQALPNFL.js.map → chunk-ESYRKX7T.js.map} +1 -1
- package/dist/{chunk-VT6FE3CB.js → chunk-F2MDQCTH.js} +3 -3
- package/dist/{chunk-VT6FE3CB.js.map → chunk-F2MDQCTH.js.map} +1 -1
- package/dist/{chunk-UVQ3QASG.js → chunk-HAH22L6T.js} +7 -7
- package/dist/{chunk-UVQ3QASG.js.map → chunk-HAH22L6T.js.map} +1 -1
- package/dist/{chunk-IRQJBRKV.js → chunk-JOY7HCIH.js} +3 -3
- package/dist/{chunk-IRQJBRKV.js.map → chunk-JOY7HCIH.js.map} +1 -1
- package/dist/{chunk-Y5ZHBECO.js → chunk-KNUANWCR.js} +9 -6
- package/dist/chunk-KNUANWCR.js.map +1 -0
- package/dist/{chunk-RVPC4AYT.js → chunk-LCBETTJI.js} +3 -3
- package/dist/{chunk-RVPC4AYT.js.map → chunk-LCBETTJI.js.map} +1 -1
- package/dist/{chunk-VXSBJZ3E.js → chunk-LG5355UU.js} +4 -4
- package/dist/{chunk-VXSBJZ3E.js.map → chunk-LG5355UU.js.map} +1 -1
- package/dist/{chunk-25MXTMV4.js → chunk-LNSMPXGR.js} +4 -4
- package/dist/{chunk-25MXTMV4.js.map → chunk-LNSMPXGR.js.map} +1 -1
- package/dist/{chunk-UMTMIMH7.js → chunk-MWOP57ZR.js} +3 -3
- package/dist/{chunk-UMTMIMH7.js.map → chunk-MWOP57ZR.js.map} +1 -1
- package/dist/{chunk-UNLQTOEN.js → chunk-N6EWTAE4.js} +7 -7
- package/dist/{chunk-UNLQTOEN.js.map → chunk-N6EWTAE4.js.map} +1 -1
- package/dist/{chunk-Y6VKKGXJ.js → chunk-NEPBUZ5S.js} +5 -5
- package/dist/{chunk-Y6VKKGXJ.js.map → chunk-NEPBUZ5S.js.map} +1 -1
- package/dist/{chunk-D2RUSG36.js → chunk-P6X2QUYL.js} +4 -4
- package/dist/{chunk-D2RUSG36.js.map → chunk-P6X2QUYL.js.map} +1 -1
- package/dist/chunk-PDIFXQDX.js +63 -0
- package/dist/chunk-PDIFXQDX.js.map +1 -0
- package/dist/{chunk-NEHOBD4K.js → chunk-PO6PTKMN.js} +3 -3
- package/dist/{chunk-NEHOBD4K.js.map → chunk-PO6PTKMN.js.map} +1 -1
- package/dist/{chunk-ME4UKH7Y.js → chunk-PQNLRRWJ.js} +4 -4
- package/dist/{chunk-ME4UKH7Y.js.map → chunk-PQNLRRWJ.js.map} +1 -1
- package/dist/{chunk-E552K72T.js → chunk-QMKC7PA2.js} +3 -3
- package/dist/{chunk-E552K72T.js.map → chunk-QMKC7PA2.js.map} +1 -1
- package/dist/{chunk-5YXJC35L.js → chunk-QTRV6N64.js} +37 -20
- package/dist/chunk-QTRV6N64.js.map +1 -0
- package/dist/{chunk-NHEMVF3B.js → chunk-UNDCL5EE.js} +10 -10
- package/dist/{chunk-NHEMVF3B.js.map → chunk-UNDCL5EE.js.map} +1 -1
- package/dist/{chunk-W6NQM4FQ.js → chunk-UQ7NS6BZ.js} +3 -3
- package/dist/{chunk-W6NQM4FQ.js.map → chunk-UQ7NS6BZ.js.map} +1 -1
- package/dist/{chunk-5CKTQAFX.js → chunk-V23ILNAK.js} +3 -3
- package/dist/{chunk-5CKTQAFX.js.map → chunk-V23ILNAK.js.map} +1 -1
- package/dist/{chunk-FIDNPYLL.js → chunk-WZOWGICV.js} +3 -3
- package/dist/{chunk-FIDNPYLL.js.map → chunk-WZOWGICV.js.map} +1 -1
- package/dist/{chunk-NU2LPGNB.js → chunk-XK6TXHVO.js} +3 -3
- package/dist/{chunk-NU2LPGNB.js.map → chunk-XK6TXHVO.js.map} +1 -1
- package/dist/{chunk-T23HXVW5.js → chunk-Y57KRLGY.js} +3 -3
- package/dist/{chunk-T23HXVW5.js.map → chunk-Y57KRLGY.js.map} +1 -1
- package/dist/{chunk-GEGB34LB.js → chunk-YC4CEVQO.js} +4 -4
- package/dist/{chunk-GEGB34LB.js.map → chunk-YC4CEVQO.js.map} +1 -1
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/RenderWhenVisible.d.ts +3 -1
- package/dist/components/common/RenderWhenVisible.d.ts.map +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/common/lazy.d.ts +1 -1
- package/dist/components/common/lazy.d.ts.map +1 -1
- package/dist/components/drawer/index.js +13 -12
- package/dist/components/home/HomePageRenderer.d.ts.map +1 -1
- package/dist/components/home/index.js +17 -16
- package/dist/components/layout/index.js +4 -4
- package/dist/components/live-editor/LiveEditorBar.d.ts +11 -0
- package/dist/components/live-editor/LiveEditorBar.d.ts.map +1 -0
- package/dist/components/live-editor/frame.d.ts +34 -0
- package/dist/components/live-editor/frame.d.ts.map +1 -0
- package/dist/components/live-editor/index.d.ts +9 -0
- package/dist/components/live-editor/index.d.ts.map +1 -0
- package/dist/components/product/index.js +14 -13
- package/dist/components/store/index.js +14 -13
- package/dist/dev/editor/index.js +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/{document-class-OSMTFGJJ.js → document-class-WRE36CKT.js} +11 -11
- package/dist/{document-class-OSMTFGJJ.js.map → document-class-WRE36CKT.js.map} +1 -1
- package/dist/hooks/index.js +13 -12
- package/dist/hooks/useGtm.js +13 -12
- package/dist/hooks/useMoney.js +13 -12
- package/dist/hooks/useStore.js +13 -12
- package/dist/hooks/useUser.js +3 -3
- package/dist/index.js +13 -12
- package/dist/index.js.map +1 -1
- package/dist/{navigation-2V7R2ANX.js → navigation-F5YC4AN5.js} +5 -5
- package/dist/{navigation-2V7R2ANX.js.map → navigation-F5YC4AN5.js.map} +1 -1
- package/dist/{navigation-LRBZCNKS.js → navigation-KPN6OPJN.js} +4 -4
- package/dist/{navigation-LRBZCNKS.js.map → navigation-KPN6OPJN.js.map} +1 -1
- package/dist/{not-found-ZX6EJRVW.js → not-found-YZOISV3W.js} +16 -15
- package/dist/not-found-YZOISV3W.js.map +1 -0
- package/dist/providers/TwilightProvider.d.ts.map +1 -1
- package/dist/providers/index.js +13 -12
- 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 +21 -20
- package/dist/routes/cart.js.map +1 -1
- package/dist/routes/home.js +18 -17
- 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.js +19 -18
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +17 -16
- package/dist/routes/product.js.map +1 -1
- package/dist/routes/seo-redirects.js +3 -3
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +4 -4
- package/dist/skeleton.js +18 -17
- package/dist/{store-lookup-YUA66JS6.js → store-lookup-GXBNYGCM.js} +8 -8
- package/dist/{store-lookup-YUA66JS6.js.map → store-lookup-GXBNYGCM.js.map} +1 -1
- package/dist/tanstack.js +11 -11
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/tailwind/components/common/RenderWhenVisible.tsx.txt +4 -0
- package/tailwind/components/home/HomePageRenderer.tsx.txt +7 -0
- package/tailwind/components/live-editor/LiveEditorBar.tsx.txt +417 -0
- package/tailwind/components/live-editor/frame.ts.txt +97 -0
- package/tailwind/components/live-editor/index.tsx.txt +37 -0
- package/dist/BlogAuthorPage-HRPTZ6KW.js.map +0 -1
- package/dist/BlogCategoryPage-2NNWTOTW.js.map +0 -1
- package/dist/BlogPage-JMVHQBYK.js.map +0 -1
- package/dist/BlogSinglePage-Y6V66JG6.js.map +0 -1
- package/dist/BlogTagPage-B4NJLSQ7.js.map +0 -1
- package/dist/BrandsPage-NBVF64JF.js.map +0 -1
- package/dist/Breadcrumb-JYGYQJLB.js.map +0 -1
- package/dist/CartItem-B3GIVKO6.js.map +0 -1
- package/dist/CartSummary-KYDOZM5M.js.map +0 -1
- package/dist/CustomerLayout-76NGJTMK.js.map +0 -1
- package/dist/LoyaltyPage-JPZEXI2N.js.map +0 -1
- package/dist/MobileMenu-5PNZNRXJ.js.map +0 -1
- package/dist/NotificationsPage-LO74N5F7.js.map +0 -1
- package/dist/OrderSinglePage-6PYW65SG.js.map +0 -1
- package/dist/OrdersPage-KTZJCAXM.js.map +0 -1
- package/dist/ProfilePage-4W6ZGYOE.js.map +0 -1
- package/dist/RenderWhenVisible-KWAXEJOJ.js.map +0 -1
- package/dist/SeoCartWidget-2WHHI6QF.js.map +0 -1
- package/dist/SettingsPage-U2B5JI5K.js.map +0 -1
- package/dist/ThankYouPage-B3KOZKMZ.js.map +0 -1
- package/dist/WalletPage-KVG6MYQ4.js.map +0 -1
- package/dist/WishlistPage-ZAXYF5WP.js.map +0 -1
- package/dist/chunk-5YXJC35L.js.map +0 -1
- package/dist/chunk-PFAPRJVF.js.map +0 -1
- package/dist/chunk-TM5MVVTX.js +0 -14
- package/dist/chunk-Y5ZHBECO.js.map +0 -1
- package/dist/not-found-ZX6EJRVW.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { order } from './chunk-
|
|
1
|
+
import { order } from './chunk-LG5355UU.js';
|
|
2
2
|
import { buildHreflangAlternates } from './chunk-OM2GRPDH.js';
|
|
3
|
-
import { unauthorized, orUnauthorized, orThrow } from './chunk-
|
|
3
|
+
import { unauthorized, orUnauthorized, orThrow } from './chunk-Y57KRLGY.js';
|
|
4
4
|
import { RouteId } from './chunk-OUW6WESU.js';
|
|
5
|
-
import { getAuthToken } from './chunk-
|
|
5
|
+
import { getAuthToken } from './chunk-6BQN4JKH.js';
|
|
6
6
|
import { getTwilightContext } from './chunk-7VNVCHID.js';
|
|
7
7
|
import { lazy } from 'react';
|
|
8
8
|
|
|
@@ -55,9 +55,9 @@ async function orderSingleLoader({
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
// src/routes/account/orders/index.tsx
|
|
58
|
-
var LazyOrdersPage = lazy(() => import('./OrdersPage-
|
|
58
|
+
var LazyOrdersPage = lazy(() => import('./OrdersPage-FPUE5T6O.js').then((m) => ({ default: m.OrdersPage })));
|
|
59
59
|
var LazyOrderSinglePage = lazy(
|
|
60
|
-
() => import('./OrderSinglePage-
|
|
60
|
+
() => import('./OrderSinglePage-IIC6JKFX.js').then((m) => ({ default: m.OrderSinglePage }))
|
|
61
61
|
);
|
|
62
62
|
var OrdersPage = LazyOrdersPage;
|
|
63
63
|
var OrderSinglePage = LazyOrderSinglePage;
|
|
@@ -104,5 +104,5 @@ var OrderSingle = {
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
export { OrderSingle, OrderSinglePage, Orders, OrdersPage, orderSingleLoader, ordersLoader };
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
108
|
-
//# sourceMappingURL=chunk-
|
|
107
|
+
//# sourceMappingURL=chunk-N6EWTAE4.js.map
|
|
108
|
+
//# sourceMappingURL=chunk-N6EWTAE4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/routes/account/orders/loader.ts","../src/routes/account/orders/index.tsx"],"names":[],"mappings":";;;;;;;;;AAQA,eAAsB,YAAA,CACpB,KACA,MAAA,EAI0B;AAC1B,EAAA,IAAI,CAAC,YAAA,EAAa,EAAG,MAAM,YAAA,EAAa;AACxC,EAAA,MAAM,QAAQ,GAAA,CAAI,KAAA;AAClB,EAAA,MAAM,SAAA,GAAY,OAAO,MAAA,KAAW,SAAA;AACpC,EAAA,MAAM,WAAW,MAAM,cAAA;AAAA,IACrB,MAAM,IAAA,CAAK;AAAA;AAAA,MAET,QAAQ,KAAA,EAAO,MAAA;AAAA,MACf,GAAI,IAAI,UAAA,GAAa,EAAE,YAAY,GAAA,CAAI,UAAA,KAAe;AAAC,KACxD;AAAA,GACH;AACA,EAAA,MAAM,IAAA,GAAO,oBAAmB,CAAE,IAAA;AAClC,EAAA,MAAM,QAAA,GAA4B;AAAA,IAChC,IAAA,EAAM;AAAA,MACJ,KAAA,EAAO,YAAY,IAAA,CAAK,CAAA,CAAE,8BAA8B,CAAA,GAAI,IAAA,CAAK,EAAE,sBAAsB,CAAA;AAAA,MACzF,MAAM,OAAA,CAAQ;AAAA,KAChB;AAAA,IACA,QAAQ,QAAA,CAAS,IAAA;AAAA,IACjB,QAAQ,QAAA,CAAS,MAAA;AAAA,IACjB;AAAA,GACF;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AA,GAAuB;AAAA,IAC3B,KAAA,EAAO,KAAK,IAAA,CAAK,KAAA;AAAA,IACjB,WAAA,EAAa,KAAK,IAAA,CAAK,WAAA;AAAA,IACvB,oBAAoB,uBAAA,CAAwB,GAAA,CAAI,QAAA,EAAU,GAAA,CAAI,SAAS,QAAQ;AAAA,GACjF;AAEA,EAAA,OAAO,IAAA;AACT;AAEO,IAAM,MAAA,GAAS;AAAA,EACpB,IAAI,OAAA,CAAQ,qBAAA;AAAA,EACZ,MAAA,EAAQ,sBAAA;AAAA,EACR,IAAA,EAAM,UAAA;AAAA,EACN,SAAA,EAAW;AACb;AACO,IAAM,WAAA,GAAc;AAAA,EACzB,IAAI,OAAA,CAAQ,sBAAA;AAAA,EACZ,MAAA,EAAQ,2BAAA;AAAA,EACR,IAAA,EAAM,eAAA;AAAA,EACN,SAAA,EAAW;AACb","file":"chunk-N6EWTAE4.js","sourcesContent":["import { order } from '../../../api/order';\nimport { getTwilightContext } from '../../../twilight/context';\nimport { RouteId } from '../../../router/route-ids';\nimport { orThrow, orUnauthorized, unauthorized } from '../../../providers/NavigationProvider';\nimport { getAuthToken } from '../../../api/client';\nimport type { OrdersPageProps, OrderSinglePageProps, OrdersQuery } from './types';\nimport type { IdParams } from '../../types';\n\nexport async function ordersLoader(\n ctx: { query?: OrdersQuery; with_items?: boolean | number },\n extend?: (\n data: OrdersPageProps,\n ctx: { params: Record<string, never> }\n ) => Promise<Record<string, unknown>> | Record<string, unknown>\n): Promise<OrdersPageProps> {\n if (!getAuthToken()) throw unauthorized();\n const query = ctx.query;\n const isPending = query?.status === 'pending';\n const response = await orUnauthorized(\n order.list({\n // Only decides the empty state; <salla-orders> applies its own review filter (`?tab=waiting`).\n status: query?.status,\n ...(ctx.with_items ? { with_items: ctx.with_items } : {}),\n })\n );\n const i18n = getTwilightContext().i18n;\n const pageData: OrdersPageProps = {\n page: {\n title: isPending ? i18n.t('common.titles.pending_orders') : i18n.t('common.titles.orders'),\n slug: RouteId.CUSTOMER_ORDERS_INDEX,\n },\n orders: response.data,\n cursor: response.cursor,\n query,\n };\n\n if (extend) {\n const extra = await extend(pageData, { params: {} });\n return { ...pageData, ...extra } as OrdersPageProps;\n }\n return pageData;\n}\n\nexport async function orderSingleLoader({\n params,\n}: {\n params: IdParams;\n}): Promise<OrderSinglePageProps> {\n if (!getAuthToken()) throw unauthorized();\n const [data, componentsOrder] = await Promise.all([\n order.findOrThrow(params.id),\n orThrow(orUnauthorized(order.findForComponents(params.id))),\n ]);\n const i18n = getTwilightContext().i18n;\n return {\n page: {\n slug: RouteId.CUSTOMER_ORDERS_SINGLE,\n id: String(params.id),\n title: i18n\n .t('pages.orders.order_details')\n .replace(':id', String(data.order.reference_id ?? params.id)),\n },\n order: data.order,\n componentsOrder,\n };\n}\n","import type { HeadDescriptor } from '../../../utils/head';\nimport { buildHreflangAlternates } from '../../../utils/baseHead';\nimport { lazy } from 'react';\nimport { ordersLoader, orderSingleLoader } from './loader';\nimport type { OrdersPageProps, OrderSinglePageProps, OrdersSearchParams } from './types';\nimport type { IdParams } from '../../types';\nimport type { TwilightContext } from '../../../twilight/context';\nimport { RouteId } from '../../../router/route-ids';\n\n// Lazy-load components for code-splitting\nconst LazyOrdersPage = lazy(() => import('./OrdersPage').then((m) => ({ default: m.OrdersPage })));\nconst LazyOrderSinglePage = lazy(() =>\n import('./OrderSinglePage').then((m) => ({ default: m.OrderSinglePage }))\n);\n\nexport const OrdersPage = LazyOrdersPage;\nexport const OrderSinglePage = LazyOrderSinglePage;\nexport { ordersLoader, orderSingleLoader } from './loader';\nexport type {\n OrdersPageProps,\n OrderSinglePageProps,\n OrdersSearchParams,\n OrdersQuery,\n} from './types';\n\nasync function ordersLoaderWithExtend(\n ctx: { search?: OrdersSearchParams; locale?: string; with_items?: boolean | number },\n extend?: (\n data: OrdersPageProps,\n ctx: { params: Record<string, never> }\n ) => Promise<Record<string, unknown>> | Record<string, unknown>\n): Promise<OrdersPageProps> {\n const query = ctx.search;\n // ordersLoader already merges the result of `extend`; calling it again here ran it twice.\n return ordersLoader({ query, with_items: ctx.with_items }, extend);\n}\n\nfunction ordersHead(ctx: TwilightContext, data: OrdersPageProps): HeadDescriptor {\n const isPending = data.query?.status === 'pending';\n const base: HeadDescriptor = {\n title: ctx.i18n.t(isPending ? 'common.titles.pending_orders' : 'common.titles.orders'),\n description: data.page.description,\n alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),\n };\n\n return base;\n}\n\nasync function orderSingleLoaderWithExtend(\n ctx: { params: IdParams; locale?: string },\n extend?: (\n data: OrderSinglePageProps,\n ctx: { params: IdParams }\n ) => Promise<Record<string, unknown>> | Record<string, unknown>\n): Promise<OrderSinglePageProps> {\n const data = await orderSingleLoader({ params: ctx.params });\n\n if (extend) {\n const extra = await extend(data, ctx);\n return { ...data, ...extra } as OrderSinglePageProps;\n }\n return data;\n}\n\nfunction orderSingleHead(ctx: TwilightContext, data: OrderSinglePageProps): HeadDescriptor {\n const base: HeadDescriptor = {\n title: data.page.title,\n description: data.page.description,\n alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),\n };\n\n return base;\n}\n\nexport const Orders = {\n id: RouteId.CUSTOMER_ORDERS_INDEX,\n loader: ordersLoaderWithExtend,\n head: ordersHead,\n Component: LazyOrdersPage,\n} as const;\nexport const OrderSingle = {\n id: RouteId.CUSTOMER_ORDERS_SINGLE,\n loader: orderSingleLoaderWithExtend,\n head: orderSingleHead,\n Component: LazyOrderSinglePage,\n} as const;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HomeComponentRenderer, ReorderProducts } from './chunk-
|
|
2
|
-
import { home } from './chunk-
|
|
3
|
-
import { useDevHomeBlocks } from './chunk-
|
|
1
|
+
import { HomeComponentRenderer, ReorderProducts } from './chunk-KNUANWCR.js';
|
|
2
|
+
import { home } from './chunk-V23ILNAK.js';
|
|
3
|
+
import { useDevHomeBlocks } from './chunk-EL6IDB5U.js';
|
|
4
4
|
import { storePageUrl, buildHreflangAlternates } from './chunk-OM2GRPDH.js';
|
|
5
5
|
import { RouteId } from './chunk-OUW6WESU.js';
|
|
6
6
|
import { HookSlot } from './chunk-5XDPAKF5.js';
|
|
@@ -87,5 +87,5 @@ function head(ctx) {
|
|
|
87
87
|
var Home = { id: RouteId.INDEX, loader, head, Component: HomePage };
|
|
88
88
|
|
|
89
89
|
export { Home, HomeSkeleton, homeLoader };
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-NEPBUZ5S.js.map
|
|
91
|
+
//# sourceMappingURL=chunk-NEPBUZ5S.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/routes/home/loader.ts","../src/routes/home/HomePage.tsx","../src/routes/home/index.tsx"],"names":["HomeSkeleton","HomePage"],"mappings":";;;;;;;;;;;;AAWA,eAAsB,WAAW,GAAA,EAAoD;AACnF,EAAA,MAAM,EAAE,WAAA,EAAY,GAAI,kBAAA,EAAmB;AAC3C,EAAA,MAAM,aAAa,MAAM,WAAA,CAAY,gBAAgB,IAAA,CAAK,OAAA,CAAQ,YAAY,CAAA;AAC9E,EAAA,MAAM,MAAA,GAAS;AAAA,IACb,MAAA,EAAQ,KAAK,MAAA,IAAU,IAAA;AAAA,IACvB,UAAA,EAAY,UAAA,CAAW,GAAA,CAAI,CAAC,IAAA,MAAU;AAAA,MACpC,GAAG,IAAA;AAAA,MACH,MAAM,IAAA,CAAK,IAAA,EAAM,QAAQ,OAAA,EAAS,EAAE,KAAK,IAAA,CAAK;AAAA,KAChD,CAAE,CAAA;AAAA,IACF,IAAA,EAAM,EAAE,IAAA,EAAM,OAAA,CAAQ,KAAA;AAAM,GAC9B;AACA,EAAA,OAAO,MAAA;AACT;AChBO,IAAM,YAAA,GAAe,IAAA,CAAK,SAASA,aAAAA,GAAe;AACvD,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA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,qBAAA;AAAA,MACN,KAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAQ,KAAA,CAAM;AAAA,KAChB;AAAA,IACA,oBAAoB,uBAAA,CAAwB,GAAA,CAAI,QAAA,EAAU,GAAA,CAAI,SAAS,QAAQ;AAAA,GACjF;AACF;AAEO,IAAM,IAAA,GAAO,EAAE,EAAA,EAAI,OAAA,CAAQ,OAAO,MAAA,EAAQ,IAAA,EAAM,WAAW,QAAA","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/routes/home/loader.ts","../src/routes/home/HomePage.tsx","../src/routes/home/index.tsx"],"names":["HomeSkeleton","HomePage"],"mappings":";;;;;;;;;;;;AAWA,eAAsB,WAAW,GAAA,EAAoD;AACnF,EAAA,MAAM,EAAE,WAAA,EAAY,GAAI,kBAAA,EAAmB;AAC3C,EAAA,MAAM,aAAa,MAAM,WAAA,CAAY,gBAAgB,IAAA,CAAK,OAAA,CAAQ,YAAY,CAAA;AAC9E,EAAA,MAAM,MAAA,GAAS;AAAA,IACb,MAAA,EAAQ,KAAK,MAAA,IAAU,IAAA;AAAA,IACvB,UAAA,EAAY,UAAA,CAAW,GAAA,CAAI,CAAC,IAAA,MAAU;AAAA,MACpC,GAAG,IAAA;AAAA,MACH,MAAM,IAAA,CAAK,IAAA,EAAM,QAAQ,OAAA,EAAS,EAAE,KAAK,IAAA,CAAK;AAAA,KAChD,CAAE,CAAA;AAAA,IACF,IAAA,EAAM,EAAE,IAAA,EAAM,OAAA,CAAQ,KAAA;AAAM,GAC9B;AACA,EAAA,OAAO,MAAA;AACT;AChBO,IAAM,YAAA,GAAe,IAAA,CAAK,SAASA,aAAAA,GAAe;AACvD,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,SAAI,SAAA,EAAU,uCAAA,EACb,8BAAC,KAAA,EAAA,EAAM,SAAA,EAAU,2BAA0B,CAAA,EAC7C,CAAA;AAAA,oBACA,IAAA,CAAC,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U,GAAA,CAAI,SAAS,QAAQ;AAAA,GACjF;AACF;AAEO,IAAM,IAAA,GAAO,EAAE,EAAA,EAAI,OAAA,CAAQ,OAAO,MAAA,EAAQ,IAAA,EAAM,WAAW,QAAA","file":"chunk-NEPBUZ5S.js","sourcesContent":["import { getTwilightContext } from '../../twilight/context';\nimport { home } from '../../api/home';\nimport type { HomeComponentData } from '../../types';\nimport { RouteId } from '../../router/route-ids';\n\nexport interface HomeLoaderData {\n locale: string;\n components: HomeComponentData[];\n page: { slug: string };\n}\n\nexport async function homeLoader(ctx?: { locale?: string }): Promise<HomeLoaderData> {\n const { queryClient } = getTwilightContext();\n const components = await queryClient.ensureQueryData(home.queries.components());\n const result = {\n locale: ctx?.locale || 'ar',\n components: components.map((comp) => ({\n ...comp,\n path: comp.path?.replace('home.', '') || comp.path,\n })),\n page: { slug: RouteId.INDEX },\n };\n return result;\n}\n","import { memo } from 'react';\nimport { useDevHomeBlocks } from '../../dev/dev-settings-store';\nimport { HookSlot } from '../../hooks';\nimport { HomeComponentRenderer, ReorderProducts } from '../../components/home';\nimport type { HomePageProps } from './types';\nimport { Pulse } from '@salla.sa/twilight-components-react';\n\nexport const HomeSkeleton = memo(function HomeSkeleton() {\n return (\n <>\n <div className=\"s-block container skeleton-block-hero\">\n <Pulse className=\"h-64 sm:h-80 rounded-md\" />\n </div>\n <div className=\"s-block container skeleton-block-products\">\n <Pulse className=\"h-10 w-48 mb-4\" />\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-4\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"h-56\" />\n ))}\n </div>\n </div>\n <div className=\"s-block container skeleton-block-products\">\n <Pulse className=\"h-10 w-48 mb-4\" />\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-4\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"h-56\" />\n ))}\n </div>\n </div>\n </>\n );\n});\n\nexport const HomePage = memo(function HomePage({ components = [] }: HomePageProps) {\n // Dev-mode only: the dev editor's layout replaces the store's blocks while it\n // is on. No-op passthrough in production builds.\n const renderedComponents = useDevHomeBlocks(components);\n return (\n <>\n <HookSlot name=\"home:start\" />\n <HookSlot name=\"home:content\" />\n {renderedComponents.map((data, index) => (\n // `data.key` is the twilight.json catalog id, shared by every placement\n // of that block. Platform blocks send null. Position is unique; a dev\n // layout block keeps its own id so a reorder doesn't remount the rest.\n <HomeComponentRenderer key={data.__dev_id ?? index} data={data} index={index} />\n ))}\n <HookSlot name=\"home:end\" />\n <ReorderProducts />\n </>\n );\n});\n\nexport { HomePage as default };\n","import type { HeadDescriptor } from '../../utils/head';\nimport { buildHreflangAlternates, storePageUrl } from '../../utils/baseHead';\nimport type { HomeLoaderData } from './loader';\nimport { homeLoader } from './loader';\nimport type { TwilightContext } from '../../twilight/context';\nimport { HomePage } from './HomePage';\nimport { RouteId } from '../../router/route-ids';\n\nexport { HomeSkeleton } from './HomePage';\nexport { registerHomeComponents, DefaultHomeComponents } from '../../components/home/register';\nexport { registerHomeComponentConfig } from '../../components/home';\nexport type { HomePageProps } from './types';\nexport type { HomeLoaderData } from './loader';\nexport type {\n HomeComponentsProps,\n AnyHomeComponent,\n HomeComponentConfig,\n} from '../../components/home';\n\nfunction loader(_ctx?: { locale?: string }): Promise<HomeLoaderData> {\n return homeLoader({ locale: _ctx?.locale });\n}\n\nfunction head(ctx: TwilightContext): HeadDescriptor {\n const store = ctx.settings?.store;\n if (!store) return {};\n\n const title = store.meta?.title ?? store.name;\n const description = store.meta?.description ?? store.description;\n const keywords = store.meta?.keywords;\n // `/ar`, like Twig, where store.url reads `/ar/`.\n const url = storePageUrl(ctx.settings, ctx.location.pathname) ?? store.url;\n\n return {\n title,\n description,\n keywords,\n canonical: url,\n openGraph: {\n type: 'website',\n title,\n description,\n images: store.logo,\n url,\n },\n twitter: {\n card: 'summary_large_image',\n title,\n description,\n images: store.logo,\n },\n alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),\n };\n}\n\nexport const Home = { id: RouteId.INDEX, loader, head, Component: HomePage } as const;\n\nexport { homeLoader };\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { orThrow } from './chunk-
|
|
2
|
-
import { getActiveScope, api } from './chunk-
|
|
1
|
+
import { orThrow } from './chunk-Y57KRLGY.js';
|
|
2
|
+
import { getActiveScope, api } from './chunk-6BQN4JKH.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-P6X2QUYL.js.map
|
|
30
|
+
//# sourceMappingURL=chunk-P6X2QUYL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/category.ts"],"names":[],"mappings":";;;;AAKO,IAAM,QAAA,GAAW;AAAA,EACtB,IAAA,EAAM,OAAO,EAAA,KAAkC;AAC7C,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CAAI,IAAI,CAAA,WAAA,EAAc,EAAE,CAAA,CAAE,CAAA,CAAE,IAAA,EAAyB;AAC5E,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAAA,EAEA,aAAa,CAAC,EAAA,KAAkC,QAAQ,QAAA,CAAS,IAAA,CAAK,EAAE,CAAC,CAAA;AAAA,EAEzE,MAAM,YAAiC;AACrC,IAAA,MAAM,EAAE,MAAK,GAAI,MAAM,IAAI,GAAA,CAAI,YAAY,EAAE,IAAA,EAA2B;AACxE,IAAA,OAAO,QAAQ,EAAC;AAAA,EAClB,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,MAAA,EAAQ,CAAC,EAAA,KACP,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,YAAA,EAAc,QAAA,EAAU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OAAA,EAAS,MAAM,QAAA,CAAS,IAAA;AAAK,KAC9B;AAAA;AAEP","file":"chunk-P6X2QUYL.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"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// src/components/live-editor/frame.ts
|
|
2
|
+
var EDITOR_ORIGINS = [
|
|
3
|
+
"https://s.salla.sa",
|
|
4
|
+
"https://salla.design",
|
|
5
|
+
"https://demostore.salla.sa"
|
|
6
|
+
];
|
|
7
|
+
var FRAME_LOADED_ACTION = "design::iframe.loaded";
|
|
8
|
+
var BLOCK_ATTRIBUTE = "data-live-block";
|
|
9
|
+
var AREA_ATTRIBUTE = "data-live-editor";
|
|
10
|
+
var AREA_FALLBACKS = {
|
|
11
|
+
header: "header.store-header, header.site-header",
|
|
12
|
+
footer: ".store-footer"
|
|
13
|
+
};
|
|
14
|
+
function parentOrigin() {
|
|
15
|
+
if (window.self === window.top) return null;
|
|
16
|
+
const ancestor = window.location.ancestorOrigins?.[0];
|
|
17
|
+
if (ancestor) return ancestor;
|
|
18
|
+
try {
|
|
19
|
+
return document.referrer ? new URL(document.referrer).origin : null;
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function editorOrigin() {
|
|
25
|
+
if (typeof window === "undefined") return null;
|
|
26
|
+
let origin;
|
|
27
|
+
try {
|
|
28
|
+
origin = parentOrigin();
|
|
29
|
+
} catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return origin && EDITOR_ORIGINS.includes(origin) ? origin : null;
|
|
33
|
+
}
|
|
34
|
+
function postToEditor(origin, action, data) {
|
|
35
|
+
window.parent.postMessage({ action, data, is_salla: true }, origin);
|
|
36
|
+
}
|
|
37
|
+
function areaOf(el) {
|
|
38
|
+
if (el.closest('[role="dialog"]')) return null;
|
|
39
|
+
const marked = el.getAttribute(AREA_ATTRIBUTE);
|
|
40
|
+
if (marked === "header" || marked === "footer") return marked;
|
|
41
|
+
if (el.matches(AREA_FALLBACKS.header)) return "header";
|
|
42
|
+
if (el.matches(AREA_FALLBACKS.footer)) return "footer";
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
var TARGET_SELECTOR = [
|
|
46
|
+
`[${BLOCK_ATTRIBUTE}]`,
|
|
47
|
+
`[${AREA_ATTRIBUTE}="header"]`,
|
|
48
|
+
`[${AREA_ATTRIBUTE}="footer"]`,
|
|
49
|
+
AREA_FALLBACKS.header,
|
|
50
|
+
AREA_FALLBACKS.footer
|
|
51
|
+
].join(", ");
|
|
52
|
+
function targetOf(node) {
|
|
53
|
+
let el = node instanceof Element ? node.closest(TARGET_SELECTOR) : null;
|
|
54
|
+
while (el) {
|
|
55
|
+
if (el.hasAttribute(BLOCK_ATTRIBUTE) || areaOf(el)) return el;
|
|
56
|
+
el = el.parentElement?.closest(TARGET_SELECTOR) ?? null;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { BLOCK_ATTRIBUTE, FRAME_LOADED_ACTION, areaOf, editorOrigin, postToEditor, targetOf };
|
|
62
|
+
//# sourceMappingURL=chunk-PDIFXQDX.js.map
|
|
63
|
+
//# sourceMappingURL=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AQ,MAAM,CAAA;AACpE;AAGO,SAAS,OAAO,EAAA,EAA0B;AAC/C,EAAA,IAAI,EAAA,CAAG,OAAA,CAAQ,iBAAiB,CAAA,EAAG,OAAO,IAAA;AAC1C,EAAA,MAAM,MAAA,GAAS,EAAA,CAAG,YAAA,CAAa,cAAc,CAAA;AAC7C,EAAA,IAAI,MAAA,KAAW,QAAA,IAAY,MAAA,KAAW,QAAA,EAAU,OAAO,MAAA;AACvD,EAAA,IAAI,EAAA,CAAG,OAAA,CAAQ,cAAA,CAAe,MAAM,GAAG,OAAO,QAAA;AAC9C,EAAA,IAAI,EAAA,CAAG,OAAA,CAAQ,cAAA,CAAe,MAAM,GAAG,OAAO,QAAA;AAC9C,EAAA,OAAO,IAAA;AACT;AAGO,IAAM,eAAA,GAAkB;AAAA,EAC7B,IAAI,eAAe,CAAA,CAAA,CAAA;AAAA,EACnB,IAAI,cAAc,CAAA,UAAA,CAAA;AAAA,EAClB,IAAI,cAAc,CAAA,UAAA,CAAA;AAAA,EAClB,cAAA,CAAe,MAAA;AAAA,EACf,cAAA,CAAe;AACjB,CAAA,CAAE,KAAK,IAAI,CAAA;AAGJ,SAAS,SAAS,IAAA,EAA8C;AACrE,EAAA,IAAI,KAAK,IAAA,YAAgB,OAAA,GAAU,IAAA,CAAK,OAAA,CAAqB,eAAe,CAAA,GAAI,IAAA;AAChF,EAAA,OAAO,EAAA,EAAI;AACT,IAAA,IAAI,GAAG,YAAA,CAAa,eAAe,KAAK,MAAA,CAAO,EAAE,GAAG,OAAO,EAAA;AAC3D,IAAA,EAAA,GAAK,EAAA,CAAG,aAAA,EAAe,OAAA,CAAqB,eAAe,CAAA,IAAK,IAAA;AAAA,EAClE;AACA,EAAA,OAAO,IAAA;AACT","file":"chunk-PDIFXQDX.js","sourcesContent":["/**\n * The storefront's side of the merchant theme editor's live preview: the editor\n * (`s.salla.sa/themes/editor`) frames the store, and the store tells it which\n * block, header or footer the merchant acted on, with the same `postMessage`\n * protocol the twig themes' `live-themes-editor.js` speaks.\n */\n\n/** Where the theme editor runs. Messages go to the one that framed the page, never to `*`. */\nexport const EDITOR_ORIGINS = [\n 'https://s.salla.sa',\n 'https://salla.design',\n 'https://demostore.salla.sa',\n] as const;\n\n/** Sent once the page has loaded; the editor's preview health check waits for it. */\nexport const FRAME_LOADED_ACTION = 'design::iframe.loaded';\n\nexport type BlockAction = 'edit' | 'hide' | 'moveup' | 'movedown' | 'duplicate' | 'add' | 'delete';\n\nexport type LiveEditorMessage =\n `preview::${BlockAction}.component` | 'preview::edit.header' | 'preview::edit.footer';\n\n/** A home block, rendered by `HomeComponentRenderer`, carries its id here. */\nexport const BLOCK_ATTRIBUTE = 'data-live-block';\n\n/** A theme can name its header or footer for the editor: `data-live-editor=\"header\"`. */\nexport const AREA_ATTRIBUTE = 'data-live-editor';\n\n/** Header and footer of themes that don't mark theirs: the engine's own, and Raed's. */\nexport const AREA_FALLBACKS = {\n header: 'header.store-header, header.site-header',\n footer: '.store-footer',\n} as const;\n\nexport type Area = keyof typeof AREA_FALLBACKS;\n\n/** The origin of the page that frames this one, or `null` at the top or when unknown. */\nfunction parentOrigin(): string | null {\n if (window.self === window.top) return null;\n // Chromium and Safari name it directly; Firefox only through the referrer.\n const ancestor = window.location.ancestorOrigins?.[0];\n if (ancestor) return ancestor;\n try {\n return document.referrer ? new URL(document.referrer).origin : null;\n } catch {\n return null;\n }\n}\n\n/** The theme editor's origin when it frames this page, otherwise `null`. Browser only. */\nexport function editorOrigin(): string | null {\n if (typeof window === 'undefined') return null;\n let origin: string | null;\n try {\n origin = parentOrigin();\n } catch {\n return null;\n }\n return origin && (EDITOR_ORIGINS as readonly string[]).includes(origin) ? origin : null;\n}\n\nexport function postToEditor(\n origin: string,\n action: LiveEditorMessage | typeof FRAME_LOADED_ACTION,\n data?: { id: string }\n): void {\n window.parent.postMessage({ action, data, is_salla: true }, origin);\n}\n\n/** The header or footer `el` stands for, if any. One inside a dialog (a sheet's copy) is not it. */\nexport function areaOf(el: Element): Area | null {\n if (el.closest('[role=\"dialog\"]')) return null;\n const marked = el.getAttribute(AREA_ATTRIBUTE);\n if (marked === 'header' || marked === 'footer') return marked;\n if (el.matches(AREA_FALLBACKS.header)) return 'header';\n if (el.matches(AREA_FALLBACKS.footer)) return 'footer';\n return null;\n}\n\n/** What the editor can act on: a block with an id, the header, or the footer. */\nexport const TARGET_SELECTOR = [\n `[${BLOCK_ATTRIBUTE}]`,\n `[${AREA_ATTRIBUTE}=\"header\"]`,\n `[${AREA_ATTRIBUTE}=\"footer\"]`,\n AREA_FALLBACKS.header,\n AREA_FALLBACKS.footer,\n].join(', ');\n\n/** The block, header or footer under `node`, nearest first. */\nexport function targetOf(node: EventTarget | null): HTMLElement | null {\n let el = node instanceof Element ? node.closest<HTMLElement>(TARGET_SELECTOR) : null;\n while (el) {\n if (el.hasAttribute(BLOCK_ATTRIBUTE) || areaOf(el)) return el;\n el = el.parentElement?.closest<HTMLElement>(TARGET_SELECTOR) ?? null;\n }\n return null;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { api } from './chunk-
|
|
1
|
+
import { api } from './chunk-6BQN4JKH.js';
|
|
2
2
|
|
|
3
3
|
// src/api/wallet.ts
|
|
4
4
|
var wallet = {
|
|
@@ -20,5 +20,5 @@ var wallet = {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export { wallet };
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-PO6PTKMN.js.map
|
|
24
|
+
//# sourceMappingURL=chunk-PO6PTKMN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/wallet.ts"],"names":[],"mappings":";;;AAgCO,IAAM,MAAA,GAAS;AAAA,EACpB,IAAA,EAAM,OAAO,MAAA,GAA2B,EAAC,KAAiC;AACxE,IAAA,MAAM,EAAE,IAAA,GAAO,CAAA,EAAG,OAAA,GAAU,E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S,MAAA;AAE7B,IAAA,MAAM,QAAA,GAAW,MAAM,GAAA,CACpB,GAAA,CAAI,CAAA,eAAA,EAAkB,YAAA,CAAa,QAAA,EAAU,CAAA,CAAA,EAAI,OAAc,CAAA,CAC/D,IAAA,EAAsE;AAEzE,IAAA,MAAM,YAAA,GAAe,SAAS,IAAA,CAAK,YAAA;AAEnC,IAAA,OAAO;AAAA,MACL,KAAA,EAAO,YAAA,CAAa,IAAA,IAAQ,EAAC;AAAA,MAC7B,MAAM,YAAA,CAAa,aAAA;AAAA,MACnB,OAAA,EAAS,SAAS,IAAA,CAAK;AAAA,KACzB;AAAA,EACF;AACF","file":"chunk-PO6PTKMN.js","sourcesContent":["import { api } from './client';\n\nexport interface TransactionItem {\n id: number;\n order_id: number;\n transaction_type: string;\n action_type: string;\n type: string;\n title: string;\n description: string;\n amount: number;\n created_at: number;\n expired_at: number;\n}\n\nexport interface WalletListParams {\n page?: number;\n perPage?: number;\n signal?: AbortSignal;\n}\n\nexport interface WalletListResponse {\n data: TransactionItem[];\n next_page_url: string | null;\n}\n\nexport interface WalletListResult {\n items: TransactionItem[];\n next: string | null;\n balance: number;\n}\n\nexport const wallet = {\n list: async (params: WalletListParams = {}): Promise<WalletListResult> => {\n const { page = 1, perPage = 10, signal } = params;\n\n const searchParams = new URLSearchParams();\n searchParams.set('page', String(page));\n searchParams.set('per_page', String(perPage));\n\n const options: Record<string, unknown> = {};\n if (signal) options.signal = signal;\n\n const response = await api\n .get(`balance/wallet?${searchParams.toString()}`, options as any)\n .json<{ data: { transactions: WalletListResponse; balance: number } }>();\n\n const transactions = response.data.transactions;\n\n return {\n items: transactions.data ?? [],\n next: transactions.next_page_url,\n balance: response.data.balance,\n };\n },\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { orThrow } from './chunk-
|
|
2
|
-
import { api } from './chunk-
|
|
1
|
+
import { orThrow } from './chunk-Y57KRLGY.js';
|
|
2
|
+
import { api } from './chunk-6BQN4JKH.js';
|
|
3
3
|
import { getSallaSDK } from './chunk-GYXUYHKO.js';
|
|
4
4
|
import { queryOptions } from '@tanstack/react-query';
|
|
5
5
|
|
|
@@ -44,5 +44,5 @@ var cart = {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
export { cart };
|
|
47
|
-
//# sourceMappingURL=chunk-
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
47
|
+
//# sourceMappingURL=chunk-PQNLRRWJ.js.map
|
|
48
|
+
//# sourceMappingURL=chunk-PQNLRRWJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/cart.ts"],"names":[],"mappings":";;;;;AAaA,SAAS,sBAAsB,IAAA,EAAoC;AACjE,EAAA,IAAI,CAAC,IAAA,CAAK,IAAA,EAAM,OAAO,IAAA;AACvB,EAAA,OAAO;AAAA,IACL,GAAG,IAAA,CAAK,IAAA;AAAA,IACR,OAAA,EAAS,KAAK,OAAA,IAAW,IAAA;AAAA;AAAA,IAEzB,IAAA,EAAM,IAAA,CAAK,IAAA,IAAQ,IAAA,CAAK,KAAK,IAAA,IAAQ;AAAA,GACvC;AACF;AAEO,IAAM,IAAA,GAAO;AAAA,EAClB,GAAA,EAAK,OAAO,MAAA,KAAyC;AACnD,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CAAI,IAAI,CAAA,KAAA,EAAQ,MAAM,CAAA,CAAE,CAAA,CAAE,IAAA,EAAgC;AACjF,IAAA,OAAO,sBAAsB,IAAI,CAAA;AAAA,EACnC,CAAA;AAAA,EAEA,YAAY,CAAC,MAAA,KAAyC,QAAQ,IAAA,CAAK,GAAA,CAAI,MAAM,CAAC,CAAA;AAAA;AAAA,EAG9E,cAAc,YAAoC;AAChD,IAAA,MAAM,QAAQ,WAAA,EAAY;AAC1B,IAAA,IAAI,CAAC,OAAO,OAAO,IAAA;AAEnB,IAAA,MAAM,KAAA,CAAM,OAAA,EAAQ,CAAE,KAAA,CAAM,MAAM,M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EAEA,YAAY,CAAC,MAAA,KAAyC,QAAQ,IAAA,CAAK,GAAA,CAAI,MAAM,CAAC,CAAA;AAAA;AAAA,EAG9E,cAAc,YAAoC;AAChD,IAAA,MAAM,QAAQ,WAAA,EAAY;AAC1B,IAAA,IAAI,CAAC,OAAO,OAAO,IAAA;AAEnB,IAAA,MAAM,KAAA,CAAM,OAAA,EAAQ,CAAE,KAAA,CAAM,MAAM,MAAS,CAAA;AAC3C,IAAA,OAAO,KAAA,CAAM,IAAA,CAAK,GAAA,CAAI,gBAAA,EAAiB;AAAA,EACzC,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,MAAA,EAAQ,CAAC,MAAA,KACP,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,MACzB,OAAA,EAAS,MAAM,IAAA,CAAK,GAAA,CAAI,MAAM,CAAA;AAAA;AAAA,MAE9B,SAAA,EAAW,CAAA;AAAA,MACX,MAAA,EAAQ;AAAA,KACT,CAAA;AAAA,IACH,SAAA,EAAW,MACT,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,YAAY,CAAA;AAAA,MAC/B,OAAA,EAAS,MAAM,IAAA,CAAK,YAAA,EAAa;AAAA;AAAA,MAEjC,SAAA,EAAW,CAAA;AAAA,MACX,MAAA,EAAQ;AAAA,KACT;AAAA;AAEP","file":"chunk-PQNLRRWJ.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api } from './client';\nimport type { Cart } from '../types';\nimport { orThrow } from '../providers/NavigationProvider';\nimport { getSallaSDK } from '../utils/sdk-helpers';\n\nexport interface CartApiResponse {\n /** Absent once the cart was turned into an order (the body then carries a top-level `redirect`). */\n cart?: Omit<Cart, 'loyalty'>;\n loyalty?: Cart['loyalty'];\n gift?: Cart['gift'];\n}\n\nfunction normalizeCartResponse(data: CartApiResponse): Cart | null {\n if (!data.cart) return null;\n return {\n ...data.cart,\n loyalty: data.loyalty ?? null,\n // The API sends `gift` inside `cart`.\n gift: data.gift ?? data.cart.gift ?? null,\n } as Cart;\n}\n\nexport const cart = {\n get: async (cartId: number): Promise<Cart | null> => {\n const { data } = await api.get(`cart/${cartId}`).json<{ data: CartApiResponse }>();\n return normalizeCartResponse(data);\n },\n\n getOrThrow: (cartId: number): Promise<Cart | null> => orThrow(cart.get(cartId)),\n\n /** The visitor's cart id, which only the Salla SDK knows; `null` outside the browser. */\n getCurrentId: async (): Promise<number | null> => {\n const salla = getSallaSDK();\n if (!salla) return null;\n // The app bundle can run before the SDK module, when `salla` is still the head stub.\n await salla.onReady().catch(() => undefined);\n return salla.cart.api.getCurrentCartId();\n },\n\n queries: {\n detail: (cartId: number) =>\n queryOptions({\n queryKey: ['cart', cartId],\n queryFn: () => cart.get(cartId),\n // The SDK changes the cart from any page, so a cached copy is never safe to show.\n staleTime: 0,\n gcTime: 0,\n }),\n currentId: () =>\n queryOptions({\n queryKey: ['cart', 'current-id'],\n queryFn: () => cart.getCurrentId(),\n // Completing an order starts a new cart, so an earlier id is never reused.\n staleTime: 0,\n gcTime: 0,\n }),\n },\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { filesCdn, cdn } from './chunk-
|
|
1
|
+
import { filesCdn, cdn } from './chunk-6BQN4JKH.js';
|
|
2
2
|
import { storeTranslationsQueryKey, translationsQueryKey, composeMessages, isPlainObject } from './chunk-7VNVCHID.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-QMKC7PA2.js.map
|
|
130
|
+
//# sourceMappingURL=chunk-QMKC7PA2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQzC,cAAA,CAAe,sBAAsB,OAAA,EAAS,MAAM,GAAG,EAAE,UAAA,EAAY,MAAM;AAAA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAc7E,KAAA,EAAO,CACL,MAAA,EACA,SAAA,EACA,WAC+B,eAAA,CAAgB,MAAA,EAAQ,SAAA,EAAW,MAAM,CAAA,IAAK,IAAA;AAAA,EAE/E,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBP,QAAA,EAAU,CAAC,MAAA,KACT,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,qBAAqB,MAAM,CAAA;AAAA,MACrC,OAAA,EAAS,MAAM,YAAA,CAAa,GAAA,CAAI,MAAM;AAAA,KACvC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWH,OAAA,EAAS,CAAC,OAAA,EAA0B,MAAA,KAClC,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,yBAAA,CAA0B,OAAA,EAAS,MAAM,CAAA;AAAA,MACnD,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-E552K72T.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,KAA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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBP,QAAA,EAAU,CAAC,MAAA,KACT,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,qBAAqB,MAAM,CAAA;AAAA,MACrC,OAAA,EAAS,MAAM,YAAA,CAAa,GAAA,CAAI,MAAM;AAAA,KACvC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWH,OAAA,EAAS,CAAC,OAAA,EAA0B,MAAA,KAClC,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,yBAAA,CAA0B,OAAA,EAAS,MAAM,CAAA;AAAA,MACnD,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-QMKC7PA2.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,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { editorOrigin, postToEditor, FRAME_LOADED_ACTION } from './chunk-PDIFXQDX.js';
|
|
2
|
+
import { Header } from './chunk-7IQCF6GU.js';
|
|
3
|
+
import { Footer } from './chunk-WZOWGICV.js';
|
|
3
4
|
import { withOwnerMaintenanceButton, resolveTwilightSdkUrl, TICKETING_SCRIPT_URL } from './chunk-D6XHL6VQ.js';
|
|
4
|
-
import { useDevSettingsOverrides } from './chunk-
|
|
5
|
-
import { apps } from './chunk-
|
|
5
|
+
import { useDevSettingsOverrides } from './chunk-EL6IDB5U.js';
|
|
6
|
+
import { apps } from './chunk-MWOP57ZR.js';
|
|
6
7
|
import { color } from './chunk-VVZNW5CB.js';
|
|
7
8
|
import { applyThemeHookSlots, installAppScope } from './chunk-5FJFN3IW.js';
|
|
8
|
-
import { useLocation, useIsHome, NavigationInterceptor } from './chunk-
|
|
9
|
-
import { useUser } from './chunk-
|
|
9
|
+
import { useLocation, useIsHome, NavigationInterceptor } from './chunk-Y57KRLGY.js';
|
|
10
|
+
import { useUser } from './chunk-F2MDQCTH.js';
|
|
10
11
|
import { DocumentClassProvider, useDocumentClass } from './chunk-JWXJPJBO.js';
|
|
11
12
|
import { WidgetHead } from './chunk-V2ZDTY6H.js';
|
|
12
13
|
import { HookSlot } from './chunk-5XDPAKF5.js';
|
|
13
14
|
import { hookRegistry } from './chunk-GCPEMNSU.js';
|
|
14
|
-
import { getActiveCurrency } from './chunk-
|
|
15
|
+
import { getActiveCurrency, ENGINE_VERSION } from './chunk-6BQN4JKH.js';
|
|
15
16
|
import { useTranslation, I18nProvider } from './chunk-TYNZ5B2B.js';
|
|
16
17
|
import { Toaster } from './chunk-V2M5YNZQ.js';
|
|
17
18
|
import { isNativeApp } from './chunk-2TLIULJZ.js';
|
|
@@ -123,11 +124,6 @@ function ThemeDocumentSync({
|
|
|
123
124
|
themeSyncScript(themeCssVars(theme), bodyClasses)
|
|
124
125
|
);
|
|
125
126
|
}
|
|
126
|
-
|
|
127
|
-
// src/utils/engine-version.ts
|
|
128
|
-
var ENGINE_VERSION = "1.0.120" ;
|
|
129
|
-
|
|
130
|
-
// src/providers/twilight-init.ts
|
|
131
127
|
function getSalla() {
|
|
132
128
|
if (typeof window === "undefined") return void 0;
|
|
133
129
|
return window.salla;
|
|
@@ -345,13 +341,13 @@ function useNativeSpaWebview() {
|
|
|
345
341
|
}
|
|
346
342
|
var navigationSetups = {
|
|
347
343
|
tanstack: lazy(
|
|
348
|
-
() => import('./navigation-
|
|
344
|
+
() => import('./navigation-F5YC4AN5.js').then((m) => ({ default: m.NavigationSetup }))
|
|
349
345
|
),
|
|
350
|
-
nextjs: lazy(() => import('./navigation-
|
|
346
|
+
nextjs: lazy(() => import('./navigation-KPN6OPJN.js').then((m) => ({ default: m.NavigationSetup })))
|
|
351
347
|
};
|
|
352
348
|
var routeDocumentSyncs = {
|
|
353
349
|
tanstack: lazy(
|
|
354
|
-
() => import('./document-class-
|
|
350
|
+
() => import('./document-class-WRE36CKT.js').then((m) => ({
|
|
355
351
|
default: m.TanStackDocumentSync
|
|
356
352
|
}))
|
|
357
353
|
)
|
|
@@ -873,7 +869,7 @@ var LazySiftSnippet = lazy(
|
|
|
873
869
|
() => import('./SiftSnippet-5FCU6TR6.js').then((m) => ({ default: m.SiftSnippet }))
|
|
874
870
|
);
|
|
875
871
|
var LazyStoreClosedNotification = lazy(
|
|
876
|
-
() => import('./StoreClosedNotification-
|
|
872
|
+
() => import('./StoreClosedNotification-C6EZSOQF.js').then((m) => ({
|
|
877
873
|
default: m.StoreClosedNotification
|
|
878
874
|
}))
|
|
879
875
|
);
|
|
@@ -1117,7 +1113,7 @@ function SallaSdkScripts({ settings }) {
|
|
|
1117
1113
|
] });
|
|
1118
1114
|
}
|
|
1119
1115
|
var LazyStoreClosedNotification2 = lazy(
|
|
1120
|
-
() => import('./StoreClosedNotification-
|
|
1116
|
+
() => import('./StoreClosedNotification-C6EZSOQF.js').then((m) => ({
|
|
1121
1117
|
default: m.StoreClosedNotification
|
|
1122
1118
|
}))
|
|
1123
1119
|
);
|
|
@@ -1166,6 +1162,26 @@ function MaintenanceDevBar() {
|
|
|
1166
1162
|
)
|
|
1167
1163
|
] });
|
|
1168
1164
|
}
|
|
1165
|
+
var LazyLiveEditorBar = lazy(
|
|
1166
|
+
() => import('./LiveEditorBar-6SKEWJOX.js').then((m) => ({ default: m.LiveEditorBar }))
|
|
1167
|
+
);
|
|
1168
|
+
function LiveEditor() {
|
|
1169
|
+
const [origin, setOrigin] = useState(null);
|
|
1170
|
+
useEffect(() => {
|
|
1171
|
+
const found = editorOrigin();
|
|
1172
|
+
if (!found) return;
|
|
1173
|
+
setOrigin(found);
|
|
1174
|
+
const announce = () => postToEditor(found, FRAME_LOADED_ACTION);
|
|
1175
|
+
if (document.readyState === "complete") {
|
|
1176
|
+
announce();
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
window.addEventListener("load", announce, { once: true });
|
|
1180
|
+
return () => window.removeEventListener("load", announce);
|
|
1181
|
+
}, []);
|
|
1182
|
+
if (!origin) return null;
|
|
1183
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyLiveEditorBar, { origin }) });
|
|
1184
|
+
}
|
|
1169
1185
|
var getSalla2 = () => typeof window !== "undefined" ? window.salla : void 0;
|
|
1170
1186
|
var TWILIGHT_LOG_STYLES = {
|
|
1171
1187
|
header: "background: linear-gradient(90deg, #7c3aed, #6366f1); color: white; padding: 4px 8px; border-radius: 4px; font-weight: bold;",
|
|
@@ -1400,7 +1416,8 @@ function TwilightProvider({
|
|
|
1400
1416
|
inner,
|
|
1401
1417
|
/* @__PURE__ */ jsx(SallaSdkScripts, { settings: initialData }),
|
|
1402
1418
|
/* @__PURE__ */ jsx(AppsSnippets, {}),
|
|
1403
|
-
/* @__PURE__ */ jsx(HookSlot, { name: "body:end" /* BODY_END */ })
|
|
1419
|
+
/* @__PURE__ */ jsx(HookSlot, { name: "body:end" /* BODY_END */ }),
|
|
1420
|
+
/* @__PURE__ */ jsx(LiveEditor, {})
|
|
1404
1421
|
] });
|
|
1405
1422
|
if (readyShell.LazyNavSetup) {
|
|
1406
1423
|
return React2.createElement(readyShell.LazyNavSetup, null, wrapped);
|
|
@@ -1441,5 +1458,5 @@ function useStore() {
|
|
|
1441
1458
|
}
|
|
1442
1459
|
|
|
1443
1460
|
export { LazyMaintenancePage, LazyStoreClosedNotification2 as LazyStoreClosedNotification, MasterLayout, TwilightProvider, fastCheckoutScript, registerDefaultHooks, registerDocumentSync, routeDocumentSyncs, useBreadcrumbs, useDate, useGtm, useMoney, useNumber, useOpeningHours, usePageConfig, useStore };
|
|
1444
|
-
//# sourceMappingURL=chunk-
|
|
1445
|
-
//# sourceMappingURL=chunk-
|
|
1461
|
+
//# sourceMappingURL=chunk-QTRV6N64.js.map
|
|
1462
|
+
//# sourceMappingURL=chunk-QTRV6N64.js.map
|