efficient-storefront-blocks 0.59.0 → 0.61.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/CHANGELOG.md +42 -0
- package/README.md +2 -1
- package/dist/chunks/{EditorPreviewCheckout-RH4YMFWR.js → EditorPreviewCheckout-55ERZEPV.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-CDMOH46L.js → SiteEditorProvider-XF374NLZ.js} +1 -1
- package/dist/chunks/chunk-FCCEAXMM.js +1 -0
- package/dist/chunks/chunk-VT346MLP.js +1 -0
- package/dist/chunks/chunk-VVQ7KFQO.js +1 -0
- package/dist/chunks/chunk-YNI65Q6Z.js +250 -0
- package/dist/chunks/{fitment-data-NSCUVNS2.js → fitment-data-RORHKBID.js} +1 -1
- package/dist/editor/lib/efficient-backend.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/CheckoutCTA/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/Collections/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/CompatibleTyres/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/DeliveryOptions/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/DetailRows/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/FitmentFinder/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/FitmentTable/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/Gallery/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/GalleryB/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/ProductGrid/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/RelatedProducts/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/SpecTable/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/index.d.ts +1 -1
- package/dist/editor/lib/puck/blocks/service/AppointmentBooking/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/service/Events/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/service/Footer/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/service/FooterGroup/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/service/FooterSocial/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/service/ReviewForm/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/service/Reviews/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/service/SiteFooter/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/service/SiteHeader/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/service/SubmitBox/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/service/SubmitBuild/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/service/SubscribeBlogs/fields.js +1 -1
- package/dist/editor/lib/puck/config.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/fitment.d.ts +56 -0
- package/dist/fitment.js +1 -0
- package/dist/index.d.ts +60 -12
- package/dist/index.js +202 -214
- package/dist/links.d.ts +1 -1
- package/dist/links.js +1 -1
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/FitmentTable.js +1 -1
- package/dist/render/components/FooterSocial.d.ts +0 -4
- package/dist/render/components/FooterSocial.js +1 -1
- package/dist/render/components/PopupFrame.d.ts +11 -0
- package/dist/render/components/PopupFrame.js +1 -0
- package/dist/render/components/ProductGridSection.d.ts +0 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/SubmitBuild.d.ts +0 -7
- package/dist/render/components/SubmitBuild.js +1 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +2 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/components/wheels-plp/usePlpFiltersInUrl.d.ts +2 -1
- package/dist/render/components/wheels-plp/usePlpFiltersInUrl.js +1 -1
- package/dist/render/lib/api/index.d.ts +9 -0
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/content/field-usage.d.ts +0 -1
- package/dist/render/lib/content/field-usage.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/AccountBlock/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/AccountBlock/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/AccountBlock/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/AlloyWheelsListing/meta.d.ts +6 -0
- package/dist/render/lib/puck/blocks/commerce/AlloyWheelsListing/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/AlloyWheelsListing/render.d.ts +0 -4
- package/dist/render/lib/puck/blocks/commerce/AlloyWheelsListing/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/BundleOffer/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/BundleOffer/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/BundleOffer/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/CartBlock/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/CartBlock/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/CartBlock/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/CatalogFilterBar/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/CatalogFilterBar/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/CatalogFilterBar/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/CheckoutCTA/meta.d.ts +6 -0
- package/dist/render/lib/puck/blocks/commerce/CheckoutCTA/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/CheckoutCTA/render.d.ts +0 -4
- package/dist/render/lib/puck/blocks/commerce/CheckoutCTA/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/CollectionCard/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/CollectionCard/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/CollectionCard/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/Collections/meta.d.ts +7 -0
- package/dist/render/lib/puck/blocks/commerce/Collections/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/Collections/render.d.ts +0 -5
- package/dist/render/lib/puck/blocks/commerce/Collections/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/CompatibleTyres/meta.d.ts +9 -0
- package/dist/render/lib/puck/blocks/commerce/CompatibleTyres/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/CompatibleTyres/render.d.ts +0 -7
- package/dist/render/lib/puck/blocks/commerce/CompatibleTyres/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/CountrySwitchBlock/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/CountrySwitchBlock/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/CountrySwitchBlock/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/DeliveryOptions/meta.d.ts +6 -0
- package/dist/render/lib/puck/blocks/commerce/DeliveryOptions/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/DeliveryOptions/render.d.ts +0 -4
- package/dist/render/lib/puck/blocks/commerce/DeliveryOptions/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/DetailRows/meta.d.ts +9 -0
- package/dist/render/lib/puck/blocks/commerce/DetailRows/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/DetailRows/render.d.ts +0 -7
- package/dist/render/lib/puck/blocks/commerce/DetailRows/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/EuTyreLabel/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/EuTyreLabel/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/EuTyreLabel/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/FitmentFinder/meta.d.ts +8 -0
- package/dist/render/lib/puck/blocks/commerce/FitmentFinder/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/FitmentFinder/render.d.ts +0 -6
- package/dist/render/lib/puck/blocks/commerce/FitmentFinder/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/FitmentTable/meta.d.ts +9 -0
- package/dist/render/lib/puck/blocks/commerce/FitmentTable/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/FitmentTable/render.d.ts +0 -7
- package/dist/render/lib/puck/blocks/commerce/FitmentTable/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/Gallery/meta.d.ts +14 -0
- package/dist/render/lib/puck/blocks/commerce/Gallery/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/Gallery/render.d.ts +0 -12
- package/dist/render/lib/puck/blocks/commerce/Gallery/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/GalleryB/meta.d.ts +13 -0
- package/dist/render/lib/puck/blocks/commerce/GalleryB/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/GalleryB/render.d.ts +0 -11
- package/dist/render/lib/puck/blocks/commerce/GalleryB/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/GalleryItem/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/GalleryItem/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/GalleryItem/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/Header/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/Header/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/Header/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/ProductGrid/meta.d.ts +7 -0
- package/dist/render/lib/puck/blocks/commerce/ProductGrid/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/ProductGrid/render.d.ts +0 -5
- package/dist/render/lib/puck/blocks/commerce/ProductGrid/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/ProductHero/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/ProductHero/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/ProductHero/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/ProductRef/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/ProductRef/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/ProductRef/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/RelatedProducts/meta.d.ts +6 -0
- package/dist/render/lib/puck/blocks/commerce/RelatedProducts/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/RelatedProducts/render.d.ts +0 -4
- package/dist/render/lib/puck/blocks/commerce/RelatedProducts/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/SearchBlock/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/SearchBlock/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/SearchBlock/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/SpecTable/meta.d.ts +7 -0
- package/dist/render/lib/puck/blocks/commerce/SpecTable/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/SpecTable/render.d.ts +0 -5
- package/dist/render/lib/puck/blocks/commerce/SpecTable/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/ThemeSwitchBlock/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/ThemeSwitchBlock/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/ThemeSwitchBlock/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/TyreFitment/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/TyreFitment/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/TyreFitment/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/TyreSizes/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/TyreSizes/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/TyreSizes/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/metas.d.ts +31 -0
- package/dist/render/lib/puck/blocks/commerce/metas.js +1 -0
- package/dist/render/lib/puck/blocks/service/AppointmentBooking/meta.d.ts +8 -0
- package/dist/render/lib/puck/blocks/service/AppointmentBooking/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/AppointmentBooking/render.d.ts +0 -6
- package/dist/render/lib/puck/blocks/service/AppointmentBooking/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/BookingBox/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/BookingBox/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/BookingBox/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/ContactRouting/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/ContactRouting/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/ContactRouting/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/Events/meta.d.ts +7 -0
- package/dist/render/lib/puck/blocks/service/Events/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/Events/render.d.ts +0 -5
- package/dist/render/lib/puck/blocks/service/Events/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/Footer/meta.d.ts +8 -0
- package/dist/render/lib/puck/blocks/service/Footer/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/Footer/render.d.ts +0 -6
- package/dist/render/lib/puck/blocks/service/Footer/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/FooterDivider/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/FooterDivider/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/FooterDivider/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/FooterEmailSignup/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/FooterEmailSignup/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/FooterEmailSignup/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/FooterGroup/meta.d.ts +8 -0
- package/dist/render/lib/puck/blocks/service/FooterGroup/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/FooterGroup/render.d.ts +0 -6
- package/dist/render/lib/puck/blocks/service/FooterGroup/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/FooterLogo/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/FooterLogo/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/FooterLogo/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/FooterMenu/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/FooterMenu/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/FooterMenu/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/FooterSocial/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/FooterSocial/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/FooterSocial/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/FooterText/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/FooterText/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/FooterText/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/Form/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/Form/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/Form/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/LegalLineBlock/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/LegalLineBlock/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/LegalLineBlock/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/ReviewForm/meta.d.ts +6 -0
- package/dist/render/lib/puck/blocks/service/ReviewForm/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/ReviewForm/render.d.ts +0 -4
- package/dist/render/lib/puck/blocks/service/ReviewForm/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/Reviews/meta.d.ts +6 -0
- package/dist/render/lib/puck/blocks/service/Reviews/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/Reviews/render.d.ts +0 -4
- package/dist/render/lib/puck/blocks/service/Reviews/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/SiteFooter/meta.d.ts +7 -0
- package/dist/render/lib/puck/blocks/service/SiteFooter/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/SiteFooter/render.d.ts +0 -5
- package/dist/render/lib/puck/blocks/service/SiteFooter/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/SiteHeader/meta.d.ts +7 -0
- package/dist/render/lib/puck/blocks/service/SiteHeader/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/SiteHeader/render.d.ts +0 -5
- package/dist/render/lib/puck/blocks/service/SiteHeader/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/SubmitBox/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/SubmitBox/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/SubmitBox/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/SubmitBuild/meta.d.ts +8 -0
- package/dist/render/lib/puck/blocks/service/SubmitBuild/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/SubmitBuild/render.d.ts +0 -6
- package/dist/render/lib/puck/blocks/service/SubmitBuild/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/Subscribe/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/Subscribe/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/Subscribe/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/SubscribeBlogs/meta.d.ts +17 -0
- package/dist/render/lib/puck/blocks/service/SubscribeBlogs/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/SubscribeBlogs/render.d.ts +0 -15
- package/dist/render/lib/puck/blocks/service/SubscribeBlogs/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/metas.d.ts +25 -0
- package/dist/render/lib/puck/blocks/service/metas.js +1 -0
- package/dist/render/lib/puck/current-product.js +1 -1
- package/dist/render/lib/puck/current-record.d.ts +0 -2
- package/dist/render/lib/puck/current-record.js +1 -1
- package/dist/render/lib/puck/lazy-draws.d.ts +5 -0
- package/dist/render/lib/puck/lazy-draws.js +1 -0
- package/dist/render/lib/puck/render-config.js +1 -1
- package/dist/render/lib/puck/storefront-root.d.ts +1 -0
- package/dist/render/lib/puck/storefront-root.js +1 -1
- package/dist/render/lib/sections/footer-social-gap.d.ts +4 -0
- package/dist/render/lib/sections/footer-social-gap.js +1 -0
- package/dist/render/lib/sections/product-grid-title.d.ts +2 -0
- package/dist/render/lib/sections/product-grid-title.js +1 -0
- package/dist/render/lib/sections/submit-build-copy.d.ts +7 -0
- package/dist/render/lib/sections/submit-build-copy.js +1 -0
- package/dist/render/lib/wheels/catalog-default-layout.d.ts +0 -6
- package/dist/render/lib/wheels/catalog-default-layout.js +1 -1
- package/dist/render/lib/wheels/fitment-columns.d.ts +6 -1
- package/dist/render/lib/wheels/fitment-columns.js +1 -1
- package/dist/render/lib/wheels/plp-hydrate.d.ts +2 -0
- package/dist/render/lib/wheels/plp-hydrate.js +1 -1
- package/dist/words.d.ts +26 -10
- package/dist/words.js +5 -5
- package/package.json +11 -4
- package/dist/chunks/chunk-76GXRMJK.js +0 -1
- package/dist/chunks/chunk-GHD5CTVU.js +0 -1
- package/dist/chunks/chunk-U72V3KUB.js +0 -261
- package/dist/chunks/chunk-UZYSAKGR.js +0 -1
- /package/dist/chunks/{chunk-2PHMIP2S.js → chunk-I6VNNXUI.js} +0 -0
- /package/dist/chunks/{chunk-U72V3KUB.js.LEGAL.txt → chunk-YNI65Q6Z.js.LEGAL.txt} +0 -0
package/dist/links.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/** What a link is. */
|
|
12
|
-
export type LinkKind = "page" | "anchor" | "blog" | "product" | "custom";
|
|
12
|
+
export type LinkKind = "page" | "anchor" | "blog" | "product" | "popup" | "custom";
|
|
13
13
|
|
|
14
14
|
/** The kinds, in menu order. `needs` names the block set a kind's targets come
|
|
15
15
|
* from; a kind without it is offered everywhere. */
|
package/dist/links.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var h={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var Oe={bold:h.bold.placeholder,italic:h.italic.placeholder,strike:h.strike.placeholder,code:h.code.placeholder,highlight:h.highlight.placeholder,quiet:h.quiet.placeholder,link:"link text",underline:h.underline.placeholder,sup:h.sup.placeholder,sub:h.sub.placeholder,color:"colored text"};var V=[{style:"bold",label:"B",name:"Strong",title:"Strong \xB7 **words** \xB7 \u2318B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic \xB7 _words_ \xB7 \u2318I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough \xB7 ~~words~~"},{style:"highlight",label:"\u25C6",name:"Emphasis",title:"Emphasis \xB7 ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet \xB7 ^^words^^"},{style:"code",label:"\u2039\u203A",name:"Code",title:"Code"},{style:"link",label:"\u{1F517}",name:"Link",title:"Link \xB7 [words](https://\u2026) \xB7 \u2318K",shortcut:"k"},{style:"bullet",label:"\u2022",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"\u275D",name:"Quote",title:"Quote"},{style:"clear",label:"T\xD7",name:"Clear marks",title:"Clear marks \xB7 \u2318\u21E7X",shortcut:"shift+x"}];var x=[{open:"**",close:"**",kind:"bold"},{open:"==",close:"==",kind:"highlight"},{open:"~~",close:"~~",kind:"strike"},{open:"_",close:"_",kind:"italic",wordBoundary:!0},{open:"^^",close:"^^",kind:"quiet"},{open:"@@",close:"@@",kind:"highlight"},{open:"++",close:"++",kind:"bold",wordStart:!0}],Q=["highlight","quiet"],Ne=V.map(e=>e.style).filter(e=>x.some(n=>n.kind===e)).filter(e=>!Q.includes(e)),Me=[...x,{open:"*",close:"*",kind:"accent"}],ve=[...x,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var ze=["http","https","mailto","tel"];function M(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||ze.includes(n[1].toLowerCase())}var X=["width","profile","rim"];var Ue=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,De={width:[100,500],profile:[20,100],rim:[10,30]};function v(e){let n=Ue.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return X.every(i=>{let[a,u]=De[i];return t[i]>=a&&t[i]<=u})?t:null}function L(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let n=`${e.width}/${e.profile}`;return e.rim==null?n:`${n} R${e.rim}`}function J(e){return[L({width:e.width}),L({width:e.width,profile:e.profile}),L(e)]}var k=["alloy-wheel","tyre"],ee=["alloy-wheel"],w={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Wn=k.map(e=>({value:e,label:w[e]}));function z(e){return e==null?[...ee]:Array.isArray(e)?k.filter(n=>e.includes(n)):[...ee]}var m=e=>e;function f(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function U(e){return m(e).brand??""}function ne(e){return m(e).prices??void 0}function te(e){return m(e).inStock!==!1}function re(e){let n=m(e),t=f(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function D(e){return f(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function ie(e){return D(e).map(n=>n.family)}function oe(e){if(f(e)==="tyre")return[];let n=m(e),t=n.categories;return t&&t.length>0?t:n.process?[n.process]:[]}function le(e){return f(e)==="tyre"?[]:m(e).spec?.pcds??[]}function se(e){return f(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ae(e){return f(e)!=="tyre"?[]:m(e).speedRatings??[]}function ue(e){if(f(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>v(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var ce=null;function pe(e,n){return n?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(n,r)?String(n[r]):t):e}function P(e,n){let t=ce?ce[e]:void 0;if(typeof t=="function"){try{let r=t(n??{});if(typeof r=="string"&&r)return r}catch{}return pe(e,n)}return pe(typeof t=="string"&&t?t:e,n)}var de="homepage";function fe(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var F=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"custom",label:"Custom URL"}];function T(e){return e.offersCommerce&&e.offersService?F:F.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}function y(e){return e===de?"/":`/${e}`}function _(e){return`/journal/${e}`}function A(e){return`/wheels/${e}`}function R(e,n){return`${y(e)}#${n}`}function $(e){return fe(e)}function $e(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}function E(...e){let n=new Set,t=[];for(let r of e)for(let i of r?.content??[]){let a=$e(i?.props?.anchor);if(!a)continue;let u=$(a);!u||n.has(u)||(n.add(u),t.push({slug:u,name:a}))}return t}var Be=()=>({choosePage:P("Choose a page"),chooseSection:P("Choose a section"),noSections:P("No section anchors yet"),sectionHint:P("Jumps to a section on that page."),choosePost:P("Choose a post"),chooseProduct:P("Choose a product")});function I(e,n,t){if(!e)return"page";if(e.startsWith("/journal/"))return"blog";if(e.startsWith("/wheels/"))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||n.includes(r))return"anchor"}return e==="/"||n.includes(e)||t&&t.listingPaths.includes(t.targetOf(e))?"page":"custom"}function me(e,n){let t=Be(),r=e.pages.map(l=>({value:y(l.slug),label:l.title})),i=n?.pageOptions?n.pageOptions(r):r,a=i.map(l=>l.value),u=e.pages.map(l=>({label:l.title,options:E(...l.docs).map(p=>({value:R(l.slug,p.slug),label:p.name}))})).filter(l=>l.options.length>0),c=l=>{switch(l){case"page":return{type:"select",options:i,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:u,placeholder:u.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(p=>({value:_(p.slug),label:p.title||p.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(p=>({value:p.href,label:p.name||p.href})),placeholder:t.chooseProduct};case"custom":return{type:"text"}}},s=T(e.offers).map(l=>({value:l.value,label:P(l.label),target:c(l.value),...l.value==="anchor"?{hint:t.sectionHint}:{},...l.value==="blog"||l.value==="product"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:s,rules:{kindOf:l=>I(l,a),targetOf:l=>l,readFilter:()=>null,withFilter:l=>l}};let o=l=>{let p=n.withFilter(l,null);return n.listingPaths.includes(p)?p:l};return{kinds:s,rules:{kindOf:l=>I(l,a,{listingPaths:n.listingPaths,targetOf:o}),targetOf:o,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:l=>n.listingPaths.includes(l)?n.filtersFor(l):null}}function B(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function ge(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let i of e){let a=i[t];if(typeof a!="number"||!Number.isFinite(a))continue;let u=r.get(i.fieldKey);(u===void 0||a<u)&&r.set(i.fieldKey,a)}return i=>i?r.get(i):void 0}function he(e,n,t,r){let i=new Map;for(let s of t){let o=s[r];typeof o=="number"&&i.set(s.fieldKey,o)}if(i.size===0)return e;let a=[],u=[];e.forEach((s,o)=>{let l=n(s);l&&(a.push(o),u.push({item:s,index:o,order:i.get(l)}))}),u.sort((s,o)=>s.order!==void 0&&o.order!==void 0?s.order-o.order||s.index-o.index:s.order!==void 0?-1:o.order!==void 0?1:s.index-o.index);let c=[...e];return a.forEach((s,o)=>{c[s]=u[o].item}),c.every((s,o)=>s===e[o])?e:c}function ye(e){return Ge(e,"filter")}var We="collection";function W(e,n){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":We},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function Ge(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}function Ye(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Pe(e,n){let t=e?.[n];return Ye(t)?t:null}function be(e,n,t,r){if(t==null&&r==null)return!0;let i=Pe(e,n);return!(i===null||t!=null&&i<t||r!=null&&i>r)}var qe={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},Lt=Object.keys(qe);var ke=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],He={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},je={diameters:"tyreSizes"};function Ze(e){if(e.length===0)return[];let n=ke.filter(t=>e.every(r=>He[t].includes(r)));return n.filter(t=>{let r=je[t];return!r||!n.includes(r)})}function Ve(e){let n=new Set;for(let t of e)n.add(f(t));return[...n]}var Se={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function Qe(e,n,t,r=null){if(r!=="kind"&&n.kind&&f(e)!==n.kind)return!1;for(let i of ke){if(r===i)continue;let a=n[i];if(a.length===0)continue;let u=a.map(String);if(!xe(e,i).some(c=>u.includes(c)))return!1}return!(r!=="price"&&!be(ne(e),t,null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!te(e))}var Xe={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function xe(e,n){switch(n){case"tyreSizes":return[...new Set(ue(e).flatMap(J))];case"brands":return U(e)?[U(e)]:[];case"finishes":return ie(e);case"diameters":return re(e).map(String);case"collections":return oe(e);case"pcds":return le(e);case"tyreTypes":return se(e);case"speedRatings":return ae(e)}}function Je(e){let n=new Map;for(let t of e)for(let r of D(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function Le(e,n,t,r=Ve(e),i=[]){let a=o=>nn(o,r,i),u=Je(e),c=Ze(r).filter(o=>o!=="tyreSizes").filter(a).map(o=>{let l=n[o].map(String),p=new Set,N=new Map,S=new Map;for(let d of e){let b=xe(d,o);for(let g of b)p.add(g);for(let g of new Set(b))S.set(g,(S.get(g)??0)+1);if(Qe(d,n,t,o))for(let g of new Set(b))N.set(g,(N.get(g)??0)+1)}let Ke=[...p].map(d=>({value:d,label:o==="diameters"?`${d}\u2033`:d,count:N.get(d)??0,checked:l.includes(d),swatch:o==="finishes"?u.get(d)??null:null})).sort((d,b)=>{if(o==="diameters")return Number(d.value)-Number(b.value);let g=(S.get(b.value)??0)-(S.get(d.value)??0);return g!==0?g:d.value.localeCompare(b.value)});return{key:o,label:Xe[o],options:Ke}}).filter(o=>o.options.length>en),s=[];for(let o of c){let l=tn(o.key,r,i);l!==void 0&&s.push({fieldKey:o.key,filterOrder:l})}return[...he(c,o=>o.key,s,"filterOrder")]}var en=1;function we(e){return e.showCollection===!1?["collections"]:[]}function nn(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>ye(B(t,r))(W(e,r)))}function tn(e,n,t){if(t.length===0)return;let r;for(let i of n){let a=ge(B(t,i),"filter")(W(e,i));a!==void 0&&(r===void 0||a<r)&&(r=a)}return r}var G={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},Y="type";var Fe="AlloyWheelsListing";function Te(e){return M(e.trim())}var C="/wheels",K="Products";function _e(e,n){return n>1?`${K} \xB7 ${e}`:K}function q(...e){for(let n of e){let t=(n?.content??[]).find(r=>r?.type===Fe);if(t)return t.props??{}}return null}function O(...e){return q(...e)!==null}function Ae(e,n){let t=e.filter(r=>O(...r.docs)).map(r=>y(r.slug));return t.length===0&&n.fallback?[C]:t}var H=[Y,...Object.entries(G).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Re(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),i=r.indexOf("?");return{path:i===-1?r:r.slice(0,i),query:i===-1?"":r.slice(i+1),hash:t}}function rn(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Ee(e){let n=new URLSearchParams(Re(e).query);for(let t of H){let r=n.get(t);if(r)return{param:t,value:r}}return null}function j(e,n){let{path:t,query:r,hash:i}=Re(e),a=r.split("&").filter(u=>u&&!H.includes(rn(u.split("=")[0])));return n?.value&&a.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${a.length?`?${a.join("&")}`:""}${i}`}function Ie(e,n){let t=j(e,null);return n.includes(t)?t:e}function on(e,n,t=[]){return I(e,n,{listingPaths:t,targetOf:r=>Ie(r,t)})}function ln(e){return Array.isArray(e)?e.filter(n=>typeof n?.kind=="string"&&typeof n.field_key=="string").map(n=>({kind:n.kind,fieldKey:n.field_key,...typeof n.filter=="boolean"?{filter:n.filter}:{},filterOrder:n.filter_order??null})):[]}var Ce="Product type",sn="AUD";function Z(e,n){let t=n.listing??{},r=z(t.kinds),i=e.filter(s=>r.includes(f(s))),a=we(t),u=Le(i,Se,sn,r,n.fieldUsage).filter(s=>!a.includes(s.key)).map(s=>({param:G[s.key],label:s.label,values:s.options.filter(o=>!o.value.includes(",")).map(o=>({value:o.value,label:o.label}))})).filter(s=>s.values.length>0),c=k.filter(s=>r.includes(s)&&i.some(o=>f(o)===s));return c.length>1&&u.unshift({param:Y,label:Ce,values:c.map(s=>({value:s,label:w[s]}))}),u}function an(e){return n=>{let t=Ae(n,{fallback:e.offersCommerce}),r=n.filter(i=>O(...i.docs)).length;return{listingPaths:t,pageOptions:i=>{let a=i.map(u=>{let c=n.find(s=>y(s.slug)===u.value);return c&&O(...c.docs)?{...u,label:_e(c.title,r)}:u});return r===0&&e.offersCommerce&&!a.some(u=>u.value===C)&&a.push({value:C,label:K}),a},filtersFor:i=>{if(!t.includes(i))return null;let a=n.find(u=>y(u.slug)===i);return Z(e.catalogue,{listing:a?q(...a.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ee,withFilter:j}}}function un(e){let n=an({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=me({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:A(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Te},filtersFor:t.filtersFor??(()=>null)}}function $t(e,n){return Z(e,n)}export{C as BUILT_IN_LISTING_PATH,F as LINK_KINDS,H as LISTING_FILTER_PARAMS,K as LISTING_PAGE_LABEL,Ce as PRODUCT_TYPE_FILTER_LABEL,R as anchorPath,ln as fieldUsageFromAdminRows,on as inferLinkKind,O as isProductListingPage,Te as isSafeLink,T as linkKindsFor,un as linkPickerSetup,$t as listingFilterFields,q as listingNode,_e as listingPageLabel,Ie as listingTarget,E as pageAnchors,y as pagePath,_ as postPath,Ae as productListingPaths,Ee as readListingFilter,$ as slugifyAnchor,A as wheelPath,j as withListingFilter};
|
|
1
|
+
var h={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var ze={bold:h.bold.placeholder,italic:h.italic.placeholder,strike:h.strike.placeholder,code:h.code.placeholder,highlight:h.highlight.placeholder,quiet:h.quiet.placeholder,link:"link text",underline:h.underline.placeholder,sup:h.sup.placeholder,sub:h.sub.placeholder,color:"colored text"};var Q=[{style:"bold",label:"B",name:"Strong",title:"Strong \xB7 **words** \xB7 \u2318B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic \xB7 _words_ \xB7 \u2318I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough \xB7 ~~words~~"},{style:"highlight",label:"\u25C6",name:"Emphasis",title:"Emphasis \xB7 ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet \xB7 ^^words^^"},{style:"code",label:"\u2039\u203A",name:"Code",title:"Code"},{style:"link",label:"\u{1F517}",name:"Link",title:"Link \xB7 [words](https://\u2026) \xB7 \u2318K",shortcut:"k"},{style:"bullet",label:"\u2022",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"\u275D",name:"Quote",title:"Quote"},{style:"clear",label:"T\xD7",name:"Clear marks",title:"Clear marks \xB7 \u2318\u21E7X",shortcut:"shift+x"}];var x=[{open:"**",close:"**",kind:"bold"},{open:"==",close:"==",kind:"highlight"},{open:"~~",close:"~~",kind:"strike"},{open:"_",close:"_",kind:"italic",wordBoundary:!0},{open:"^^",close:"^^",kind:"quiet"},{open:"@@",close:"@@",kind:"highlight"},{open:"++",close:"++",kind:"bold",wordStart:!0}],X=["highlight","quiet"],Ue=Q.map(e=>e.style).filter(e=>x.some(n=>n.kind===e)).filter(e=>!X.includes(e)),De=[...x,{open:"*",close:"*",kind:"accent"}],$e=[...x,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var Be=["http","https","mailto","tel"];function v(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||Be.includes(n[1].toLowerCase())}var J=["width","profile","rim"];var We=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,Ge={width:[100,500],profile:[20,100],rim:[10,30]};function M(e){let n=We.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return J.every(i=>{let[a,u]=Ge[i];return t[i]>=a&&t[i]<=u})?t:null}function L(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let n=`${e.width}/${e.profile}`;return e.rim==null?n:`${n} R${e.rim}`}function ee(e){return[L({width:e.width}),L({width:e.width,profile:e.profile}),L(e)]}var k=["alloy-wheel","tyre"],ne=["alloy-wheel"],w={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Hn=k.map(e=>({value:e,label:w[e]}));function z(e){return e==null?[...ne]:Array.isArray(e)?k.filter(n=>e.includes(n)):[...ne]}var m=e=>e;function f(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function U(e){return m(e).brand??""}function te(e){return m(e).prices??void 0}function re(e){return m(e).inStock!==!1}function ie(e){let n=m(e),t=f(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function D(e){return f(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function oe(e){return D(e).map(n=>n.family)}function le(e){if(f(e)==="tyre")return[];let n=m(e),t=n.categories;return t&&t.length>0?t:n.process?[n.process]:[]}function se(e){return f(e)==="tyre"?[]:m(e).spec?.pcds??[]}function ae(e){return f(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ue(e){return f(e)!=="tyre"?[]:m(e).speedRatings??[]}function ce(e){if(f(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>M(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var pe=null;function de(e,n){return n?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(n,r)?String(n[r]):t):e}function y(e,n){let t=pe?pe[e]:void 0;if(typeof t=="function"){try{let r=t(n??{});if(typeof r=="string"&&r)return r}catch{}return de(e,n)}return de(typeof t=="string"&&t?t:e,n)}var fe="homepage";function me(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var F=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function T(e){return e.offersCommerce&&e.offersService?F:F.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var $="#popup:";function ge(e){return`${$}${e}`}function he(e){return e.startsWith($)&&e.slice($.length).trim()||null}function P(e){return e===fe?"/":`/${e}`}function _(e){return`/journal/${e}`}function A(e){return`/wheels/${e}`}function R(e,n){return`${P(e)}#${n}`}function B(e){return me(e)}function Ye(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}function E(...e){let n=new Set,t=[];for(let r of e)for(let i of r?.content??[]){let a=Ye(i?.props?.anchor);if(!a)continue;let u=B(a);!u||n.has(u)||(n.add(u),t.push({slug:u,name:a}))}return t}function ye(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var qe=()=>({choosePage:y("Choose a page"),chooseSection:y("Choose a section"),noSections:y("No section anchors yet"),sectionHint:y("Jumps to a section on that page."),choosePost:y("Choose a post"),chooseProduct:y("Choose a product"),choosePopup:y("Choose a popup")});function I(e,n,t){if(!e)return"page";if(he(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(ye(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||n.includes(r))return"anchor"}return e==="/"||n.includes(e)||t&&t.listingPaths.includes(t.targetOf(e))?"page":"custom"}function Pe(e,n){let t=qe(),r=e.pages.map(l=>({value:P(l.slug),label:l.title})),i=n?.pageOptions?n.pageOptions(r):r,a=i.map(l=>l.value),u=e.pages.map(l=>({label:l.title,options:E(...l.docs).map(c=>({value:R(l.slug,c.slug),label:c.name}))})).filter(l=>l.options.length>0),p=l=>{switch(l){case"page":return{type:"select",options:i,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:u,placeholder:u.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(c=>({value:_(c.slug),label:c.title||c.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(c=>({value:c.href,label:c.name||c.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(c=>({value:ge(c.slug),label:c.title||c.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},s=T(e.offers).map(l=>({value:l.value,label:y(l.label),target:p(l.value),...l.value==="anchor"?{hint:t.sectionHint}:{},...l.value==="blog"||l.value==="product"||l.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:s,rules:{kindOf:l=>I(l,a),targetOf:l=>l,readFilter:()=>null,withFilter:l=>l}};let o=l=>{let c=n.withFilter(l,null);return n.listingPaths.includes(c)?c:l};return{kinds:s,rules:{kindOf:l=>I(l,a,{listingPaths:n.listingPaths,targetOf:o}),targetOf:o,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:l=>n.listingPaths.includes(l)?n.filtersFor(l):null}}function W(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function be(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let i of e){let a=i[t];if(typeof a!="number"||!Number.isFinite(a))continue;let u=r.get(i.fieldKey);(u===void 0||a<u)&&r.set(i.fieldKey,a)}return i=>i?r.get(i):void 0}function ke(e,n,t,r){let i=new Map;for(let s of t){let o=s[r];typeof o=="number"&&i.set(s.fieldKey,o)}if(i.size===0)return e;let a=[],u=[];e.forEach((s,o)=>{let l=n(s);l&&(a.push(o),u.push({item:s,index:o,order:i.get(l)}))}),u.sort((s,o)=>s.order!==void 0&&o.order!==void 0?s.order-o.order||s.index-o.index:s.order!==void 0?-1:o.order!==void 0?1:s.index-o.index);let p=[...e];return a.forEach((s,o)=>{p[s]=u[o].item}),p.every((s,o)=>s===e[o])?e:p}function Se(e){return je(e,"filter")}var He="collection";function G(e,n){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":He},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function je(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}function Ze(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function xe(e,n){let t=e?.[n];return Ze(t)?t:null}function Le(e,n,t,r){if(t==null&&r==null)return!0;let i=xe(e,n);return!(i===null||t!=null&&i<t||r!=null&&i>r)}var Ve={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},_t=Object.keys(Ve);var we=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],Qe={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},Xe={diameters:"tyreSizes"};function Je(e){if(e.length===0)return[];let n=we.filter(t=>e.every(r=>Qe[t].includes(r)));return n.filter(t=>{let r=Xe[t];return!r||!n.includes(r)})}function en(e){let n=new Set;for(let t of e)n.add(f(t));return[...n]}var Fe={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function nn(e,n,t,r=null){if(r!=="kind"&&n.kind&&f(e)!==n.kind)return!1;for(let i of we){if(r===i)continue;let a=n[i];if(a.length===0)continue;let u=a.map(String);if(!Te(e,i).some(p=>u.includes(p)))return!1}return!(r!=="price"&&!Le(te(e),t,null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!re(e))}var tn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Te(e,n){switch(n){case"tyreSizes":return[...new Set(ce(e).flatMap(ee))];case"brands":return U(e)?[U(e)]:[];case"finishes":return oe(e);case"diameters":return ie(e).map(String);case"collections":return le(e);case"pcds":return se(e);case"tyreTypes":return ae(e);case"speedRatings":return ue(e)}}function rn(e){let n=new Map;for(let t of e)for(let r of D(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function _e(e,n,t,r=en(e),i=[]){let a=o=>ln(o,r,i),u=rn(e),p=Je(r).filter(o=>o!=="tyreSizes").filter(a).map(o=>{let l=n[o].map(String),c=new Set,N=new Map,S=new Map;for(let d of e){let b=Te(d,o);for(let g of b)c.add(g);for(let g of new Set(b))S.set(g,(S.get(g)??0)+1);if(nn(d,n,t,o))for(let g of new Set(b))N.set(g,(N.get(g)??0)+1)}let Me=[...c].map(d=>({value:d,label:o==="diameters"?`${d}\u2033`:d,count:N.get(d)??0,checked:l.includes(d),swatch:o==="finishes"?u.get(d)??null:null})).sort((d,b)=>{if(o==="diameters")return Number(d.value)-Number(b.value);let g=(S.get(b.value)??0)-(S.get(d.value)??0);return g!==0?g:d.value.localeCompare(b.value)});return{key:o,label:tn[o],options:Me}}).filter(o=>o.options.length>on),s=[];for(let o of p){let l=sn(o.key,r,i);l!==void 0&&s.push({fieldKey:o.key,filterOrder:l})}return[...ke(p,o=>o.key,s,"filterOrder")]}var on=1;function Ae(e){return e.showCollection===!1?["collections"]:[]}function ln(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>Se(W(t,r))(G(e,r)))}function sn(e,n,t){if(t.length===0)return;let r;for(let i of n){let a=be(W(t,i),"filter")(G(e,i));a!==void 0&&(r===void 0||a<r)&&(r=a)}return r}var Y={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},q="type";var Re="AlloyWheelsListing";function Ee(e){return v(e.trim())}var C="/wheels",K="Products";function Ie(e,n){return n>1?`${K} \xB7 ${e}`:K}function H(...e){for(let n of e){let t=(n?.content??[]).find(r=>r?.type===Re);if(t)return t.props??{}}return null}function O(...e){return H(...e)!==null}function Ce(e,n){let t=e.filter(r=>O(...r.docs)).map(r=>P(r.slug));return t.length===0&&n.fallback?[C]:t}var j=[q,...Object.entries(Y).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Ke(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),i=r.indexOf("?");return{path:i===-1?r:r.slice(0,i),query:i===-1?"":r.slice(i+1),hash:t}}function an(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Oe(e){let n=new URLSearchParams(Ke(e).query);for(let t of j){let r=n.get(t);if(r)return{param:t,value:r}}return null}function Z(e,n){let{path:t,query:r,hash:i}=Ke(e),a=r.split("&").filter(u=>u&&!j.includes(an(u.split("=")[0])));return n?.value&&a.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${a.length?`?${a.join("&")}`:""}${i}`}function Ne(e,n){let t=Z(e,null);return n.includes(t)?t:e}function un(e,n,t=[]){return I(e,n,{listingPaths:t,targetOf:r=>Ne(r,t)})}function cn(e){return Array.isArray(e)?e.filter(n=>typeof n?.kind=="string"&&typeof n.field_key=="string").map(n=>({kind:n.kind,fieldKey:n.field_key,...typeof n.filter=="boolean"?{filter:n.filter}:{},filterOrder:n.filter_order??null})):[]}var ve="Product type",pn="AUD";function V(e,n){let t=n.listing??{},r=z(t.kinds),i=e.filter(s=>r.includes(f(s))),a=Ae(t),u=_e(i,Fe,pn,r,n.fieldUsage).filter(s=>!a.includes(s.key)).map(s=>({param:Y[s.key],label:s.label,values:s.options.filter(o=>!o.value.includes(",")).map(o=>({value:o.value,label:o.label}))})).filter(s=>s.values.length>0),p=k.filter(s=>r.includes(s)&&i.some(o=>f(o)===s));return p.length>1&&u.unshift({param:q,label:ve,values:p.map(s=>({value:s,label:w[s]}))}),u}function dn(e){return n=>{let t=Ce(n,{fallback:e.offersCommerce}),r=n.filter(i=>O(...i.docs)).length;return{listingPaths:t,pageOptions:i=>{let a=i.map(u=>{let p=n.find(s=>P(s.slug)===u.value);return p&&O(...p.docs)?{...u,label:Ie(p.title,r)}:u});return r===0&&e.offersCommerce&&!a.some(u=>u.value===C)&&a.push({value:C,label:K}),a},filtersFor:i=>{if(!t.includes(i))return null;let a=n.find(u=>P(u.slug)===i);return V(e.catalogue,{listing:a?H(...a.docs):null,fieldUsage:e.fieldUsage})},readFilter:Oe,withFilter:Z}}}function fn(e){let n=dn({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Pe({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:A(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Ee},filtersFor:t.filtersFor??(()=>null)}}function Yt(e,n){return V(e,n)}export{C as BUILT_IN_LISTING_PATH,F as LINK_KINDS,j as LISTING_FILTER_PARAMS,K as LISTING_PAGE_LABEL,ve as PRODUCT_TYPE_FILTER_LABEL,R as anchorPath,cn as fieldUsageFromAdminRows,un as inferLinkKind,O as isProductListingPage,Ee as isSafeLink,T as linkKindsFor,fn as linkPickerSetup,Yt as listingFilterFields,H as listingNode,Ie as listingPageLabel,Ne as listingTarget,E as pageAnchors,P as pagePath,_ as postPath,Ce as productListingPaths,Oe as readListingFilter,B as slugifyAnchor,A as wheelPath,Z as withListingFilter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as r,Fragment as q}from"react/jsx-runtime";import F from"./SectionBand.js";import{useEffect as D,useState as A}from"react";import _ from"efficient-web-builder/render/components/SectionHeader";import J from"./SectionFootnote.js";import{renderGold as u,renderHeadline as E}from"efficient-web-builder/render/components/goldPhrases";import M from"./fitment/FitmentRowFit.js";import{useVehicleFit as Q}from"./fitment/useVehicleFit.js";import{fitmentRowAnswer as Y}from"../lib/wheels/fitment-row-fit.js";import{fitmentColumns as ee,loadUnitFor as te}from"../lib/wheels/fitment-columns.js";import{useActiveCountry as ne}from"./CurrencyContext.js";import{say as T}from"efficient-web-builder/format/lib/editor-words";const o={body:"text-[length:var(--size-body,12px)]",labelXs:"text-[length:var(--size-label,11px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"},re=[],le="whitespace-nowrap border-b border-line px-4 py-4",X=`relative cursor-pointer border-2 px-4 py-2 font-mono ${o.labelSmall} font-semibold uppercase tracking-[0.18em] text-fg transition-colors`,j="border-b border-line py-[120px] max-[1100px]:py-20",L="border-b border-line pt-0 pb-[120px] max-[1100px]:pt-0 max-[1100px]:pb-20",R={background:"color-mix(in oklab, var(--accent) 14%, transparent)"},B=(a,i,s)=>i.map(f=>f.cell(a,s)).join("|");function oe({num:a,title:i,description:s,rows:f,showFilter:I=!0,tooltipDefaultOn:b=!0,footnote:H,footnoteLinkText:O,footnoteLinkHref:W,editing:y=!1,omitHead:p=!1,fieldUsage:G=re}){const N=f??[],c=ee(G),h=te(ne()),[x,k]=A(null),[l,S]=A(b);D(()=>S(b),[b]);const K=Q({editing:y}),$=c.length===0;if(N.length===0||$)return y?r(F,{className:p?L:j,children:[p?null:t(_,{num:a!=null?u(a):void 0,title:i!=null?E(i,!1):void 0,description:s!=null?u(s):void 0,accent:!0}),t("p",{className:`border-t border-line py-6 font-mono ${o.labelLarge} uppercase tracking-[0.18em] text-fg-dim`,children:$?T("Every fitment column is hidden in Product Types — show one to draw this table."):T("No fitment data for this wheel — pick a wheel with fitment specs.")})]}):null;const z=new Set,g=N.filter(e=>{const n=B(e,c,h);return z.has(n)?!1:(z.add(n),!0)}),w=Array.from(new Set(g.map(e=>e.diameter))).sort((e,n)=>e-n),d=x!==null&&w.includes(x)?x:null,v=d===null?g:g.filter(e=>e.diameter===d),P=I&&w.length>1,V=e=>{if(e===0)return!1;const n=v[e-1],m=v[e];return n.diameter!==m.diameter||n.width!==m.width};return r(F,{className:p?L:j,children:[p?null:t(_,{num:a!=null?u(a):void 0,title:i!=null?E(i,!1):void 0,description:s!=null?u(s):void 0,accent:!0}),r("div",{className:"mb-6 flex flex-wrap items-center gap-x-2 gap-y-3",children:[P&&r(q,{children:[t("span",{className:`mr-2 font-mono ${o.labelSmall} uppercase tracking-[0.24em] text-fg-dim max-[720px]:mr-0 max-[720px]:mb-1 max-[720px]:w-full`,children:"Filter by size:"}),r("button",{type:"button",onClick:()=>k(null),className:`${X} ${d===null?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 hover:border-accent"}`,style:d===null?R:void 0,children:[d===null&&t("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),"All"]}),w.map(e=>{const n=e===d;return r("button",{type:"button",onClick:()=>k(n?null:e),className:`${X} ${n?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 hover:border-accent"}`,style:n?R:void 0,children:[n&&t("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e,'"']},e)})]}),r("button",{type:"button",onClick:()=>S(e=>!e),"aria-pressed":l,"aria-label":l?"Hide vehicle tooltip":"Show vehicle tooltip",className:`ml-auto inline-flex items-center gap-3 font-mono ${o.labelSmall} uppercase tracking-[0.24em] text-fg-dim transition-colors hover:text-fg max-[720px]:hidden`,children:[t("span",{children:"Vehicle tooltip"}),t("span",{className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 transition-colors ${l?"border-accent":"border-fg-dim/50"}`,style:l?{background:"color-mix(in oklab, var(--accent) 30%, transparent)"}:void 0,"aria-hidden":!0,children:t("span",{className:`block h-3 w-3 rounded-full transition-transform ${l?"translate-x-[18px] bg-accent":"translate-x-[2px] bg-fg-dim"}`})}),t("span",{className:l?"text-accent":"text-fg-dim",children:l?"On":"Off"})]})]}),t("div",{className:"-mx-1 overflow-x-auto",children:r("table",{className:`w-full border-collapse font-mono ${o.labelXl} tracking-[0.06em] text-fg`,children:[t("thead",{children:t("tr",{children:c.map(({header:e},n)=>t("th",{className:`whitespace-nowrap border-b border-line bg-surface px-4 py-4 text-left ${o.body} font-normal uppercase tracking-[0.22em] text-fg-dim`,children:e},n))})}),t("tbody",{children:v.map((e,n)=>t("tr",{className:`group transition-colors hover:[&>td]:bg-surface ${V(n)?"[&>td]:border-t [&>td]:border-line":""}`,children:c.map((m,U)=>{const C=U===c.length-1,Z=m.fieldKey==="diameter";return r("td",{className:`${C?"relative ":""}${le}${Z?" text-accent":""}`,children:[m.cell(e,h),C&&l&&t("span",{role:"tooltip",className:`pointer-events-none absolute top-1/2 right-0 z-20 hidden w-[520px] -translate-y-1/2 whitespace-normal bg-[var(--tooltip-bg)] px-3 py-2 text-right font-mono ${o.labelXs} normal-case tracking-[0.12em] text-fg shadow-lg group-hover:block max-[720px]:!hidden`,children:t(M,{answer:Y(e,K)})})]},m.fieldKey)})},B(e,c,h)))})]})}),t(J,{text:H,linkText:O,linkHref:W})]})}export{oe as default};
|
|
@@ -2,10 +2,6 @@ import { type SocialIconStyle } from "efficient-web-builder/render/components/so
|
|
|
2
2
|
export type SocialIconSize = "small" | "medium" | "large";
|
|
3
3
|
export type SocialAlign = "start" | "center" | "end";
|
|
4
4
|
export declare const SOCIAL_ICON_PX: Record<SocialIconSize, number>;
|
|
5
|
-
export declare const SOCIAL_GAP_MIN = 0;
|
|
6
|
-
export declare const SOCIAL_GAP_MAX = 32;
|
|
7
|
-
export declare const SOCIAL_GAP_STEP = 2;
|
|
8
|
-
export declare const SOCIAL_GAP_DEFAULT = 0;
|
|
9
5
|
export interface FooterSocialProps {
|
|
10
6
|
iconStyle?: SocialIconStyle;
|
|
11
7
|
iconSize?: SocialIconSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import{useSiteSocialLinks as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{useSiteSocialLinks as x}from"./SiteRecordContext.js";import{SOCIAL_GAP_DEFAULT as S,SOCIAL_GAP_MAX as b,SOCIAL_GAP_MIN as h}from"../lib/sections/footer-social-gap.js";import{DEFAULT_SOCIAL_ICON_STYLE as _,SocialMark as A}from"efficient-web-builder/render/components/socialIcons";import{normalizeSocialLinks as k,socialLinksToDraw as L}from"efficient-web-builder/format/lib/content/social-links";import{say as y}from"efficient-web-builder/format/lib/editor-words";const o={small:16,medium:20,large:24},s={start:"justify-start",center:"justify-center",end:"justify-end"};function I({iconStyle:l=_,iconSize:n="medium",align:c="start",gap:i=S,editing:m=!1}){const d=x(),a=L(k(d));if(a.length===0)return m?e("div",{"data-social-placeholder":"",className:"rounded border border-dashed border-line px-3 py-2 text-[13px] text-fg-dim",children:y("Add your social links")}):null;const r=o[n]??o.medium,u={gap:Math.min(b,Math.max(h,Number.isFinite(i)?i:0)),"--social-mark":`${r}px`};return e("ul",{"data-social-block":"","aria-label":"Social media",className:`flex list-none flex-wrap p-0 [margin:calc((44px-var(--social-mark))/-2)] max-[800px]:[margin:calc((40px-var(--social-mark))/-2)] ${s[c]??s.start}`,style:u,children:a.map(({platform:t,href:f,label:p})=>e("li",{children:e("a",{href:f,target:"_blank",rel:"noopener noreferrer","aria-label":`${p} (opens in a new tab)`,className:"grid h-11 w-11 place-items-center rounded text-fg transition-colors hover:text-accent focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-4px] focus-visible:outline-current motion-reduce:transition-none max-[800px]:h-10 max-[800px]:w-10",children:e(A,{platform:t,iconStyle:l,size:r})})},t))})}export{o as SOCIAL_ICON_PX,I as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { PopupLook } from "efficient-web-builder/format/lib/popup/look";
|
|
3
|
+
export declare function tintOf(hex: string, opacity: number): string;
|
|
4
|
+
export default function PopupFrame({ look, open, inline, onClose, label, children, }: {
|
|
5
|
+
look: PopupLook;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
label: string;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as u,jsxs as m}from"react/jsx-runtime";import{useCallback as p,useRef as x}from"react";import{useModalDismiss as g}from"./useModalDismiss.js";const h={"top-left":{justifyContent:"flex-start",alignItems:"flex-start"},"top-center":{justifyContent:"center",alignItems:"flex-start"},"top-right":{justifyContent:"flex-end",alignItems:"flex-start"},left:{justifyContent:"flex-start",alignItems:"center"},center:{justifyContent:"center",alignItems:"center"},right:{justifyContent:"flex-end",alignItems:"center"},"bottom-left":{justifyContent:"flex-start",alignItems:"flex-end"},"bottom-center":{justifyContent:"center",alignItems:"flex-end"},"bottom-right":{justifyContent:"flex-end",alignItems:"flex-end"}};function b(t,n){const e=Number.parseInt(t.slice(1),16),s=e>>16&255,i=e>>8&255,r=e&255;return`rgba(${s}, ${i}, ${r}, ${Math.round(n)/100})`}function y({look:t,open:n=!0,inline:e=!1,onClose:s,label:i,children:r}){const o=x(null),l=p(()=>s?.(),[s]);if(g({active:!e&&n,onDismiss:l,focusRef:o}),!e&&!n)return null;const c=f=>{e||!t.outsideClick||f.target===f.currentTarget&&l()},a=t.height==="full",d=m("div",{ref:o,tabIndex:-1,"data-popup-panel":"",className:"relative bg-bg text-fg outline-none",style:{width:t.fullWidth?"100%":`min(${t.width}px, 100%)`,height:a?"100%":void 0,maxHeight:"100%",overflow:"auto",borderRadius:t.fullWidth||a?0:"var(--sf-section-radius, 0px)"},children:[t.closeButton!=="none"?u("button",{type:"button","aria-label":"Close",onClick:e?void 0:l,"data-popup-close":t.closeButton,className:"absolute z-[5] flex h-[38px] w-[38px] items-center justify-center border border-line bg-bg font-mono text-[14px] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:t.closeButton==="outside"?{top:-46,right:0}:{top:12,right:12},children:"×"}):null,r]});return u("div",{role:"dialog","aria-modal":e?void 0:!0,"aria-label":i,"data-popup-frame":e?"inline":"live",onClick:c,className:e?"relative flex min-h-[100vh] w-full":"fixed inset-0 z-[90] flex",style:{...h[t.placement],background:b(t.tintColor,t.tintOpacity),padding:t.fullWidth||a?0:24},children:d})}export{y as default,b as tintOf};
|
|
@@ -26,7 +26,6 @@ export declare const TITLE_SIZES: readonly [{
|
|
|
26
26
|
readonly cls: "font-heading2 font-medium tracking-[-0.03em] text-[length:var(--size-headingMedium,64px)] max-[800px]:text-[length:var(--size-headingMedium,40px)]";
|
|
27
27
|
}];
|
|
28
28
|
export type TitleSize = (typeof TITLE_SIZES)[number]["value"];
|
|
29
|
-
export declare const DEFAULT_TITLE_SIZE: TitleSize;
|
|
30
29
|
interface Props {
|
|
31
30
|
gap?: number | string;
|
|
32
31
|
num?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as d,Fragment as Ne}from"react/jsx-runtime";import{GRID_CARD_SHOW as R}from"../lib/sections/card-show-defaults.js";import{useEffect as V,useId as Te,useMemo as p}from"react";import{CARD_IMAGE_BG_OFF as ze,resolveCardImageBackground as Ie}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as Le}from"efficient-web-builder/format/lib/content/card-image-shape";import{containerGapProps as Pe,GAP_LENGTH_VAR as Ae,GAP_ZONE_CLASS as Fe}from"efficient-web-builder/format/lib/content/container-gap";import Re from"next/link";import Oe from"./ProductCard.js";import{CARD_ROWS_GRID_CLASS as De,cardRowsGridStyle as Ge}from"./WheelCardFrame.js";import{ProductCardChromeProvider as ke}from"./ProductCardChrome.js";import{gridClassImageSizes as Be}from"../lib/sections/card-image-sizes.js";import{fillRowCss as Ue}from"../lib/sections/fill-row.js";import{answersForKind as Y}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as He}from"./ProductCardEyebrow.js";import je from"./NoCurrencyNote.js";import{DEFAULT_CARD_OUTLINE as Ke,cardIndexCss as We,parseCardIndexFormat as Xe}from"efficient-web-builder/format/lib/sections/product-card-style";import{DEFAULT_COVER_INDEX as Ze}from"../lib/wheels/cover-rendering.js";import{SITE_WIDTH_CAP as Ve,centredCap as Ye}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as qe,SectionWheelsProvider as Je}from"./ProductRef.js";import{useCurrency as Qe}from"./CurrencyContext.js";import{COLLECTION_ATTR as er,useCatalogFilter as rr}from"./catalog/CatalogFilterContext.js";import{renderGold as O,renderHeadline as tr}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as ar}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as sr}from"../lib/wheels/wheel-summary-casing.js";import nr from"./TyreSummaryCard.js";import{itemKind as q,plpItemsOfKinds as or,plpKindNoun as ir,resolvePlpKinds as J}from"../lib/catalog/plp-item.js";import{rowsForGridSource as lr}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as mr}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as dr}from"efficient-web-builder/render/lib/puck/header-clearance";import{finishFamiliesOf as pr}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as cr}from"../lib/wheels/lug-count.js";import{diametersOf as gr}from"../lib/wheels/size-range.js";import{say as xr}from"efficient-web-builder/format/lib/editor-words";const t={headingMediumUpTo800Xs:"max-[800px]:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-[800px]:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-[800px]:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-[800px]:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},Q={1:"grid-cols-1",2:"grid-cols-2 max-[800px]:grid-cols-1",3:"grid-cols-3 max-[800px]:grid-cols-1",4:"grid-cols-4 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1",5:"grid-cols-5 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1",6:"grid-cols-6 max-[1100px]:grid-cols-3 max-[800px]:grid-cols-1"},ee=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${t.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${t.headingMedium1} ${t.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${t.headingMedium2} ${t.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${t.headingMedium3} ${t.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${t.headingMedium4} ${t.headingMediumUpTo800Xl}`}]
|
|
1
|
+
"use client";import{jsx as e,jsxs as d,Fragment as Ne}from"react/jsx-runtime";import{GRID_CARD_SHOW as R}from"../lib/sections/card-show-defaults.js";import{useEffect as V,useId as Te,useMemo as p}from"react";import{CARD_IMAGE_BG_OFF as ze,resolveCardImageBackground as Ie}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as Le}from"efficient-web-builder/format/lib/content/card-image-shape";import{containerGapProps as Pe,GAP_LENGTH_VAR as Ae,GAP_ZONE_CLASS as Fe}from"efficient-web-builder/format/lib/content/container-gap";import Re from"next/link";import Oe from"./ProductCard.js";import{CARD_ROWS_GRID_CLASS as De,cardRowsGridStyle as Ge}from"./WheelCardFrame.js";import{ProductCardChromeProvider as ke}from"./ProductCardChrome.js";import{gridClassImageSizes as Be}from"../lib/sections/card-image-sizes.js";import{fillRowCss as Ue}from"../lib/sections/fill-row.js";import{answersForKind as Y}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as He}from"./ProductCardEyebrow.js";import je from"./NoCurrencyNote.js";import{DEFAULT_CARD_OUTLINE as Ke,cardIndexCss as We,parseCardIndexFormat as Xe}from"efficient-web-builder/format/lib/sections/product-card-style";import{DEFAULT_COVER_INDEX as Ze}from"../lib/wheels/cover-rendering.js";import{SITE_WIDTH_CAP as Ve,centredCap as Ye}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as qe,SectionWheelsProvider as Je}from"./ProductRef.js";import{useCurrency as Qe}from"./CurrencyContext.js";import{COLLECTION_ATTR as er,useCatalogFilter as rr}from"./catalog/CatalogFilterContext.js";import{renderGold as O,renderHeadline as tr}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as ar}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as sr}from"../lib/wheels/wheel-summary-casing.js";import nr from"./TyreSummaryCard.js";import{itemKind as q,plpItemsOfKinds as or,plpKindNoun as ir,resolvePlpKinds as J}from"../lib/catalog/plp-item.js";import{rowsForGridSource as lr}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as mr}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as dr}from"efficient-web-builder/render/lib/puck/header-clearance";import{finishFamiliesOf as pr}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as cr}from"../lib/wheels/lug-count.js";import{diametersOf as gr}from"../lib/wheels/size-range.js";import{say as xr}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as ur}from"../lib/sections/product-grid-title.js";const t={headingMediumUpTo800Xs:"max-[800px]:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-[800px]:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-[800px]:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-[800px]:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},Q={1:"grid-cols-1",2:"grid-cols-2 max-[800px]:grid-cols-1",3:"grid-cols-3 max-[800px]:grid-cols-1",4:"grid-cols-4 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1",5:"grid-cols-5 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1",6:"grid-cols-6 max-[1100px]:grid-cols-3 max-[800px]:grid-cols-1"},ee=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${t.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${t.headingMedium1} ${t.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${t.headingMedium2} ${t.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${t.headingMedium3} ${t.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${t.headingMedium4} ${t.headingMediumUpTo800Xl}`}];function hr(c){return(ee.find(o=>o.value===c)??ee.find(o=>o.value===ur)).cls}function fr({num:c,catalog:o,kinds:S,title:$,titleSize:re,padTop:D,description:y,link:g,products:te,wheels:ae,source:i,columns:se,limit:x,editing:u,contentCapped:ne=!1,imageBackground:oe,spinOnHover:ie,coverIndex:le,indexBadge:me,outline:de,showBadge:pe,fieldUsage:l,showCardPrice:ce,showCardFinishes:ge,showCardSizes:xe,showCardBuy:ue,showCardPage:he,cardImage:fe,gap:ye}){const M=p(()=>l?Y(l,"alloy-wheel"):void 0,[l]),Ce=p(()=>l?Y(l,"tyre"):void 0,[l]),r=`pg-${Te().replace(/:/g,"")}`,_=Q[Math.min(6,Math.max(1,se??4))]??Q[4],G=typeof x=="number"&&x>0,k=ne,B=mr(u===!0&&!!i),n=p(()=>i?sr(lr(i,or(B??o??[],J(S)))):null,[o,B,i,S]),E=i?.process,m=!!E,{filters:C,reportCount:N,reportLugs:T,reportSizes:z,reportFinishes:I,vehicle:U}=rr(),{currency:L}=Qe(),P=m&&!!C.process&&C.process!==E,a=p(()=>n?m?ar(n,C,L,U.fit):n:null,[n,m,C,L,U.fit]);V(()=>{if(m)return N(r,P?0:a?.length??0),()=>N(r,0)},[m,P,a,N,r]);const ve=p(()=>{const s=(a??[]).filter(f=>q(f)!=="tyre");if(s.length===0)return!1;const w=s.some(f=>!!f.process);return s.some(f=>!!f.setWords)||He({kind:!1,brand:!1,process:w},M??[])},[a,M]),v=p(()=>({lugs:cr(n??[]),sizes:gr(n??[]),finishes:pr(n??[])}),[n]);V(()=>(T(r,v.lugs),z(r,v.sizes),I(r,v.finishes),()=>{T(r,[]),z(r,[]),I(r,[])}),[v,T,z,I,r]);const h=Pe("ProductGrid",ye,"both"),H=h.className.includes(Fe),A=`${r} grid${h.className} bg-[var(--catalog-grid-bg)] ${_}`,be=H?`${A} ${De}`:A,we=H?{...h.style,...Ge(`var(${Ae})`)}:h.style,Se=a?a.length>0?e("div",{className:be,style:we,children:a.map((s,w)=>q(s)==="tyre"?e(nr,{item:s,currency:L,editing:u,fieldUsage:Ce},`tyre:${s.slug}-${w}`):e(Oe,{wheel:s,variant:"catalog"},`${s.slug}-${w}`))}):u?e("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",children:e("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:xr("No products in “{name}” yet",{name:i?.name??""})})}):null:e(te,{className:A,style:h.style,minEmptyHeight:320}),b=a?a.length:null,j=ir(J(S)),$e=c||$||y||g?d("div",{className:`${dr} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-[800px]:flex-wrap max-[800px]:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${k?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-[800px]:-mx-[min(20px,var(--sf-site-gutter,40px))] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]"}`,children:[d("div",{className:"flex min-w-0 items-end gap-6 max-[800px]:flex-col max-[800px]:items-stretch max-[800px]:gap-3",children:[c&&e("span",{className:`font-mono ${t.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:O(c)}),$&&e("h2",{className:`${hr(re)} leading-none text-fg max-[800px]:leading-[1] [&>span]:block`,children:tr($,!1)})]}),(y||g||b!==null)&&d("div",{className:"flex items-center gap-5 max-[800px]:gap-3 min-[800px]:grow min-[800px]:justify-end",children:[y&&e("span",{className:`max-w-[340px] truncate font-display ${t.body} leading-[1.4] text-fg-dim max-[800px]:hidden min-[800px]:w-0 min-[800px]:grow min-[800px]:text-right`,children:O(y)}),g&&d(Re,{href:g.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${t.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:[O(g.text),e("span",{"aria-hidden":!0,children:"→"})]}),b!==null&&d("span",{className:`whitespace-nowrap font-mono ${t.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[b," ",b===1?j.one:j.many]})]})]}):null,Me=typeof D=="number"?D:120,K=Xe(me),_e=a?G?Math.min(a.length,x):a.length:void 0,W=Ue(r,_,{limit:x,cards:a?.length}),X=We(r,K),Z=d(Ne,{children:[G&&e("style",{children:`.${r} > *:nth-child(n+${x+1}){display:none}`}),W&&e("style",{children:W}),X&&e("style",{children:X}),$e,Se,e(je,{editing:u})]});if(P)return null;const F=e("section",{...m?{[er]:E}:{},className:"relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] pt-[var(--pg-pt)] pb-[120px] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[800px]:pt-[70px] max-[800px]:pb-[70px]",style:{"--pg-pt":`${Me}px`,...Le(fe)},children:k?e("div",{style:Ye(Ve),children:Z}):Z}),Ee=n?F:u?e(qe,{children:F}):e(Je,{wheels:ae,children:F});return e(ke,{imageSizes:Be(_,_e),imageBackgroundFill:Ie(oe,ze),spinOnHover:ie??!0,coverIndex:le??Ze,indexBadge:K,outline:de??Ke,showBadge:pe??!0,fieldUsage:M,reserveEyebrow:ve,showCardPrice:ce??!0,showCardFinishes:ge??!0,showCardSizes:xe??R.showCardSizes,showCardBuy:ue??R.showCardBuy,showCardPage:he??R.showCardPage,children:Ee})}export{ee as TITLE_SIZES,fr as default};
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { Form } from "../lib/api/index.js";
|
|
2
2
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
3
|
-
export declare const SUBMIT_DEFAULTS: {
|
|
4
|
-
eyebrow: string;
|
|
5
|
-
title: string;
|
|
6
|
-
body: string;
|
|
7
|
-
buttonText: string;
|
|
8
|
-
consent: string;
|
|
9
|
-
};
|
|
10
3
|
interface Props {
|
|
11
4
|
eyebrow?: string;
|
|
12
5
|
title?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as F}from"react/jsx-runtime";import S from"./SectionBand.js";import{useBoundForm as v,useFormSubmission as j}from"./formSubmission.js";import{SubmitFormColumn as N,SubmitHead as B}from"./submit/SubmitRegions.js";import{SUBMIT_DEFAULTS as o}from"../lib/sections/submit-build-copy.js";function e(s,n){return s===void 0?n:s}function L({eyebrow:s,title:n,body:l,buttonText:u,consent:b,formSlug:m,form:f,editing:i=!1,boxes:x,inBoxes:g=!1}){const a=e(s,o.eyebrow),p=e(n,o.title),c=e(l,o.body),y=e(u,o.buttonText),w=e(b,o.consent),r=v(m,f),h=j({form:r,formSlug:m,editing:i}),T=r===void 0,d=!!r||i;return!d&&!a&&!p&&!c?null:g&&x?t(S,{className:"border-y border-line py-[120px] max-[1100px]:py-[60px]",children:t(x,{className:"grid grid-cols-2 items-start gap-[60px] max-[1100px]:grid-cols-1 max-[1100px]:gap-10"})}):t("section",{className:"border-y border-line py-[120px] max-[1100px]:py-[60px]",children:F("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-2 items-end gap-[60px] px-[var(--sf-site-gutter,40px)] max-[1100px]:grid-cols-1 max-[1100px]:gap-10 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[t(B,{eyebrow:a,title:p}),t(N,{body:c,buttonLabel:y,consent:w,form:r,submission:h,showForm:d,resolving:T,editing:i})]})})}export{L as default};
|
|
@@ -20,6 +20,7 @@ export interface AlloyWheelsListingProps {
|
|
|
20
20
|
showInStock?: boolean;
|
|
21
21
|
kinds?: string[];
|
|
22
22
|
products?: ProductSummary[];
|
|
23
|
+
requestQuery?: string;
|
|
23
24
|
wheels?: WheelSummary[];
|
|
24
25
|
editing?: boolean;
|
|
25
26
|
coverIndex?: number;
|
|
@@ -39,4 +40,4 @@ export declare const PLP_GATE_DEFAULTS: {
|
|
|
39
40
|
readonly heading: "Let's find wheels that fit your car.";
|
|
40
41
|
readonly intro: "Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you.";
|
|
41
42
|
};
|
|
42
|
-
export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, products, wheels, editing, coverIndex, cardImage, spinOnHover, imageBackground, showBadge, showCardSizes, showCardBuy, showCardPage, showCardPrice, showCardFinishes, outline, indexBadge, titleLevel, }: AlloyWheelsListingProps): import("react").JSX.Element | null;
|
|
43
|
+
export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, products, wheels, requestQuery, editing, coverIndex, cardImage, spinOnHover, imageBackground, showBadge, showCardSizes, showCardBuy, showCardPage, showCardPrice, showCardFinishes, outline, indexBadge, titleLevel, }: AlloyWheelsListingProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as s,Fragment as se}from"react/jsx-runtime";import{LISTING_CARD_SHOW as B}from"../../lib/sections/card-show-defaults.js";import{useCallback as d,useEffect as Je,useId as Qe,useMemo as l,useRef as Ze,useState as et}from"react";import{CARD_IMAGE_BG_OFF as tt,resolveCardImageBackground as ot}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as rt}from"efficient-web-builder/format/lib/content/card-image-shape";import{cardIndexCss as nt,DEFAULT_CARD_INDEX_FORMAT as st,DEFAULT_CARD_OUTLINE as it}from"efficient-web-builder/format/lib/sections/product-card-style";import{answersForKind as ie}from"../../lib/content/field-usage.js";import{useCurrency as lt}from"../CurrencyContext.js";import at from"../NoCurrencyNote.js";import{usePreviewDevice as ct}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as pt,renderHeadline as dt}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as mt}from"../useProductCatalog.js";import{scrollBehavior as ht}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as ut,PLP_GRID_GAP_VAR as ft,plpGridVars as gt}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as yt}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as xt,cardRowsGridStyle as St}from"../WheelCardFrame.js";import{applyPlpFilters as wt,asPlpSortKey as bt,buildPlpFacets as Ct,buildPlpTypeOptions as Nt,buildTyreSizeBoxes as vt,EMPTY_PLP_FILTERS as le,hasActivePlpFilters as Pt,paginatePlp as kt,pickTyreSize as _t,plpTyreSizeBoxesShown as Tt,plpInStockCount as At,plpOpeningSort as zt,plpPriceBounds as Ft,plpShownKinds as It,plpSortKeysFor as Ot,PLP_SORT_LABELS as Bt}from"../../lib/wheels/plp-filters.js";import{itemKind as z,itemSlug as L,itemTyreSizes as Lt,plpBrandVaries as Vt,plpProcessVaries as Rt,plpItemsOfKinds as Et,plpKindNoun as V,resolvePlpKinds as Dt}from"../../lib/catalog/plp-item.js";import{plpGateWords as Kt,plpVehicleCopy as jt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as Gt,oemTyreSizes as Mt}from"../../lib/tyres/tyre-vehicle-fitment.js";import $t from"../TyreSummaryCard.js";import{wheelsFittingVehicle as Wt}from"../../lib/wheels/plp-fitment-match.js";import Ht from"./PlpActiveChips.js";import{DEFAULT_COVER_INDEX as Ut}from"../../lib/wheels/cover-rendering.js";import Xt from"./PlpCard.js";import Yt from"./PlpPagination.js";import qt from"./PlpSidebar.js";import Jt from"./PlpVehicleBar.js";import Qt from"./PlpVehicleGate.js";import{useVehicleCatalog as Zt}from"./useVehicleCatalog.js";import{useVehicleFit as eo}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as to}from"./usePlpFiltersInUrl.js";import{say as R}from"efficient-web-builder/format/lib/editor-words";const Do={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function oo({level:C,className:N,children:v}){return r(C===2?"h2":"h1",{className:N,children:v})}const ro=[];function no({heading:C="",intro:N="",askForCar:v=!0,gateHeading:E="",gateIntro:ae="",perPage:D=24,columns:ce,defaultSort:pe="recommended",hiddenFacets:de=[],fieldUsage:g=ro,showPrice:K=!0,showInStock:me=!0,kinds:he,products:ue,wheels:fe,editing:m=!1,coverIndex:ge=Ut,cardImage:ye,spinOnHover:xe=!1,imageBackground:Se,showBadge:we=!0,showCardSizes:be,showCardBuy:Ce,showCardPage:Ne,showCardPrice:ve,showCardFinishes:Pe,outline:ke=it,indexBadge:j=st,titleLevel:_e}){const{currency:a}=lt(),Te=ot(Se,tt),h=Dt(he),G=ct(),M=ut(ce),Ae=gt(M,m?G:null),ze=yt(M,m?G:null),$=`plp-${Qe().replace(/:/g,"")}`,F=nt($,j),Fe=mt(),W=ue??fe??Fe??[],H=l(()=>Et(W,h),[W,h.join(",")]),o=eo({editing:m,enabled:v,autoApply:!0}),[Ie,I]=et(!1),Oe=zt(pe,h),y=o.applied?.vehicle??null,[t,w]=to({editing:m,openingSort:Oe,appliedVehicle:y,vehicleRestored:o.restored}),p=It(h,t.kind),i=d(e=>w(e),[w]),U=d((e,u)=>{const c=t[e],Ye=c.map(String).includes(u)?c.filter(qe=>String(qe)!==u):[...c,e==="diameters"?Number(u):u];i({...t,[e]:Ye,page:1})},[t,i]),X=d(e=>i({...t,priceMax:e,page:1}),[t,i]),Y=d(e=>i({...t,inStockOnly:e,page:1}),[t,i]),q=d(e=>i({...le,kind:e,inStockOnly:t.inStockOnly,priceMax:t.priceMax,sort:t.sort}),[t.inStockOnly,t.priceMax,t.sort,i]),Be=d(e=>i({...t,sort:e,page:1}),[t,i]),Le=d(e=>{i({...t,page:e}),typeof window<"u"&&window.scrollTo({top:0,behavior:ht()})},[t,i]),J=d(()=>i({...le,sort:t.sort}),[t.sort,i]),{clear:k}=o,Q=d(()=>{k(),I(!0),w(e=>({...e,page:1}))},[k]),Ve=d(()=>{k(),I(!1),w(e=>({...e,page:1}))},[k]),_=y?[y.make,y.model,y.year,y.modification].join("|"):"",T=Ze(null);Je(()=>{if(o.restored){if(T.current===null){T.current=_;return}T.current!==_&&(T.current=_,w(e=>e.page===1?e:{...e,page:1}))}},[o.restored,_,w]);const A=Zt({catalog:H,shownKinds:h,vehicle:y,editing:m}),n=l(()=>{if(!o.fit)return A;const e=A.filter(c=>z(c)==="alloy-wheel"),u=new Set(Wt(e,o.fit).map(c=>c.slug));return A.filter(c=>z(c)!=="alloy-wheel"||u.has(L(c)))},[A,o.fit]),b=de.join(","),Re=l(()=>{const e=new Set(b?b.split(","):[]);return Ct(n,t,a,p,g).filter(u=>!e.has(u.key))},[n,t,a,b,p.join(","),g]),x=l(()=>wt(n,t,a),[n,t,a]),Z=p.length>1,Ee=l(()=>ie(g,"alloy-wheel"),[g]),De=l(()=>ie(g,"tyre"),[g]),ee=l(()=>Vt(x),[x]),Ke=l(()=>Rt(x),[x]),je=l(()=>K?Ft(n,a):null,[n,a,K]),Ge=l(()=>At(n,t,a),[n,t,a]),Me=l(()=>Nt(n,h,t,a),[n,h.join(","),t,a]),$e=d((e,u)=>{const c=_t(n.flatMap(Lt),t.tyreSizes[0]??"",e,u);i({...t,tyreSizes:c?[c]:[],page:1})},[n,t,i]),We=l(()=>{const e=new Set(b?b.split(","):[]);return!Tt(n,p)||e.has("tyreSizes")?null:vt(n,t,a)},[n,t,a,b,p.join(","),g]),f=l(()=>kt(x,t.page,D),[x,t.page,D]),S=V(p),O=jt(p),te=Kt(E,ae,p,h),oe=p.length===1&&p[0]==="tyre",re=o.applied?.stock??null,P=l(()=>Mt(re),[re]),He=l(()=>n.filter(e=>p.includes(z(e))).length,[n,p.join(",")]),ne=H.length===0,Ue=!ne&&n.length===0,Xe=v&&!m&&!o.applied&&!Ie;return h.length===0?null:s("section",{style:rt(ye),children:[v&&r(Jt,{cascade:o.cascade,appliedName:o.appliedName,fit:o.fit,fitSummary:oe&&P.length>0?`Takes ${P.join(" · ")}`:null,resolving:o.resolving,unresolved:oe?!!o.applied&&!o.resolving&&P.length===0:o.unresolved,matchCount:He,copy:O,onAmend:Ve,onClear:Q}),Xe&&r(Qt,{cascade:o.cascade,heading:te.heading,intro:te.intro,ready:o.restored,copy:O,onSkip:()=>I(!0)}),s("div",{className:"px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]",children:[(C||N)&&s("header",{className:"mb-6",children:[C&&r(oo,{level:_e,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:dt(C,!1)}),N&&r("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:pt(N)})]}),s("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[r(qt,{facets:Re,filters:t,typeOptions:Me,sizeBoxes:We,sizeMatches:t.tyreSizes.length>0?x.length:null,noun:S,priceBounds:je,inStockCount:me?Ge:null,onToggle:U,onPickType:q,onPickSize:$e,onPriceMax:X,onInStockOnly:Y,onClearAll:J}),s("div",{className:"min-w-0 flex-1",children:[s("div",{className:"mb-4 flex min-h-[34px] flex-wrap items-center justify-between gap-x-4 gap-y-2 border-b border-line pb-3",children:[s("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-4 gap-y-2",children:[r("p",{className:"font-mono text-[12px] tabular-nums tracking-[0.08em]",children:f.total===0?s("span",{className:"text-fg-dim",children:["No ",S.many]}):s(se,{children:[s("span",{children:[f.from,"–",f.to]}),s("span",{className:"text-fg-dim",children:[" of ",f.total," ",S.many]})]})}),r(Ht,{filters:t,onToggle:U,onPriceMax:X,onInStockOnly:Y,onPickType:q})]}),s("label",{className:"flex items-center gap-2 font-mono text-[11px] uppercase tracking-[0.16em] text-fg-dim",children:["Sort by",r("select",{value:t.sort,onChange:e=>Be(bt(e.target.value)),className:"cursor-pointer border border-line bg-transparent px-2 py-2 font-mono text-[12px] normal-case tracking-normal text-fg",children:Ot(h).map(e=>r("option",{value:e,children:Bt[e]},e))})]})]}),ne?r("div",{className:"border border-dashed border-line p-10",children:r("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:m?S.many==="wheels"?R("No wheels in this website's catalog yet — curate products to see them here."):S.many==="tyres"?R("No tyres in this website's catalog yet — curate products to see them here."):R("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):Ue?s("div",{className:"border border-line p-10",children:[s("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",o.appliedName]}),r("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:O.nothingFits}),s("button",{type:"button",onClick:Q,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",S.many]})]}):f.total===0?s("div",{className:"border border-line p-10",children:[s("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",S.many," match those filters"]}),r("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),Pt(t)&&r("button",{type:"button",onClick:J,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):s(se,{children:[F&&r("style",{children:F}),r("div",{className:`${F?`${$} plp-card-grid`:"plp-card-grid"} ${xt}`,style:{...Ae,...St(`var(${ft})`)},children:f.items.map(e=>z(e)==="tyre"?r($t,{item:e,currency:a,fitSize:P.length>0?Gt(e.sizes,P):null,kindLabel:Z?V(["tyre"]).one:null,showBrand:ee,editing:m,fieldUsage:De},`tyre:${L(e)}`):r(Xt,{wheel:e,colours:t.finishes,fit:o.fit,editing:m,kindLabel:Z?V(["alloy-wheel"]).one:null,showBrand:ee,coverIndex:ge,fieldUsage:Ee,showProcess:Ke,spinOnHover:xe,imageBackgroundFill:Te,showBadge:we,outline:ke,indexBadge:j,showCardSizes:be??B.showCardSizes,showCardBuy:Ce??B.showCardBuy,showCardPage:Ne??B.showCardPage,showCardPrice:ve??!0,showCardFinishes:Pe??!0,imageSizes:ze},`wheel:${L(e)}`))})]}),r(Yt,{page:f.page,pageCount:f.pageCount,onPage:Le}),r(at,{editing:m})]})]})]})]})}export{Do as PLP_GATE_DEFAULTS,no as default};
|
|
1
|
+
"use client";import{jsx as r,jsxs as s,Fragment as se}from"react/jsx-runtime";import{LISTING_CARD_SHOW as B}from"../../lib/sections/card-show-defaults.js";import{useCallback as d,useEffect as Qe,useId as Ze,useMemo as l,useRef as et,useState as tt}from"react";import{CARD_IMAGE_BG_OFF as ot,resolveCardImageBackground as rt}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as nt}from"efficient-web-builder/format/lib/content/card-image-shape";import{cardIndexCss as st,DEFAULT_CARD_INDEX_FORMAT as it,DEFAULT_CARD_OUTLINE as lt}from"efficient-web-builder/format/lib/sections/product-card-style";import{answersForKind as ie}from"../../lib/content/field-usage.js";import{useCurrency as at}from"../CurrencyContext.js";import ct from"../NoCurrencyNote.js";import{usePreviewDevice as pt}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as dt,renderHeadline as mt}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as ht}from"../useProductCatalog.js";import{scrollBehavior as ut}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as ft,PLP_GRID_GAP_VAR as gt,plpGridVars as yt}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as xt}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as St,cardRowsGridStyle as wt}from"../WheelCardFrame.js";import{applyPlpFilters as bt,asPlpSortKey as Ct,buildPlpFacets as Nt,buildPlpTypeOptions as vt,buildTyreSizeBoxes as Pt,EMPTY_PLP_FILTERS as le,hasActivePlpFilters as kt,paginatePlp as _t,pickTyreSize as Tt,plpTyreSizeBoxesShown as At,plpInStockCount as zt,plpOpeningSort as Ft,plpPriceBounds as It,plpShownKinds as Ot,plpSortKeysFor as Bt,PLP_SORT_LABELS as Lt}from"../../lib/wheels/plp-filters.js";import{itemKind as z,itemSlug as L,itemTyreSizes as Vt,plpBrandVaries as Rt,plpProcessVaries as Et,plpItemsOfKinds as Dt,plpKindNoun as V,resolvePlpKinds as Kt}from"../../lib/catalog/plp-item.js";import{plpGateWords as jt,plpVehicleCopy as Gt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as Mt,oemTyreSizes as $t}from"../../lib/tyres/tyre-vehicle-fitment.js";import Wt from"../TyreSummaryCard.js";import{wheelsFittingVehicle as Ht}from"../../lib/wheels/plp-fitment-match.js";import Ut from"./PlpActiveChips.js";import{DEFAULT_COVER_INDEX as Xt}from"../../lib/wheels/cover-rendering.js";import Yt from"./PlpCard.js";import qt from"./PlpPagination.js";import Jt from"./PlpSidebar.js";import Qt from"./PlpVehicleBar.js";import Zt from"./PlpVehicleGate.js";import{useVehicleCatalog as eo}from"./useVehicleCatalog.js";import{useVehicleFit as to}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as oo}from"./usePlpFiltersInUrl.js";import{say as R}from"efficient-web-builder/format/lib/editor-words";const Ko={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function ro({level:C,className:N,children:v}){return r(C===2?"h2":"h1",{className:N,children:v})}const no=[];function so({heading:C="",intro:N="",askForCar:v=!0,gateHeading:E="",gateIntro:ae="",perPage:D=24,columns:ce,defaultSort:pe="recommended",hiddenFacets:de=[],fieldUsage:g=no,showPrice:K=!0,showInStock:me=!0,kinds:he,products:ue,wheels:fe,requestQuery:ge,editing:m=!1,coverIndex:ye=Xt,cardImage:xe,spinOnHover:Se=!1,imageBackground:we,showBadge:be=!0,showCardSizes:Ce,showCardBuy:Ne,showCardPage:ve,showCardPrice:Pe,showCardFinishes:ke,outline:_e=lt,indexBadge:j=it,titleLevel:Te}){const{currency:a}=at(),Ae=rt(we,ot),h=Kt(he),G=pt(),M=ft(ce),ze=yt(M,m?G:null),Fe=xt(M,m?G:null),$=`plp-${Ze().replace(/:/g,"")}`,F=st($,j),Ie=ht(),W=ue??fe??Ie??[],H=l(()=>Dt(W,h),[W,h.join(",")]),o=to({editing:m,enabled:v,autoApply:!0}),[Oe,I]=tt(!1),Be=Ft(pe,h),y=o.applied?.vehicle??null,[t,w]=oo({editing:m,openingSort:Be,appliedVehicle:y,vehicleRestored:o.restored,requestQuery:ge}),p=Ot(h,t.kind),i=d(e=>w(e),[w]),U=d((e,u)=>{const c=t[e],qe=c.map(String).includes(u)?c.filter(Je=>String(Je)!==u):[...c,e==="diameters"?Number(u):u];i({...t,[e]:qe,page:1})},[t,i]),X=d(e=>i({...t,priceMax:e,page:1}),[t,i]),Y=d(e=>i({...t,inStockOnly:e,page:1}),[t,i]),q=d(e=>i({...le,kind:e,inStockOnly:t.inStockOnly,priceMax:t.priceMax,sort:t.sort}),[t.inStockOnly,t.priceMax,t.sort,i]),Le=d(e=>i({...t,sort:e,page:1}),[t,i]),Ve=d(e=>{i({...t,page:e}),typeof window<"u"&&window.scrollTo({top:0,behavior:ut()})},[t,i]),J=d(()=>i({...le,sort:t.sort}),[t.sort,i]),{clear:k}=o,Q=d(()=>{k(),I(!0),w(e=>({...e,page:1}))},[k]),Re=d(()=>{k(),I(!1),w(e=>({...e,page:1}))},[k]),_=y?[y.make,y.model,y.year,y.modification].join("|"):"",T=et(null);Qe(()=>{if(o.restored){if(T.current===null){T.current=_;return}T.current!==_&&(T.current=_,w(e=>e.page===1?e:{...e,page:1}))}},[o.restored,_,w]);const A=eo({catalog:H,shownKinds:h,vehicle:y,editing:m}),n=l(()=>{if(!o.fit)return A;const e=A.filter(c=>z(c)==="alloy-wheel"),u=new Set(Ht(e,o.fit).map(c=>c.slug));return A.filter(c=>z(c)!=="alloy-wheel"||u.has(L(c)))},[A,o.fit]),b=de.join(","),Ee=l(()=>{const e=new Set(b?b.split(","):[]);return Nt(n,t,a,p,g).filter(u=>!e.has(u.key))},[n,t,a,b,p.join(","),g]),x=l(()=>bt(n,t,a),[n,t,a]),Z=p.length>1,De=l(()=>ie(g,"alloy-wheel"),[g]),Ke=l(()=>ie(g,"tyre"),[g]),ee=l(()=>Rt(x),[x]),je=l(()=>Et(x),[x]),Ge=l(()=>K?It(n,a):null,[n,a,K]),Me=l(()=>zt(n,t,a),[n,t,a]),$e=l(()=>vt(n,h,t,a),[n,h.join(","),t,a]),We=d((e,u)=>{const c=Tt(n.flatMap(Vt),t.tyreSizes[0]??"",e,u);i({...t,tyreSizes:c?[c]:[],page:1})},[n,t,i]),He=l(()=>{const e=new Set(b?b.split(","):[]);return!At(n,p)||e.has("tyreSizes")?null:Pt(n,t,a)},[n,t,a,b,p.join(","),g]),f=l(()=>_t(x,t.page,D),[x,t.page,D]),S=V(p),O=Gt(p),te=jt(E,ae,p,h),oe=p.length===1&&p[0]==="tyre",re=o.applied?.stock??null,P=l(()=>$t(re),[re]),Ue=l(()=>n.filter(e=>p.includes(z(e))).length,[n,p.join(",")]),ne=H.length===0,Xe=!ne&&n.length===0,Ye=v&&!m&&!o.applied&&!Oe;return h.length===0?null:s("section",{style:nt(xe),children:[v&&r(Qt,{cascade:o.cascade,appliedName:o.appliedName,fit:o.fit,fitSummary:oe&&P.length>0?`Takes ${P.join(" · ")}`:null,resolving:o.resolving,unresolved:oe?!!o.applied&&!o.resolving&&P.length===0:o.unresolved,matchCount:Ue,copy:O,onAmend:Re,onClear:Q}),Ye&&r(Zt,{cascade:o.cascade,heading:te.heading,intro:te.intro,ready:o.restored,copy:O,onSkip:()=>I(!0)}),s("div",{className:"px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]",children:[(C||N)&&s("header",{className:"mb-6",children:[C&&r(ro,{level:Te,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:mt(C,!1)}),N&&r("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:dt(N)})]}),s("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[r(Jt,{facets:Ee,filters:t,typeOptions:$e,sizeBoxes:He,sizeMatches:t.tyreSizes.length>0?x.length:null,noun:S,priceBounds:Ge,inStockCount:me?Me:null,onToggle:U,onPickType:q,onPickSize:We,onPriceMax:X,onInStockOnly:Y,onClearAll:J}),s("div",{className:"min-w-0 flex-1",children:[s("div",{className:"mb-4 flex min-h-[34px] flex-wrap items-center justify-between gap-x-4 gap-y-2 border-b border-line pb-3",children:[s("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-4 gap-y-2",children:[r("p",{className:"font-mono text-[12px] tabular-nums tracking-[0.08em]",children:f.total===0?s("span",{className:"text-fg-dim",children:["No ",S.many]}):s(se,{children:[s("span",{children:[f.from,"–",f.to]}),s("span",{className:"text-fg-dim",children:[" of ",f.total," ",S.many]})]})}),r(Ut,{filters:t,onToggle:U,onPriceMax:X,onInStockOnly:Y,onPickType:q})]}),s("label",{className:"flex items-center gap-2 font-mono text-[11px] uppercase tracking-[0.16em] text-fg-dim",children:["Sort by",r("select",{value:t.sort,onChange:e=>Le(Ct(e.target.value)),className:"cursor-pointer border border-line bg-transparent px-2 py-2 font-mono text-[12px] normal-case tracking-normal text-fg",children:Bt(h).map(e=>r("option",{value:e,children:Lt[e]},e))})]})]}),ne?r("div",{className:"border border-dashed border-line p-10",children:r("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:m?S.many==="wheels"?R("No wheels in this website's catalog yet — curate products to see them here."):S.many==="tyres"?R("No tyres in this website's catalog yet — curate products to see them here."):R("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):Xe?s("div",{className:"border border-line p-10",children:[s("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",o.appliedName]}),r("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:O.nothingFits}),s("button",{type:"button",onClick:Q,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",S.many]})]}):f.total===0?s("div",{className:"border border-line p-10",children:[s("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",S.many," match those filters"]}),r("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),kt(t)&&r("button",{type:"button",onClick:J,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):s(se,{children:[F&&r("style",{children:F}),r("div",{className:`${F?`${$} plp-card-grid`:"plp-card-grid"} ${St}`,style:{...ze,...wt(`var(${gt})`)},children:f.items.map(e=>z(e)==="tyre"?r(Wt,{item:e,currency:a,fitSize:P.length>0?Mt(e.sizes,P):null,kindLabel:Z?V(["tyre"]).one:null,showBrand:ee,editing:m,fieldUsage:Ke},`tyre:${L(e)}`):r(Yt,{wheel:e,colours:t.finishes,fit:o.fit,editing:m,kindLabel:Z?V(["alloy-wheel"]).one:null,showBrand:ee,coverIndex:ye,fieldUsage:De,showProcess:je,spinOnHover:Se,imageBackgroundFill:Ae,showBadge:be,outline:_e,indexBadge:j,showCardSizes:Ce??B.showCardSizes,showCardBuy:Ne??B.showCardBuy,showCardPage:ve??B.showCardPage,showCardPrice:Pe??!0,showCardFinishes:ke??!0,imageSizes:Fe},`wheel:${L(e)}`))})]}),r(qt,{page:f.page,pageCount:f.pageCount,onPage:Ve}),r(ct,{editing:m})]})]})]})]})}export{Ko as PLP_GATE_DEFAULTS,so as default};
|
|
@@ -6,5 +6,6 @@ export interface PlpUrlFiltersArgs {
|
|
|
6
6
|
openingSort: PlpSortKey;
|
|
7
7
|
appliedVehicle: VehicleSelection | null;
|
|
8
8
|
vehicleRestored: boolean;
|
|
9
|
+
requestQuery?: string;
|
|
9
10
|
}
|
|
10
|
-
export declare function usePlpFiltersInUrl({ editing, openingSort, appliedVehicle, vehicleRestored, }: PlpUrlFiltersArgs): [PlpFilterState, Dispatch<SetStateAction<PlpFilterState>>];
|
|
11
|
+
export declare function usePlpFiltersInUrl({ editing, openingSort, appliedVehicle, vehicleRestored, requestQuery, }: PlpUrlFiltersArgs): [PlpFilterState, Dispatch<SetStateAction<PlpFilterState>>];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useEffect as
|
|
1
|
+
"use client";import{useEffect as d,useState as l}from"react";import{EMPTY_PLP_FILTERS as E,plpFiltersFromParams as L,plpFiltersToParams as i}from"../../lib/wheels/plp-filters.js";import{appendVehicleParams as P}from"../../lib/wheels/plp-vehicle-params.js";const w="plp:locationchange";let m=!1;function S(t){if(typeof window>"u")return()=>{};if(!m){m=!0;for(const e of["pushState","replaceState"]){const n=window.history[e];window.history[e]=function(...a){n.apply(this,a),window.dispatchEvent(new Event(w))}}}return window.addEventListener("popstate",t),window.addEventListener(w,t),()=>{window.removeEventListener("popstate",t),window.removeEventListener(w,t)}}function y(t,e){const n=L(new URLSearchParams(t));return i(n).toString()===""?{...E,sort:e}:n}function I({editing:t,openingSort:e,appliedVehicle:n,vehicleRestored:s,requestQuery:a}){const[c,p]=l(()=>y(t?"":a??"",e)),[f,h]=l(!1);return d(()=>{if(t||typeof window>"u")return;const r=()=>{const o=y(window.location.search,e);p(u=>i(u).toString()===i(o).toString()?u:o)};return r(),h(!0),S(r)},[t,e]),d(()=>{if(t||!f||!s||typeof window>"u")return;const r=i(c);P(r,n);const o=r.toString();window.history.replaceState(null,"",`${window.location.pathname}${o?`?${o}`:""}`)},[t,f,s,c,n]),[c,p]}export{I as usePlpFiltersInUrl};
|
|
@@ -422,6 +422,13 @@ export interface AdminStorefrontPage {
|
|
|
422
422
|
kind?: "normal" | "dynamic" | "lightbox" | "footer";
|
|
423
423
|
live_state?: "live" | "changed" | "never";
|
|
424
424
|
}
|
|
425
|
+
export interface AdminGeocodeAnswer {
|
|
426
|
+
status: "found" | "not_found" | "try_again";
|
|
427
|
+
lat: number | null;
|
|
428
|
+
lng: number | null;
|
|
429
|
+
label: string;
|
|
430
|
+
placement: "located" | "approximate" | "";
|
|
431
|
+
}
|
|
425
432
|
export interface AdminPagePreviewLink {
|
|
426
433
|
token: string;
|
|
427
434
|
expires_at: string;
|
|
@@ -660,6 +667,7 @@ export declare function createStorefrontAdmin(client?: AdminClient): {
|
|
|
660
667
|
title: string;
|
|
661
668
|
slug: string;
|
|
662
669
|
}, token: string) => Promise<AdminStorefrontPage>;
|
|
670
|
+
geocode: (query: string, token: string, country?: string) => Promise<AdminGeocodeAnswer>;
|
|
663
671
|
createPagePreviewLink: (id: string, token: string) => Promise<AdminPagePreviewLink>;
|
|
664
672
|
claimPageEditLock: (id: string, token: string, clientId: string, takeover?: boolean) => Promise<AdminEditLock>;
|
|
665
673
|
releasePageEditLock: (id: string, token: string) => Promise<void>;
|
|
@@ -736,6 +744,7 @@ export declare const storefrontAdmin: {
|
|
|
736
744
|
title: string;
|
|
737
745
|
slug: string;
|
|
738
746
|
}, token: string) => Promise<AdminStorefrontPage>;
|
|
747
|
+
geocode: (query: string, token: string, country?: string) => Promise<AdminGeocodeAnswer>;
|
|
739
748
|
createPagePreviewLink: (id: string, token: string) => Promise<AdminPagePreviewLink>;
|
|
740
749
|
claimPageEditLock: (id: string, token: string, clientId: string, takeover?: boolean) => Promise<AdminEditLock>;
|
|
741
750
|
releasePageEditLock: (id: string, token: string) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PREVIEW_TOKEN_HEADER as Y,SITE_HOST_HEADER as tt,SITE_SLUG_HEADER as et}from"../site-headers.js";import{PRODUCT_API_BASE as rt,PRODUCT_BACKEND_URL as k}from"./origins.js";import{backendHopHeaders as at,clientIpFromForwardedFor as st,FORWARDED_FOR_HEADER as nt,hopCachingOf as ot}from"../forwarded-for.js";import it from"efficient-web-builder/format/lib/puck/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as ct}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as J}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as L}from"../wheels/renderable-finishes.js";const dt=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,o){super(s),this.status=e,this.data=o}}const _="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",ut=new Set([502,503,504]),N=0,lt="This editor runs on its host's own backend, which does not serve this request.",pt=5e3,yt=15e3,ht=()=>typeof window>"u"?pt:yt;function D(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(ht())}const x=t=>t instanceof Error&&t.name==="TimeoutError",H=(t,e)=>ut.has(t)?_:e,ft=["admin","venue"];let F="admin";function ae(t){F=ft.includes(t)?t:"admin"}function gt(){return F}const mt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let M=null;function se(t){M=t&&mt.test(t)?t:null}function wt(){return M}function St(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=j();return!e||/[?&]site=/.test(t)?t:C(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...w}=e;if(typeof window<"u"&&!ct())throw new m(N,lt,null);if(typeof window>"u"&&o===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);const a=typeof FormData<"u"&&w.body instanceof FormData;let r;try{r=await fetch(`${o??dt}${St(t)}`,{...w,headers:{...a?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:w.signal??D({...w,audience:p})})}catch(y){throw y instanceof TypeError||x(y)?new m(N,_,null):y}let n;try{n=await r.text()}catch(y){throw x(y)?new m(N,_,null):y}let c=null;if(n)try{c=JSON.parse(n)}catch{throw new m(r.status,r.ok?"Expected JSON but received a non-JSON response":H(r.status,r.statusText),n)}if(!r.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??H(r.status,r.statusText);throw new m(r.status,y,c)}return c}let b=null;async function B(){return b||(b=Pt().finally(()=>{b=null}),b)}async function Pt(){const t=P.takeLegacyRefresh(),e=await Ot.refresh(t??void 0);return P.setTokens(e.access),e.access}async function q(){return P.getAccess()??B()}async function h(t,e={}){let s;try{s=await q()}catch{throw P.clear(),new m(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(o){if(!(o instanceof m)||o.status!==401)throw o;try{const l=await B();return await i(t,{...e,token:l})}catch{throw P.clear(),o}}}async function G(t,e={}){if(P.getAccess())try{return{data:await h(t,e),asShopper:!0}}catch(s){if(!(s instanceof m)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function W(){const t=await h("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new m(403,"This session is not valid for this shop.",null);return t}const Ot={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await q();return await W(),t},me:W,updateMe:t=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:t=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:t=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(t=>t.results),myOrder:t=>h(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>h(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>h(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`).then(e=>e.results),createReturn:t=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>h(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as bt,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Tt,isSvgUrl as At}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Rt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Et,webRuntimeSiteSlug as j}from"efficient-web-builder/format/lib/web-runtime";function g(t){if(typeof t=="string")return t.startsWith("/media/")?bt(t):t;if(Array.isArray(t))return t.map(g);if(t&&typeof t=="object"){const e={};for(const[s,o]of Object.entries(t))e[s]=s==="captions"&&o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([l,p])=>[g(l),p])):g(o);return e}return t}import{PRODUCT_API_BASE as ge}from"./origins.js";const z=typeof window>"u"&&k!=="",Ct=z?k:rt,$t=Et,O=()=>({baseUrl:$t(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const Ut=100,K=50;function V(t,e,s){const o=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&o.set(l,String(p));return o.set("pageSize",String(Ut)),s&&o.set("cursor",s),`/api/v1${t}?${o.toString()}`}function _t(t,e){return V("/wheels",{process:t},e)}function Nt(t,e,s){return V("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function vt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function X(t,e,s=()=>!1){const o=[];let l=null;try{for(let p=0;p<K;p++){const w=await i(await e(l),await u());if(o.push(...w.results),l=vt(w.next),!l)break}l&&console.warn(`[${t}] stopped at ${K} pages (${o.length} rows); catalog may be truncated`)}catch(p){if(s(p))throw p;console.warn(`[${t}] product API unavailable, returning []`,p)}return o}const It=t=>t instanceof m&&t.status===400;function kt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?J([e]):[e])}async function Z(){return(await Jt()).host}async function Jt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,o=s(e.get(tt)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:o,matchesRequestHost:o!==null&&o===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Lt(){try{const{headers:t}=await import("next/headers");return st((await t()).get(nt))}catch{return null}}async function Dt(){try{const{headers:t}=await import("next/headers");return(await t()).get(et)||null}catch{return null}}async function xt(){const t=await Dt();if(t)return`site=${encodeURIComponent(t)}`;const e=await Z();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=j();return e?C(t,`site=${encodeURIComponent(e)}`):t}return C(t,await xt())}function C(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Ht="preview";async function Ft(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(Y)}catch{return null}}async function Mt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function I(t,e){const s=await Ft();if(s===null)return[await f(t),await u(e)];const o=C(await f(t),`${Ht}=${encodeURIComponent(s)}`),{next:l,cache:p,...w}=e??{},a=await u({...w,cache:"no-store"}),r=await Mt();return r&&(a.headers={...a.headers,"user-agent":r}),[o,a]}async function Bt(t){if(!z)return;const[e,s]=await Promise.all([Z(),Lt()]),o=at(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await Bt(ot(t)),s={baseUrl:Ct,...t};return e&&(s.headers={...e,...t?.headers}),s}const T=typeof window>"u";function A(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const o=s.toString();return`/api/v1/fitment${t}${o?`?${o}`:""}`}const de={listMakes:async t=>{if(T){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(A("/makes",{region:t}),O())).results},listModels:async(t,e)=>{if(T){const{fitmentData:o}=await import("./fitment-data.js");return o.models(t,e)}return(await i(A("/models",{make:t,region:e}),O())).results},listYears:async(t,e,s)=>{if(T){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(A("/years",{make:t,model:e,region:s}),O())).results},listModifications:async(t,e,s,o)=>{if(T){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(A("/modifications",{make:t,model:e,year:s,region:o}),O())).results},getStockFitment:async(t,e,s,o,l)=>{if(T){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(A("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),O())}},ue={listWheels:async t=>{const e=await X("products.listWheels",async s=>await f(_t(t,s)));return J(g(e))},listCatalog:async(t,e)=>{if(t.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` — so the call would silently return the wheel catalog instead of nothing.");const s=await X("products.listCatalog",async o=>await f(Nt(t,e,o)),It);return kt(g(s))},getWheel:async t=>L(g(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>g(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async()=>{try{return await i(await f(d("/bundles")),await u())}catch{return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:o}=await import("./gallery-builds-data.js");return g(o(e,s))}try{const o=new URLSearchParams;e&&o.set("process",e),s&&o.set("wheelSlug",s);const l=o.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,O());return g(p.results)}catch(o){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",o),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>g(await i(await f(d("/pages")),await u())),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof m&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof m&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof m&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[o,l]=await I(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return g(await i(o,l))},listBlogPosts:async()=>{try{return(await i(d("/blog-posts"),await u())).map(e=>({...e,coverImage:v(e.coverImage)??""}))}catch(t){return console.warn("[products.listBlogPosts] blog API unavailable, returning []",t),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:v(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>h(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const s=d("/reviews"),o=e.toString();try{return await i(await f(o?`${s}?${o}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await G(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await G(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=D({method:"GET"}),e=await i(...await I(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let o=null,l=null;if(s&&At(s)){const p=await Tt(s,t);p&&(o=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:o,logoInkIsDark:l}},getThemeSettings:async()=>i(...await I(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},le={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class qt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const $=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},R=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Gt=t=>`${R(t)}currencies/`,Wt="/api/storefront/media/ingest/";class jt extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}}function zt(){const t=Rt();if(!t)throw new jt;return`${Wt}?${new URLSearchParams({site:t})}`}const U={"X-Puck-Media-Manifest":it.contentHash},pe=Q({});function Q(t){return(e,s={})=>{const o=wt(),l=t.headers||o?{...o?{"Accept-Language":o}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??gt()})}}function Kt(t={}){const e=Q(t),s=t.siteDrafts===!0,o=a=>$("header-settings",a,s),l=a=>$("theme-settings",a,s),p=a=>$("chat-settings",a,s),w=a=>$("social-settings",a,s);return{findPageBySlug:async(a,r,n)=>{const c=new URLSearchParams({slug:a});n&&c.set("site",n);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:r}),S=Array.isArray(y)?y:y.results??[];if(!n&&S.length>1)throw new qt(a,S.length);return S[0]??null},getPageById:(a,r)=>e(`/api/storefront/pages/${a}/`,{token:r}),saveLayout:(a,r,n,c,y)=>e(`/api/storefront/pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r,expected_updated_at:c,...y?{client_id:y}:{}}),token:n}),duplicatePage:(a,r,n)=>e(`/api/storefront/pages/${a}/duplicate/`,{method:"POST",body:JSON.stringify({title:r.title,slug:r.slug}),token:n}),createPagePreviewLink:(a,r)=>e(`/api/storefront/pages/${a}/preview-link/`,{method:"POST",token:r}),claimPageEditLock:(a,r,n,c=!1)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:c}),token:r}),releasePageEditLock:(a,r)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"DELETE",token:r}),createTemplate:(a,r,n)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:a,layout:r}),headers:U,token:n}),getTemplate:(a,r)=>e(`/api/storefront/page-templates/${a}/`,{token:r}),saveTemplateLayout:(a,r,n)=>e(`/api/storefront/page-templates/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:U,token:n}),listTemplatePages:async(a,r)=>{const n=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}`,{token:r});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(a,r,n)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}&slug=${encodeURIComponent(r)}`,{token:n});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(a,r,n)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:a,...r}),headers:U,token:n}),saveTemplatePageLayout:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:U,token:n}),deleteTemplatePage:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"DELETE",token:r,...n?.keepalive?{keepalive:!0}:{}}),listPages:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("site",r);const c=await e(`/api/storefront/pages/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]},createPage:(a,r,n,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:a,slug:r,layout:n}),token:c}),deletePage:(a,r)=>e(`/api/storefront/pages/${a}/`,{method:"DELETE",token:r}),getHeaderSettings:(a,r)=>e(o(r),{token:a}),listMenus:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("site",r);const c=await e(`/api/storefront/menus/?${n}`,{token:a});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.visibleOnly&&n.set("is_visible","true"),r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/blog-posts/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(a,r)=>{const n=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(r)}`,{token:a});return Array.isArray(n?.entries)?n.entries:[]},listCategories:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.visibleOnly&&n.set("is_visible","true"),r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/categories/?${n.toString()}`,{token:a});return[...Array.isArray(c)?c:c.results??[]].sort((S,E)=>S.sort_order-E.sort_order||S.name.localeCompare(E.name))},listForms:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/forms/?${n.toString()}`,{token:a});return[...Array.isArray(c)?c:c.results??[]].sort((S,E)=>S.title.localeCompare(E.title))},listWheelSummaries:async(a,r={})=>{const n=new URLSearchParams;r.siteId&&n.set("site",r.siteId);const c=n.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:a});return g(y)},listProducts:async(a,r={})=>{const n=new URLSearchParams;r.kinds?.length&&n.set("kind",r.kinds.join(",")),r.siteId&&n.set("site",r.siteId);const c=n.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:a});return g(y)},getWheelDetail:async(a,r,n={})=>{const c=new URLSearchParams({slug:r});return n.siteId&&c.set("site",n.siteId),L(g(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:a})))},updateHeaderSettings:(a,r,n)=>e(o(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getSite:(a,r)=>e(R(a),{token:r}),listSites:async a=>{const r=await e("/api/storefront/sites/?no_page=true",{token:a});return Array.isArray(r)?r:r.results??[]},listSiteCurrencies:async(a,r)=>{const n=await e(Gt(a),{token:r});return Array.isArray(n)?n:[]},publishSite:(a,r)=>e(`${R(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${R(a)}live-state/`,{token:r}),updateSite:(a,r,n)=>e(R(a),{method:"PATCH",body:JSON.stringify(r),token:n}),getThemeSettings:(a,r)=>e(l(r),{token:a}),updateThemeSettings:(a,r,n)=>e(l(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getChatSettings:(a,r)=>e(p(r),{token:a}),updateChatSettings:(a,r,n)=>e(p(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getSocialSettings:(a,r)=>e(w(r),{token:a}),updateSocialSettings:(a,r,n)=>e(w(n),{method:"PATCH",body:JSON.stringify(a),token:r}),uploadHeaderLogo:(a,r,n)=>{const c=new FormData;return c.append("logo",a),e(o(n),{method:"PATCH",body:c,token:r})},clearHeaderLogo:(a,r)=>e(o(r),{method:"PATCH",body:JSON.stringify({logo:null}),token:a}),setHeaderLogoFromAsset:(a,r,n)=>e(o(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:a}),token:r}),uploadMedia:async(a,r)=>{const n=new FormData;return n.append("file",a),e(zt(),{method:"POST",body:n,token:r})},listMedia:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("kind",r);const c=await e(`/api/storefront/media-assets/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]}}}const ye=Kt({siteDrafts:!0});export{dt as API_URL,qt as AmbiguousPageSlugError,m as ApiError,yt as BROWSER_READ_TIMEOUT_MS,lt as EFFICIENT_CLIENT_CLOSED_MESSAGE,jt as MediaUploadDestinationError,Ht as PREVIEW_PARAM,ge as PRODUCT_API_BASE,pt as SERVER_READ_TIMEOUT_MS,_ as SERVER_UNREACHABLE_MESSAGE,N as STATUS_NETWORK_ERROR,pe as adminFetch,Ot as api,i as apiFetch,C as appendSiteQuery,le as bookings,Kt as createStorefrontAdmin,D as defaultRequestDeadline,zt as editorMediaUploadPath,gt as editorPortalAudience,wt as editorRequestLanguage,de as fitment,ue as products,ht as readDeadlineMs,Lt as resolveClientIp,g as resolveMediaUrls,Ft as resolvePreviewToken,Z as resolveSiteHost,Jt as resolveSiteHostSource,Dt as resolveSiteSlug,se as setEditorLanguage,ae as setEditorPortalAudience,ye as storefrontAdmin};
|
|
1
|
+
import{PREVIEW_TOKEN_HEADER as Y,SITE_HOST_HEADER as tt,SITE_SLUG_HEADER as et}from"../site-headers.js";import{PRODUCT_API_BASE as rt,PRODUCT_BACKEND_URL as k}from"./origins.js";import{backendHopHeaders as at,clientIpFromForwardedFor as st,FORWARDED_FOR_HEADER as nt,hopCachingOf as ot}from"../forwarded-for.js";import it from"efficient-web-builder/format/lib/puck/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as ct}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as J}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as L}from"../wheels/renderable-finishes.js";const dt=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,o){super(s),this.status=e,this.data=o}}const _="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",ut=new Set([502,503,504]),N=0,lt="This editor runs on its host's own backend, which does not serve this request.",pt=5e3,yt=15e3,ht=()=>typeof window>"u"?pt:yt;function D(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(ht())}const x=t=>t instanceof Error&&t.name==="TimeoutError",H=(t,e)=>ut.has(t)?_:e,ft=["admin","venue"];let F="admin";function ae(t){F=ft.includes(t)?t:"admin"}function gt(){return F}const mt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let M=null;function se(t){M=t&&mt.test(t)?t:null}function wt(){return M}function St(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=j();return!e||/[?&]site=/.test(t)?t:C(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...w}=e;if(typeof window<"u"&&!ct())throw new m(N,lt,null);if(typeof window>"u"&&o===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);const a=typeof FormData<"u"&&w.body instanceof FormData;let r;try{r=await fetch(`${o??dt}${St(t)}`,{...w,headers:{...a?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:w.signal??D({...w,audience:p})})}catch(y){throw y instanceof TypeError||x(y)?new m(N,_,null):y}let n;try{n=await r.text()}catch(y){throw x(y)?new m(N,_,null):y}let c=null;if(n)try{c=JSON.parse(n)}catch{throw new m(r.status,r.ok?"Expected JSON but received a non-JSON response":H(r.status,r.statusText),n)}if(!r.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??H(r.status,r.statusText);throw new m(r.status,y,c)}return c}let b=null;async function B(){return b||(b=Pt().finally(()=>{b=null}),b)}async function Pt(){const t=P.takeLegacyRefresh(),e=await Ot.refresh(t??void 0);return P.setTokens(e.access),e.access}async function q(){return P.getAccess()??B()}async function h(t,e={}){let s;try{s=await q()}catch{throw P.clear(),new m(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(o){if(!(o instanceof m)||o.status!==401)throw o;try{const l=await B();return await i(t,{...e,token:l})}catch{throw P.clear(),o}}}async function G(t,e={}){if(P.getAccess())try{return{data:await h(t,e),asShopper:!0}}catch(s){if(!(s instanceof m)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function W(){const t=await h("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new m(403,"This session is not valid for this shop.",null);return t}const Ot={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await q();return await W(),t},me:W,updateMe:t=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:t=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:t=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(t=>t.results),myOrder:t=>h(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>h(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>h(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`).then(e=>e.results),createReturn:t=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>h(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as bt,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Tt,isSvgUrl as At}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Rt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Et,webRuntimeSiteSlug as j}from"efficient-web-builder/format/lib/web-runtime";function g(t){if(typeof t=="string")return t.startsWith("/media/")?bt(t):t;if(Array.isArray(t))return t.map(g);if(t&&typeof t=="object"){const e={};for(const[s,o]of Object.entries(t))e[s]=s==="captions"&&o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([l,p])=>[g(l),p])):g(o);return e}return t}import{PRODUCT_API_BASE as ge}from"./origins.js";const z=typeof window>"u"&&k!=="",Ct=z?k:rt,$t=Et,O=()=>({baseUrl:$t(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const Ut=100,K=50;function V(t,e,s){const o=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&o.set(l,String(p));return o.set("pageSize",String(Ut)),s&&o.set("cursor",s),`/api/v1${t}?${o.toString()}`}function _t(t,e){return V("/wheels",{process:t},e)}function Nt(t,e,s){return V("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function vt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function X(t,e,s=()=>!1){const o=[];let l=null;try{for(let p=0;p<K;p++){const w=await i(await e(l),await u());if(o.push(...w.results),l=vt(w.next),!l)break}l&&console.warn(`[${t}] stopped at ${K} pages (${o.length} rows); catalog may be truncated`)}catch(p){if(s(p))throw p;console.warn(`[${t}] product API unavailable, returning []`,p)}return o}const It=t=>t instanceof m&&t.status===400;function kt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?J([e]):[e])}async function Z(){return(await Jt()).host}async function Jt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,o=s(e.get(tt)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:o,matchesRequestHost:o!==null&&o===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Lt(){try{const{headers:t}=await import("next/headers");return st((await t()).get(nt))}catch{return null}}async function Dt(){try{const{headers:t}=await import("next/headers");return(await t()).get(et)||null}catch{return null}}async function xt(){const t=await Dt();if(t)return`site=${encodeURIComponent(t)}`;const e=await Z();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=j();return e?C(t,`site=${encodeURIComponent(e)}`):t}return C(t,await xt())}function C(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Ht="preview";async function Ft(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(Y)}catch{return null}}async function Mt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function I(t,e){const s=await Ft();if(s===null)return[await f(t),await u(e)];const o=C(await f(t),`${Ht}=${encodeURIComponent(s)}`),{next:l,cache:p,...w}=e??{},a=await u({...w,cache:"no-store"}),r=await Mt();return r&&(a.headers={...a.headers,"user-agent":r}),[o,a]}async function Bt(t){if(!z)return;const[e,s]=await Promise.all([Z(),Lt()]),o=at(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await Bt(ot(t)),s={baseUrl:Ct,...t};return e&&(s.headers={...e,...t?.headers}),s}const T=typeof window>"u";function A(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const o=s.toString();return`/api/v1/fitment${t}${o?`?${o}`:""}`}const de={listMakes:async t=>{if(T){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(A("/makes",{region:t}),O())).results},listModels:async(t,e)=>{if(T){const{fitmentData:o}=await import("./fitment-data.js");return o.models(t,e)}return(await i(A("/models",{make:t,region:e}),O())).results},listYears:async(t,e,s)=>{if(T){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(A("/years",{make:t,model:e,region:s}),O())).results},listModifications:async(t,e,s,o)=>{if(T){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(A("/modifications",{make:t,model:e,year:s,region:o}),O())).results},getStockFitment:async(t,e,s,o,l)=>{if(T){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(A("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),O())}},ue={listWheels:async t=>{const e=await X("products.listWheels",async s=>await f(_t(t,s)));return J(g(e))},listCatalog:async(t,e)=>{if(t.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` — so the call would silently return the wheel catalog instead of nothing.");const s=await X("products.listCatalog",async o=>await f(Nt(t,e,o)),It);return kt(g(s))},getWheel:async t=>L(g(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>g(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async()=>{try{return await i(await f(d("/bundles")),await u())}catch{return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:o}=await import("./gallery-builds-data.js");return g(o(e,s))}try{const o=new URLSearchParams;e&&o.set("process",e),s&&o.set("wheelSlug",s);const l=o.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,O());return g(p.results)}catch(o){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",o),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>g(await i(await f(d("/pages")),await u())),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof m&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof m&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof m&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[o,l]=await I(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return g(await i(o,l))},listBlogPosts:async()=>{try{return(await i(d("/blog-posts"),await u())).map(e=>({...e,coverImage:v(e.coverImage)??""}))}catch(t){return console.warn("[products.listBlogPosts] blog API unavailable, returning []",t),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:v(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>h(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const s=d("/reviews"),o=e.toString();try{return await i(await f(o?`${s}?${o}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await G(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await G(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=D({method:"GET"}),e=await i(...await I(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let o=null,l=null;if(s&&At(s)){const p=await Tt(s,t);p&&(o=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:o,logoInkIsDark:l}},getThemeSettings:async()=>i(...await I(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},le={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class qt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const $=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},R=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Gt=t=>`${R(t)}currencies/`,Wt="/api/storefront/media/ingest/";class jt extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}}function zt(){const t=Rt();if(!t)throw new jt;return`${Wt}?${new URLSearchParams({site:t})}`}const U={"X-Puck-Media-Manifest":it.contentHash},pe=Q({});function Q(t){return(e,s={})=>{const o=wt(),l=t.headers||o?{...o?{"Accept-Language":o}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??gt()})}}function Kt(t={}){const e=Q(t),s=t.siteDrafts===!0,o=a=>$("header-settings",a,s),l=a=>$("theme-settings",a,s),p=a=>$("chat-settings",a,s),w=a=>$("social-settings",a,s);return{findPageBySlug:async(a,r,n)=>{const c=new URLSearchParams({slug:a});n&&c.set("site",n);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:r}),S=Array.isArray(y)?y:y.results??[];if(!n&&S.length>1)throw new qt(a,S.length);return S[0]??null},getPageById:(a,r)=>e(`/api/storefront/pages/${a}/`,{token:r}),saveLayout:(a,r,n,c,y)=>e(`/api/storefront/pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r,expected_updated_at:c,...y?{client_id:y}:{}}),token:n}),duplicatePage:(a,r,n)=>e(`/api/storefront/pages/${a}/duplicate/`,{method:"POST",body:JSON.stringify({title:r.title,slug:r.slug}),token:n}),geocode:(a,r,n)=>e(`/api/storefront/geocode/?${new URLSearchParams(n?{q:a,country:n}:{q:a})}`,{token:r}),createPagePreviewLink:(a,r)=>e(`/api/storefront/pages/${a}/preview-link/`,{method:"POST",token:r}),claimPageEditLock:(a,r,n,c=!1)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:c}),token:r}),releasePageEditLock:(a,r)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"DELETE",token:r}),createTemplate:(a,r,n)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:a,layout:r}),headers:U,token:n}),getTemplate:(a,r)=>e(`/api/storefront/page-templates/${a}/`,{token:r}),saveTemplateLayout:(a,r,n)=>e(`/api/storefront/page-templates/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:U,token:n}),listTemplatePages:async(a,r)=>{const n=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}`,{token:r});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(a,r,n)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}&slug=${encodeURIComponent(r)}`,{token:n});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(a,r,n)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:a,...r}),headers:U,token:n}),saveTemplatePageLayout:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:U,token:n}),deleteTemplatePage:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"DELETE",token:r,...n?.keepalive?{keepalive:!0}:{}}),listPages:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("site",r);const c=await e(`/api/storefront/pages/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]},createPage:(a,r,n,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:a,slug:r,layout:n}),token:c}),deletePage:(a,r)=>e(`/api/storefront/pages/${a}/`,{method:"DELETE",token:r}),getHeaderSettings:(a,r)=>e(o(r),{token:a}),listMenus:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("site",r);const c=await e(`/api/storefront/menus/?${n}`,{token:a});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.visibleOnly&&n.set("is_visible","true"),r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/blog-posts/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(a,r)=>{const n=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(r)}`,{token:a});return Array.isArray(n?.entries)?n.entries:[]},listCategories:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.visibleOnly&&n.set("is_visible","true"),r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/categories/?${n.toString()}`,{token:a});return[...Array.isArray(c)?c:c.results??[]].sort((S,E)=>S.sort_order-E.sort_order||S.name.localeCompare(E.name))},listForms:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/forms/?${n.toString()}`,{token:a});return[...Array.isArray(c)?c:c.results??[]].sort((S,E)=>S.title.localeCompare(E.title))},listWheelSummaries:async(a,r={})=>{const n=new URLSearchParams;r.siteId&&n.set("site",r.siteId);const c=n.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:a});return g(y)},listProducts:async(a,r={})=>{const n=new URLSearchParams;r.kinds?.length&&n.set("kind",r.kinds.join(",")),r.siteId&&n.set("site",r.siteId);const c=n.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:a});return g(y)},getWheelDetail:async(a,r,n={})=>{const c=new URLSearchParams({slug:r});return n.siteId&&c.set("site",n.siteId),L(g(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:a})))},updateHeaderSettings:(a,r,n)=>e(o(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getSite:(a,r)=>e(R(a),{token:r}),listSites:async a=>{const r=await e("/api/storefront/sites/?no_page=true",{token:a});return Array.isArray(r)?r:r.results??[]},listSiteCurrencies:async(a,r)=>{const n=await e(Gt(a),{token:r});return Array.isArray(n)?n:[]},publishSite:(a,r)=>e(`${R(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${R(a)}live-state/`,{token:r}),updateSite:(a,r,n)=>e(R(a),{method:"PATCH",body:JSON.stringify(r),token:n}),getThemeSettings:(a,r)=>e(l(r),{token:a}),updateThemeSettings:(a,r,n)=>e(l(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getChatSettings:(a,r)=>e(p(r),{token:a}),updateChatSettings:(a,r,n)=>e(p(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getSocialSettings:(a,r)=>e(w(r),{token:a}),updateSocialSettings:(a,r,n)=>e(w(n),{method:"PATCH",body:JSON.stringify(a),token:r}),uploadHeaderLogo:(a,r,n)=>{const c=new FormData;return c.append("logo",a),e(o(n),{method:"PATCH",body:c,token:r})},clearHeaderLogo:(a,r)=>e(o(r),{method:"PATCH",body:JSON.stringify({logo:null}),token:a}),setHeaderLogoFromAsset:(a,r,n)=>e(o(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:a}),token:r}),uploadMedia:async(a,r)=>{const n=new FormData;return n.append("file",a),e(zt(),{method:"POST",body:n,token:r})},listMedia:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("kind",r);const c=await e(`/api/storefront/media-assets/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]}}}const ye=Kt({siteDrafts:!0});export{dt as API_URL,qt as AmbiguousPageSlugError,m as ApiError,yt as BROWSER_READ_TIMEOUT_MS,lt as EFFICIENT_CLIENT_CLOSED_MESSAGE,jt as MediaUploadDestinationError,Ht as PREVIEW_PARAM,ge as PRODUCT_API_BASE,pt as SERVER_READ_TIMEOUT_MS,_ as SERVER_UNREACHABLE_MESSAGE,N as STATUS_NETWORK_ERROR,pe as adminFetch,Ot as api,i as apiFetch,C as appendSiteQuery,le as bookings,Kt as createStorefrontAdmin,D as defaultRequestDeadline,zt as editorMediaUploadPath,gt as editorPortalAudience,wt as editorRequestLanguage,de as fitment,ue as products,ht as readDeadlineMs,Lt as resolveClientIp,g as resolveMediaUrls,Ft as resolvePreviewToken,Z as resolveSiteHost,Jt as resolveSiteHostSource,Dt as resolveSiteSlug,se as setEditorLanguage,ae as setEditorPortalAudience,ye as storefrontAdmin};
|
|
@@ -18,7 +18,6 @@ export declare function applyCardAnswers<T extends {
|
|
|
18
18
|
}>(facts: readonly T[], answers: readonly FieldUsageAnswer[]): readonly T[];
|
|
19
19
|
export declare function answerOrder(answers: readonly FieldUsageAnswer[], place: "filter" | "card"): (fieldKey: string | undefined) => number | undefined;
|
|
20
20
|
export declare function keepForSpec(answers: readonly FieldUsageAnswer[]): (fieldKey: string | undefined) => boolean;
|
|
21
|
-
export declare function keepForFitment(answers: readonly FieldUsageAnswer[]): (fieldKey: string | undefined) => boolean;
|
|
22
21
|
export declare function applySpecAnswers<T extends {
|
|
23
22
|
fieldKey?: string;
|
|
24
23
|
}>(rows: T[], answers: readonly FieldUsageAnswer[]): T[];
|