@salla.sa/twilight-theme-engine 1.0.117 → 1.0.119
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-OHUF5AB7.js → AddToCartForm-2E25Z3JH.js} +3 -3
- package/dist/{AddToCartForm-OHUF5AB7.js.map → AddToCartForm-2E25Z3JH.js.map} +1 -1
- package/dist/{BlogAuthorPage-4FEUVAUM.js → BlogAuthorPage-DIQMXVKT.js} +11 -11
- package/dist/{BlogAuthorPage-4FEUVAUM.js.map → BlogAuthorPage-DIQMXVKT.js.map} +1 -1
- package/dist/{BlogCategoryPage-GCDDD4TO.js → BlogCategoryPage-CIEC3I3C.js} +11 -11
- package/dist/{BlogCategoryPage-GCDDD4TO.js.map → BlogCategoryPage-CIEC3I3C.js.map} +1 -1
- package/dist/{BlogPage-AHBBXOTS.js → BlogPage-SRBQBKLP.js} +9 -9
- package/dist/{BlogPage-AHBBXOTS.js.map → BlogPage-SRBQBKLP.js.map} +1 -1
- package/dist/{BlogSinglePage-GQPO24UA.js → BlogSinglePage-5BD3OVXK.js} +9 -9
- package/dist/{BlogSinglePage-GQPO24UA.js.map → BlogSinglePage-5BD3OVXK.js.map} +1 -1
- package/dist/{BlogTagPage-MZIA7SRR.js → BlogTagPage-ZCDTNTKI.js} +11 -11
- package/dist/{BlogTagPage-MZIA7SRR.js.map → BlogTagPage-ZCDTNTKI.js.map} +1 -1
- package/dist/{BrandsPage-5DWAMTNA.js → BrandsPage-XHWYHEQS.js} +10 -10
- package/dist/{BrandsPage-5DWAMTNA.js.map → BrandsPage-XHWYHEQS.js.map} +1 -1
- package/dist/{Breadcrumb-6FJS2523.js → Breadcrumb-OODSTILO.js} +9 -9
- package/dist/{Breadcrumb-6FJS2523.js.map → Breadcrumb-OODSTILO.js.map} +1 -1
- package/dist/{CartItem-YL3HRWEN.js → CartItem-N7PX7K6E.js} +9 -9
- package/dist/{CartItem-YL3HRWEN.js.map → CartItem-N7PX7K6E.js.map} +1 -1
- package/dist/{CartSummary-KAFG7UAC.js → CartSummary-FVM26G2M.js} +9 -9
- package/dist/{CartSummary-KAFG7UAC.js.map → CartSummary-FVM26G2M.js.map} +1 -1
- package/dist/{Copyright-BPWB33YX.js → Copyright-JCBJN5YN.js} +3 -3
- package/dist/{Copyright-BPWB33YX.js.map → Copyright-JCBJN5YN.js.map} +1 -1
- package/dist/{CustomerLayout-OH3U7D5I.js → CustomerLayout-B3W377Y4.js} +9 -9
- package/dist/{CustomerLayout-OH3U7D5I.js.map → CustomerLayout-B3W377Y4.js.map} +1 -1
- package/dist/{Footer-M7KCCGJG.js → Footer-JYJDPUSD.js} +4 -4
- package/dist/{Footer-M7KCCGJG.js.map → Footer-JYJDPUSD.js.map} +1 -1
- package/dist/{Header-WU6S6SNO.js → Header-DETRFG6N.js} +5 -5
- package/dist/{Header-WU6S6SNO.js.map → Header-DETRFG6N.js.map} +1 -1
- package/dist/{LoyaltyPage-PYTL63HY.js → LoyaltyPage-UBYNGW6Z.js} +9 -9
- package/dist/{LoyaltyPage-PYTL63HY.js.map → LoyaltyPage-UBYNGW6Z.js.map} +1 -1
- package/dist/{LoyaltyPointsPage-KUK3BP7H.js → LoyaltyPointsPage-OMCCDBLI.js} +3 -3
- package/dist/{LoyaltyPointsPage-KUK3BP7H.js.map → LoyaltyPointsPage-OMCCDBLI.js.map} +1 -1
- package/dist/{MainMenu-VEUDAJ25.js → MainMenu-BNVH3EVF.js} +3 -3
- package/dist/{MainMenu-VEUDAJ25.js.map → MainMenu-BNVH3EVF.js.map} +1 -1
- package/dist/{MasterLayout-Y5YVZTHN.js → MasterLayout-OLB2JUUR.js} +9 -9
- package/dist/{MasterLayout-Y5YVZTHN.js.map → MasterLayout-OLB2JUUR.js.map} +1 -1
- package/dist/{MobileMenu-5U3TIT2I.js → MobileMenu-2EAPAHX5.js} +9 -9
- package/dist/{MobileMenu-5U3TIT2I.js.map → MobileMenu-2EAPAHX5.js.map} +1 -1
- package/dist/{NotificationsPage-477VJ6XE.js → NotificationsPage-PIQJTEHJ.js} +9 -9
- package/dist/{NotificationsPage-477VJ6XE.js.map → NotificationsPage-PIQJTEHJ.js.map} +1 -1
- package/dist/{OrderSinglePage-ZZIGWYQV.js → OrderSinglePage-YPNO5B3Z.js} +10 -10
- package/dist/{OrderSinglePage-ZZIGWYQV.js.map → OrderSinglePage-YPNO5B3Z.js.map} +1 -1
- package/dist/{OrdersPage-K7T6ZNJ6.js → OrdersPage-FYL73WZO.js} +9 -9
- package/dist/{OrdersPage-K7T6ZNJ6.js.map → OrdersPage-FYL73WZO.js.map} +1 -1
- package/dist/{PageSingle-DMXT57VC.js → PageSingle-3VAW7S6B.js} +3 -3
- package/dist/{PageSingle-DMXT57VC.js.map → PageSingle-3VAW7S6B.js.map} +1 -1
- package/dist/{ProductDetails-UISP7TFH.js → ProductDetails-UJ4MKTFM.js} +3 -3
- package/dist/{ProductDetails-UISP7TFH.js.map → ProductDetails-UJ4MKTFM.js.map} +1 -1
- package/dist/{ProfilePage-RALWGI2P.js → ProfilePage-5NZVZU2S.js} +9 -9
- package/dist/{ProfilePage-RALWGI2P.js.map → ProfilePage-5NZVZU2S.js.map} +1 -1
- package/dist/{ReviewsPage-MJXZKKLC.js → ReviewsPage-SYD5UUVN.js} +3 -3
- package/dist/{ReviewsPage-MJXZKKLC.js.map → ReviewsPage-SYD5UUVN.js.map} +1 -1
- package/dist/{SeoCartWidget-VJRASYIL.js → SeoCartWidget-R45K7M4U.js} +9 -9
- package/dist/{SeoCartWidget-VJRASYIL.js.map → SeoCartWidget-R45K7M4U.js.map} +1 -1
- package/dist/{SettingsPage-EIYGSJY7.js → SettingsPage-DWTUF5TO.js} +9 -9
- package/dist/{SettingsPage-EIYGSJY7.js.map → SettingsPage-DWTUF5TO.js.map} +1 -1
- package/dist/{StoreClosedNotification-EY4UMR7F.js → StoreClosedNotification-2NARK6HJ.js} +10 -10
- package/dist/{StoreClosedNotification-EY4UMR7F.js.map → StoreClosedNotification-2NARK6HJ.js.map} +1 -1
- package/dist/{TestimonialsPage-NBQQPUZB.js → TestimonialsPage-QAOBCMAV.js} +3 -3
- package/dist/{TestimonialsPage-NBQQPUZB.js.map → TestimonialsPage-QAOBCMAV.js.map} +1 -1
- package/dist/{ThankYouPage-4FEFUSEE.js → ThankYouPage-GBAAHFWB.js} +9 -9
- package/dist/{ThankYouPage-4FEFUSEE.js.map → ThankYouPage-GBAAHFWB.js.map} +1 -1
- package/dist/{WalletPage-LWKISA73.js → WalletPage-QWJM6DTB.js} +9 -9
- package/dist/{WalletPage-LWKISA73.js.map → WalletPage-QWJM6DTB.js.map} +1 -1
- package/dist/{WishlistPage-N3VX6JZV.js → WishlistPage-PCQR3DEF.js} +11 -11
- package/dist/{WishlistPage-N3VX6JZV.js.map → WishlistPage-PCQR3DEF.js.map} +1 -1
- package/dist/api/blog.js +2 -2
- package/dist/api/brands.js +2 -2
- package/dist/api/cart.js +2 -2
- package/dist/api/category.js +2 -2
- package/dist/api/loyalty.js +2 -2
- package/dist/api/order.js +2 -2
- package/dist/api/page.js +2 -2
- package/dist/api/product.js +2 -2
- package/dist/api/store.d.ts +15 -0
- package/dist/api/store.d.ts.map +1 -1
- package/dist/api/store.js +1 -1
- package/dist/api/wishlist.js +3 -3
- package/dist/{chunk-CF2XUAAK.js → chunk-3LJF7ECP.js} +4 -4
- package/dist/{chunk-CF2XUAAK.js.map → chunk-3LJF7ECP.js.map} +1 -1
- package/dist/{chunk-KPTVSC46.js → chunk-3WGZZD2Y.js} +3 -3
- package/dist/{chunk-KPTVSC46.js.map → chunk-3WGZZD2Y.js.map} +1 -1
- package/dist/{chunk-P5NIICFT.js → chunk-4EATTQQA.js} +3 -3
- package/dist/{chunk-P5NIICFT.js.map → chunk-4EATTQQA.js.map} +1 -1
- package/dist/{chunk-45YF2KXD.js → chunk-7K3AK6IC.js} +4 -4
- package/dist/{chunk-45YF2KXD.js.map → chunk-7K3AK6IC.js.map} +1 -1
- package/dist/{chunk-O4UUZ254.js → chunk-AVW4CLTB.js} +3 -3
- package/dist/{chunk-O4UUZ254.js.map → chunk-AVW4CLTB.js.map} +1 -1
- package/dist/{chunk-JM6SMCEK.js → chunk-B6JTC5R6.js} +3 -3
- package/dist/{chunk-JM6SMCEK.js.map → chunk-B6JTC5R6.js.map} +1 -1
- package/dist/{chunk-MMKLT4YU.js → chunk-CKMLOJGM.js} +5 -5
- package/dist/{chunk-MMKLT4YU.js.map → chunk-CKMLOJGM.js.map} +1 -1
- package/dist/{chunk-ZQMLBSSL.js → chunk-CTNSIK3V.js} +6 -6
- package/dist/{chunk-ZQMLBSSL.js.map → chunk-CTNSIK3V.js.map} +1 -1
- package/dist/{chunk-EJB6NN3F.js → chunk-D2RUSG36.js} +3 -3
- package/dist/{chunk-EJB6NN3F.js.map → chunk-D2RUSG36.js.map} +1 -1
- package/dist/{chunk-TDOVEDHH.js → chunk-D6XHL6VQ.js} +69 -46
- package/dist/chunk-D6XHL6VQ.js.map +1 -0
- package/dist/{chunk-DVOPY7MI.js → chunk-EQ7I4AFL.js} +4 -4
- package/dist/{chunk-DVOPY7MI.js.map → chunk-EQ7I4AFL.js.map} +1 -1
- package/dist/{chunk-S7P72JBV.js → chunk-GEGB34LB.js} +3 -3
- package/dist/{chunk-S7P72JBV.js.map → chunk-GEGB34LB.js.map} +1 -1
- package/dist/{chunk-WJ7IGOIK.js → chunk-I46KQSZH.js} +6 -6
- package/dist/{chunk-WJ7IGOIK.js.map → chunk-I46KQSZH.js.map} +1 -1
- package/dist/{chunk-LPCNDH4F.js → chunk-IRQJBRKV.js} +23 -5
- package/dist/chunk-IRQJBRKV.js.map +1 -0
- package/dist/{chunk-XKP5LIEJ.js → chunk-JHTTTXTI.js} +3 -3
- package/dist/{chunk-XKP5LIEJ.js.map → chunk-JHTTTXTI.js.map} +1 -1
- package/dist/{chunk-KZFIA76B.js → chunk-ME4UKH7Y.js} +3 -3
- package/dist/{chunk-KZFIA76B.js.map → chunk-ME4UKH7Y.js.map} +1 -1
- package/dist/{chunk-SC2X42RE.js → chunk-MQALPNFL.js} +3 -3
- package/dist/{chunk-SC2X42RE.js.map → chunk-MQALPNFL.js.map} +1 -1
- package/dist/{chunk-IRGT53OJ.js → chunk-NU2LPGNB.js} +3 -3
- package/dist/{chunk-IRGT53OJ.js.map → chunk-NU2LPGNB.js.map} +1 -1
- package/dist/{chunk-MJ6J3HUJ.js → chunk-PRA6E6SQ.js} +3 -3
- package/dist/{chunk-MJ6J3HUJ.js.map → chunk-PRA6E6SQ.js.map} +1 -1
- package/dist/{chunk-WJZXENPN.js → chunk-QWGSGNM7.js} +6 -6
- package/dist/{chunk-WJZXENPN.js.map → chunk-QWGSGNM7.js.map} +1 -1
- package/dist/{chunk-ZAPRXUPS.js → chunk-R5TTR2G7.js} +13 -13
- package/dist/{chunk-ZAPRXUPS.js.map → chunk-R5TTR2G7.js.map} +1 -1
- package/dist/{chunk-RUDUXB55.js → chunk-S4VVTUCI.js} +7 -7
- package/dist/{chunk-RUDUXB55.js.map → chunk-S4VVTUCI.js.map} +1 -1
- package/dist/{chunk-L5BP6ARL.js → chunk-T23HXVW5.js} +12 -5
- package/dist/chunk-T23HXVW5.js.map +1 -0
- package/dist/chunk-UI625G7U.js +14 -0
- package/dist/{chunk-MJ7FQJDF.js.map → chunk-UI625G7U.js.map} +1 -1
- package/dist/{chunk-MTDXG2GS.js → chunk-VXSBJZ3E.js} +3 -3
- package/dist/{chunk-MTDXG2GS.js.map → chunk-VXSBJZ3E.js.map} +1 -1
- package/dist/{chunk-E7MENFQB.js → chunk-XM22O2B2.js} +3 -3
- package/dist/{chunk-E7MENFQB.js.map → chunk-XM22O2B2.js.map} +1 -1
- package/dist/{chunk-FYJPK6XU.js → chunk-XMFVSBEO.js} +3 -3
- package/dist/{chunk-FYJPK6XU.js.map → chunk-XMFVSBEO.js.map} +1 -1
- package/dist/{chunk-NKSXBOIB.js → chunk-Y36VLQGV.js} +34 -9
- package/dist/chunk-Y36VLQGV.js.map +1 -0
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/drawer/index.js +7 -7
- package/dist/components/home/index.js +10 -10
- package/dist/components/layout/index.js +1 -1
- package/dist/components/product/index.js +8 -8
- package/dist/components/store/index.js +8 -8
- package/dist/dev/editor/index.js +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/{document-class-K5VLY3NR.js → document-class-TSDZIVXW.js} +7 -7
- package/dist/{document-class-K5VLY3NR.js.map → document-class-TSDZIVXW.js.map} +1 -1
- package/dist/hooks/index.js +7 -7
- package/dist/hooks/useGtm.js +7 -7
- package/dist/hooks/useMoney.js +7 -7
- package/dist/hooks/useStore.js +7 -7
- package/dist/index.js +7 -7
- package/dist/{navigation-JHGESS7X.js → navigation-2V7R2ANX.js} +4 -4
- package/dist/{navigation-JHGESS7X.js.map → navigation-2V7R2ANX.js.map} +1 -1
- package/dist/{navigation-QLPZ2GEV.js → navigation-LRBZCNKS.js} +3 -3
- package/dist/{navigation-QLPZ2GEV.js.map → navigation-LRBZCNKS.js.map} +1 -1
- package/dist/{not-found-IETXWT4W.js → not-found-5DFPFQ4B.js} +10 -10
- package/dist/{not-found-IETXWT4W.js.map → not-found-5DFPFQ4B.js.map} +1 -1
- package/dist/providers/NavigationProvider.d.ts +4 -0
- package/dist/providers/NavigationProvider.d.ts.map +1 -1
- package/dist/providers/index.js +7 -7
- package/dist/routes/account/orders.js +3 -3
- package/dist/routes/account.js +10 -10
- package/dist/routes/blog.js +7 -7
- package/dist/routes/brands.js +3 -3
- package/dist/routes/cart.js +14 -14
- package/dist/routes/home.js +11 -11
- package/dist/routes/index.js +2 -2
- package/dist/routes/loyalty.js +4 -4
- package/dist/routes/page.js +3 -3
- package/dist/routes/product-listing.js +12 -12
- package/dist/routes/product.js +10 -10
- package/dist/routes/seo-redirects.js +2 -2
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +3 -3
- package/dist/skeleton.js +11 -11
- package/dist/{store-lookup-TGNDK2KQ.js → store-lookup-YUA66JS6.js} +7 -7
- package/dist/{store-lookup-TGNDK2KQ.js.map → store-lookup-YUA66JS6.js.map} +1 -1
- package/dist/tanstack/middleware/twilight.d.ts.map +1 -1
- package/dist/tanstack/router.d.ts +17 -0
- package/dist/tanstack/router.d.ts.map +1 -1
- package/dist/tanstack.js +24 -7
- package/dist/tanstack.js.map +1 -1
- package/dist/utils/maintenance.d.ts +17 -0
- package/dist/utils/maintenance.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-L5BP6ARL.js.map +0 -1
- package/dist/chunk-LPCNDH4F.js.map +0 -1
- package/dist/chunk-MJ7FQJDF.js +0 -14
- package/dist/chunk-NKSXBOIB.js.map +0 -1
- package/dist/chunk-TDOVEDHH.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/routes/root/head.ts","../src/utils/maintenance.ts"],"names":[],"mappings":";;;;;;;;;AAeA,IAAM,mBAAA,GAAsB,sEAAA;AAC5B,IAAM,WAAA,GAAc,OAAA;AACpB,IAAM,YAAA,GAAe,+CAA+C,WAAW,CAAA,CAAA;AAG/E,IAAM,WAAA,GAAsC;AAAA,EAC1C,GAAA,EAAK,GAAG,YAAY,CAAA,OAAA,CAAA;AAAA,EACpB,MAAA,EAAQ,GAAG,YAAY,CAAA,CAAA,CAAA;AAAA,EACvB,UAAA,EAAY,GAAG,YAAY,CAAA,qBAAA,CAAA;AAAA,EAC3B,WAAA,EAAa,GAAG,YAAY,CAAA,UAAA,CAAA;AAAA,EAC5B,aAAA,EAAe,GAAG,YAAY,CAAA,2BAAA,CAAA;AAAA,EAC9B,cAAA,EAAgB,GAAG,YAAY,CAAA,aAAA,CAAA;AAAA,EAC/B,uBAAA,EAAyB,GAAG,YAAY,CAAA,qCAAA,CAAA;AAAA,EACxC,wBAAA,EAA0B,GAAG,YAAY,CAAA,kBAAA;AAC3C,CAAA;AAEO,IAAM,oBAAA,GACX;AAEF,IAAM,oBAAA,GAAuB,uCAAA;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,IAAQ,CAAC,WAAA,IAAe,QAAA,CAAS,OAAO,IAAA,KAAS,SAAA;AACpF;AAKA,IAAM,aAAA,GAAgB,oBAAA;AAGf,IAAM,wBAAA,GAA2B,GAAG,aAAa,CAAA,2CAAA,CAAA;AAUjD,SAAS,0BAAA,CAEd,UAAa,WAAA,EAAwB;AACrC,EAAA,MAAM,UAAU,QAAA,CAAS,mBAAA;AACzB,EAAA,IAAI,QAAA,CAAS,WAAA,KAAgB,IAAA,IAAQ,OAAA,EAAS,cAAc,OAAO,QAAA;AACnE,EAAA,OAAO;AAAA,IACL,GAAG,QAAA;AAAA,IACH,mBAAA,EAAqB;AAAA,MACnB,GAAG,OAAA;AAAA,MACH,YAAA,EAAc,WAAA;AAAA,MACd,iBAAA,EAAmB,WAAA;AAAA,MACnB,UAAA,EAAY;AAAA;AACd,GACF;AACF","file":"chunk-TDOVEDHH.js","sourcesContent":["import type { HeadDescriptor, HeadResult } from '../../utils/head';\nimport { mergeHead, resolveHead } from '../../utils/head';\nimport { buildBaseHead } from '../../utils/baseHead';\nimport { FALLBACK_LOCALE } from '../../providers/locale-constants';\nimport { getTwilightContext } from '../../twilight/context';\nimport type { TwilightContextMatch } from '../../twilight/ensure-context';\nimport { ensureTwilightContextFromMatches } from '../../twilight/ensure-context';\nimport type { StoreContext } from '../../api/store';\nimport type { AppSnippet } from '../../api/apps';\nimport { SettingsError } from '../../utils/errors';\nimport { renderAppScopeInstallScript } from '../../utils/app-scope';\nimport { renderThemeHookSlotsScript } from '../../utils/theme-hook-slots';\nimport { escapeForInlineScript } from '../../utils/inline-script';\nimport { readEnv, renderRuntimeEnvScript } from '../../utils/runtime-env';\n\nconst SALLA_ICONS_CSS_URL = 'https://cdn.assets.salla.network/static/fonts/sallaicons.css?v=2.0.5';\nconst LIT_VERSION = '3.3.3';\nconst LIT_CDN_BASE = `https://cdn.assets.salla.network/static/lit/${LIT_VERSION}`;\n\n/** Bare-specifier map for the lit build the engine's `<salla-*>` web components resolve against. */\nconst LIT_IMPORTS: Record<string, string> = {\n lit: `${LIT_CDN_BASE}/lit.js`,\n 'lit/': `${LIT_CDN_BASE}/`,\n 'lit-html': `${LIT_CDN_BASE}/lit-html/lit-html.js`,\n 'lit-html/': `${LIT_CDN_BASE}/lit-html/`,\n 'lit-element': `${LIT_CDN_BASE}/lit-element/lit-element.js`,\n 'lit-element/': `${LIT_CDN_BASE}/lit-element/`,\n '@lit/reactive-element': `${LIT_CDN_BASE}/reactive-element/reactive-element.js`,\n '@lit/reactive-element/': `${LIT_CDN_BASE}/reactive-element/`,\n};\n\nexport const TICKETING_SCRIPT_URL =\n 'https://cdn.assets.salla.network/latest/@salla.sa/ui-store-ticketing-system/ticketing-system.es.js';\n\nconst TWILIGHT_RELEASE_CDN = 'https://cdn.salla.network/js/twilight';\nconst TWILIGHT_DEV_CDN = 'https://cdn.assets.salla.network/dev/@salla.sa/twilight';\n// The oldest Twilight release this engine works with. Raise it whenever the engine\n// starts relying on something newer; the reason lives in that commit. Today's floor:\n// components ship their own CSS, which themes no longer compile (SallaApp/twilight#2107).\nconst MIN_TWILIGHT_VERSION = '2.14.538';\n// Last resort when no override and no platform pin, and the substitute for a pin below the floor.\nconst DEFAULT_TWILIGHT_VERSION = '2.14.584';\nconst releaseUrl = (version: string): string =>\n `${TWILIGHT_RELEASE_CDN}/${version}/twilight.esm.js`;\n// The head is built more than once per request (early hints, then the page); say it once.\nconst warnedPins = new Set<string>();\n\n/** `x.y.z` release pins only; dev shas and other strings are loaded as given. */\nfunction belowMinimum(version: string): boolean {\n return (\n /^\\d+\\.\\d+\\.\\d+$/.test(version) &&\n version.localeCompare(MIN_TWILIGHT_VERSION, undefined, { numeric: true }) < 0\n );\n}\n\n/** The `x.y.z` release segment of a release-CDN `.../twilight.esm.js` URL, if present. */\nfunction releaseVersionInUrl(url: string): string | null {\n const match = url.match(/\\/(\\d+\\.\\d+\\.\\d+)\\/twilight\\.esm\\.js(?:[?#]|$)/);\n return match ? match[1] : null;\n}\n\n/**\n * `VITE_TWILIGHT_URL`/`VITE_TWILIGHT_VERSION` outrank everything below, including\n * `theme.twilight.version`'s own `belowMinimum` guard — a stale override wins\n * silently otherwise (TD-16375: a scaffold-time pin outlived the engine raising\n * MIN_TWILIGHT_VERSION, so every new theme rendered without component CSS and\n * nothing said why). Only a dev-mode nudge, not a swap: an env override is a\n * deliberate choice, so unlike the settings-pin path below this never substitutes\n * the engine default underneath the developer.\n */\nfunction warnIfOverrideBelowMinimum(source: string, version: string): void {\n // Worker logs in production should stay quiet -- this is a developer-directed nudge,\n // not a user-facing or production-monitored signal. import.meta.env.DEV is a static\n // false in production builds, so this branch (and the console.warn below) is\n // tree-shaken out entirely, same as DevSettingsWidget / dev-settings-store.ts.\n if (!import.meta.env.DEV) return;\n if (!belowMinimum(version)) return;\n const key = `${source}:${version}`;\n if (warnedPins.has(key)) return;\n warnedPins.add(key);\n console.warn(\n `[twilight] ${source}=${version} is below the engine minimum ${MIN_TWILIGHT_VERSION} — components may load without their CSS (SallaApp/twilight#2107). Unset it or bump it to ${MIN_TWILIGHT_VERSION}+.`\n );\n}\n\n/**\n * Which twilight.esm.js the storefront loads, in priority order:\n * 1. `VITE_TWILIGHT_URL` — full local/deployment override.\n * 2. `VITE_TWILIGHT_VERSION` — dev-CDN build override.\n * 3. `theme.twilight.version` from the settings endpoint — the platform-pinned\n * release used when no environment override is configured.\n * 4. The engine's default release, also used when the pin is below the engine minimum.\n */\nexport function resolveTwilightSdkUrl(settings?: StoreContext): string {\n const urlOverride = readEnv('VITE_TWILIGHT_URL');\n if (urlOverride) {\n const version = releaseVersionInUrl(urlOverride);\n if (version) warnIfOverrideBelowMinimum('VITE_TWILIGHT_URL', version);\n return urlOverride;\n }\n\n const versionOverride = readEnv('VITE_TWILIGHT_VERSION');\n if (versionOverride) {\n warnIfOverrideBelowMinimum('VITE_TWILIGHT_VERSION', versionOverride);\n return `${TWILIGHT_DEV_CDN}/${versionOverride}/twilight.esm.js`;\n }\n\n const pinnedVersion = settings?.theme?.twilight?.version;\n if (pinnedVersion && belowMinimum(pinnedVersion)) {\n if (!warnedPins.has(pinnedVersion)) {\n warnedPins.add(pinnedVersion);\n console.warn(\n `[twilight] theme.twilight.version ${pinnedVersion} is below the engine minimum ${MIN_TWILIGHT_VERSION}; loading ${DEFAULT_TWILIGHT_VERSION} instead`\n );\n }\n return releaseUrl(DEFAULT_TWILIGHT_VERSION);\n }\n if (pinnedVersion) return releaseUrl(pinnedVersion);\n\n return releaseUrl(DEFAULT_TWILIGHT_VERSION);\n}\n\n// On a page that preloads its LCP image, the icon font (~270 KB) applies once the first screen's\n// priority images have painted, so it doesn't compete with them; other pages swap on load.\nconst MEDIA_SWAP_SCRIPT = `\n(function(){var d=document,s=function(l){if(l.sheet||\"all\"===l.media)l.media=\"all\";else l.onload=function(){this.media=\"all\"}},f=d.getElementById(\"salla-theme-font\"),i=d.getElementById(\"salla-icons-css\");f&&s(f);if(!i)return;if(!d.querySelector('link[rel=\"preload\"][as=\"image\"]'))return s(i);var g=function(){g=function(){};s(i)},p=function(){requestAnimationFrame(function(){setTimeout(function(){g()})});setTimeout(function(){g()},100)};d.addEventListener(\"DOMContentLoaded\",function(){var m=[].filter.call(d.querySelectorAll('img[fetchpriority=\"high\"]'),function(x){return!x.complete}),n=m.length;if(!n)return p();m.forEach(function(x){var o=function(){--n||p()};x.addEventListener(\"load\",o,{once:!0});x.addEventListener(\"error\",o,{once:!0})});setTimeout(function(){g()},2500)})})();\n`.trim();\n\nconst LOADING_CSS = `\n.loading-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#fff;z-index:9999}\n.loading-spinner{animation:spin 1s linear infinite;border-radius:9999px;height:3rem;width:3rem;border-bottom:2px solid var(--color-primary,#000)}\n@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}\nhtml,body{margin:0;padding:0;height:100%}\n`.trim();\n\nconst SALLA_INIT_SCRIPT = `\nwindow.salla = window.Salla = window.Salla || window.salla || {};\nwindow.Salla.onReady = window.Salla.onReady || function(callback) {\n return new Promise(function(resolve) {\n if (window.Salla.status === 'ready') {\n var config = window.salla && window.salla.config && window.salla.config.all();\n resolve(callback ? callback(config) : config);\n } else {\n window.addEventListener('twilight::initiated', function(event) {\n resolve(callback ? callback(event.detail) : event.detail);\n }, { once: true });\n }\n });\n};\n`.trim();\n\n/**\n * Distinct snippet-host origins to `preconnect` (warm DNS/TCP/TLS during parse). From the real\n * URLs (dev/prod-correct), deduped and capped at 4. No `crossOrigin`: snippets are no-cors fetches.\n */\nexport function snippetPreconnectOrigins(snippets: readonly AppSnippet[] | undefined): string[] {\n if (!snippets?.length) return [];\n const origins = new Set<string>();\n for (const app of snippets) {\n if (app.status !== 'enabled') continue;\n for (const s of app.snippets) {\n if (!s.url) continue;\n try {\n origins.add(new URL(s.url).origin);\n } catch {\n /* skip a malformed snippet url rather than breaking the head */\n }\n if (origins.size >= 4) return [...origins];\n }\n }\n return [...origins];\n}\n\nexport function rootHead(ctx: {\n params: Record<string, string>;\n matches?: readonly TwilightContextMatch[];\n}): HeadResult {\n // Re-run on the client during hydration, where the twilight module store may\n // still be empty. Recover it from the resolved match context so the head is\n // built from real settings instead of falling through to 'Store Unavailable'.\n ensureTwilightContextFromMatches(ctx.matches);\n\n let settings: StoreContext | undefined;\n try {\n settings = getTwilightContext().settings;\n } catch (e) {\n if (e instanceof SettingsError) {\n return resolveHead({\n title: 'Store Unavailable',\n });\n }\n throw e;\n }\n const locale = ctx.params.locale || FALLBACK_LOCALE;\n const parts = deriveHeadParts(settings);\n\n return resolveHead(\n mergeHead(buildBaseHead(settings, locale), {\n meta: buildRootMeta(parts),\n links: buildRootLinks(parts),\n styles: buildRootStyles(parts),\n importMap: [{ imports: LIT_IMPORTS }],\n scripts: buildRootScripts(parts),\n })\n );\n}\n\n/** Everything the root head's tag builders read, derived once from the store settings. */\ninterface RootHeadParts {\n store: StoreContext['store'] | undefined;\n favicon?: string;\n primaryColor?: string;\n fontUrl?: string;\n fontUrlWithDisplay?: string;\n isGoogleFont?: boolean;\n fontFamilyName?: string;\n customJs?: string;\n customCss?: string;\n isCustomCssUrl?: boolean;\n isCustomJsUrl?: boolean;\n twilightSdkUrl: string;\n /** The visitor gets the maintenance page, which loads no SDK and no app snippets. */\n maintenance: boolean;\n snippetPreconnects: Array<{ rel: 'preconnect'; href: string }>;\n appScopeInstallScript: string;\n themeHookSlotsScript: string | null;\n runtimeEnvScript: string | null;\n}\n\n/** Google Fonts only honours `display=swap` as a query param; other hosts get the @font-face\n * override instead (see buildRootStyles). */\nfunction deriveFontParts(theme?: StoreContext['theme']) {\n const font = theme?.font;\n const fontUrl = font?.url || font?.path;\n const isGoogleFont = fontUrl?.includes('fonts.googleapis.com');\n const needsDisplay = Boolean(isGoogleFont && fontUrl && !fontUrl.includes('display='));\n const separator = fontUrl?.includes('?') ? '&' : '?';\n\n return {\n fontUrl,\n isGoogleFont,\n fontFamilyName: font?.family_name,\n fontUrlWithDisplay: needsDisplay ? `${fontUrl}${separator}display=swap` : fontUrl,\n };\n}\n\n/** Theme customization JS/CSS, each either a URL to load or an inline blob to embed. */\nfunction deriveCustomizationParts(theme?: StoreContext['theme']) {\n const customization = theme?.customization;\n const customJs = customization?.js?.trim();\n const customCss = customization?.css?.trim();\n const isUrl = (value?: string): boolean =>\n Boolean(value?.startsWith('http') || value?.startsWith('//'));\n\n return {\n customJs,\n customCss,\n isCustomCssUrl: isUrl(customCss),\n isCustomJsUrl: isUrl(customJs),\n };\n}\n\nfunction deriveHeadParts(settings?: StoreContext): RootHeadParts {\n const store = settings?.store;\n\n return {\n store,\n favicon: store?.icon,\n primaryColor: settings?.theme?.color?.primary,\n ...deriveFontParts(settings?.theme),\n ...deriveCustomizationParts(settings?.theme),\n twilightSdkUrl: resolveTwilightSdkUrl(settings),\n maintenance: getTwilightContext().maintenance,\n // Warm the connection to the snippet host(s) during head parse, so the body's deferred\n // `<script src>` snippet tags fetch off an already-open socket instead of DNS+TCP+TLS.\n snippetPreconnects: snippetPreconnectOrigins(getTwilightContext().appsSnippets).map((href) => ({\n rel: 'preconnect' as const,\n href,\n })),\n // Install `Salla.appScope` inline at parse time, before the SDK is ready — else a snippet's\n // onReady callback calls it too early and throws. Always emitted, even when the settings\n // prefetch failed: the CDN snippet tags ship regardless (they come from the *snippets*\n // endpoint), so the factory has to exist for them. `installAppScope` then seeds the real\n // buckets into this install once the client query resolves.\n appScopeInstallScript: renderAppScopeInstallScript(\n getTwilightContext().appsSettings ?? { apps: {} }\n ),\n // Whitelist the theme's own hook slots at parse time too, for the same reason: apps register\n // their `onReady` callbacks from parser-inserted snippet tags, long before React hydrates.\n themeHookSlotsScript: renderThemeHookSlotsScript(),\n // Env this render resolved (worker `vars` live in server-only `process.env`), handed to the\n // client so it doesn't silently fall back to the production defaults. Re-rendered on the\n // client during hydration, where it resolves to the same values or to nothing.\n runtimeEnvScript: renderRuntimeEnvScript(),\n };\n}\n\nfunction buildRootMeta(p: RootHeadParts): NonNullable<HeadDescriptor['meta']> {\n return [\n { name: 'robots', content: 'index, follow' },\n { name: 'msapplication-TileColor', content: '#ffffff' },\n ...(p.favicon ? [{ name: 'msapplication-TileImage', content: p.favicon }] : []),\n ...(p.primaryColor\n ? [\n { name: 'theme-color', content: p.primaryColor },\n { name: 'msapplication-navbutton-color', content: p.primaryColor },\n { name: 'apple-mobile-web-app-status-bar-style', content: p.primaryColor },\n ]\n : []),\n ];\n}\n\nfunction buildRootLinks(p: RootHeadParts): NonNullable<HeadDescriptor['links']> {\n return [\n { rel: 'preconnect', href: 'https://api.salla.dev' },\n { rel: 'preconnect', href: 'https://cdn.salla.sa' },\n { rel: 'preconnect', href: 'https://cdn.assets.salla.network', crossOrigin: 'anonymous' },\n // Warm the installed apps' CDN snippet host(s) — see snippetPreconnectOrigins.\n // Not on the maintenance page: it renders neither the snippets nor the SDK.\n ...(p.maintenance ? [] : p.snippetPreconnects),\n ...(p.isGoogleFont\n ? [\n {\n rel: 'preconnect' as const,\n href: 'https://fonts.gstatic.com',\n crossOrigin: 'anonymous' as const,\n },\n ]\n : []),\n ...(p.maintenance ? [] : [{ rel: 'modulepreload' as const, href: p.twilightSdkUrl }]),\n ...(p.fontUrlWithDisplay\n ? [\n {\n id: 'salla-theme-font',\n rel: 'stylesheet',\n href: p.fontUrlWithDisplay,\n media: 'print',\n },\n ]\n : []),\n ...(p.fontUrlWithDisplay && !p.isGoogleFont && p.fontFamilyName\n ? [\n {\n id: 'salla-font-display-override',\n rel: 'preload',\n as: 'style',\n href: p.fontUrlWithDisplay,\n },\n ]\n : []),\n ...(p.favicon ? [{ rel: 'icon', href: p.favicon }] : []),\n ...(p.favicon\n ? [{ id: 'salla-apple-icon', rel: 'apple-touch-icon-precomposed', href: p.favicon }]\n : []),\n ...(p.isCustomCssUrl && p.customCss\n ? [{ id: 'salla-custom-css', rel: 'stylesheet', href: p.customCss }]\n : []),\n {\n id: 'salla-icons-css',\n rel: 'stylesheet',\n href: SALLA_ICONS_CSS_URL,\n media: 'print',\n },\n // {\n // id: 'intl-tel-input-css',\n // rel: 'stylesheet',\n // href: 'https://cdn.jsdelivr.net/npm/intl-tel-input@26.8.0/build/css/intlTelInput.css',\n // },\n ...(p.isCustomJsUrl && p.customJs\n ? [{ id: 'salla-custom-js-preload', rel: 'preload', as: 'script', href: p.customJs }]\n : []),\n ];\n}\n\n// Hoistable (href + precedence): the web components insert their own <style> near the top of\n// <head> before hydration, which a positionally hydrated <style> would be matched against.\nconst hoisted = (id: string, children: string) => ({\n id,\n href: id,\n precedence: 'default',\n children,\n});\n\nfunction buildRootStyles(p: RootHeadParts): NonNullable<HeadDescriptor['styles']> {\n return [\n hoisted('twilight-loading', LOADING_CSS),\n ...(!p.isGoogleFont && p.fontFamilyName\n ? [\n hoisted(\n 'salla-font-display-swap',\n `@font-face{font-family:\"${p.fontFamilyName}\";font-display:swap;src:local(\"${p.fontFamilyName}\")}`\n ),\n ]\n : []),\n ...(!p.isCustomCssUrl && p.customCss ? [hoisted('salla-custom-css', p.customCss)] : []),\n ];\n}\n\nfunction buildRootScripts(p: RootHeadParts): NonNullable<HeadDescriptor['scripts']> {\n return [\n // First: the API base / store identifier this render used, so the hydrated client\n // resolves the same ones (worker `vars` never reach the browser bundle on their own).\n ...(p.runtimeEnvScript ? [{ id: 'salla-runtime-env', children: p.runtimeEnvScript }] : []),\n { id: 'twilight-init', children: SALLA_INIT_SCRIPT },\n // After twilight-init (which defines window.Salla) and before the SDK module, so the\n // appScope factory exists ahead of any snippet's onReady callback firing.\n { id: 'salla-app-scope', children: p.appScopeInstallScript },\n // Arms the hook-slot whitelist push here, so its `twilight::initiated` listener is\n // registered before any app snippet's — listeners fire in registration order.\n ...(p.themeHookSlotsScript\n ? [{ id: 'salla-theme-hook-slots', children: p.themeHookSlotsScript }]\n : []),\n { id: 'salla-async-css', children: MEDIA_SWAP_SCRIPT },\n // The SDK and ticketing modules are rendered at the end of <body> (SallaSdkScripts).\n ...(p.customJs ? [buildCustomJsScript(p.customJs, Boolean(p.isCustomJsUrl))] : []),\n ];\n}\n\n/** A URL customization is loaded after SDK init; an inline one is wrapped so a syntax/runtime\n * error in partner JS warns instead of taking the page down. */\nfunction buildCustomJsScript(customJs: string, isUrl: boolean) {\n return {\n id: 'salla-custom-js',\n children: isUrl\n ? `window.addEventListener('twilight::initiated',function(){var s=document.createElement('script');s.src=${escapeForInlineScript(JSON.stringify(customJs))};s.async=true;document.head.appendChild(s)},{once:true});`\n : `try { ${customJs} } catch(e) { console.warn(\"[ThemeCustomization] Custom JS error:\", e); }`,\n };\n}\n","import type { StoreContext } from '../api/store';\nimport { extractTokenFromCookies } from './cookies';\n\n/**\n * Remembers that this browser is the merchant looking at their own closed store.\n *\n * The dashboard's \"view store\" link carries `?utm_source=dashboard&identifier=<store id>`\n * (`portal` for the partners portal). Twig's backend checks that once, keeps\n * `view-as: owner` in the PHP session and lets every later request through; this\n * cookie is that session entry. No `max-age`: a session cookie, as the PHP session\n * was, so closing the browser ends the owner view.\n *\n * The value is the store id the bypass was granted for, checked against the store\n * the settings answer about, so one store's cookie opens no other store.\n */\nexport const VIEW_AS_OWNER_COOKIE_NAME = 'salla_view_as';\n\nconst OWNER_SOURCES = ['dashboard', 'portal'];\n\n/** The id as the URL and the cookie spell it, or null when the settings name none. */\nfunction storeIdOf(settings: StoreContext | null | undefined): string | null {\n const id = settings?.store?.id;\n return id == null ? null : String(id);\n}\n\n/**\n * Whether `href` is the dashboard's link into the merchant's own store:\n * `utm_source` is `dashboard` or `portal`, and `identifier` is this store's id.\n * The backend's own rule, translated.\n */\nexport function ownerLinkMatches(href: string, settings: StoreContext | null | undefined): boolean {\n const storeId = storeIdOf(settings);\n if (!storeId) return false;\n let params: URLSearchParams;\n try {\n params = new URL(href, 'http://localhost').searchParams;\n } catch {\n return false;\n }\n const source = params.get('utm_source');\n return source != null && OWNER_SOURCES.includes(source) && params.get('identifier') === storeId;\n}\n\n/** Whether the cookie remembers an owner view of this store. */\nexport function ownerCookieMatches(\n cookieHeader: string | null,\n settings: StoreContext | null | undefined\n): boolean {\n const storeId = storeIdOf(settings);\n return !!storeId && extractTokenFromCookies(cookieHeader, VIEW_AS_OWNER_COOKIE_NAME) === storeId;\n}\n\n/**\n * Whether this visitor gets the maintenance page instead of the store.\n *\n * True only when the settings say the store is closed and nothing lets the visitor\n * through: neither an owner view (the link or the cookie) nor the theme editor's\n * preview, which the backend also always lets in.\n */\nexport function showsMaintenancePage(\n settings: StoreContext | null | undefined,\n viewAsOwner: boolean\n): boolean {\n return settings?.maintenance === true && !viewAsOwner && settings.theme?.mode !== 'preview';\n}\n\n// todo:: drop both once the backend sends `dashboard_url` (or the filled `button_*`) in the\n// settings; until then this mirrors `config('salla.app.dashboard_url')` and the path Twig's\n// `StoreStatusAlertWidget` appends for the owner.\nconst DASHBOARD_URL = 'https://s.salla.sa';\n\n/** The dashboard page where the merchant turns maintenance mode off, as the backend links it. */\nexport const MAINTENANCE_SETTINGS_URL = `${DASHBOARD_URL}/channel/settings?legacy=0#maintenance-mode`;\n\n/**\n * The button on the SDK's merchant maintenance bar. The API fills the `button_*`\n * fields only inside Twig's owner session, which the engine's settings request has\n * none of, so the SDK, handed the settings as they are, draws an empty button. The\n * SDK renders only in the store view, so `maintenance: true` there means the owner\n * (or the preview, where the SDK mounts no bar): the three fields get what Twig's\n * owner branch gives them. The merchant's own title and message stay as they are.\n */\nexport function withOwnerMaintenanceButton<\n T extends Pick<StoreContext, 'maintenance' | 'maintenance_details'>,\n>(settings: T, buttonTitle: string): T {\n const details = settings.maintenance_details;\n if (settings.maintenance !== true || details?.button_title) return settings;\n return {\n ...settings,\n maintenance_details: {\n ...details,\n button_title: buttonTitle,\n button_full_title: buttonTitle,\n button_url: MAINTENANCE_SETTINGS_URL,\n },\n };\n}\n"]}
|