@usethrottle/storefront-react 0.0.0-stage → 0.1.0
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/CLAUDE.md +67 -0
- package/README.md +119 -2
- package/dist/StorefrontProvider-Br4wUHui.d.cts +559 -0
- package/dist/StorefrontProvider-DLEPEjg6.d.ts +559 -0
- package/dist/account/index.cjs +69 -0
- package/dist/account/index.cjs.map +1 -0
- package/dist/account/index.d.cts +23 -0
- package/dist/account/index.d.ts +23 -0
- package/dist/account/index.js +68 -0
- package/dist/account/index.js.map +1 -0
- package/dist/chunk-2LCPIY2P.cjs +16 -0
- package/dist/chunk-2LCPIY2P.cjs.map +1 -0
- package/dist/chunk-3A72UY6T.js +2126 -0
- package/dist/chunk-3A72UY6T.js.map +1 -0
- package/dist/chunk-3JMIVAHN.js +185 -0
- package/dist/chunk-3JMIVAHN.js.map +1 -0
- package/dist/chunk-4J6AGWNC.cjs +24 -0
- package/dist/chunk-4J6AGWNC.cjs.map +1 -0
- package/dist/chunk-4U6MYDZV.js +17 -0
- package/dist/chunk-4U6MYDZV.js.map +1 -0
- package/dist/chunk-66HDJVPS.js +22 -0
- package/dist/chunk-66HDJVPS.js.map +1 -0
- package/dist/chunk-6X2OZSNV.cjs +83 -0
- package/dist/chunk-6X2OZSNV.cjs.map +1 -0
- package/dist/chunk-6ZMMZ245.cjs +2127 -0
- package/dist/chunk-6ZMMZ245.cjs.map +1 -0
- package/dist/chunk-7R37CVAB.cjs +23 -0
- package/dist/chunk-7R37CVAB.cjs.map +1 -0
- package/dist/chunk-A3IFWQUV.js +368 -0
- package/dist/chunk-A3IFWQUV.js.map +1 -0
- package/dist/chunk-AYC2YK4E.cjs +95 -0
- package/dist/chunk-AYC2YK4E.cjs.map +1 -0
- package/dist/chunk-AZV5U7YB.cjs +18 -0
- package/dist/chunk-AZV5U7YB.cjs.map +1 -0
- package/dist/chunk-CE2SKNQP.cjs +71 -0
- package/dist/chunk-CE2SKNQP.cjs.map +1 -0
- package/dist/chunk-D76CRI4X.js +2175 -0
- package/dist/chunk-D76CRI4X.js.map +1 -0
- package/dist/chunk-DOAII637.cjs +186 -0
- package/dist/chunk-DOAII637.cjs.map +1 -0
- package/dist/chunk-DYHHAOMG.cjs +17 -0
- package/dist/chunk-DYHHAOMG.cjs.map +1 -0
- package/dist/chunk-EYSVU5SJ.js +196 -0
- package/dist/chunk-EYSVU5SJ.js.map +1 -0
- package/dist/chunk-HSUUDZWS.js +37 -0
- package/dist/chunk-HSUUDZWS.js.map +1 -0
- package/dist/chunk-HZ6VEN6Q.cjs +101 -0
- package/dist/chunk-HZ6VEN6Q.cjs.map +1 -0
- package/dist/chunk-IJOTLGPT.js +16 -0
- package/dist/chunk-IJOTLGPT.js.map +1 -0
- package/dist/chunk-ISDATHVC.js +219 -0
- package/dist/chunk-ISDATHVC.js.map +1 -0
- package/dist/chunk-LW2A6USV.js +100 -0
- package/dist/chunk-LW2A6USV.js.map +1 -0
- package/dist/chunk-M4YXSLRG.cjs +369 -0
- package/dist/chunk-M4YXSLRG.cjs.map +1 -0
- package/dist/chunk-NDUEJJLP.cjs +2176 -0
- package/dist/chunk-NDUEJJLP.cjs.map +1 -0
- package/dist/chunk-NNE4FYRT.js +820 -0
- package/dist/chunk-NNE4FYRT.js.map +1 -0
- package/dist/chunk-NW3EFHY2.js +15 -0
- package/dist/chunk-NW3EFHY2.js.map +1 -0
- package/dist/chunk-NZRUQUN5.js +167 -0
- package/dist/chunk-NZRUQUN5.js.map +1 -0
- package/dist/chunk-P6HHE57S.cjs +38 -0
- package/dist/chunk-P6HHE57S.cjs.map +1 -0
- package/dist/chunk-PHY7AY27.cjs +197 -0
- package/dist/chunk-PHY7AY27.cjs.map +1 -0
- package/dist/chunk-PNJOFFTL.cjs +128 -0
- package/dist/chunk-PNJOFFTL.cjs.map +1 -0
- package/dist/chunk-PXZQ4ONA.js +127 -0
- package/dist/chunk-PXZQ4ONA.js.map +1 -0
- package/dist/chunk-Q3VTUBPP.js +82 -0
- package/dist/chunk-Q3VTUBPP.js.map +1 -0
- package/dist/chunk-Q3XFD5UI.js +45 -0
- package/dist/chunk-Q3XFD5UI.js.map +1 -0
- package/dist/chunk-QM7KTT7F.js +94 -0
- package/dist/chunk-QM7KTT7F.js.map +1 -0
- package/dist/chunk-RLWZOLXL.js +70 -0
- package/dist/chunk-RLWZOLXL.js.map +1 -0
- package/dist/chunk-SV53BRP2.js +23 -0
- package/dist/chunk-SV53BRP2.js.map +1 -0
- package/dist/chunk-VWXJO427.cjs +821 -0
- package/dist/chunk-VWXJO427.cjs.map +1 -0
- package/dist/chunk-WIIOJDHR.cjs +220 -0
- package/dist/chunk-WIIOJDHR.cjs.map +1 -0
- package/dist/chunk-XQHGFWLG.cjs +46 -0
- package/dist/chunk-XQHGFWLG.cjs.map +1 -0
- package/dist/chunk-ZHCXI2ZZ.cjs +168 -0
- package/dist/chunk-ZHCXI2ZZ.cjs.map +1 -0
- package/dist/index-RSj2Rg62.d.cts +8 -0
- package/dist/index-RSj2Rg62.d.ts +8 -0
- package/dist/index.cjs +2829 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1718 -0
- package/dist/index.d.ts +1718 -0
- package/dist/index.js +2828 -0
- package/dist/index.js.map +1 -0
- package/dist/metadata-QhKw-tvz.d.cts +188 -0
- package/dist/metadata-QhKw-tvz.d.ts +188 -0
- package/dist/next/client.cjs +84 -0
- package/dist/next/client.cjs.map +1 -0
- package/dist/next/client.d.cts +40 -0
- package/dist/next/client.d.ts +40 -0
- package/dist/next/client.js +83 -0
- package/dist/next/client.js.map +1 -0
- package/dist/next/index.cjs +1090 -0
- package/dist/next/index.cjs.map +1 -0
- package/dist/next/index.d.cts +218 -0
- package/dist/next/index.d.ts +218 -0
- package/dist/next/index.js +1049 -0
- package/dist/next/index.js.map +1 -0
- package/dist/server/index.cjs +994 -0
- package/dist/server/index.cjs.map +1 -0
- package/dist/server/index.d.cts +229 -0
- package/dist/server/index.d.ts +229 -0
- package/dist/server/index.js +951 -0
- package/dist/server/index.js.map +1 -0
- package/dist/styles.css +2111 -0
- package/dist/use-part-DCfFk7kf.d.ts +24 -0
- package/dist/use-part-DgjPBL_O.d.cts +24 -0
- package/package.json +121 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/link.tsx","../src/settings/normalize.ts","../src/styles/index.ts","../src/presets/bold.css.ts","../src/presets/clean.css.ts","../src/presets/editorial.css.ts","../src/presets/index.ts","../src/styles/base.css.ts","../src/styles/frame.css.ts","../src/styles/merch.css.ts","../src/styles/pages.css.ts","../src/styles/pieces.css.ts","../src/styles/product.css.ts","../src/styles/shop.css.ts","../src/styles/shopper.css.ts","../src/theme/to-variables.ts","../src/provider/router.ts","../src/provider/StorefrontProvider.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, ComponentType } from 'react';\n\n/** What a link renders as: a plain `<a>` by default, `next/link` through `StorefrontNextProvider`. */\nexport type LinkComponent = ComponentType<\n AnchorHTMLAttributes<HTMLAnchorElement> & { href: string; prefetch?: boolean }\n>;\n\n/** The default `linkComponent`: a plain anchor (`prefetch` has no meaning here). */\nexport const DefaultLink: LinkComponent = ({ prefetch: _prefetch, ...anchor }) => <a {...anchor} />;\n","import type { ResolvedStorefrontSettings } from '@usethrottle/catalog';\nimport { DEFAULT_SETTINGS } from './defaults';\nimport { isRecord, isUnsafeKey } from './guards';\n\n/** The settings a component reads: the catalog's resolved document with every field present. */\nexport type NormalizedSettings = ResolvedStorefrontSettings;\n\nconst SORT_KEYS = [\n 'relevance', 'featured', 'manual', 'title_asc', 'title_desc', 'price_asc', 'price_desc', 'newest', 'updated', 'best_rated',\n];\n\n/** Where an enum-valued setting lives and what it may hold. */\nconst ENUMS: ReadonlyArray<readonly [path: readonly string[], values: readonly string[]]> = [\n [['theme', 'colorScheme'], ['light', 'dark', 'auto']],\n [['theme', 'spacingScale'], ['compact', 'comfortable', 'roomy']],\n [['listing', 'pagination'], ['numbered', 'load_more', 'infinite']],\n [['listing', 'filterLayout'], ['sidebar', 'topbar', 'drawer']],\n [['listing', 'defaultSort'], SORT_KEYS],\n [['card', 'style'], ['standard', 'minimal', 'overlay', 'row']],\n [['product', 'layout'], ['classic', 'stacked', 'editorial']],\n [['product', 'sectionsStyle'], ['auto', 'tabs', 'accordion', 'stacked']],\n];\n\nconst SECTION_KEYS = ['description', 'specs', 'shipping', 'tags', 'categories', 'related', 'reviews'];\n\n\n/**\n * Fills `raw` from `defaults`, value by value: a missing or wrong-typed value\n * takes the default, an object recurses, an array is kept whole when it is an\n * array (the lists have no per-item defaults). A default of `null` accepts any\n * non-undefined value (a media ref, a menu target, a nullable number).\n */\nfunction fill(defaults: unknown, raw: unknown): unknown {\n if (isRecord(defaults)) {\n const given = isRecord(raw) ? raw : {};\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(defaults)) out[key] = fill(defaults[key], given[key]);\n // Unknown keys are kept as they came: a newer catalog may send more.\n for (const key of Object.keys(given)) if (!isUnsafeKey(key) && !(key in out)) out[key] = given[key];\n return out;\n }\n if (Array.isArray(defaults)) return Array.isArray(raw) ? raw : defaults;\n if (defaults === null) return raw === undefined ? null : raw;\n if (typeof defaults === 'number') return typeof raw === 'number' && Number.isFinite(raw) ? raw : defaults;\n return typeof raw === typeof defaults ? raw : defaults;\n}\n\n/** Menu items with a string label and an object target; a malformed item (and its subtree) is dropped, `children` must be an array. */\nfunction cleanMenu(items: unknown): unknown[] {\n if (!Array.isArray(items)) return [];\n return items.flatMap((item): unknown[] => {\n if (!isRecord(item) || typeof item.label !== 'string' || !isRecord(item.target)) return [];\n if (item.children === undefined) return [item];\n if (!Array.isArray(item.children)) return [];\n return [{ ...item, children: cleanMenu(item.children) }];\n });\n}\n\nconst warned = new Set<string>();\nfunction warnOnce(key: string, message: string): void {\n if (process.env.NODE_ENV === 'production' || warned.has(key)) return;\n warned.add(key);\n // eslint-disable-next-line no-console\n console.warn(`[@usethrottle/storefront-react] ${message}`);\n}\n\n/** Test seam: forgets which warnings were already logged. */\nexport function resetSettingsWarnings(): void {\n warned.clear();\n}\n\nfunction get(obj: Record<string, unknown>, path: readonly string[]): unknown {\n let at: unknown = obj;\n for (const key of path) at = isRecord(at) ? at[key] : undefined;\n return at;\n}\n\nfunction set(obj: Record<string, unknown>, path: readonly string[], value: unknown): void {\n let at: Record<string, unknown> = obj;\n for (const key of path.slice(0, -1)) at = at[key] as Record<string, unknown>;\n at[path[path.length - 1]!] = value;\n}\n\n/**\n * Settings from whatever the catalog answered (or nothing): deep-filled from\n * `DEFAULT_SETTINGS`, an unknown enum value replaced by its default with one\n * development warning. Never throws, so a partial or newer answer renders.\n */\nexport function normalizeSettings(raw: unknown): NormalizedSettings {\n const out = fill(DEFAULT_SETTINGS, raw) as Record<string, unknown>;\n\n // An empty string is \"not set\" for a catalog string, as the SDK's own `t` reads it.\n const strings = out.strings as Record<string, unknown>;\n const defaultStrings = DEFAULT_SETTINGS.strings as Record<string, string>;\n for (const key of Object.keys(defaultStrings)) if (strings[key] === '') strings[key] = defaultStrings[key];\n\n for (const [path, allowed] of ENUMS) {\n const value = get(out, path);\n if (typeof value === 'string' && allowed.includes(value)) continue;\n const dotted = path.join('.');\n warnOnce(`enum:${dotted}`, `settings.${dotted} has an unknown value (${JSON.stringify(value)}); using the default.`);\n set(out, path, get(DEFAULT_SETTINGS as unknown as Record<string, unknown>, path));\n }\n\n // Lists whose items carry an enum key: drop an item the components could not place.\n const listing = out.listing as Record<string, unknown>;\n listing.sorts = (listing.sorts as unknown[]).filter(\n (s) => isRecord(s) && typeof s.key === 'string' && SORT_KEYS.includes(s.key),\n );\n const product = out.product as Record<string, unknown>;\n product.sections = (product.sections as unknown[]).filter(\n (s) => isRecord(s) && typeof s.key === 'string' && SECTION_KEYS.includes(s.key),\n );\n\n // A list item that is not an object would crash the component that reads its fields.\n const nav = out.navigation as Record<string, unknown>;\n nav.header = cleanMenu(nav.header);\n nav.footer = cleanMenu(nav.footer);\n const badges = out.badges as Record<string, unknown>;\n badges.custom = (badges.custom as unknown[]).filter(isRecord);\n const home = out.home as Record<string, unknown>;\n home.shelves = (home.shelves as unknown[]).filter(isRecord);\n\n return out as unknown as NormalizedSettings;\n}\n","import { primitiveStyles } from '@usethrottle/ui';\nimport { PRESET_CSS } from '../presets';\nimport { BASE_CSS } from './base.css';\nimport { FRAME_CSS } from './frame.css';\nimport { MERCH_CSS } from './merch.css';\nimport { PAGES_CSS } from './pages.css';\nimport { PIECES_CSS } from './pieces.css';\nimport { PRODUCT_CSS } from './product.css';\nimport { SHOP_CSS } from './shop.css';\nimport { SHOPPER_CSS } from './shopper.css';\n\n/** The `id` of the `<style>` element that carries the storefront's CSS (`@layer throttle`). */\nexport const STOREFRONT_STYLE_ID = 'throttle-storefront-styles';\n/** The `id` of the `<style>` element that declares the layer order first in `<head>`. */\nexport const STOREFRONT_LAYER_ORDER_ID = 'throttle-storefront-layer-order';\n/**\n * Declares the layer order before anything else does (R5). `throttle` sits between Tailwind v4's `base` (its\n * preflight reset) and `components`/`utilities`: the reset cannot override the storefront's own rules (a filled\n * button, a card's padding), while a utility or a store's rule still beats the package. The Tailwind names are\n * declared here empty so the order holds whether or not Tailwind is on the page.\n */\nexport const STOREFRONT_LAYER_ORDER = '@layer theme, base, throttle, components, utilities;';\n\n/**\n * The whole storefront stylesheet: the primitives (class prefix `tsf-`, so\n * auth's sheet never styles them), the base, each area's rules, then every\n * preset's rules, all inside `@layer throttle` so an unlayered store rule or a\n * Tailwind utility beats it. One source feeds the runtime injector and\n * `dist/styles.css`.\n */\nexport const STOREFRONT_STYLES =\n '@layer throttle{' +\n primitiveStyles('tsf-') +\n BASE_CSS +\n PIECES_CSS +\n SHOP_CSS +\n PRODUCT_CSS +\n FRAME_CSS +\n MERCH_CSS +\n SHOPPER_CSS +\n PAGES_CSS +\n PRESET_CSS +\n '}';\n","/** `bold`'s per-preset rules. Every rule is scoped by `[data-throttle-preset]`. */\nexport const BOLD_CSS = `\n[data-throttle-preset=\"bold\"] {\n --throttle-sf-heading-weight: 800;\n --throttle-sf-heading-tracking: 0.02em;\n --throttle-sf-heading-transform: uppercase;\n}\n`;\n","/** `clean`'s per-preset rules. Every rule is scoped by `[data-throttle-preset]` (and so may use a descendant selector). */\nexport const CLEAN_CSS = `\n[data-throttle-preset=\"clean\"] {\n --throttle-sf-heading-weight: 600;\n --throttle-sf-heading-tracking: -0.01em;\n --throttle-sf-heading-transform: none;\n}\n`;\n","/** `editorial`'s per-preset rules. Every rule is scoped by `[data-throttle-preset]`. */\nexport const EDITORIAL_CSS = `\n[data-throttle-preset=\"editorial\"] {\n --throttle-sf-heading-weight: 400;\n --throttle-sf-heading-tracking: 0;\n --throttle-sf-heading-transform: none;\n}\n`;\n","import { BOLD_CSS } from './bold.css';\nimport { CLEAN_CSS } from './clean.css';\nimport { EDITORIAL_CSS } from './editorial.css';\n\n/** Every preset's CSS, after the base and area rules so a preset wins on equal specificity. Tokens are `@usethrottle/ui/presets`'. */\nexport const PRESET_CSS = CLEAN_CSS + EDITORIAL_CSS + BOLD_CSS;\n","/**\n * The storefront's own base rules (the primitives' come from `primitiveStyles`).\n * Single-class selectors and logical properties only: a class passed through\n * `classNames` must win on equal specificity, and the sheet must hold in rtl.\n * No backticks inside: this is a template literal.\n */\nexport const BASE_CSS = `\n.tsf-root {\n --throttle-sf-accent: #2563eb;\n --throttle-sf-accent-hover: #1d4ed8;\n --throttle-sf-accent-subtle: #eaf0fd;\n --throttle-sf-sale: #b91c1c;\n --throttle-sf-success: #15803d;\n --throttle-sf-warning: #b45309;\n --throttle-sf-danger: #b91c1c;\n --throttle-sf-card-radius: 8px;\n --throttle-sf-grid-gap: 20px;\n --throttle-sf-heading-weight: 600;\n --throttle-sf-heading-tracking: -0.01em;\n --throttle-sf-heading-transform: none;\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n text-align: start;\n}\n\n.tsf-slot-outlet { display: block; }\n`;\n","/**\n * The store frame's rules. Single-class selectors and logical properties only; a state is a `:where()`\n * attribute so it stays one class in specificity. No backticks inside: this is a template literal.\n */\nexport const FRAME_CSS = `\n.tsf-skip-link {\n position: absolute;\n inset-inline-start: 8px;\n inset-block-start: -120px;\n z-index: 1000;\n padding: 12px 16px;\n border-radius: 8px;\n background: var(--throttle-color-primary);\n color: var(--throttle-color-primary-foreground);\n font-weight: 600;\n text-decoration: none;\n}\n.tsf-skip-link:focus { inset-block-start: 8px; }\n\n.tsf-store-frame { display: flex; flex-direction: column; min-block-size: 100vh; }\n.tsf-store-frame-main { flex: 1 0 auto; }\n.tsf-store-frame-main:focus { outline: none; }\n\n.tsf-announcement-bar {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n min-block-size: 44px;\n padding-block: 4px;\n padding-inline: 52px;\n background: var(--throttle-color-primary);\n color: var(--throttle-color-primary-foreground);\n font-size: 13px;\n text-align: center;\n}\n.tsf-announcement-bar-text { display: inline-flex; align-items: center; min-block-size: 44px; margin: 0; color: inherit; text-decoration: none; }\n.tsf-announcement-bar-text:hover { text-decoration: underline; }\n.tsf-announcement-bar-dismiss {\n position: absolute;\n inset-inline-end: 4px;\n inset-block-start: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-inline-size: 44px;\n min-block-size: 44px;\n border: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n}\n\n.tsf-header:focus { outline: none; }\n.tsf-header { border-block-end: 1px solid var(--throttle-color-border); background: var(--throttle-color-background); color: var(--throttle-color-foreground); }\n.tsf-header-bar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 4px 12px;\n max-inline-size: 1280px;\n margin-inline: auto;\n padding-block: 8px;\n padding-inline: 16px;\n}\n.tsf-header-menu-button,\n.tsf-header-drawer-close,\n.tsf-category-nav-toggle,\n.tsf-cart-button,\n.tsf-account-button {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-inline-size: 44px;\n min-block-size: 44px;\n border: 0;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n cursor: pointer;\n text-decoration: none;\n}\n.tsf-header-menu-button:hover,\n.tsf-header-drawer-close:hover,\n.tsf-cart-button:hover,\n.tsf-account-button:hover { background: var(--throttle-color-muted); }\n@media (min-width: 960px) { .tsf-header-menu-button { display: none; } }\n\n.tsf-header-brand {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n flex: none;\n min-inline-size: 44px;\n min-block-size: 44px;\n color: inherit;\n font-size: 20px;\n font-weight: var(--throttle-sf-heading-weight);\n letter-spacing: var(--throttle-sf-heading-tracking);\n text-transform: var(--throttle-sf-heading-transform);\n text-decoration: none;\n}\n.tsf-header-logo { display: block; block-size: 32px; inline-size: auto; max-inline-size: 160px; }\n.tsf-header-store-name:where([data-has-logo]) {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n.tsf-header-search { order: 3; flex: 1 1 100%; min-inline-size: 0; }\n@media (min-width: 640px) {\n .tsf-header-search { order: 0; flex: 1 1 auto; max-inline-size: 520px; margin-inline: auto; }\n}\n.tsf-header-actions { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; }\n@media (min-width: 640px) { .tsf-header-actions { margin-inline-start: 0; } }\n\n.tsf-header-nav-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n max-inline-size: 1280px;\n margin-inline: auto;\n padding-inline: 16px;\n}\n@media (max-width: 959px) { .tsf-header-nav-row { display: none; } }\n.tsf-header-prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-inline-start: auto; }\n.tsf-header-prefs:where([data-in-drawer]) { margin-inline-start: 0; padding-block: 8px; padding-inline: 16px; }\n.tsf-header-drawer-top {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-block: 8px;\n padding-inline: 16px;\n border-block-end: 1px solid var(--throttle-color-border);\n}\n.tsf-header-drawer-title { margin: 0; font-size: 18px; font-weight: var(--throttle-sf-heading-weight); }\n\n.tsf-category-nav-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; margin: 0; padding: 0; list-style: none; }\n.tsf-category-nav-list:where([data-stacked=\"true\"]) { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding-block: 8px; padding-inline: 16px; }\n.tsf-category-nav-item { position: relative; display: flex; align-items: center; }\n.tsf-category-nav-item:where([data-stacked=\"true\"]) { flex-wrap: wrap; }\n.tsf-category-nav-link {\n display: inline-flex;\n align-items: center;\n min-block-size: 44px;\n color: inherit;\n text-decoration: none;\n}\n.tsf-category-nav-link:hover { color: var(--throttle-sf-accent); }\n.tsf-category-nav-toggle { min-inline-size: 28px; }\n.tsf-category-nav-panel {\n position: absolute;\n inset-block-start: 100%;\n inset-inline-start: 0;\n z-index: 30;\n min-inline-size: 200px;\n margin: 0;\n padding: 8px;\n list-style: none;\n background: var(--throttle-color-background);\n border: 1px solid var(--throttle-color-border);\n border-radius: var(--throttle-radius, 8px);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);\n}\n.tsf-category-nav-panel:where([data-stacked=\"true\"]) {\n position: static;\n flex-basis: 100%;\n min-inline-size: 0;\n padding-block: 0;\n padding-inline: 16px 0;\n border: 0;\n box-shadow: none;\n}\n\n.tsf-search-box {\n position: relative;\n display: flex;\n align-items: center;\n gap: 8px;\n min-block-size: 44px;\n padding-inline: 12px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: 999px;\n background: var(--throttle-color-background);\n color: var(--throttle-color-muted-foreground);\n}\n.tsf-search-box:focus-within { outline: 2px solid var(--throttle-sf-accent); outline-offset: 2px; }\n.tsf-search-box-input {\n flex: 1 1 auto;\n min-inline-size: 0;\n padding-block: 10px;\n border: 0;\n outline: none;\n background: transparent;\n color: var(--throttle-color-foreground);\n font: inherit;\n}\n.tsf-search-box-panel {\n position: absolute;\n inset-inline: 0;\n inset-block-start: calc(100% + 4px);\n z-index: 40;\n max-block-size: min(70vh, 480px);\n overflow: auto;\n padding: 8px;\n border: 1px solid var(--throttle-color-border);\n border-radius: var(--throttle-radius, 8px);\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);\n}\n.tsf-search-box-group-label {\n padding-block: 8px 4px;\n padding-inline: 8px;\n color: var(--throttle-color-muted-foreground);\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n}\n.tsf-search-box-option,\n.tsf-search-box-all {\n display: flex;\n align-items: center;\n gap: 10px;\n min-block-size: 44px;\n padding: 6px 8px;\n border-radius: 6px;\n color: inherit;\n text-decoration: none;\n}\n.tsf-search-box-option:hover,\n.tsf-search-box-all:hover,\n.tsf-search-box-option:where([aria-selected=\"true\"]),\n.tsf-search-box-all:where([aria-selected=\"true\"]) { background: var(--throttle-color-muted); }\n.tsf-search-box-all { font-weight: 600; color: var(--throttle-sf-accent); }\n.tsf-search-box-thumb { flex: none; inline-size: 40px; }\n.tsf-search-box-option-name { flex: 1 1 auto; min-inline-size: 0; overflow-wrap: anywhere; }\n.tsf-search-box-option-meta { flex: none; color: var(--throttle-color-muted-foreground); font-size: 13px; }\n.tsf-search-box-none { margin: 0; padding: 8px; color: var(--throttle-color-muted-foreground); }\n.tsf-search-box-status {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n.tsf-locale-switch,\n.tsf-currency-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }\n.tsf-locale-switch-label,\n.tsf-currency-switch-label { color: var(--throttle-color-muted-foreground); }\n.tsf-locale-switch-select,\n.tsf-currency-switch-select {\n min-block-size: 44px;\n padding-inline: 8px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: 6px;\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n font: inherit;\n}\n\n.tsf-cart-button-count {\n position: absolute;\n inset-block-start: 4px;\n inset-inline-end: 2px;\n min-inline-size: 18px;\n block-size: 18px;\n padding-inline: 4px;\n border-radius: 999px;\n background: var(--throttle-sf-accent);\n color: #ffffff;\n font-size: 11px;\n font-weight: 600;\n line-height: 18px;\n text-align: center;\n font-variant-numeric: tabular-nums;\n}\n.tsf-cart-button-count:where([data-empty]) { display: none; }\n\n.tsf-header-menu-button:focus-visible,\n.tsf-header-drawer-close:focus-visible,\n.tsf-header-brand:focus-visible,\n.tsf-category-nav-link:focus-visible,\n.tsf-category-nav-toggle:focus-visible,\n.tsf-cart-button:focus-visible,\n.tsf-account-button:focus-visible,\n.tsf-announcement-bar-dismiss:focus-visible,\n.tsf-announcement-bar-text:focus-visible,\n.tsf-footer-link:focus-visible,\n.tsf-search-box-option:focus-visible,\n.tsf-search-box-all:focus-visible,\n.tsf-locale-switch-select:focus-visible,\n.tsf-currency-switch-select:focus-visible { outline: 2px solid var(--throttle-sf-accent); outline-offset: 2px; }\n\n.tsf-footer {\n margin-block-start: 48px;\n padding-block: 32px;\n padding-inline: 16px;\n border-block-start: 1px solid var(--throttle-color-border);\n background: var(--throttle-color-surface);\n color: var(--throttle-color-foreground);\n}\n.tsf-footer-brand,\n.tsf-footer-extra { max-inline-size: 1280px; margin-inline: auto; margin-block-end: 24px; }\n.tsf-footer-extra { margin-block: 24px 0; }\n.tsf-footer-nav { max-inline-size: 1280px; margin-inline: auto; }\n.tsf-footer-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 40px; margin: 0; padding: 0; list-style: none; }\n.tsf-footer-sublist { display: grid; gap: 0; margin: 4px 0 0; padding: 0; list-style: none; }\n.tsf-footer-link { display: inline-flex; align-items: center; min-inline-size: 44px; min-block-size: 44px; color: inherit; text-decoration: none; }\n.tsf-footer-link:hover { color: var(--throttle-sf-accent); text-decoration: underline; }\n.tsf-footer-copyright { max-inline-size: 1280px; margin-block: 24px 0; margin-inline: auto; color: color-mix(in srgb, var(--throttle-color-muted-foreground) 75%, var(--throttle-color-foreground)); font-size: 13px; }\n`;\n","/**\n * The merchandising sections' rules. Single-class selectors and logical\n * properties only. The grid reads its column counts from custom properties the\n * section sets. No backticks inside: this is a template literal.\n */\nexport const MERCH_CSS = `\n.tsf-merch-skeleton { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--throttle-sf-grid-gap); }\n.tsf-merch-skeleton-item { aspect-ratio: 4 / 5; border-radius: var(--throttle-sf-card-radius); background: var(--throttle-color-muted); }\n@media (min-width: 768px) { .tsf-merch-skeleton { grid-template-columns: repeat(4, minmax(0, 1fr)); } }\n\n.tsf-collection-shelf { display: block; }\n.tsf-collection-shelf-header,\n.tsf-product-carousel-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-block-end: 16px; }\n.tsf-collection-shelf-title,\n.tsf-product-carousel-title { margin: 0; font-size: 22px; font-weight: var(--throttle-sf-heading-weight); letter-spacing: var(--throttle-sf-heading-tracking); text-transform: var(--throttle-sf-heading-transform); }\n.tsf-collection-shelf-eyebrow,\n.tsf-product-carousel-eyebrow { flex: 1 0 100%; margin: 0; color: var(--throttle-sf-accent); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }\n.tsf-collection-shelf-link { display: inline-flex; align-items: center; min-block-size: 44px; color: var(--throttle-sf-accent); font-weight: 500; text-decoration: none; }\n.tsf-collection-shelf-link:hover { color: var(--throttle-sf-accent-hover); text-decoration: underline; }\n.tsf-collection-shelf-grid { display: grid; grid-template-columns: repeat(var(--tsf-columns-mobile, 2), minmax(0, 1fr)); gap: var(--throttle-sf-grid-gap); margin: 0; padding: 0; list-style: none; }\n.tsf-collection-shelf-item { min-inline-size: 0; }\n@media (min-width: 768px) { .tsf-collection-shelf-grid { grid-template-columns: repeat(var(--tsf-columns-desktop, 4), minmax(0, 1fr)); } }\n\n.tsf-product-carousel { display: block; }\n.tsf-product-carousel-controls { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }\n.tsf-product-carousel-prev,\n.tsf-product-carousel-next { display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; padding: 0; border: 1px solid var(--throttle-color-border-control); border-radius: 999px; background: var(--throttle-color-background); color: var(--throttle-color-foreground); cursor: pointer; }\n.tsf-product-carousel-prev:hover:not(:disabled),\n.tsf-product-carousel-next:hover:not(:disabled) { border-color: var(--throttle-color-foreground); }\n.tsf-product-carousel-prev:disabled,\n.tsf-product-carousel-next:disabled { opacity: 0.4; cursor: default; }\n.tsf-product-carousel-track { display: flex; gap: var(--throttle-sf-grid-gap); margin: 0; padding: 0; list-style: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }\n.tsf-product-carousel-item { flex: 0 0 68%; min-inline-size: 0; scroll-snap-align: start; }\n@media (min-width: 640px) { .tsf-product-carousel-item { flex-basis: calc((100% - var(--throttle-sf-grid-gap)) / 2); } }\n@media (min-width: 900px) { .tsf-product-carousel-item { flex-basis: calc((100% - 2 * var(--throttle-sf-grid-gap)) / 3); } }\n@media (min-width: 1200px) { .tsf-product-carousel-item { flex-basis: calc((100% - 3 * var(--throttle-sf-grid-gap)) / 4); } }\n@media (prefers-reduced-motion: no-preference) { .tsf-product-carousel-track { scroll-behavior: smooth; } }\n\n.tsf-featured-product { display: grid; gap: 24px; align-items: center; }\n.tsf-featured-product-media { min-inline-size: 0; max-inline-size: 520px; }\n.tsf-featured-product-media-link { display: block; }\n.tsf-featured-product-placeholder { inline-size: 100%; background: var(--throttle-color-muted); border-radius: var(--throttle-sf-card-radius); }\n.tsf-featured-product-body { display: grid; gap: 12px; justify-items: start; min-inline-size: 0; }\n.tsf-featured-product-title { margin: 0; font-size: 28px; font-weight: var(--throttle-sf-heading-weight); letter-spacing: var(--throttle-sf-heading-tracking); text-transform: var(--throttle-sf-heading-transform); }\n.tsf-featured-product-price { margin: 0; font-size: 18px; }\n.tsf-featured-product-from { font-size: 14px; color: var(--throttle-color-muted-foreground); }\n.tsf-featured-product-description { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; color: var(--throttle-color-muted-foreground); }\n.tsf-featured-product-link { display: inline-flex; padding: 10px 20px; border-radius: var(--throttle-radius-md, 6px); background: var(--throttle-sf-accent); color: var(--throttle-color-background); font-weight: 600; text-decoration: none; }\n.tsf-featured-product-link:hover { background: var(--throttle-sf-accent-hover); }\n@media (min-width: 768px) {\n .tsf-featured-product:where([data-layout=\"image-left\"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }\n .tsf-featured-product:where([data-layout=\"image-right\"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }\n .tsf-featured-product-media:where([data-layout=\"image-right\"]) { order: 2; }\n}\n\n.tsf-category-directory { display: block; }\n.tsf-category-directory-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }\n.tsf-category-directory-list:where([data-layout=\"list\"]) { grid-template-columns: minmax(0, 1fr); gap: 4px; }\n@media (min-width: 768px) { .tsf-category-directory-list:where([data-layout=\"grid\"]) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }\n.tsf-category-directory-item { min-inline-size: 0; }\n.tsf-category-directory-link { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--throttle-color-border); border-radius: var(--throttle-sf-card-radius); color: inherit; text-decoration: none; }\n.tsf-category-directory-link:hover { border-color: var(--throttle-color-foreground); }\n.tsf-category-directory-image { inline-size: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--throttle-sf-card-radius); background: var(--throttle-color-muted); }\n.tsf-category-directory-name { font-weight: 600; }\n.tsf-category-directory-count { font-size: 13px; color: var(--throttle-color-muted-foreground); }\n.tsf-category-directory-children { display: grid; gap: 2px; margin: 6px 0 0; padding: 0; padding-inline-start: 16px; list-style: none; font-size: 14px; }\n\n.tsf-reviews-list { display: block; }\n.tsf-reviews-list-items { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }\n.tsf-reviews-list-item { display: grid; gap: 6px; padding-block-end: 20px; border-block-end: 1px solid var(--throttle-color-border); }\n.tsf-reviews-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }\n.tsf-reviews-list-title { margin: 0; font-size: 16px; font-weight: 600; }\n.tsf-reviews-list-body { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }\n.tsf-reviews-list-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: 13px; color: var(--throttle-color-muted-foreground); }\n.tsf-reviews-list-author { font-weight: 600; color: var(--throttle-color-foreground); }\n.tsf-reviews-list-verified { color: var(--throttle-sf-success); }\n.tsf-reviews-list-product { color: var(--throttle-sf-accent); }\n@media (max-width: 767px) {\n .tsf-reviews-list-product { display: inline-flex; align-items: center; min-block-size: 44px; }\n}\n.tsf-reviews-list-reply { padding: 10px 14px; border-inline-start: 3px solid var(--throttle-color-border); background: var(--throttle-color-muted); font-size: 14px; }\n`;\n","/** The pages' rules (search, not-found, account). Single-class selectors, logical properties. No backticks inside. */\nexport const PAGES_CSS = `\n.tsf-search-results { max-inline-size: 1280px; margin-inline: auto; padding-block: 24px; padding-inline: 16px; }\n.tsf-search-results-title {\n margin-block: 0 16px;\n font-size: 28px;\n font-weight: var(--throttle-sf-heading-weight);\n letter-spacing: var(--throttle-sf-heading-tracking);\n text-transform: var(--throttle-sf-heading-transform);\n}\n.tsf-search-results-prompt { margin: 0; color: var(--throttle-color-muted-foreground); }\n\n.tsf-not-found {\n display: grid;\n justify-items: center;\n gap: 12px;\n padding-block: 64px;\n padding-inline: 16px;\n text-align: center;\n}\n.tsf-not-found-code {\n margin: 0;\n color: var(--throttle-color-muted-foreground);\n font-size: 72px;\n font-weight: 700;\n line-height: 1;\n letter-spacing: -0.03em;\n}\n.tsf-not-found-title {\n margin: 0;\n font-size: 28px;\n font-weight: var(--throttle-sf-heading-weight);\n letter-spacing: var(--throttle-sf-heading-tracking);\n text-transform: var(--throttle-sf-heading-transform);\n}\n.tsf-not-found-body { max-inline-size: 44ch; margin: 0; color: var(--throttle-color-muted-foreground); }\n.tsf-not-found-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-block: 12px 0; margin-inline: 0; }\n.tsf-not-found-link {\n display: inline-flex;\n align-items: center;\n min-block-size: 44px;\n padding-inline: 20px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: var(--throttle-radius, 8px);\n color: inherit;\n font-weight: 600;\n text-decoration: none;\n}\n.tsf-not-found-link:first-child { border-color: transparent; background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground); }\n.tsf-not-found-link:focus-visible { outline: 2px solid var(--throttle-sf-accent); outline-offset: 2px; }\n\n.tsf-account-page { max-inline-size: 960px; margin-inline: auto; padding-block: 32px; padding-inline: 16px; }\n.tsf-account-page-title { margin-block: 0 16px; font-size: 28px; font-weight: var(--throttle-sf-heading-weight); letter-spacing: var(--throttle-sf-heading-tracking); text-transform: var(--throttle-sf-heading-transform); }\n.tsf-account-page-setup-notice {\n max-inline-size: 560px;\n margin-block: 48px;\n margin-inline: auto;\n padding: 24px;\n border: 1px solid var(--throttle-color-border);\n border-radius: var(--throttle-radius, 8px);\n background: var(--throttle-color-surface);\n}\n.tsf-account-page-setup-title { margin-block: 0 8px; font-size: 18px; }\n.tsf-account-page-setup-body { margin: 0; color: color-mix(in srgb, var(--throttle-color-muted-foreground) 75%, var(--throttle-color-foreground)); }\n`;\n","/**\n * The pieces' rules. Single-class selectors; the card's variants set custom\n * properties on the root (`:where()` keeps their specificity at one class) and\n * the parts read them. No backticks inside: this is a template literal.\n */\nexport const PIECES_CSS = `\n.tsf-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }\n.tsf-link:hover { color: var(--throttle-sf-accent); }\n\n.tsf-image { display: block; inline-size: 100%; block-size: auto; object-fit: cover; background: var(--throttle-color-muted); }\n\n.tsf-rich-text { overflow-wrap: anywhere; line-height: 1.6; }\n.tsf-rich-text-link { color: var(--throttle-sf-accent); }\n\n.tsf-money { font-variant-numeric: tabular-nums; }\n.tsf-money-compare { margin-inline-start: 6px; color: var(--throttle-color-muted-foreground); font-weight: 400; font-variant-numeric: tabular-nums; }\n\n.tsf-price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-weight: 600; }\n.tsf-price-label { flex-basis: 100%; font-size: 12px; font-weight: 500; color: var(--throttle-sf-accent); }\n.tsf-price-hint { flex-basis: 100%; font-size: 12px; font-weight: 400; color: var(--throttle-color-muted-foreground); }\n\n.tsf-star-rating { display: inline-flex; align-items: center; gap: 6px; color: var(--throttle-color-muted-foreground); font-size: 13px; }\n.tsf-star-rating-stars { display: inline-flex; gap: 1px; color: var(--throttle-color-warning); }\n.tsf-star-rating-count { font-variant-numeric: tabular-nums; }\n\n.tsf-product-badge {\n display: inline-flex;\n align-items: center;\n padding: 2px 8px;\n border-radius: 999px;\n font-size: 12px;\n font-weight: 600;\n line-height: 1.4;\n background: var(--tsf-badge-bg, var(--throttle-color-foreground));\n color: var(--tsf-badge-fg, var(--throttle-color-background));\n}\n\n.tsf-swatch {\n display: inline-block;\n inline-size: 16px;\n block-size: 16px;\n border-radius: 999px;\n border: 1px solid var(--throttle-color-border-control);\n background-color: var(--throttle-color-muted);\n background-size: cover;\n background-position: center;\n box-sizing: border-box;\n vertical-align: middle;\n}\n.tsf-swatch:where([data-selected=\"true\"]) { outline: 2px solid var(--throttle-color-foreground); outline-offset: 2px; }\n.tsf-swatch:where([data-disabled=\"true\"]) { opacity: 0.4; }\n\n/* The card: the variant sets the properties, the parts read them. */\n.tsf-product-card {\n --tsf-card-border: 1px solid var(--throttle-color-border);\n --tsf-card-radius: var(--throttle-sf-card-radius);\n --tsf-body-padding: 12px;\n --tsf-media-radius: 0;\n position: relative;\n display: flex;\n flex-direction: column;\n min-inline-size: 0;\n border: var(--tsf-card-border);\n border-radius: var(--tsf-card-radius);\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n overflow: hidden;\n}\n.tsf-product-card:where([data-variant=\"minimal\"]) {\n --tsf-card-border: 0 solid transparent;\n --tsf-card-radius: 0;\n --tsf-body-padding: 10px 0 0;\n --tsf-media-radius: var(--throttle-sf-card-radius);\n overflow: visible;\n background: transparent;\n}\n.tsf-product-card:where([data-variant=\"overlay\"]) {\n --tsf-card-border: 0 solid transparent;\n --tsf-body-padding: 40px 14px 14px;\n --tsf-body-position: absolute;\n --tsf-body-events: none;\n --tsf-body-color: #fff;\n --tsf-body-background: linear-gradient(to top, rgb(0 0 0 / 0.72), rgb(0 0 0 / 0));\n}\n.tsf-product-card:where([data-variant=\"row\"]) { --tsf-media-basis: 38%; }\n.tsf-product-card:where([data-sold-out]) { --tsf-media-opacity: 0.6; }\n\n.tsf-product-card-row { display: flex; align-items: stretch; flex: 1; min-inline-size: 0; }\n\n.tsf-product-card-media {\n --tsf-alt: 0;\n position: relative;\n flex: 0 0 var(--tsf-media-basis, auto);\n overflow: hidden;\n border-radius: var(--tsf-media-radius);\n background: var(--throttle-color-muted);\n}\n.tsf-product-card-media:focus-within { --tsf-alt: 1; }\n@media (hover: hover) {\n .tsf-product-card-media:hover { --tsf-alt: 1; }\n}\n.tsf-product-card-media-link { display: block; color: inherit; text-decoration: none; opacity: var(--tsf-media-opacity, 1); }\n.tsf-product-card-image { display: block; }\n.tsf-product-card-image-alt {\n position: absolute;\n inset: 0;\n opacity: var(--tsf-alt);\n transition: opacity 0.2s ease;\n background: var(--throttle-color-muted);\n}\n/* No hover on a touch screen: the two images sit side by side and the shopper swipes. */\n@media (hover: none) {\n .tsf-product-card-media-link { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }\n .tsf-product-card-image, .tsf-product-card-image-alt { position: static; flex: 0 0 100%; opacity: 1; scroll-snap-align: start; }\n}\n@media (prefers-reduced-motion: reduce) {\n .tsf-product-card-image-alt { transition: none; }\n}\n.tsf-product-card-placeholder { inline-size: 100%; background: var(--throttle-color-muted); }\n\n.tsf-product-card-badges {\n position: absolute;\n inset-block-start: 8px;\n inset-inline-start: 8px;\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n max-inline-size: calc(100% - 16px);\n pointer-events: none;\n}\n.tsf-product-card-actions {\n position: absolute;\n inset-block-end: 8px;\n inset-inline-end: 8px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.tsf-product-card-body {\n position: var(--tsf-body-position, static);\n inset-inline: 0;\n inset-block-end: 0;\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 6px;\n padding: var(--tsf-body-padding);\n min-inline-size: 0;\n color: var(--tsf-body-color, inherit);\n background: var(--tsf-body-background, transparent);\n pointer-events: var(--tsf-body-events, auto);\n}\n.tsf-product-card-brand { margin: 0; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.7; }\n.tsf-product-card-title {\n margin: 0;\n font-size: 15px;\n font-weight: var(--throttle-sf-heading-weight);\n letter-spacing: var(--throttle-sf-heading-tracking);\n text-transform: var(--throttle-sf-heading-transform);\n line-height: 1.3;\n overflow-wrap: anywhere;\n}\n.tsf-product-card-title-link { color: inherit; text-decoration: none; pointer-events: auto; }\n.tsf-product-card-title-link:hover { text-decoration: underline; }\n.tsf-product-card-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }\n.tsf-product-card-swatch-more { font-size: 12px; opacity: 0.7; }\n.tsf-product-card-rating { color: inherit; }\n.tsf-product-card-price { margin: 0; font-size: 15px; }\n.tsf-product-card-from { font-size: 12px; font-weight: 400; opacity: 0.7; }\n.tsf-product-card-unpriced { font-size: 13px; opacity: 0.7; }\n`;\n","/**\n * The product page's rules. Single-class selectors only (attribute selectors\n * and `:where()` add no class), logical properties only, so a class passed\n * through `classNames` wins on equal specificity and the sheet holds in rtl.\n * The layout sets custom properties on the page root and the parts read them.\n * No backticks inside: this is a template literal.\n */\nexport const PRODUCT_CSS = `\n.tsf-product-page {\n --tsf-main-columns: minmax(0, 1.1fr) minmax(0, 1fr);\n --tsf-main-gap: 48px;\n --tsf-buy-position: static;\n --tsf-gallery-max: none;\n --tsf-buy-max: none;\n --tsf-main-justify: stretch;\n display: block;\n max-inline-size: 1280px;\n margin-inline: auto;\n padding-block: 24px 96px;\n padding-inline: 16px;\n box-sizing: border-box;\n}\n.tsf-product-page:where([data-layout=\"stacked\"]) {\n --tsf-main-columns: minmax(0, 1fr);\n --tsf-main-gap: 32px;\n --tsf-gallery-max: 720px;\n --tsf-buy-max: 640px;\n --tsf-main-justify: center;\n}\n.tsf-product-page:where([data-layout=\"editorial\"]) {\n --tsf-main-columns: minmax(0, 1.7fr) minmax(0, 1fr);\n --tsf-main-gap: 64px;\n --tsf-buy-position: sticky;\n}\n@media (max-width: 767px) {\n .tsf-product-page,\n .tsf-product-page:where([data-layout=\"stacked\"]),\n .tsf-product-page:where([data-layout=\"editorial\"]) {\n --tsf-main-columns: minmax(0, 1fr);\n --tsf-main-gap: 24px;\n --tsf-buy-position: static;\n --tsf-gallery-max: none;\n --tsf-buy-max: none;\n }\n}\n\n.tsf-product-page-main {\n display: grid;\n grid-template-columns: var(--tsf-main-columns);\n gap: var(--tsf-main-gap);\n justify-content: var(--tsf-main-justify);\n align-items: start;\n margin-block-end: 48px;\n}\n\n/* Breadcrumbs */\n.tsf-product-breadcrumbs { margin-block-end: 16px; font-size: var(--throttle-font-size-sm, 14px); color: var(--throttle-color-muted-foreground); }\n.tsf-product-breadcrumbs-list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 0; list-style: none; }\n.tsf-product-breadcrumbs-item { display: inline-flex; align-items: center; gap: 8px; }\n.tsf-product-breadcrumbs-item:not(:last-child)::after { content: \"/\"; color: var(--throttle-color-border-control); }\n.tsf-product-breadcrumbs-link { color: inherit; text-decoration: none; }\n.tsf-product-breadcrumbs-link:hover { color: var(--throttle-color-foreground); text-decoration: underline; }\n.tsf-product-breadcrumbs-current { color: var(--throttle-color-foreground); }\n@media (max-width: 767px) {\n .tsf-product-breadcrumbs-link,\n .tsf-buy-box-rating { display: inline-flex; align-items: center; min-block-size: 44px; }\n}\n\n/* Gallery */\n.tsf-gallery { display: grid; gap: 12px; max-inline-size: var(--tsf-gallery-max); inline-size: 100%; margin-inline: auto; min-inline-size: 0; }\n.tsf-gallery-stage {\n position: relative;\n overflow: hidden;\n border-radius: var(--throttle-sf-card-radius);\n background: var(--throttle-color-muted);\n touch-action: pan-y;\n cursor: zoom-in;\n outline-offset: 2px;\n}\n.tsf-gallery-stage:focus-visible { outline: 2px solid var(--throttle-color-primary); }\n.tsf-gallery-item { display: block; transition: transform 0.2s ease; will-change: transform; }\n.tsf-gallery-item:where([data-zoomed=\"true\"]) { transform: scale(1.9); }\n.tsf-gallery-item:where([data-zoomed=\"true\"]) { cursor: zoom-in; }\n.tsf-gallery-video { display: block; inline-size: 100%; block-size: auto; background: #000; }\n.tsf-gallery-placeholder { aspect-ratio: 4 / 5; background: var(--throttle-color-muted); }\n.tsf-gallery-previous, .tsf-gallery-next, .tsf-gallery-enlarge, .tsf-lightbox-previous, .tsf-lightbox-next {\n position: absolute;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: 44px;\n block-size: 44px;\n padding: 0;\n border: 1px solid var(--throttle-color-border);\n border-radius: 999px;\n background: color-mix(in srgb, var(--throttle-color-background) 88%, transparent);\n color: var(--throttle-color-foreground);\n cursor: pointer;\n}\n.tsf-gallery-previous { inset-inline-start: 12px; inset-block-start: calc(50% - 22px); }\n.tsf-gallery-next { inset-inline-end: 12px; inset-block-start: calc(50% - 22px); }\n.tsf-gallery-enlarge { inset-inline-end: 12px; inset-block-end: 12px; }\n.tsf-gallery-previous:hover, .tsf-gallery-next:hover, .tsf-gallery-enlarge:hover { background: var(--throttle-color-background); }\n.tsf-gallery-counter {\n position: absolute;\n inset-inline-start: 12px;\n inset-block-end: 12px;\n margin: 0;\n padding: 2px 10px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--throttle-color-background) 88%, transparent);\n font-size: 12px;\n font-variant-numeric: tabular-nums;\n}\n.tsf-gallery-thumbs { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; overflow-x: auto; }\n.tsf-gallery-thumbs-item { flex: 0 0 72px; }\n.tsf-gallery-thumb {\n display: block;\n inline-size: 72px;\n padding: 0;\n border: 2px solid transparent;\n border-radius: calc(var(--throttle-sf-card-radius) / 1.5);\n background: var(--throttle-color-muted);\n overflow: hidden;\n cursor: pointer;\n opacity: 0.7;\n}\n.tsf-gallery-thumb:where([aria-current=\"true\"]) { border-color: var(--throttle-color-foreground); opacity: 1; }\n.tsf-gallery-thumb:hover { opacity: 1; }\n.tsf-gallery-thumb:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }\n\n/* Lightbox (inside the ui modal) */\n.tsf-lightbox { position: relative; display: grid; place-items: center; min-inline-size: min(92vw, 960px); min-block-size: 50vh; }\n.tsf-lightbox-title { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.tsf-lightbox-stage { display: grid; place-items: center; max-block-size: 82vh; }\n.tsf-lightbox-previous { inset-inline-start: 8px; inset-block-start: calc(50% - 22px); }\n.tsf-lightbox-next { inset-inline-end: 8px; inset-block-start: calc(50% - 22px); }\n.tsf-lightbox-counter { margin: 8px 0 0; font-size: 13px; color: var(--throttle-color-muted-foreground); font-variant-numeric: tabular-nums; }\n\n/* Buy box */\n.tsf-buy-box {\n position: var(--tsf-buy-position);\n inset-block-start: 24px;\n display: grid;\n gap: 16px;\n max-inline-size: var(--tsf-buy-max);\n inline-size: 100%;\n margin-inline: auto;\n min-inline-size: 0;\n}\n.tsf-buy-box-kicker { margin: 0; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--throttle-color-muted-foreground); }\n.tsf-buy-box-title {\n margin: 0;\n font-family: var(--throttle-font-family-heading, inherit);\n font-size: clamp(26px, 3vw, 36px);\n line-height: 1.15;\n font-weight: var(--throttle-sf-heading-weight);\n letter-spacing: var(--throttle-sf-heading-tracking);\n text-transform: var(--throttle-sf-heading-transform);\n overflow-wrap: anywhere;\n}\n.tsf-buy-box-rating { justify-self: start; color: inherit; text-decoration: none; }\n.tsf-buy-box-summary { margin: 0; color: var(--throttle-color-muted-foreground); line-height: 1.55; }\n.tsf-buy-box-price { margin: 0; font-size: 22px; }\n.tsf-buy-box-sku { margin: 0; font-size: 13px; color: var(--throttle-color-muted-foreground); }\n.tsf-buy-box-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }\n\n/* Variant picker */\n.tsf-variant-picker { display: grid; gap: 16px; }\n.tsf-variant-option { margin: 0; padding: 0; border: 0; min-inline-size: 0; }\n.tsf-variant-option-legend { display: flex; gap: 8px; align-items: baseline; padding: 0; margin-block-end: 8px; font-size: 14px; }\n.tsf-variant-option-name { font-weight: 600; }\n.tsf-variant-option-chosen { color: var(--throttle-color-muted-foreground); }\n.tsf-variant-option-values { display: flex; flex-wrap: wrap; gap: 8px; }\n.tsf-variant-value {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-inline-size: 44px;\n min-block-size: 44px;\n padding-inline: 14px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: var(--throttle-radius);\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n font: inherit;\n cursor: pointer;\n overflow: hidden;\n}\n.tsf-variant-value:where([data-kind=\"swatch\"]) { padding-inline: 0; border-radius: 999px; min-inline-size: 44px; }\n.tsf-variant-value:hover { border-color: var(--throttle-color-foreground); }\n.tsf-variant-value:where([aria-pressed=\"true\"]) { border-color: var(--throttle-color-foreground); box-shadow: inset 0 0 0 1px var(--throttle-color-foreground); }\n.tsf-variant-value:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }\n.tsf-variant-value:where([data-sold-out]), .tsf-variant-value:where([data-unavailable]) { color: var(--throttle-color-muted-foreground); }\n.tsf-variant-value:where([data-sold-out])::after {\n content: \"\";\n position: absolute;\n inset: 0;\n background: linear-gradient(to bottom right, transparent calc(50% - 1px), var(--throttle-color-muted-foreground) 50%, transparent calc(50% + 1px));\n pointer-events: none;\n}\n.tsf-variant-value:where([data-unavailable]) { border-style: dashed; }\n.tsf-variant-value-label { pointer-events: none; }\n\n/* Stock, quantity, add */\n.tsf-stock-status { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }\n.tsf-stock-status::before { content: \"\"; inline-size: 8px; block-size: 8px; border-radius: 999px; background: var(--throttle-sf-success); }\n.tsf-stock-status:where([data-state=\"low\"])::before { background: var(--throttle-sf-warning); }\n.tsf-stock-status:where([data-state=\"out\"])::before, .tsf-stock-status:where([data-state=\"no_currency\"])::before { background: var(--throttle-color-muted-foreground); }\n.tsf-stock-status:where([data-state=\"backorder\"])::before, .tsf-stock-status:where([data-state=\"preorder\"])::before { background: var(--throttle-sf-accent); }\n\n.tsf-quantity-input { display: inline-flex; align-items: stretch; border: 1px solid var(--throttle-color-border-control); border-radius: var(--throttle-radius); overflow: hidden; }\n.tsf-quantity-decrease, .tsf-quantity-increase {\n inline-size: 44px;\n min-block-size: 48px;\n padding: 0;\n border: 0;\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n font-size: 18px;\n cursor: pointer;\n}\n.tsf-quantity-decrease:where([aria-disabled=\"true\"]), .tsf-quantity-increase:where([aria-disabled=\"true\"]) { opacity: 0.4; cursor: not-allowed; }\n.tsf-quantity-field {\n inline-size: 56px;\n padding: 0;\n border: 0;\n border-inline: 1px solid var(--throttle-color-border);\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n font: inherit;\n text-align: center;\n appearance: textfield;\n -moz-appearance: textfield;\n}\n.tsf-quantity-field::-webkit-outer-spin-button, .tsf-quantity-field::-webkit-inner-spin-button { appearance: none; margin: 0; }\n\n.tsf-add-to-cart { display: grid; gap: 8px; min-inline-size: 0; }\n.tsf-add-to-cart-button, .tsf-sticky-add-to-cart-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n inline-size: 100%;\n min-block-size: 48px;\n padding-inline: 20px;\n border: 1px solid transparent;\n border-radius: var(--throttle-radius);\n background: var(--throttle-color-primary);\n color: var(--throttle-color-primary-foreground);\n font: inherit;\n font-weight: 600;\n cursor: pointer;\n}\n.tsf-add-to-cart-button:hover:not(:disabled), .tsf-sticky-add-to-cart-button:hover:not(:disabled) { filter: brightness(0.92); }\n.tsf-add-to-cart-button:disabled, .tsf-sticky-add-to-cart-button:disabled { opacity: 0.55; cursor: not-allowed; }\n.tsf-add-to-cart-button:where([aria-disabled=\"true\"]) { cursor: progress; }\n.tsf-add-to-cart-button:focus-visible, .tsf-sticky-add-to-cart-button:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }\n.tsf-add-to-cart-message { margin: 0; min-block-size: 1.4em; font-size: 14px; }\n.tsf-add-to-cart-message:where([data-tone=\"ok\"]) { color: var(--throttle-sf-success); }\n.tsf-add-to-cart-message:where([data-tone=\"refused\"]) { color: var(--throttle-sf-danger); }\n\n.tsf-sticky-add-to-cart {\n position: fixed;\n inset-inline: 0;\n inset-block-end: 0;\n z-index: var(--throttle-z-popover, 30);\n display: flex;\n align-items: center;\n gap: 16px;\n padding: 12px 16px;\n border-block-start: 1px solid var(--throttle-color-border);\n background: var(--throttle-color-background);\n box-shadow: var(--throttle-shadow-popover, 0 -4px 16px rgba(0, 0, 0, 0.08));\n}\n.tsf-sticky-add-to-cart-title { flex: 1 1 auto; margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-inline-size: 0; }\n.tsf-sticky-add-to-cart-price { margin: 0; flex: 0 0 auto; }\n.tsf-sticky-add-to-cart-button { inline-size: auto; flex: 0 0 auto; }\n\n/* Sections */\n.tsf-product-sections { display: grid; gap: 32px; }\n.tsf-product-sections:where([data-style=\"accordion\"]) { gap: 0; border-block-start: 1px solid var(--throttle-color-border); }\n.tsf-product-section { min-inline-size: 0; scroll-margin-block-start: 16px; }\n.tsf-product-section:where([hidden]) { display: none; }\n.tsf-product-section-title {\n margin: 0 0 12px;\n font-family: var(--throttle-font-family-heading, inherit);\n font-size: 22px;\n font-weight: var(--throttle-sf-heading-weight);\n letter-spacing: var(--throttle-sf-heading-tracking);\n text-transform: var(--throttle-sf-heading-transform);\n}\n.tsf-product-section-title:where([data-in-tabs]) { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.tsf-product-section-trigger {\n display: flex;\n align-items: center;\n justify-content: space-between;\n inline-size: 100%;\n min-block-size: 56px;\n padding: 0;\n border: 0;\n border-block-end: 1px solid var(--throttle-color-border);\n background: none;\n color: inherit;\n font: inherit;\n text-align: start;\n cursor: pointer;\n}\n.tsf-product-section-trigger:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.tsf-product-section-body { padding-block: 16px; min-inline-size: 0; }\n.tsf-product-section-body:where([hidden]) { display: none; }\n.tsf-product-specs { display: grid; margin: 0; }\n.tsf-product-specs-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: 16px; padding-block: 10px; border-block-end: 1px solid var(--throttle-color-border); }\n.tsf-product-specs-label { margin: 0; color: var(--throttle-color-muted-foreground); text-transform: capitalize; }\n.tsf-product-specs-value { margin: 0; overflow-wrap: anywhere; }\n.tsf-shipping-section { line-height: 1.6; }\n\n.tsf-tag-list, .tsf-category-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }\n.tsf-tag-list-link, .tsf-category-list-link {\n display: inline-flex;\n align-items: center;\n min-block-size: 36px;\n padding-inline: 14px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: 999px;\n color: inherit;\n text-decoration: none;\n font-size: 14px;\n}\n.tsf-tag-list-link:hover, .tsf-category-list-link:hover { border-color: var(--throttle-color-foreground); }\n\n.tsf-related-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--throttle-sf-grid-gap); margin: 0; padding: 0; list-style: none; }\n.tsf-related-products-item { min-inline-size: 0; }\n\n/* Reviews */\n.tsf-product-reviews { display: grid; gap: 24px; }\n.tsf-product-reviews-summary { display: grid; gap: 12px; max-inline-size: 420px; }\n.tsf-product-reviews-main { display: grid; gap: 24px; min-inline-size: 0; }\n@media (min-width: 768px) {\n .tsf-product-reviews:where([data-layout=\"columns\"]) { grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr); gap: 48px; align-items: start; }\n .tsf-product-reviews-summary:where([data-layout=\"columns\"]) { max-inline-size: none; }\n}\n.tsf-product-reviews-average { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 36px; font-weight: 600; }\n.tsf-product-reviews-histogram { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }\n.tsf-product-reviews-histogram-row {\n display: grid;\n grid-template-columns: 36px minmax(0, 1fr) 32px;\n align-items: center;\n gap: 10px;\n inline-size: 100%;\n min-block-size: 32px;\n padding: 0 6px;\n border: 1px solid transparent;\n border-radius: var(--throttle-radius-sm, 6px);\n background: none;\n color: inherit;\n font: inherit;\n font-size: 14px;\n cursor: pointer;\n}\n.tsf-product-reviews-histogram-row:hover { background: var(--throttle-color-muted); }\n.tsf-product-reviews-histogram-row:where([aria-pressed=\"true\"]) { border-color: var(--throttle-color-foreground); background: var(--throttle-color-muted); }\n.tsf-product-reviews-histogram-row:focus-visible { outline: 2px solid var(--throttle-color-primary); }\n.tsf-product-reviews-histogram-bar { display: block; block-size: 8px; border-radius: 999px; background: var(--throttle-color-muted); overflow: hidden; }\n.tsf-product-reviews-histogram-fill { display: block; block-size: 100%; background: var(--throttle-color-warning); }\n.tsf-product-reviews-histogram-count { text-align: end; font-variant-numeric: tabular-nums; color: var(--throttle-color-muted-foreground); }\n.tsf-product-reviews-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }\n.tsf-product-reviews-clear { min-block-size: 44px; padding-inline: 4px; border: 0; background: none; color: var(--throttle-sf-accent); font: inherit; text-decoration: underline; cursor: pointer; }\n.tsf-product-reviews-list { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }\n.tsf-product-review { display: grid; gap: 6px; padding-block-end: 20px; border-block-end: 1px solid var(--throttle-color-border); }\n.tsf-product-review-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.tsf-product-review-date { font-size: 13px; color: var(--throttle-color-muted-foreground); }\n.tsf-product-review-title { margin: 0; font-size: 16px; }\n.tsf-product-review-body { margin: 0; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-line; }\n.tsf-product-review-author { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--throttle-color-muted-foreground); }\n.tsf-product-review-reply { padding: 12px 16px; border-inline-start: 3px solid var(--throttle-color-border-control); background: var(--throttle-color-muted); font-size: 14px; }\n.tsf-product-reviews-load-more {\n justify-self: start;\n min-block-size: 44px;\n padding-inline: 20px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: var(--throttle-radius);\n background: var(--throttle-color-background);\n color: inherit;\n font: inherit;\n cursor: pointer;\n}\n.tsf-product-reviews-load-more:where([aria-disabled=\"true\"]) { cursor: progress; opacity: 0.7; }\n.tsf-product-reviews-empty, .tsf-product-reviews-gate, .tsf-product-reviews-error { margin: 0; color: var(--throttle-color-muted-foreground); }\n.tsf-product-reviews-error { color: var(--throttle-sf-danger); }\n\n.tsf-review-form { display: grid; gap: 14px; max-inline-size: 520px; padding: 20px; border: 1px solid var(--throttle-color-border); border-radius: var(--throttle-sf-card-radius); }\n.tsf-review-form-title { margin: 0; font-weight: 600; font-size: 18px; }\n.tsf-review-form-stars { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; border: 0; }\n.tsf-review-form-star { position: relative; display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; font-size: 26px; color: var(--throttle-color-border-control); cursor: pointer; }\n.tsf-review-form-star:where([data-on=\"true\"]) { color: var(--throttle-color-warning); }\n.tsf-review-form-star-input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }\n.tsf-review-form-star:focus-within { outline: 2px solid var(--throttle-color-primary); border-radius: 6px; }\n.tsf-review-form-field { display: grid; gap: 6px; font-size: 14px; }\n.tsf-review-form-textarea { padding: 10px 12px; border: 1px solid var(--throttle-color-border-control); border-radius: var(--throttle-radius); background: var(--throttle-color-background); color: inherit; font: inherit; resize: vertical; }\n.tsf-review-form-error { display: block; font-size: 13px; color: var(--throttle-sf-danger); }\n.tsf-review-form-submit { justify-self: start; min-block-size: 48px; padding-inline: 24px; border: 0; border-radius: var(--throttle-radius); background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground); font: inherit; font-weight: 600; cursor: pointer; }\n.tsf-review-form-submit:where([aria-disabled=\"true\"]) { cursor: progress; opacity: 0.7; }\n.tsf-review-form-thanks { margin: 0; padding: 14px 16px; border-radius: var(--throttle-radius); background: var(--throttle-color-success-surface, var(--throttle-color-muted)); }\n\n@media (prefers-reduced-motion: reduce) {\n .tsf-gallery-item { transition: none; }\n}\n`;\n","/**\n * The shop-all sections' rules. Single-class selectors (a variant or state is\n * a `:where([data-...])` on the same class) and logical properties only. The\n * filters become a drawer below 768px, the width the component also uses.\n * No backticks inside: this is a template literal.\n */\nexport const SHOP_CSS = `\n.tsf-shop-all { display: flex; flex-direction: column; gap: 16px; min-inline-size: 0; padding-block: 24px; }\n\n.tsf-shop-all-heading {\n margin: 0;\n font-size: 28px;\n line-height: 1.2;\n font-weight: var(--throttle-sf-heading-weight);\n letter-spacing: var(--throttle-sf-heading-tracking);\n text-transform: var(--throttle-sf-heading-transform);\n}\n.tsf-shop-all-description { margin: 0; max-inline-size: 70ch; color: var(--throttle-color-muted-foreground); line-height: 1.6; }\n\n.tsf-shop-all-breadcrumb-list { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--throttle-color-muted-foreground); }\n.tsf-shop-all-breadcrumb:where(:not(:last-child))::after { content: \"/\"; margin-inline-start: 8px; opacity: 0.6; }\n.tsf-shop-all-breadcrumb-link { color: inherit; text-decoration: none; }\n.tsf-shop-all-breadcrumb-link:hover { color: var(--throttle-color-foreground); text-decoration: underline; }\n\n.tsf-shop-all-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }\n.tsf-shop-all-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }\n.tsf-result-count { margin: 0; color: var(--throttle-color-muted-foreground); font-size: 14px; }\n\n.tsf-shop-all-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }\n.tsf-shop-all-body:where([data-layout=\"sidebar\"]) { grid-template-columns: 240px minmax(0, 1fr); }\n.tsf-shop-all-main { display: flex; flex-direction: column; gap: 24px; min-inline-size: 0; }\n\n.tsf-live-region {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Sort */\n.tsf-sort-select { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }\n.tsf-sort-select-input,\n.tsf-facet-select,\n.tsf-facet-search,\n.tsf-facet-range-input {\n min-block-size: 44px;\n padding-inline: 12px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: var(--throttle-sf-card-radius);\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n font: inherit;\n box-sizing: border-box;\n}\n.tsf-facet-select, .tsf-facet-search { inline-size: 100%; }\n\n/* Filters: the column */\n.tsf-filter-sidebar { display: flex; flex-direction: column; gap: 4px; min-inline-size: 0; }\n.tsf-filter-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block-end: 8px; }\n.tsf-filter-sidebar-title { margin: 0; font-size: 16px; font-weight: var(--throttle-sf-heading-weight); }\n.tsf-filter-clear, .tsf-active-filters-clear, .tsf-facet-range-clear, .tsf-facet-show-all {\n padding: 0;\n min-block-size: 44px;\n border: 0;\n background: none;\n color: var(--throttle-sf-accent);\n font: inherit;\n font-size: 14px;\n text-decoration: underline;\n text-underline-offset: 2px;\n cursor: pointer;\n}\n\n/* Filters: the top bar and the drawer trigger */\n.tsf-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }\n.tsf-filter-bar-more,\n.tsf-filter-drawer-trigger {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n min-block-size: 44px;\n padding-inline: 14px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: var(--throttle-sf-card-radius);\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n font: inherit;\n cursor: pointer;\n}\n.tsf-filter-drawer-count, .tsf-facet-selected {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-inline-size: 20px;\n padding-inline: 6px;\n border-radius: 999px;\n background: var(--throttle-sf-accent);\n color: var(--throttle-color-background);\n font-size: 12px;\n line-height: 20px;\n}\n\n/* A facet */\n.tsf-facet { min-inline-size: 0; border-block-start: 1px solid var(--throttle-color-border); }\n.tsf-facet:where([data-presentation=\"dropdown\"]) { border: 0; position: relative; }\n.tsf-facet-heading { margin: 0; font-size: 15px; }\n.tsf-facet-toggle {\n display: flex;\n align-items: center;\n gap: 8px;\n inline-size: 100%;\n min-block-size: 44px;\n padding: 0;\n border: 0;\n background: none;\n color: inherit;\n font: inherit;\n font-weight: 600;\n text-align: start;\n cursor: pointer;\n}\n.tsf-facet-label { flex: 1; text-align: start; }\n.tsf-facet-body { padding-block-end: 12px; }\n.tsf-facet-fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }\n.tsf-facet-legend {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n.tsf-facet-trigger {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n min-block-size: 44px;\n padding-inline: 14px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: var(--throttle-sf-card-radius);\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n font: inherit;\n cursor: pointer;\n}\n.tsf-facet-trigger:where([aria-expanded=\"true\"]) { border-color: var(--throttle-color-foreground); }\n.tsf-facet-panel {\n position: absolute;\n inset-block-start: calc(100% + 4px);\n inset-inline-start: 0;\n z-index: 20;\n min-inline-size: 240px;\n max-block-size: 360px;\n overflow-y: auto;\n padding: 8px 14px;\n border: 1px solid var(--throttle-color-border);\n border-radius: var(--throttle-sf-card-radius);\n background: var(--throttle-color-background);\n box-shadow: 0 8px 24px rgb(0 0 0 / 0.14);\n}\n.tsf-facet-options { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }\n.tsf-facet-search { margin-block-end: 8px; }\n.tsf-facet-option-label { display: flex; align-items: center; gap: 10px; min-block-size: 44px; cursor: pointer; font-size: 14px; }\n.tsf-facet-option:where([data-empty]) { opacity: 0.5; }\n.tsf-facet-option-input { inline-size: 18px; block-size: 18px; margin: 0; accent-color: var(--throttle-sf-accent); }\n.tsf-facet-option-text { flex: 1; overflow-wrap: anywhere; }\n.tsf-facet-option-count { color: var(--throttle-color-muted-foreground); font-variant-numeric: tabular-nums; font-size: 13px; }\n.tsf-facet-empty { margin: 0; color: var(--throttle-color-muted-foreground); font-size: 14px; }\n.tsf-facet-boolean { display: flex; flex-direction: column; }\n\n.tsf-facet-range { display: flex; flex-direction: column; gap: 8px; }\n.tsf-facet-range-fields { display: flex; gap: 8px; }\n.tsf-facet-range-field { display: flex; flex: 1; flex-direction: column; gap: 4px; min-inline-size: 0; font-size: 13px; }\n.tsf-facet-range-input { inline-size: 100%; }\n.tsf-facet-range-error { margin: 0; color: var(--throttle-sf-danger); font-size: 13px; }\n.tsf-facet-range-hint { margin: 0; color: var(--throttle-color-muted-foreground); font-size: 13px; }\n.tsf-facet-range-actions { display: flex; align-items: center; gap: 12px; }\n.tsf-facet-range-apply {\n min-block-size: 44px;\n padding-inline: 16px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: var(--throttle-sf-card-radius);\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n font: inherit;\n cursor: pointer;\n}\n\n/* Filters: the drawer */\n.tsf-filter-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 20px; border-block-end: 1px solid var(--throttle-color-border); }\n.tsf-filter-drawer-title { margin: 0; font-size: 18px; font-weight: var(--throttle-sf-heading-weight); }\n.tsf-filter-drawer-close { display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; border: 0; background: none; color: inherit; cursor: pointer; }\n.tsf-filter-drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; }\n.tsf-filter-drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-block-start: 1px solid var(--throttle-color-border); }\n.tsf-filter-drawer-apply {\n flex: 1;\n min-block-size: 44px;\n padding-inline: 16px;\n border: 0;\n border-radius: var(--throttle-sf-card-radius);\n background: var(--throttle-color-primary);\n color: var(--throttle-color-primary-foreground);\n font: inherit;\n font-weight: 600;\n cursor: pointer;\n}\n\n/* The chips */\n.tsf-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }\n.tsf-active-filter-remove {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-block-size: 36px;\n padding-inline: 12px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: 999px;\n background: var(--throttle-color-muted);\n color: inherit;\n font: inherit;\n font-size: 13px;\n cursor: pointer;\n}\n\n/* The grid */\n.tsf-product-grid-pages { display: flex; flex-direction: column; gap: var(--throttle-sf-grid-gap); }\n.tsf-product-grid, .tsf-product-grid-skeleton {\n display: grid;\n grid-template-columns: repeat(var(--tsf-cols-mobile, 2), minmax(0, 1fr));\n gap: var(--throttle-sf-grid-gap);\n align-items: start;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n@media (min-width: 768px) {\n .tsf-product-grid, .tsf-product-grid-skeleton { grid-template-columns: repeat(var(--tsf-cols-desktop, 4), minmax(0, 1fr)); }\n}\n.tsf-product-grid:where([data-previous]) { opacity: 0.55; transition: opacity 0.15s ease; }\n.tsf-product-grid-item { min-inline-size: 0; }\n.tsf-product-grid-skeleton-item { aspect-ratio: 4 / 5; border-radius: var(--throttle-sf-card-radius); background: var(--throttle-color-muted); animation: tsf-shop-pulse 1.4s ease-in-out infinite; }\n@keyframes tsf-shop-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }\n@media (prefers-reduced-motion: reduce) {\n .tsf-product-grid-skeleton-item { animation: none; }\n .tsf-product-grid:where([data-previous]) { transition: none; }\n}\n.tsf-product-grid-empty, .tsf-product-grid-error { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-block: 48px; text-align: center; color: var(--throttle-color-muted-foreground); }\n\n/* Pagination */\n.tsf-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }\n.tsf-pagination-list { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }\n.tsf-pagination-link, .tsf-pagination-step, .tsf-pagination-gap {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-inline-size: 44px;\n min-block-size: 44px;\n padding-inline: 8px;\n border-radius: var(--throttle-sf-card-radius);\n color: inherit;\n text-decoration: none;\n font-variant-numeric: tabular-nums;\n box-sizing: border-box;\n}\n.tsf-pagination-link:hover, .tsf-pagination-step:hover { background: var(--throttle-color-muted); }\n.tsf-pagination-link:where([aria-current=\"page\"]) { border: 1px solid var(--throttle-color-foreground); font-weight: 600; }\n.tsf-pagination-step:where([data-disabled]) { opacity: 0.4; }\n.tsf-pagination-more {\n min-block-size: 44px;\n padding-inline: 24px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: var(--throttle-sf-card-radius);\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n font: inherit;\n cursor: pointer;\n}\n.tsf-pagination-more:where([aria-disabled=\"true\"]) { opacity: 0.6; cursor: progress; }\n.tsf-pagination-crawl {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n}\n\n/* From 768px up the sidebar or the bar are the filters, and the drawer's button is only for phones. */\n@media (min-width: 768px) {\n .tsf-filter-drawer-trigger:where([data-phone-only]) { display: none; }\n}\n\n/* Phones: every filter layout is the drawer. */\n@media (max-width: 767px) {\n .tsf-filter-sidebar, .tsf-filter-bar { display: none; }\n .tsf-shop-all-body:where([data-layout=\"sidebar\"]) { grid-template-columns: minmax(0, 1fr); }\n}\n`;\n","/**\n * The cart drawer, quick add, quick view, recently viewed and compare. Single-class selectors and\n * logical properties only; a state is a `:where()` attribute so it stays one class in specificity.\n * No backticks inside: this is a template literal.\n */\nexport const SHOPPER_CSS = `\n/* Cart drawer */\n.tsf-cart-drawer {\n display: flex;\n flex-direction: column;\n block-size: 100%;\n min-block-size: 0;\n color: var(--throttle-color-foreground);\n}\n.tsf-cart-drawer:where([data-inline]) { block-size: auto; }\n.tsf-cart-drawer-top {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding-block: 12px;\n padding-inline: 20px;\n border-block-end: 1px solid var(--throttle-color-border);\n}\n.tsf-cart-drawer-title {\n margin: 0;\n font-family: var(--throttle-font-family-heading, inherit);\n font-size: 20px;\n font-weight: var(--throttle-sf-heading-weight);\n letter-spacing: var(--throttle-sf-heading-tracking);\n text-transform: var(--throttle-sf-heading-transform);\n}\n.tsf-cart-drawer-title:where([data-inline]) { margin-block-end: 12px; }\n.tsf-cart-drawer-close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-inline-size: 44px;\n min-block-size: 44px;\n border: 0;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n cursor: pointer;\n}\n.tsf-cart-drawer-close:focus-visible,\n.tsf-cart-line-remove:focus-visible,\n.tsf-cart-line-decrease:focus-visible,\n.tsf-cart-line-increase:focus-visible,\n.tsf-cart-checkout:focus-visible,\n.tsf-cart-continue:focus-visible,\n.tsf-quick-add-button:focus-visible,\n.tsf-compare-button:focus-visible,\n.tsf-compare-clear:focus-visible,\n.tsf-compare-product-remove:focus-visible {\n outline: 2px solid var(--throttle-color-primary);\n outline-offset: 2px;\n}\n.tsf-cart-drawer-body {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-block-size: 0;\n}\n.tsf-cart-status:empty { display: none; }\n.tsf-cart-status { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.tsf-cart-error {\n margin: 12px 20px 0;\n padding: 10px 12px;\n border-radius: var(--throttle-radius);\n background: var(--throttle-color-muted);\n color: var(--throttle-sf-danger);\n font-size: 14px;\n}\n.tsf-cart-loading { padding: 20px; }\n.tsf-cart-empty { display: grid; justify-items: center; gap: 16px; padding: 48px 20px; text-align: center; }\n.tsf-cart-empty-text { margin: 0; color: var(--throttle-color-muted-foreground); }\n.tsf-cart-lines {\n flex: 1 1 auto;\n min-block-size: 0;\n margin: 0;\n padding: 0 20px;\n list-style: none;\n overflow-y: auto;\n}\n.tsf-cart-line {\n display: grid;\n grid-template-columns: 72px minmax(0, 1fr) auto;\n grid-template-areas: \"media body total\" \"media body remove\";\n align-items: start;\n gap: 4px 12px;\n padding-block: 16px;\n border-block-end: 1px solid var(--throttle-color-border);\n}\n.tsf-cart-line:where([data-busy]) { opacity: 0.7; }\n.tsf-cart-line-media { grid-area: media; overflow: hidden; border-radius: var(--throttle-radius); background: var(--throttle-color-muted); }\n.tsf-cart-line-body { grid-area: body; display: grid; gap: 4px; min-inline-size: 0; }\n.tsf-cart-line-name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }\n.tsf-cart-line-price { margin: 0; color: var(--throttle-color-muted-foreground); font-size: 14px; }\n.tsf-cart-line-note { margin: 0; color: var(--throttle-sf-danger); font-size: 13px; }\n.tsf-cart-line-quantity {\n display: inline-flex;\n align-items: center;\n justify-self: start;\n margin-block-start: 4px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: var(--throttle-radius);\n}\n.tsf-cart-line-decrease,\n.tsf-cart-line-increase {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-inline-size: 44px;\n min-block-size: 44px;\n border: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n}\n.tsf-cart-line-decrease:disabled,\n.tsf-cart-line-increase:disabled { opacity: 0.4; cursor: not-allowed; }\n.tsf-cart-line-count { min-inline-size: 28px; text-align: center; font-variant-numeric: tabular-nums; }\n.tsf-cart-line-total { grid-area: total; margin: 0; font-weight: 600; text-align: end; }\n.tsf-cart-line-remove {\n grid-area: remove;\n align-self: end;\n justify-self: end;\n min-block-size: 44px;\n padding-inline: 4px;\n border: 0;\n background: transparent;\n color: var(--throttle-color-muted-foreground);\n font: inherit;\n font-size: 13px;\n text-decoration: underline;\n cursor: pointer;\n}\n.tsf-cart-line-remove:disabled { opacity: 0.5; cursor: not-allowed; }\n.tsf-cart-footer {\n display: grid;\n gap: 12px;\n padding-block: 16px;\n padding-inline: 20px;\n border-block-start: 1px solid var(--throttle-color-border);\n background: var(--throttle-color-background);\n}\n.tsf-cart-subtotal { display: flex; align-items: baseline; justify-content: space-between; margin: 0; font-size: 18px; font-weight: 600; }\n.tsf-cart-checkout {\n min-block-size: 48px;\n padding-inline: 20px;\n border: 1px solid transparent;\n border-radius: var(--throttle-radius);\n background: var(--throttle-color-primary);\n color: var(--throttle-color-primary-foreground);\n font: inherit;\n font-weight: 600;\n cursor: pointer;\n}\n.tsf-cart-checkout:hover:not(:disabled) { filter: brightness(0.92); }\n.tsf-cart-checkout:disabled { opacity: 0.55; cursor: not-allowed; }\n.tsf-cart-checkout:where([aria-disabled=\"true\"]) { cursor: progress; }\n.tsf-cart-continue {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-block-size: 44px;\n padding-inline: 12px;\n border: 0;\n background: transparent;\n color: var(--throttle-sf-accent);\n font: inherit;\n text-decoration: underline;\n cursor: pointer;\n}\n\n/* Quick add */\n.tsf-quick-add { position: relative; display: grid; gap: 4px; justify-items: end; }\n.tsf-quick-add-button,\n.tsf-compare-button {\n min-block-size: 44px;\n padding-inline: 14px;\n border: 1px solid var(--throttle-color-border-control);\n border-radius: var(--throttle-radius);\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n font: inherit;\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n}\n.tsf-quick-add-button:hover,\n.tsf-compare-button:hover:not(:disabled) { background: var(--throttle-color-muted); }\n.tsf-quick-add-button:where([aria-disabled=\"true\"]) { cursor: progress; }\n.tsf-compare-button:where([aria-pressed=\"true\"]) { border-color: var(--throttle-sf-accent); color: var(--throttle-sf-accent); }\n.tsf-compare-button:disabled { opacity: 0.5; cursor: not-allowed; }\n.tsf-quick-add-message { margin: 0; max-inline-size: 220px; font-size: 13px; text-align: end; }\n.tsf-quick-add-message:empty { display: none; }\n.tsf-quick-add-message:where([data-tone=\"ok\"]) { color: var(--throttle-sf-success); }\n.tsf-quick-add-message:where([data-tone=\"refused\"]) { color: var(--throttle-sf-danger); }\n.tsf-quick-add-panel {\n position: fixed;\n z-index: var(--throttle-z-popover, 30);\n display: grid;\n gap: 12px;\n inline-size: min(280px, calc(100vw - 16px));\n overflow-y: auto;\n padding: 16px;\n border: 1px solid var(--throttle-color-border);\n border-radius: var(--throttle-radius);\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n box-shadow: var(--throttle-shadow-popover, 0 8px 24px rgba(0, 0, 0, 0.12));\n text-align: start;\n}\n.tsf-quick-add-title { margin: 0; font-weight: 600; }\n\n/* Quick view */\n.tsf-quick-view-title {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n.tsf-quick-view { padding: 24px; }\n.tsf-quick-view-message { margin: 0; padding: 24px; text-align: center; color: var(--throttle-color-muted-foreground); }\n.tsf-quick-view-body { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }\n@media (min-width: 640px) {\n .tsf-quick-view-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }\n}\n.tsf-quick-view-gallery, .tsf-quick-view-details { min-inline-size: 0; }\n.tsf-quick-view-details { display: grid; align-content: start; gap: 16px; }\n.tsf-quick-view-link { color: var(--throttle-sf-accent); text-decoration: underline; }\n\n/* Recently viewed */\n.tsf-recently-viewed { display: grid; gap: 16px; }\n.tsf-recently-viewed-title {\n margin: 0;\n font-family: var(--throttle-font-family-heading, inherit);\n font-size: 22px;\n font-weight: var(--throttle-sf-heading-weight);\n letter-spacing: var(--throttle-sf-heading-tracking);\n text-transform: var(--throttle-sf-heading-transform);\n}\n.tsf-recently-viewed-list {\n display: flex;\n gap: var(--throttle-sf-grid-gap, 16px);\n margin: 0;\n padding: 0;\n list-style: none;\n overflow-x: auto;\n scroll-snap-type: x proximity;\n}\n.tsf-recently-viewed-item { flex: 0 0 min(220px, 60vw); min-inline-size: 0; scroll-snap-align: start; }\n\n/* Compare */\n.tsf-compare { display: grid; gap: 16px; }\n.tsf-compare-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.tsf-compare-title {\n margin: 0;\n font-family: var(--throttle-font-family-heading, inherit);\n font-size: 22px;\n font-weight: var(--throttle-sf-heading-weight);\n letter-spacing: var(--throttle-sf-heading-tracking);\n text-transform: var(--throttle-sf-heading-transform);\n}\n.tsf-compare-clear {\n min-block-size: 44px;\n padding-inline: 12px;\n border: 0;\n background: transparent;\n color: var(--throttle-sf-accent);\n font: inherit;\n text-decoration: underline;\n cursor: pointer;\n}\n.tsf-compare-empty { margin: 0; color: var(--throttle-color-muted-foreground); }\n.tsf-compare-scroll { overflow-x: auto; }\n.tsf-compare-table { inline-size: 100%; min-inline-size: 560px; border-collapse: collapse; table-layout: fixed; }\n.tsf-compare-caption {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n.tsf-compare-label {\n inline-size: 140px;\n padding: 12px;\n border-block-end: 1px solid var(--throttle-color-border);\n color: var(--throttle-color-muted-foreground);\n font-size: 14px;\n font-weight: 600;\n text-align: start;\n vertical-align: top;\n}\n.tsf-compare-product {\n position: relative;\n padding: 12px;\n border-block-end: 1px solid var(--throttle-color-border);\n font-weight: 600;\n text-align: start;\n vertical-align: top;\n}\n.tsf-compare-product-media { overflow: hidden; margin-block-end: 8px; border-radius: var(--throttle-radius); background: var(--throttle-color-muted); }\n.tsf-compare-product-link { color: inherit; text-decoration: none; }\n.tsf-compare-product-link:hover { text-decoration: underline; }\n.tsf-compare-product-remove {\n position: absolute;\n inset-block-start: 4px;\n inset-inline-end: 4px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-inline-size: 44px;\n min-block-size: 44px;\n border: 0;\n border-radius: 999px;\n background: var(--throttle-color-background);\n color: var(--throttle-color-foreground);\n cursor: pointer;\n}\n.tsf-compare-cell { padding: 12px; border-block-end: 1px solid var(--throttle-color-border); vertical-align: top; overflow-wrap: anywhere; }\n`;\n","import { toAuthAppearance } from '@usethrottle/catalog';\nimport type { ThemeTokens, ThrottleVariables } from '@usethrottle/ui';\nimport { brighten, isHexColor, mix, normalizeHex } from './color';\n\ntype Scheme = 'light' | 'dark';\n\n/** The `--throttle-sf-*` custom properties the storefront stylesheet reads. */\nexport type SfVariables = Record<`--throttle-sf-${string}`, string>;\n\nconst BLACK = '#000000';\n\nconst GRID_GAP: Record<ThemeTokens['spacingScale'], string> = {\n compact: '12px',\n comfortable: '20px',\n roomy: '32px',\n};\n\n/** A palette colour as `#rrggbb`, or `undefined` when it is not a hex colour (so nothing odd reaches CSS). */\nconst hex = (value: unknown): string | undefined => (isHexColor(value) ? normalizeHex(value) : undefined);\n\n/**\n * The theme as the two variable layers the storefront renders from.\n *\n * - `variables` are `@usethrottle/ui`'s variables (the catalog SDK's own\n * mapping, so storefront and auth components agree on every colour, the body\n * font stack and the radius);\n * - `sf` are the storefront-only properties: the accent colours that have no\n * ui variable, the card radius and the grid gap.\n *\n * The derived accent shades use Meridian's formulas: `accent-hover` is the\n * accent mixed toward black in the light scheme and brightened in the dark one,\n * and `accent-subtle` is a wash of the brightened accent over the surface.\n * Server-safe: no React, no DOM.\n */\nexport function themeToVariables(\n theme: ThemeTokens,\n scheme: Scheme,\n): { variables: ThrottleVariables; sf: SfVariables } {\n const mapped = toAuthAppearance(\n { light: theme.light, dark: theme.dark, fonts: theme.fonts as never, radius: theme.radius },\n scheme,\n );\n const variables: ThrottleVariables = { ...mapped.variables };\n\n const palette = theme[scheme];\n const sf: SfVariables = {\n '--throttle-sf-card-radius': `${Number.isFinite(theme.radius) ? theme.radius : 0}px`,\n '--throttle-sf-grid-gap': GRID_GAP[theme.spacingScale] ?? GRID_GAP.comfortable,\n };\n const put = (name: string, value: string | undefined) => {\n if (value !== undefined) sf[`--throttle-sf-${name}`] = value;\n };\n put('sale', hex(palette.colorSale));\n put('success', hex(palette.colorSuccess));\n put('warning', hex(palette.colorWarning));\n put('danger', hex(palette.colorDanger));\n\n const accent = hex(palette.colorAccent);\n if (accent !== undefined) {\n const bright = brighten(accent, 0.165, 1.15);\n const surface = hex(palette.colorSurface);\n put('accent', accent);\n put('accent-hover', scheme === 'light' ? mix(accent, BLACK, 0.8) : bright);\n put('accent-subtle', surface === undefined ? undefined : mix(bright, surface, 0.15));\n }\n return { variables, sf };\n}\n","import { useMemo, useSyncExternalStore } from 'react';\n\n/** Navigation as the components use it. Next's router is adapted to this by `StorefrontNextProvider`. */\nexport type StorefrontRouter = {\n pathname: string;\n searchParams: URLSearchParams;\n push(href: string, options?: { scroll?: boolean }): void;\n replace(href: string, options?: { scroll?: boolean }): void;\n};\n\nconst listeners = new Set<() => void>();\nconst notify = () => listeners.forEach((l) => l());\n\nfunction subscribe(listener: () => void): () => void {\n if (listeners.size === 0) window.addEventListener('popstate', notify);\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n if (listeners.size === 0) window.removeEventListener('popstate', notify);\n };\n}\n\nconst snapshot = () => window.location.pathname + window.location.search;\nconst serverSnapshot = () => '/';\n\nfunction navigate(mode: 'push' | 'replace', href: string, options?: { scroll?: boolean }): void {\n window.history[mode === 'push' ? 'pushState' : 'replaceState'](null, '', href);\n notify();\n if (options?.scroll !== false) window.scrollTo(0, 0);\n}\n\n/**\n * The default router (plain React, Vite): the browser's History API. It\n * re-renders on `popstate` and after its own `push` / `replace`. On the server\n * it answers `/` with no query; a Next store uses `StorefrontNextProvider`.\n */\nexport function useHistoryRouter(): StorefrontRouter {\n const location = useSyncExternalStore(subscribe, snapshot, serverSnapshot);\n return useMemo(() => {\n const at = location.indexOf('?');\n return {\n pathname: at === -1 ? location : location.slice(0, at),\n searchParams: new URLSearchParams(at === -1 ? '' : location.slice(at + 1)),\n push: (href, options) => navigate('push', href, options),\n replace: (href, options) => navigate('replace', href, options),\n };\n }, [location]);\n}\n","import { createCatalogClient, type CatalogClient } from '@usethrottle/catalog';\nimport {\n CatalogProvider,\n useGenerationWatch,\n useStorefrontSettings,\n type CartStorage,\n type CartUrls,\n type CatalogProviderProps,\n} from '@usethrottle/catalog/react';\nimport {\n ThrottleUIProvider,\n isRtlLocale,\n useAppearance,\n useInjectStyles,\n useSiteDesign,\n type IconOverrides,\n type PresetName,\n type ThemeTokens,\n type ThrottleAppearance,\n type ThrottleVariables,\n} from '@usethrottle/ui';\nimport { useMemo, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { usePart } from '../parts';\nimport { DefaultLink, type LinkComponent } from '../link';\nimport { normalizeSettings, type NormalizedSettings } from '../settings/normalize';\nimport { resolveSiteDesign, type ResolvedSiteDesign } from '../site/resolve';\nimport {\n STOREFRONT_LAYER_ORDER,\n STOREFRONT_LAYER_ORDER_ID,\n STOREFRONT_STYLES,\n STOREFRONT_STYLE_ID,\n} from '../styles';\nimport { SfLocalizationProvider } from '../strings/localization';\nimport type { StorefrontLocalization } from '../strings';\nimport { themeToVariables, type SfVariables } from '../theme/to-variables';\nimport { CartDrawerContext } from './cart-drawer';\nimport {\n StorefrontContext,\n type AnalyticsSink,\n type StorefrontAppearance,\n type StorefrontContextValue,\n} from './context';\nimport { useHistoryRouter, type StorefrontRouter } from './router';\n\n/** The props of `StorefrontProvider`. Give it a `catalogKey` (or a `client`) and everything else has a default. */\nexport type StorefrontProviderProps = {\n /** The catalog's publishable key. Give this or `client`. */\n catalogKey?: string;\n /** A ready catalog client (a server-built one, or a fixture in tests). */\n client?: CatalogClient;\n /** The settings answered on the server (`loadSettings`); the first render uses them with no request. */\n settings?: NormalizedSettings;\n /** Whether the catalog's lists carry ratings (`/config` `reviews`; the server loaders return it). Default true. */\n reviewsOnLists?: boolean;\n /** A preset's name. A Builder's theme wins over it; it wins over the catalog's theme (R11). */\n preset?: PresetName;\n /** Token overrides, merged over the preset. */\n theme?: Partial<ThemeTokens>;\n /** Colour scheme. Default: the site design's, else `'auto'` (follows the visitor's system setting). */\n scheme?: 'light' | 'dark' | 'auto';\n /**\n * BCP 47 locale (`'en'`, `'de'`, `'ar'`), sent to the catalog when the provider makes the client; picks `dir` when\n * that is not given. Default `'en'`.\n */\n locale?: string;\n /**\n * ISO 4217 code prices are read in (`'EUR'`), sent to the catalog when the provider makes the client. Default: the\n * catalog's. Every amount is shown by `formatMoney` in its own record's currency.\n */\n currency?: string;\n /** Default: from `locale`. */\n dir?: 'ltr' | 'rtl';\n /**\n * Style overrides: `parts` (class names per part key), `variables` / `darkVariables` (token overrides that win over every other theme source).\n */\n appearance?: StorefrontAppearance;\n /**\n * Text overrides keyed by string key, for any language. Site-design and catalog-settings strings win over it; the package's English is the last fallback.\n */\n localization?: StorefrontLocalization;\n /** Replacement icons by name (a shared `@usethrottle/ui` icon override map). */\n icons?: IconOverrides;\n /** Where GA4-shaped ecommerce events go: `{ track(event, payload) }`. Default: nothing is sent. */\n analytics?: AnalyticsSink;\n /**\n * How the storefront reads and changes the URL. Default: the History API (client-only apps). `StorefrontNextProvider` supplies Next's.\n */\n router?: StorefrontRouter;\n /**\n * The component every storefront link renders through. Default: a plain `<a>`. `StorefrontNextProvider` supplies `next/link`.\n */\n linkComponent?: LinkComponent;\n /** Default true. Set false and import `@usethrottle/storefront-react/styles.css` for a flash-free SSR paint. */\n injectStyles?: boolean;\n /**\n * An opaque, stable id of the signed-in customer (not a token), `null` when signed out. The catalog\n * cache is partitioned by it: when it changes, every list and product is read again. The prices come\n * from the catalog client's own `customerToken` source (`createCatalogClient({ customerToken })`);\n * this prop only says whose cache entries these are.\n */\n customerKey?: string | null;\n /**\n * Cart wiring, handed to the `CatalogProvider` this component creates, so the storefront's add-to-cart,\n * cart button and drawer read the app's one cart. Never mount a second `CatalogProvider` around it: two\n * providers never share a cart. `cartStorage` is where the cart session id is kept (default: memory only),\n * `customerCart` resumes a signed-in customer's cart on any device.\n */\n cartStorage?: CartStorage;\n /** Resumes a signed-in customer's cart on any device; passed to the `CatalogProvider` unchanged. */\n customerCart?: CatalogProviderProps['customerCart'];\n /** The store's own URLs, sent on every cart created and used by `checkout()`: `returnUrl`, `cancelUrl` (and `storefrontUrl`). */\n cartUrls?: CartUrls;\n /** Where the checkout lives, when it is not Throttle's own. */\n throttleBaseUrl?: string;\n /** Throttle's hosted pages, used to build a cart link. Default `https://checkout.usethrottle.dev`. */\n throttleCheckoutUrl?: string;\n /** The account key; a Builder's connections may supply it instead. */\n throttlePublishableKey?: string;\n /** Called when the catalog's generation changes (a merchant published). */\n onGenerationChange?: (generation: number) => void;\n /**\n * The open tab's check for a new catalog generation (a conditional read, a `304` when nothing changed).\n * Default on, every 60 s; `intervalMs` is never below 60 s. `false` turns it off: the signed webhook\n * then is the only way a change reaches an open tab.\n */\n generationWatch?: boolean | { intervalMs?: number };\n /** The storefront tree. */\n children?: ReactNode;\n};\n\nconst MIN_WATCH_INTERVAL_MS = 60_000;\n\nconst NO_ANALYTICS: AnalyticsSink = { track() {} };\n\n/** Hex colours and `px` lengths only reach this, but a custom property is still declared with care. */\nconst declarations = (vars: SfVariables) =>\n Object.entries(vars)\n .map(([name, value]) => `${name}: ${value};`)\n .join(' ');\n\n/** A short stable id for one sf-variable set, like `@usethrottle/ui`'s scope ids. */\nfunction scopeIdOf(text: string): string {\n let hash = 5381;\n for (let i = 0; i < text.length; i++) hash = ((hash << 5) + hash + text.charCodeAt(i)) | 0;\n return `f${(hash >>> 0).toString(36)}`;\n}\n\n/**\n * The storefront root: the catalog provider, the ui provider (class prefix\n * `tsf-`), the resolved site design, strings and router, and the one wrapper\n * element that carries the theme.\n */\nexport function StorefrontProvider(props: StorefrontProviderProps) {\n const { catalogKey, client: given, currency, locale } = props;\n const client = useMemo(() => {\n if (given) return given;\n if (!catalogKey) throw new Error('StorefrontProvider needs a `catalogKey` or a `client`.');\n return createCatalogClient({\n publishableKey: catalogKey,\n ...(currency ? { currency } : {}),\n ...(locale ? { locale } : {}),\n });\n }, [given, catalogKey, currency, locale]);\n\n return (\n <CatalogProvider\n client={client}\n customerKey={props.customerKey ?? null}\n cartStorage={props.cartStorage}\n customerCart={props.customerCart}\n cartUrls={props.cartUrls}\n throttleBaseUrl={props.throttleBaseUrl}\n throttleCheckoutUrl={props.throttleCheckoutUrl}\n >\n <StorefrontRoot {...props} client={client} />\n </CatalogProvider>\n );\n}\n\nfunction StorefrontRoot(props: StorefrontProviderProps & { client: CatalogClient }) {\n const {\n client, settings: initialSettings, preset, scheme, appearance, localization, icons, analytics, router,\n linkComponent, injectStyles = true, reviewsOnLists = true, throttlePublishableKey, onGenerationChange, generationWatch = true, currency, children,\n } = props;\n const locale = props.locale ?? 'en';\n const dir = props.dir ?? (isRtlLocale(locale) ? 'rtl' : 'ltr');\n\n // The settings: seeded from the server's answer, refreshed by the catalog hook when the generation moves.\n const seeded = useMemo(\n () => (initialSettings ? { settings: initialSettings, settingsVersion: 0, generation: 0 } : undefined),\n [initialSettings],\n );\n const query = useStorefrontSettings(seeded ? { initialData: seeded } : undefined);\n const settings = useMemo(\n () => normalizeSettings(query.data?.settings ?? initialSettings),\n [query.data, initialSettings],\n );\n const status = query.data ? 'ready' : query.error ? 'error' : 'loading';\n\n\n const siteDesign = useSiteDesign();\n const themeKey = JSON.stringify(props.theme ?? null);\n const site = useMemo(\n () =>\n resolveSiteDesign({\n site: siteDesign,\n settings,\n preset,\n theme: props.theme,\n scheme,\n throttlePublishableKey,\n }),\n // `theme` is compared by value: an inline object must not rebuild every context below.\n [siteDesign, settings, preset, themeKey, scheme, throttlePublishableKey],\n );\n\n useInjectStyles(STOREFRONT_LAYER_ORDER_ID, STOREFRONT_LAYER_ORDER, { enabled: injectStyles, position: 'prepend' });\n useInjectStyles(STOREFRONT_STYLE_ID, STOREFRONT_STYLES, { enabled: injectStyles });\n\n // The developer's `appearance` is the last layer: its variables beat the theme mapping.\n const effectiveScheme = appearance?.theme ?? site.scheme;\n const light = useMemo(() => themeToVariables(site.theme, 'light'), [site.theme]);\n const dark = useMemo(() => themeToVariables(site.theme, 'dark'), [site.theme]);\n const uiAppearance = useMemo<ThrottleAppearance>(() => {\n const own = appearance?.variables;\n const ownDark = appearance?.darkVariables;\n const base: ThrottleVariables = { ...(effectiveScheme === 'dark' ? dark : light).variables, ...own };\n const value: ThrottleAppearance = { theme: effectiveScheme, variables: base };\n if (effectiveScheme === 'auto') value.darkVariables = { ...dark.variables, ...own, ...ownDark };\n else if (effectiveScheme === 'dark' && ownDark) value.darkVariables = ownDark;\n if (appearance?.elements) value.elements = appearance.elements;\n if (appearance?.parts) value.parts = appearance.parts;\n if (appearance?.components) value.components = appearance.components;\n return value;\n }, [appearance, effectiveScheme, light, dark]);\n\n const historyRouter = useHistoryRouter();\n const [drawerOpen, setDrawerOpen] = useState(false);\n const drawer = useMemo(() => ({ open: drawerOpen, setOpen: setDrawerOpen }), [drawerOpen]);\n\n const value = useMemo<StorefrontContextValue>(\n () => ({\n settings,\n site,\n preset: site.preset,\n scheme: site.scheme,\n dir,\n locale,\n currency,\n client,\n router: router ?? historyRouter,\n analytics: analytics ?? NO_ANALYTICS,\n Link: linkComponent ?? DefaultLink,\n reviewsOnLists,\n throttlePublishableKey: site.throttlePublishableKey,\n }),\n [settings, site, dir, locale, currency, client, router, historyRouter, analytics, linkComponent, reviewsOnLists],\n );\n\n return (\n <ThrottleUIProvider appearance={uiAppearance} classPrefix=\"tsf-\" dir={dir} icons={icons}>\n <SfLocalizationProvider value={localization ?? {}}>\n <StorefrontContext.Provider value={value}>\n {generationWatch !== false ? (\n <GenerationWatcher\n intervalMs={typeof generationWatch === 'object' ? generationWatch.intervalMs : undefined}\n onChange={onGenerationChange}\n />\n ) : null}\n <CartDrawerContext.Provider value={drawer}>\n <StorefrontRootElement\n site={site}\n scheme={effectiveScheme}\n sf={{ light: light.sf, dark: dark.sf }}\n dir={dir}\n status={status}\n >\n {children}\n </StorefrontRootElement>\n </CartDrawerContext.Provider>\n </StorefrontContext.Provider>\n </SfLocalizationProvider>\n </ThrottleUIProvider>\n );\n}\n\n/** The watch is a component so it can be left out; never faster than once a minute. */\nfunction GenerationWatcher({ intervalMs, onChange }: { intervalMs?: number; onChange?: (generation: number) => void }) {\n useGenerationWatch({ intervalMs: Math.max(intervalMs ?? MIN_WATCH_INTERVAL_MS, MIN_WATCH_INTERVAL_MS), onChange });\n return null;\n}\n\n/** The one element the provider renders. It is inside the ui provider so it can read the resolved appearance. */\nfunction StorefrontRootElement(props: {\n site: ResolvedSiteDesign;\n scheme: 'light' | 'dark' | 'auto';\n sf: { light: SfVariables; dark: SfVariables };\n dir: 'ltr' | 'rtl';\n status: 'loading' | 'ready' | 'error';\n children?: ReactNode;\n}) {\n const { site, scheme, sf, dir, status, children } = props;\n const { rootProps, scopeCss } = useAppearance();\n const part = usePart('storefront-root');\n\n // `auto` cannot switch inline custom properties on a media query, so the sf\n // variables ride in a scoped rule, as the ui does for its own variables.\n const sfScope = scheme === 'auto' ? scopeIdOf(JSON.stringify(sf)) : null;\n const sfCss =\n sfScope === null\n ? null\n : `.tsf-root[data-sf-scope=\"${sfScope}\"] { ${declarations(sf.light)} }\\n` +\n `@media (prefers-color-scheme: dark) {\\n .tsf-root[data-sf-scope=\"${sfScope}\"] { ${declarations(sf.dark)} }\\n}\\n`;\n\n const style = scheme === 'auto' ? rootProps.style : { ...rootProps.style, ...(scheme === 'dark' ? sf.dark : sf.light) };\n // `tsf-root` carries the theme variables and stays even when unstyled; the part class follows the usual rule.\n const className = [rootProps.className, part.className].filter(Boolean).join(' ');\n\n return (\n <div\n className={className}\n style={style}\n data-throttle-part={part['data-throttle-part']}\n data-throttle-preset={site.preset}\n data-throttle-theme={rootProps['data-throttle-theme']}\n data-throttle-scope={rootProps['data-throttle-scope']}\n data-sf-scope={sfScope ?? undefined}\n data-site-source={site.source}\n data-theme-accent={site.theme.light.colorAccent}\n data-theme-radius={site.theme.radius}\n data-settings-status={status}\n dir={dir}\n >\n {scopeCss ? <style>{scopeCss}</style> : null}\n {sfCss ? <style>{sfCss}</style> : null}\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQkF;AAA3E,IAAM,cAA6B,CAAC,EAAE,UAAU,WAAW,GAAG,OAAO,MAAM,oBAAC,OAAG,GAAG,QAAQ;;;ACDjG,IAAM,YAAY;AAAA,EAChB;AAAA,EAAa;AAAA,EAAY;AAAA,EAAU;AAAA,EAAa;AAAA,EAAc;AAAA,EAAa;AAAA,EAAc;AAAA,EAAU;AAAA,EAAW;AAChH;AAGA,IAAM,QAAsF;AAAA,EAC1F,CAAC,CAAC,SAAS,aAAa,GAAG,CAAC,SAAS,QAAQ,MAAM,CAAC;AAAA,EACpD,CAAC,CAAC,SAAS,cAAc,GAAG,CAAC,WAAW,eAAe,OAAO,CAAC;AAAA,EAC/D,CAAC,CAAC,WAAW,YAAY,GAAG,CAAC,YAAY,aAAa,UAAU,CAAC;AAAA,EACjE,CAAC,CAAC,WAAW,cAAc,GAAG,CAAC,WAAW,UAAU,QAAQ,CAAC;AAAA,EAC7D,CAAC,CAAC,WAAW,aAAa,GAAG,SAAS;AAAA,EACtC,CAAC,CAAC,QAAQ,OAAO,GAA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AO,OAAO,EAAE,KAAK,GAAG;AAEhF,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,sBAAoB,KAAK,oBAAoB;AAAA,MAC7C,wBAAsB,KAAK;AAAA,MAC3B,uBAAqB,UAAU,qBAAqB;AAAA,MACpD,uBAAqB,UAAU,qBAAqB;AAAA,MACpD,iBAAe,WAAW;AAAA,MAC1B,oBAAkB,KAAK;AAAA,MACvB,qBAAmB,KAAK,MAAM,MAAM;AAAA,MACpC,qBAAmB,KAAK,MAAM;AAAA,MAC9B,wBAAsB;AAAA,MACtB;AAAA,MAEC;AAAA,mBAAW,gBAAAA,KAAC,WAAO,oBAAS,IAAW;AAAA,QACvC,QAAQ,gBAAAA,KAAC,WAAO,iBAAM,IAAW;AAAA,QACjC;AAAA;AAAA;AAAA,EACH;AAEJ;","names":["useMemo","jsx","useMemo","value"]}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
toGa4Item
|
|
4
|
+
} from "./chunk-LW2A6USV.js";
|
|
5
|
+
import {
|
|
6
|
+
useTrack
|
|
7
|
+
} from "./chunk-IJOTLGPT.js";
|
|
8
|
+
import {
|
|
9
|
+
useStorefront
|
|
10
|
+
} from "./chunk-NNE4FYRT.js";
|
|
11
|
+
|
|
12
|
+
// src/url/shop-list-query.ts
|
|
13
|
+
import { formatRange } from "@usethrottle/catalog/url";
|
|
14
|
+
var LITE_FIELDS = [
|
|
15
|
+
"availability",
|
|
16
|
+
"badges",
|
|
17
|
+
"brand",
|
|
18
|
+
"featured",
|
|
19
|
+
"handle",
|
|
20
|
+
"images",
|
|
21
|
+
"lowStock",
|
|
22
|
+
"optionSwatches",
|
|
23
|
+
"priceRange",
|
|
24
|
+
"productType",
|
|
25
|
+
"rating",
|
|
26
|
+
"seo",
|
|
27
|
+
"title",
|
|
28
|
+
"variantCount"
|
|
29
|
+
];
|
|
30
|
+
function cardFields(settings) {
|
|
31
|
+
return settings.card.showBadges && settings.badges.custom.length > 0 ? [...LITE_FIELDS, "tags"] : void 0;
|
|
32
|
+
}
|
|
33
|
+
function shopListQuery(query, source, settings, o = {}) {
|
|
34
|
+
const { listing } = settings;
|
|
35
|
+
const filters = {};
|
|
36
|
+
for (const [key, values] of Object.entries(query.filters)) filters[key] = [...values];
|
|
37
|
+
for (const [key, range] of Object.entries(query.ranges)) (filters[key] ??= []).push(formatRange(range));
|
|
38
|
+
const out = {
|
|
39
|
+
limit: listing.pageSize,
|
|
40
|
+
facets: true,
|
|
41
|
+
...o.fields ? { fields: o.fields } : {},
|
|
42
|
+
...query.page > 1 ? { page: query.page } : {},
|
|
43
|
+
...query.q ? { q: query.q } : {},
|
|
44
|
+
...Object.keys(filters).length > 0 ? { filters } : {},
|
|
45
|
+
...source.kind === "collection" ? { collection: source.handle } : {},
|
|
46
|
+
...source.kind === "category" ? { category: source.handle } : {},
|
|
47
|
+
...source.kind === "tag" ? { tags: [source.handle] } : {}
|
|
48
|
+
};
|
|
49
|
+
if (query.sort !== listing.defaultSort) {
|
|
50
|
+
const usable = query.sort === "relevance" ? Boolean(query.q) : query.sort === "manual" ? o.manualCollection === true : true;
|
|
51
|
+
if (usable) out.sort = query.sort;
|
|
52
|
+
} else if ((source.kind === "all" || source.kind === "category" || source.kind === "tag") && !["featured", "relevance", "manual"].includes(listing.defaultSort)) {
|
|
53
|
+
out.sort = listing.defaultSort;
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// src/merch/product-source.ts
|
|
59
|
+
var MAX_MERCH_LIMIT = 96;
|
|
60
|
+
function clampLimit(limit) {
|
|
61
|
+
return Number.isFinite(limit) ? Math.min(MAX_MERCH_LIMIT, Math.max(1, Math.floor(limit))) : 1;
|
|
62
|
+
}
|
|
63
|
+
function manualHandles(source) {
|
|
64
|
+
return [...new Set(source.handles.filter((h) => typeof h === "string" && h.trim() !== ""))];
|
|
65
|
+
}
|
|
66
|
+
function isEmptySource(source) {
|
|
67
|
+
if (source.kind === "manual") return manualHandles(source).length === 0;
|
|
68
|
+
if (source.kind === "collection" || source.kind === "category" || source.kind === "tag") return source.handle.trim() === "";
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
function productSourceQuery(source, limit, o = {}) {
|
|
72
|
+
const more = o.fields ? { fields: o.fields } : {};
|
|
73
|
+
const size = clampLimit(limit);
|
|
74
|
+
switch (source.kind) {
|
|
75
|
+
case "collection":
|
|
76
|
+
return { collection: source.handle, limit: size, ...more };
|
|
77
|
+
case "category":
|
|
78
|
+
return { category: source.handle, limit: size, ...more };
|
|
79
|
+
case "tag":
|
|
80
|
+
return { tags: [source.handle], limit: size, ...more };
|
|
81
|
+
case "featured":
|
|
82
|
+
return { featured: true, limit: size, ...more };
|
|
83
|
+
case "newest":
|
|
84
|
+
case "best_rated":
|
|
85
|
+
return { sort: source.kind, limit: size, ...more };
|
|
86
|
+
case "manual": {
|
|
87
|
+
const handles = manualHandles(source).slice(0, size);
|
|
88
|
+
return { handles, limit: Math.max(1, handles.length), ...more };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function orderByHandles(products, handles) {
|
|
93
|
+
const byHandle = new Map(products.map((p) => [p.handle, p]));
|
|
94
|
+
return handles.flatMap((h) => {
|
|
95
|
+
const found = byHandle.get(h);
|
|
96
|
+
return found ? [found] : [];
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function sourceProducts(source, products, limit) {
|
|
100
|
+
const ordered = source.kind === "manual" ? orderByHandles(products, manualHandles(source)) : [...products];
|
|
101
|
+
return ordered.slice(0, clampLimit(limit));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// src/merch/use-merch.ts
|
|
105
|
+
import { useCollection, useProducts } from "@usethrottle/catalog/react";
|
|
106
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
107
|
+
var MERCH_STALE_MS = 36e5;
|
|
108
|
+
function seedOf(data, limit) {
|
|
109
|
+
return {
|
|
110
|
+
products: data.products,
|
|
111
|
+
page: { number: 1, limit, total: null, pageCount: null, nextCursor: null },
|
|
112
|
+
...data.priceContext ? { priceContext: data.priceContext } : {}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function useMerchProducts(source, o) {
|
|
116
|
+
const { settings } = useStorefront();
|
|
117
|
+
const empty = isEmptySource(source);
|
|
118
|
+
const sourceKey = JSON.stringify(source);
|
|
119
|
+
const query = useMemo(
|
|
120
|
+
() => productSourceQuery(source, o.limit, { fields: cardFields(settings) }),
|
|
121
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
122
|
+
[sourceKey, o.limit, settings]
|
|
123
|
+
);
|
|
124
|
+
const seed = useMemo(() => o.initialData ? seedOf(o.initialData, o.limit) : void 0, [o.initialData, o.limit]);
|
|
125
|
+
const list = useProducts(query, { enabled: !empty, initialData: seed, staleTimeMs: MERCH_STALE_MS });
|
|
126
|
+
const needTitle = Boolean(o.withTitle) && source.kind === "collection" && !empty && !o.initialData?.title;
|
|
127
|
+
const handle = needTitle && source.kind === "collection" ? source.handle : null;
|
|
128
|
+
const first = useCollection(handle, { staleTimeMs: MERCH_STALE_MS });
|
|
129
|
+
const renamed = first.data && "redirectTo" in first.data ? first.data.redirectTo : null;
|
|
130
|
+
const second = useCollection(renamed, { staleTimeMs: MERCH_STALE_MS });
|
|
131
|
+
const found = [first.data, second.data].find((d) => d && "collection" in d);
|
|
132
|
+
const title = o.initialData?.title ?? (found && "collection" in found ? found.collection.title : void 0);
|
|
133
|
+
const titleLoading = needTitle && (first.isLoading || renamed !== null && second.isLoading);
|
|
134
|
+
const products = useMemo(
|
|
135
|
+
() => list.data && !empty ? sourceProducts(source, list.data.products, o.limit) : [],
|
|
136
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
137
|
+
[list.data, empty, sourceKey, o.limit]
|
|
138
|
+
);
|
|
139
|
+
const arrivedAt = useMemo(() => (/* @__PURE__ */ new Date()).toISOString(), [list.data]);
|
|
140
|
+
const generatedAt = o.initialData && list.data?.products === o.initialData.products ? o.initialData.generatedAt : arrivedAt;
|
|
141
|
+
const status = empty || list.data && !titleLoading ? "ready" : list.error && !list.data ? "error" : "loading";
|
|
142
|
+
return {
|
|
143
|
+
products,
|
|
144
|
+
status,
|
|
145
|
+
generatedAt,
|
|
146
|
+
...title ? { title } : {},
|
|
147
|
+
...list.data?.priceContext ? { priceContext: list.data.priceContext } : {}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function useListAnalytics(listName, products) {
|
|
151
|
+
const track = useTrack();
|
|
152
|
+
const { currency: provided } = useStorefront();
|
|
153
|
+
const sent = useRef(null);
|
|
154
|
+
const currency = products.find((p) => p.priceRange)?.priceRange?.currency ?? provided;
|
|
155
|
+
const handles = products.map((p) => p.handle).join(",");
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
if (products.length === 0 || !currency) return;
|
|
158
|
+
const key = `${listName ?? ""}|${handles}`;
|
|
159
|
+
if (sent.current === key) return;
|
|
160
|
+
sent.current = key;
|
|
161
|
+
track("view_item_list", {
|
|
162
|
+
currency,
|
|
163
|
+
...listName ? { item_list_name: listName } : {},
|
|
164
|
+
items: products.map((p, index) => toGa4Item(p, { index, listName }))
|
|
165
|
+
});
|
|
166
|
+
}, [listName, handles, currency, track]);
|
|
167
|
+
return (product) => {
|
|
168
|
+
const index = products.findIndex((p) => p.handle === product.handle);
|
|
169
|
+
const cur = product.priceRange?.currency ?? currency;
|
|
170
|
+
if (!cur) return;
|
|
171
|
+
track("select_item", { currency: cur, ...listName ? { item_list_name: listName } : {}, items: [toGa4Item(product, { index: index < 0 ? void 0 : index, listName })] });
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export {
|
|
176
|
+
cardFields,
|
|
177
|
+
shopListQuery,
|
|
178
|
+
isEmptySource,
|
|
179
|
+
productSourceQuery,
|
|
180
|
+
orderByHandles,
|
|
181
|
+
MERCH_STALE_MS,
|
|
182
|
+
useMerchProducts,
|
|
183
|
+
useListAnalytics
|
|
184
|
+
};
|
|
185
|
+
//# sourceMappingURL=chunk-3JMIVAHN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/url/shop-list-query.ts","../src/merch/product-source.ts","../src/merch/use-merch.ts"],"sourcesContent":["import type { ProductsQuery } from '@usethrottle/catalog';\nimport { formatRange } from '@usethrottle/catalog/url';\nimport type { NormalizedSettings } from '../settings/normalize';\nimport type { ShopQuery, ShopSource } from './shop-query';\n\n/** What the catalog's list answer carries by default (`fields: 'lite'`), as the keys `fields` takes. */\nconst LITE_FIELDS = [\n 'availability',\n 'badges',\n 'brand',\n 'featured',\n 'handle',\n 'images',\n 'lowStock',\n 'optionSwatches',\n 'priceRange',\n 'productType',\n 'rating',\n 'seo',\n 'title',\n 'variantCount',\n] as const;\n\n/**\n * The `fields` a product list asks for. A custom tag badge needs the product's\n * tags, which the default (lite) answer leaves out. Undefined otherwise, so the\n * request is the default one.\n */\nexport function cardFields(settings: NormalizedSettings): readonly string[] | undefined {\n return settings.card.showBadges && settings.badges.custom.length > 0 ? [...LITE_FIELDS, 'tags'] : undefined;\n}\n\n/**\n * The `products.list` query for a listing. Pure, and the one place it is built:\n * the server loader and a client island both call it, so the island's request\n * matches the server's and starts on its answer (`initialData`).\n *\n * The page's path (`source`) names the collection, category or tag. A sort that\n * is not the store's default counts as asked for (the URL omits the default):\n * it is kept when it makes sense, `relevance` only with a search and `manual`\n * only on a manual collection (`manualCollection`). With no sort asked for, the\n * shop, a category or a tag takes `listing.defaultSort` (`featured` is the\n * catalog's own default); a collection keeps its own order and a search keeps\n * relevance. Pass `fields` from `cardFields(settings)`.\n */\nexport function shopListQuery(\n query: ShopQuery,\n source: ShopSource,\n settings: NormalizedSettings,\n o: { fields?: readonly string[]; manualCollection?: boolean } = {},\n): ProductsQuery {\n const { listing } = settings;\n const filters: Record<string, string[]> = {};\n for (const [key, values] of Object.entries(query.filters)) filters[key] = [...values];\n for (const [key, range] of Object.entries(query.ranges)) (filters[key] ??= []).push(formatRange(range));\n const out: ProductsQuery = {\n limit: listing.pageSize,\n facets: true,\n ...(o.fields ? { fields: o.fields } : {}),\n ...(query.page > 1 ? { page: query.page } : {}),\n ...(query.q ? { q: query.q } : {}),\n ...(Object.keys(filters).length > 0 ? { filters } : {}),\n ...(source.kind === 'collection' ? { collection: source.handle } : {}),\n ...(source.kind === 'category' ? { category: source.handle } : {}),\n ...(source.kind === 'tag' ? { tags: [source.handle] } : {}),\n };\n if (query.sort !== listing.defaultSort) {\n const usable =\n query.sort === 'relevance' ? Boolean(query.q) : query.sort === 'manual' ? o.manualCollection === true : true;\n if (usable) out.sort = query.sort;\n } else if (\n (source.kind === 'all' || source.kind === 'category' || source.kind === 'tag') &&\n !['featured', 'relevance', 'manual'].includes(listing.defaultSort)\n ) {\n out.sort = listing.defaultSort;\n }\n return out;\n}\n","// Server-safe: types and pure functions only (`./server` re-exports it), so nothing here imports React.\nimport type { ListProduct, ProductsQuery } from '@usethrottle/catalog';\n\n/** What a section lists. Plain data, so a Builder can store it as a widget's prop. */\nexport type ProductSource =\n | { kind: 'collection' | 'category' | 'tag'; handle: string }\n | { kind: 'featured' | 'newest' | 'best_rated' }\n | { kind: 'manual'; handles: string[] };\n\n/** The catalog's `products.list` query. */\nexport type ListQuery = ProductsQuery;\n\n/**\n * What `loadMerchProducts` answers and a section's `initialData` takes. Plain JSON.\n * `title` is a collection's own title and `priceContext` is the list answer's; both are optional.\n */\nexport type MerchProductsData = {\n products: ListProduct[];\n /** When the server built this answer (ISO 8601). The `new` badge ages against it. */\n generatedAt: string;\n title?: string;\n priceContext?: 'anonymous' | 'customer' | 'email_unverified' | 'anonymous_fallback';\n};\n\n/** The most one products request may ask for (the catalog's page limit). */\nexport const MAX_MERCH_LIMIT = 96;\n\n/** `limit` as a whole number from 1 to the catalog's page limit. */\nexport function clampLimit(limit: number): number {\n return Number.isFinite(limit) ? Math.min(MAX_MERCH_LIMIT, Math.max(1, Math.floor(limit))) : 1;\n}\n\n/** The handles of a manual source, without blanks or repeats, in the given order. */\nexport function manualHandles(source: Extract<ProductSource, { kind: 'manual' }>): string[] {\n return [...new Set(source.handles.filter((h) => typeof h === 'string' && h.trim() !== ''))];\n}\n\n/** A source that names nothing (a blank handle, no manual handles) lists nothing and asks for nothing. */\nexport function isEmptySource(source: ProductSource): boolean {\n if (source.kind === 'manual') return manualHandles(source).length === 0;\n if (source.kind === 'collection' || source.kind === 'category' || source.kind === 'tag') return source.handle.trim() === '';\n return false;\n}\n\n/**\n * The `products.list` query for a source: the shelf mapping of Meridian\n * `lib/home.ts` (`featured` is the featured flag; `newest` and `best_rated` are\n * those sorts). A `manual` source asks for its handles in one request; the\n * catalog does not promise their order, so `orderByHandles` restores it.\n * `fields` is `cardFields(settings)`, the same one the server loader uses.\n */\nexport function productSourceQuery(source: ProductSource, limit: number, o: { fields?: readonly string[] } = {}): ListQuery {\n const more = o.fields ? { fields: o.fields } : {};\n const size = clampLimit(limit);\n switch (source.kind) {\n case 'collection':\n return { collection: source.handle, limit: size, ...more };\n case 'category':\n return { category: source.handle, limit: size, ...more };\n case 'tag':\n return { tags: [source.handle], limit: size, ...more };\n case 'featured':\n return { featured: true, limit: size, ...more };\n case 'newest':\n case 'best_rated':\n return { sort: source.kind, limit: size, ...more };\n case 'manual': {\n const handles = manualHandles(source).slice(0, size);\n return { handles, limit: Math.max(1, handles.length), ...more };\n }\n }\n}\n\n/** A manual source's products in the order its handles give; one the catalog did not answer is left out. */\nexport function orderByHandles(products: readonly ListProduct[], handles: readonly string[]): ListProduct[] {\n const byHandle = new Map(products.map((p) => [p.handle, p]));\n return handles.flatMap((h) => {\n const found = byHandle.get(h);\n return found ? [found] : [];\n });\n}\n\n/** What a source's answer shows: a manual source in its own order, every source cut to `limit`. */\nexport function sourceProducts(source: ProductSource, products: readonly ListProduct[], limit: number): ListProduct[] {\n const ordered = source.kind === 'manual' ? orderByHandles(products, manualHandles(source)) : [...products];\n return ordered.slice(0, clampLimit(limit));\n}\n","import type { ListProduct, StorefrontListAnswer } from '@usethrottle/catalog';\nimport { useCollection, useProducts } from '@usethrottle/catalog/react';\nimport { useEffect, useMemo, useRef } from 'react';\nimport { toGa4Item } from '../analytics/items';\nimport { useTrack } from '../analytics/use-track';\nimport { useStorefront } from '../provider/context';\nimport { cardFields } from '../url/shop-list-query';\nimport {\n isEmptySource,\n productSourceQuery,\n sourceProducts,\n type MerchProductsData,\n type ProductSource,\n} from './product-source';\n\n/** A merchandising read is fresh for an hour: the storefront generation watch invalidates it when the merchant publishes. */\nexport const MERCH_STALE_MS = 3_600_000;\n\n/** What a merchandising read answers: the products, a status and when the data was made. */\nexport type MerchProducts = {\n products: ListProduct[];\n /** `loading` until the first answer (a section shows a placeholder), `error` when there is none (a section renders nothing). */\n status: 'ready' | 'loading' | 'error';\n /** When the data was made (ISO). The server's time for `initialData`, else when the browser got the answer. */\n generatedAt: string;\n /** A collection's title, when `withTitle` asked for it and the catalog has one. */\n title?: string;\n priceContext?: MerchProductsData['priceContext'];\n};\n\n/** `initialData` as the catalog hook's seed. The hook reads only `products` and `priceContext` from it. */\nfunction seedOf(data: MerchProductsData, limit: number): StorefrontListAnswer {\n return {\n products: data.products,\n page: { number: 1, limit, total: null, pageCount: null, nextCursor: null },\n ...(data.priceContext ? { priceContext: data.priceContext } : {}),\n } as StorefrontListAnswer;\n}\n\n/**\n * The products of a source: one `products.list` request however many cards it\n * shows (a manual source's handles go in one request). With `initialData` (from\n * `loadMerchProducts`) the first render has the answer and makes no request.\n * `withTitle` also reads a collection's title, unless `initialData` has it.\n */\nexport function useMerchProducts(\n source: ProductSource,\n o: { limit: number; initialData?: MerchProductsData; withTitle?: boolean },\n): MerchProducts {\n const { settings } = useStorefront();\n const empty = isEmptySource(source);\n const sourceKey = JSON.stringify(source);\n // `source` is compared by value: an inline object must not make a new request on every render.\n const query = useMemo(\n () => productSourceQuery(source, o.limit, { fields: cardFields(settings) }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [sourceKey, o.limit, settings],\n );\n const seed = useMemo(() => (o.initialData ? seedOf(o.initialData, o.limit) : undefined), [o.initialData, o.limit]);\n const list = useProducts(query, { enabled: !empty, initialData: seed, staleTimeMs: MERCH_STALE_MS });\n\n const needTitle = Boolean(o.withTitle) && source.kind === 'collection' && !empty && !o.initialData?.title;\n const handle = needTitle && source.kind === 'collection' ? source.handle : null;\n const first = useCollection(handle, { staleTimeMs: MERCH_STALE_MS });\n const renamed = first.data && 'redirectTo' in first.data ? first.data.redirectTo : null;\n const second = useCollection(renamed, { staleTimeMs: MERCH_STALE_MS });\n const found = [first.data, second.data].find((d) => d && 'collection' in d);\n const title = o.initialData?.title ?? (found && 'collection' in found ? found.collection.title : undefined);\n const titleLoading = needTitle && (first.isLoading || (renamed !== null && second.isLoading));\n\n const products = useMemo(\n () => (list.data && !empty ? sourceProducts(source, list.data.products, o.limit) : []),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [list.data, empty, sourceKey, o.limit],\n );\n // Browser-fetched data has no server time: its own arrival is the best the `new` badge has.\n const arrivedAt = useMemo(() => new Date().toISOString(), [list.data]);\n const generatedAt = o.initialData && list.data?.products === o.initialData.products ? o.initialData.generatedAt : arrivedAt;\n\n const status = empty || (list.data && !titleLoading) ? 'ready' : list.error && !list.data ? 'error' : 'loading';\n return {\n products,\n status,\n generatedAt,\n ...(title ? { title } : {}),\n ...(list.data?.priceContext ? { priceContext: list.data.priceContext } : {}),\n };\n}\n\n/**\n * `view_item_list` once per list (the same handles under the same name), when\n * the products are first ready. Returns `select_item` for a card's `onSelect`.\n */\nexport function useListAnalytics(listName: string | undefined, products: readonly ListProduct[]): (product: ListProduct) => void {\n const track = useTrack();\n const { currency: provided } = useStorefront();\n const sent = useRef<string | null>(null);\n const currency = products.find((p) => p.priceRange)?.priceRange?.currency ?? provided;\n const handles = products.map((p) => p.handle).join(',');\n\n useEffect(() => {\n if (products.length === 0 || !currency) return;\n const key = `${listName ?? ''}|${handles}`;\n if (sent.current === key) return;\n sent.current = key;\n track('view_item_list', {\n currency,\n ...(listName ? { item_list_name: listName } : {}),\n items: products.map((p, index) => toGa4Item(p, { index, listName })),\n });\n // `products` is read through `handles`: the event is about which products, not about a new array.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [listName, handles, currency, track]);\n\n return (product) => {\n const index = products.findIndex((p) => p.handle === product.handle);\n const cur = product.priceRange?.currency ?? currency;\n if (!cur) return;\n track('select_item', { currency: cur, ...(listName ? { item_list_name: listName } : {}), items: [toGa4Item(product, { index: index < 0 ? undefined : index, listName })] });\n };\n}\n"],"mappings":";;;;;;;;;;;;AACA,SAAS,mBAAmB;AAK5B,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAOO,SAAS,WAAW,UAA6D;AACtF,SAAO,SAAS,KAAK,cAAc,SAAS,OAAO,OAAO,SAAS,IAAI,CAAC,GAAG,aAAa,MAAM,IAAI;AACpG;AAeO,SAAS,cACd,OACA,QACA,UACA,IAAgE,CAAC,GAClD;AACf,QAAM,EAAE,QAAQ,IAAI;AACpB,QAAM,UAAoC,CAAC;AAC3C,aAAW,CAAC,KAAK,MAAM,KAAK,OAAO,QAAQ,MAAM,OAAO,EAAG,SAAQ,GAAG,IAAI,CAAC,GAAG,MAAM;AACpF,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,MAAM,EAAG,EAAC,QAAQ,GAAG,MAAM,CAAC,GAAG,KAAK,YAAY,KAAK,CAAC;AACtG,QAAM,MAAqB;AAAA,IACzB,OAAO,QAAQ;AAAA,IACf,QAAQ;AAAA,IACR,GAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,IAAI,CAAC;AAAA,IACvC,GAAI,MAAM,OAAO,IAA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AG,YAAY,EAAE,IAAI,OAAO;AACxC,QAAI,KAAK,YAAY,IAAK;AAC1B,SAAK,UAAU;AACf,UAAM,kBAAkB;AAAA,MACtB;AAAA,MACA,GAAI,WAAW,EAAE,gBAAgB,SAAS,IAAI,CAAC;AAAA,MAC/C,OAAO,SAAS,IAAI,CAAC,GAAG,UAAU,UAAU,GAAG,EAAE,OAAO,SAAS,CAAC,CAAC;AAAA,IACrE,CAAC;AAAA,EAGH,GAAG,CAAC,UAAU,SAAS,UAAU,KAAK,CAAC;AAEvC,SAAO,CAAC,YAAY;AAClB,UAAM,QAAQ,SAAS,UAAU,CAAC,MAAM,EAAE,WAAW,QAAQ,MAAM;AACnE,UAAM,MAAM,QAAQ,YAAY,YAAY;AAC5C,QAAI,CAAC,IAAK;AACV,UAAM,eAAe,EAAE,UAAU,KAAK,GAAI,WAAW,EAAE,gBAAgB,SAAS,IAAI,CAAC,GAAI,OAAO,CAAC,UAAU,SAAS,EAAE,OAAO,QAAQ,IAAI,SAAY,OAAO,SAAS,CAAC,CAAC,EAAE,CAAC;AAAA,EAC5K;AACF;","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
3
|
+
|
|
4
|
+
// src/frame/use-media-query.ts
|
|
5
|
+
var _react = require('react');
|
|
6
|
+
var supported = () => typeof window !== "undefined" && typeof window.matchMedia === "function";
|
|
7
|
+
function useMediaQuery(query) {
|
|
8
|
+
return _react.useSyncExternalStore.call(void 0,
|
|
9
|
+
(onChange) => {
|
|
10
|
+
if (!supported()) return () => {
|
|
11
|
+
};
|
|
12
|
+
const list = window.matchMedia(query);
|
|
13
|
+
list.addEventListener("change", onChange);
|
|
14
|
+
return () => list.removeEventListener("change", onChange);
|
|
15
|
+
},
|
|
16
|
+
() => supported() && window.matchMedia(query).matches,
|
|
17
|
+
() => false
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
exports.useMediaQuery = useMediaQuery;
|
|
24
|
+
//# sourceMappingURL=chunk-4J6AGWNC.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/app-throttle/app-throttle/packages/storefront-react/dist/chunk-4J6AGWNC.cjs","../src/frame/use-media-query.ts"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACA;ACFA,8BAAqC;AAErC,IAAM,UAAA,EAAY,CAAA,EAAA,GAAM,OAAO,OAAA,IAAW,YAAA,GAAe,OAAO,MAAA,CAAO,WAAA,IAAe,UAAA;AAM/E,SAAS,aAAA,CAAc,KAAA,EAAwB;AACpD,EAAA,OAAO,yCAAA;AAAA,IACL,CAAC,QAAA,EAAA,GAAa;AACZ,MAAA,GAAA,CAAI,CAAC,SAAA,CAAU,CAAA,EAAG,OAAO,CAAA,EAAA,GAAM;AAAA,MAAC,CAAA;AAChC,MAAA,MAAM,KAAA,EAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAA;AACpC,MAAA,IAAA,CAAK,gBAAA,CAAiB,QAAA,EAAU,QAAQ,CAAA;AACxC,MAAA,OAAO,CAAA,EAAA,GAAM,IAAA,CAAK,mBAAA,CAAoB,QAAA,EAAU,QAAQ,CAAA;AAAA,IAC1D,CAAA;AAAA,IACA,CAAA,EAAA,GAAM,SAAA,CAAU,EAAA,GAAK,MAAA,CAAO,UAAA,CAAW,KAAK,CAAA,CAAE,OAAA;AAAA,IAC9C,CAAA,EAAA,GAAM;AAAA,EACR,CAAA;AACF;ADDA;AACA;AACE;AACF,sCAAC","file":"/home/runner/work/app-throttle/app-throttle/packages/storefront-react/dist/chunk-4J6AGWNC.cjs","sourcesContent":[null,"import { useSyncExternalStore } from 'react';\n\nconst supported = () => typeof window !== 'undefined' && typeof window.matchMedia === 'function';\n\n/**\n * Whether a media query matches. False on the server and for the hydration pass, so the first client\n * render equals the server's; it updates right after. False where `matchMedia` does not exist.\n */\nexport function useMediaQuery(query: string): boolean {\n return useSyncExternalStore(\n (onChange) => {\n if (!supported()) return () => {};\n const list = window.matchMedia(query);\n list.addEventListener('change', onChange);\n return () => list.removeEventListener('change', onChange);\n },\n () => supported() && window.matchMedia(query).matches,\n () => false,\n );\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
QuickAdd
|
|
4
|
+
} from "./chunk-EYSVU5SJ.js";
|
|
5
|
+
import "./chunk-D76CRI4X.js";
|
|
6
|
+
import "./chunk-A3IFWQUV.js";
|
|
7
|
+
import "./chunk-66HDJVPS.js";
|
|
8
|
+
import "./chunk-3JMIVAHN.js";
|
|
9
|
+
import "./chunk-LW2A6USV.js";
|
|
10
|
+
import "./chunk-IJOTLGPT.js";
|
|
11
|
+
import "./chunk-HSUUDZWS.js";
|
|
12
|
+
import "./chunk-Q3XFD5UI.js";
|
|
13
|
+
import "./chunk-NNE4FYRT.js";
|
|
14
|
+
export {
|
|
15
|
+
QuickAdd
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-4U6MYDZV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/product/gallery-items.ts
|
|
4
|
+
function galleryItems(product) {
|
|
5
|
+
return product.images;
|
|
6
|
+
}
|
|
7
|
+
var isVideo = (item) => item.kind === "video";
|
|
8
|
+
function srcSetOf(item) {
|
|
9
|
+
const entries = Object.entries(item.sizes ?? {}).filter(([, url]) => typeof url === "string" && url !== "");
|
|
10
|
+
return entries.length > 0 ? entries.map(([width, url]) => `${url} ${width}w`).join(", ") : void 0;
|
|
11
|
+
}
|
|
12
|
+
function ratioOf(item) {
|
|
13
|
+
return item?.width && item?.height ? item.width / item.height : 0.8;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
galleryItems,
|
|
18
|
+
isVideo,
|
|
19
|
+
srcSetOf,
|
|
20
|
+
ratioOf
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-66HDJVPS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/product/gallery-items.ts"],"sourcesContent":["import type { StorefrontProduct } from '@usethrottle/catalog';\n\ntype CatalogImage = StorefrontProduct['images'][number];\n\n/** One entry of the gallery: a photo, or a video when the media item says `kind: 'video'`. */\nexport type GalleryItem = CatalogImage & { kind?: 'image' | 'video'; posterUrl?: string };\n\n/** The photos of a product in the catalog's order; a media item of `kind: 'video'` plays instead of showing. */\nexport function galleryItems(product: Pick<StorefrontProduct, 'images'>): GalleryItem[] {\n return product.images as GalleryItem[];\n}\n\nexport const isVideo = (item: GalleryItem): boolean => item.kind === 'video';\n\n/** The `srcset` of an item's sizes (`{ '400': url, ... }`), or undefined without any. */\nexport function srcSetOf(item: GalleryItem): string | undefined {\n const entries = Object.entries(item.sizes ?? {}).filter(([, url]) => typeof url === 'string' && url !== '');\n return entries.length > 0 ? entries.map(([width, url]) => `${url} ${width}w`).join(', ') : undefined;\n}\n\n/** The ratio of an item (width over height); the 4:5 portrait the cards use when it has none. */\nexport function ratioOf(item: GalleryItem | undefined): number {\n return item?.width && item?.height ? item.width / item.height : 0.8;\n}\n"],"mappings":";;;AAQO,SAAS,aAAa,SAA2D;AACtF,SAAO,QAAQ;AACjB;AAEO,IAAM,UAAU,CAAC,SAA+B,KAAK,SAAS;AAG9D,SAAS,SAAS,MAAuC;AAC9D,QAAM,UAAU,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,GAAG,MAAM,OAAO,QAAQ,YAAY,QAAQ,EAAE;AAC1G,SAAO,QAAQ,SAAS,IAAI,QAAQ,IAAI,CAAC,CAAC,OAAO,GAAG,MAAM,GAAG,GAAG,IAAI,KAAK,GAAG,EAAE,KAAK,IAAI,IAAI;AAC7F;AAGO,SAAS,QAAQ,MAAuC;AAC7D,SAAO,MAAM,SAAS,MAAM,SAAS,KAAK,QAAQ,KAAK,SAAS;AAClE;","names":[]}
|