@suiteop/storefront 0.3.0 → 0.5.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +5 -0
  3. package/dist/astro-content-model.cjs +5 -5
  4. package/dist/astro-content-model.js +4 -4
  5. package/dist/{availability-CnzmxuV3.d.cts → availability-Dh0yLSkj.d.cts} +25 -1
  6. package/dist/{availability-CnzmxuV3.d.ts → availability-Dh0yLSkj.d.ts} +25 -1
  7. package/dist/checkout.cjs +4 -4
  8. package/dist/checkout.js +3 -3
  9. package/dist/chunk-5TUJX6GY.js +5 -0
  10. package/dist/{chunk-HMLBMNGA.js → chunk-7ZAI36LH.js} +1 -1
  11. package/dist/{chunk-LVFRVNT3.cjs → chunk-EHQFWSP6.cjs} +2 -1
  12. package/dist/{chunk-6NFURJXI.js → chunk-IBCBDAGY.js} +2 -2
  13. package/dist/{chunk-IBIDIWTI.js → chunk-IUNIQSFB.js} +2 -2
  14. package/dist/{chunk-USOISC2R.cjs → chunk-J5FZ4WDQ.cjs} +2 -2
  15. package/dist/chunk-LY73ZYN5.cjs +20 -0
  16. package/dist/{chunk-W4VKQWXY.cjs → chunk-NNWJZUQL.cjs} +3 -3
  17. package/dist/chunk-NZWYOV5Y.cjs +19 -0
  18. package/dist/{chunk-VV2UNVQ2.cjs → chunk-UMCI4YBN.cjs} +2 -2
  19. package/dist/{chunk-ZI2PG7LS.js → chunk-W5K7IDYN.js} +1 -1
  20. package/dist/chunk-YSKWSL2F.js +9 -0
  21. package/dist/{client-CmoApA__.d.cts → client-2KyVv-2l.d.cts} +88 -11
  22. package/dist/{client-CdsTfFv7.d.ts → client-C9Igm7O-.d.ts} +88 -11
  23. package/dist/components.cjs +2 -2
  24. package/dist/components.d.cts +1 -1
  25. package/dist/components.d.ts +1 -1
  26. package/dist/components.js +1 -1
  27. package/dist/config.cjs +8 -1
  28. package/dist/config.d.cts +168 -11
  29. package/dist/config.d.ts +168 -11
  30. package/dist/config.js +3 -3
  31. package/dist/content.cjs +11 -11
  32. package/dist/content.d.cts +3 -3
  33. package/dist/content.d.ts +3 -3
  34. package/dist/content.js +4 -4
  35. package/dist/{errors-Ct7uJn5o.d.ts → errors-BGgJ--XR.d.ts} +1 -1
  36. package/dist/{errors-LMVeW29z.d.cts → errors-DpImb0Uf.d.cts} +1 -1
  37. package/dist/index.cjs +21 -21
  38. package/dist/index.d.cts +4 -4
  39. package/dist/index.d.ts +4 -4
  40. package/dist/index.js +4 -4
  41. package/dist/react.cjs +6 -6
  42. package/dist/react.d.cts +3 -3
  43. package/dist/react.d.ts +3 -3
  44. package/dist/react.js +5 -5
  45. package/package.json +1 -1
  46. package/dist/chunk-BFUMJBZV.js +0 -9
  47. package/dist/chunk-PUY7GWID.cjs +0 -19
  48. package/dist/chunk-WNCQ6YBT.cjs +0 -18
  49. package/dist/chunk-Y6INA5K7.js +0 -5
@@ -0,0 +1,9 @@
1
+ import { BE_BOOKING_REQUEST_STATUSES, STOREFRONT_KEY_ENVIRONMENTS, REGIONS } from './chunk-PYVUDQSQ.js';
2
+ import { requiredTrimmedEmailField, storefrontReviewSchema, storefrontContentItemSchema, storefrontIdSchema, storefrontLocationSchema, storefrontBuildingSchema, storefrontListingSummarySchema, storefrontListingFacetsSchema, storefrontContactResultSchema, storefrontContentModelSchema, storefrontListingSchema, storefrontSiteSchema } from './chunk-5TUJX6GY.js';
3
+ import { StorefrontConfigError, StorefrontError, storefrontQuoteSchema, StorefrontTimeoutError, StorefrontNetworkError, errorFromResponse } from './chunk-W5K7IDYN.js';
4
+ import { openEnum, storefrontDateSchema, storefrontCalendarSchema, storefrontAvailabilitySchema, storefrontUnitAvailabilitySchema } from './chunk-IBCBDAGY.js';
5
+ import { z } from 'zod';
6
+
7
+ var STOREFRONT_CHANNELS=["ai_assistant","paid_search","paid_social","organic_search","organic_social","email","referral","direct"];var AI_ASSISTANT_HOSTS={"chatgpt.com":"chatgpt","chat.openai.com":"chatgpt","perplexity.ai":"perplexity","gemini.google.com":"gemini","copilot.microsoft.com":"copilot","claude.ai":"claude"};var AI_ASSISTANT_SOURCES={"chatgpt.com":"chatgpt",perplexity:"perplexity","perplexity.ai":"perplexity",gemini:"gemini",copilot:"copilot","claude.ai":"claude"};var PAID_CLICKS=["google","microsoft","meta"];var PAID_MEDIUMS=new Set(["cpc","ppc","paid","paidsearch","sem"]);var EMAIL_RE=/newsletter|mailchimp|klaviyo/;var SEARCH_SUFFIXES=["bing.com","duckduckgo.com","search.yahoo.com","baidu.com","ecosia.org","search.brave.com"];var SEARCH_ANY_TLD_RE=/^(?:www\.)?(?:google|yandex)\.[a-z]{2,3}(?:\.[a-z]{2})?$/;var SOCIAL_SUFFIXES=["facebook.com","instagram.com","t.co","x.com","twitter.com","linkedin.com","tiktok.com","youtube.com","reddit.com"];var SOCIAL_ANY_TLD_RE=/(?:^|\.)pinterest\.[a-z]{2,3}(?:\.[a-z]{2})?$/;var SOCIAL_SOURCES=new Set(["facebook","fb","instagram","ig","meta","twitter","x","linkedin","pinterest","tiktok","youtube","reddit"]);var clean=value=>{const v=value?.trim().toLowerCase();return v?v:null};var hostOf=value=>clean(value)?.replace(/\.$/,"")??null;var hostMatches=(host,suffix)=>host===suffix||host.endsWith(`.${suffix}`);var bareHost=host=>host.replace(/^www\./,"");function aiLabel(host,source){if(host){const suffix=Object.keys(AI_ASSISTANT_HOSTS).find(s=>hostMatches(host,s));if(suffix)return AI_ASSISTANT_HOSTS[suffix]}return source&&Object.hasOwn(AI_ASSISTANT_SOURCES,source)?AI_ASSISTANT_SOURCES[source]:null}var isSearchHost=host=>SEARCH_ANY_TLD_RE.test(host)||SEARCH_SUFFIXES.some(s=>hostMatches(host,s));var isSocialHost=host=>SOCIAL_ANY_TLD_RE.test(host)||SOCIAL_SUFFIXES.some(s=>hostMatches(host,s));function paidClickOf(t){const medium=clean(t.utmMedium);if(t.fbclid&&medium!==null&&PAID_MEDIUMS.has(medium))return "meta";if(t.gclid||t.gbraid||t.wbraid)return "google";if(t.msclkid)return "microsoft";if(t.fbclid)return "meta";return t.paidClick??null}function classifyChannel(t){const source=clean(t.utmSource);const medium=clean(t.utmMedium);const site=bareHost(hostOf(t.siteHost)??"");const ref=hostOf(t.referrerHost);const external=ref&&bareHost(ref)!==site?ref:null;const result=(channel,label=null)=>({channel,source:label??source??external,medium});const socialSource=source!==null&&(SOCIAL_SOURCES.has(source)||isSocialHost(source))||!!(external&&isSocialHost(external));const paidMedium=medium!==null&&PAID_MEDIUMS.has(medium);const searchClick=t.gclid||t.gbraid||t.wbraid||t.msclkid||t.paidClick==="google"||t.paidClick==="microsoft";const metaClick=t.fbclid||t.paidClick==="meta";if(searchClick||paidMedium){return result(socialSource||metaClick&&paidMedium?"paid_social":"paid_search")}if(medium==="email"||EMAIL_RE.test(source??"")||EMAIL_RE.test(medium??"")){return result("email")}const ai=aiLabel(external,source);if(ai)return result("ai_assistant",ai);if(external&&isSearchHost(external))return result("organic_search");if(socialSource||metaClick)return result("organic_social");const anyUtm=[source,medium,t.utmCampaign,t.utmTerm,t.utmContent].some(v=>clean(v??null));if(!external&&!anyUtm)return result("direct");return result("referral")}var consentStateSchema=z.object({analytics:z.boolean(),ads:z.boolean(),source:z.enum(["default","user"]),region:z.enum(["restricted","other"]),decidedAt:z.iso.datetime().max(40).nullable()});function isSafePrivacyUrl(value){if([...value].some(ch=>/\s/.test(ch)||ch.charCodeAt(0)<32))return false;if(value.startsWith("/"))return !value.startsWith("//")&&!value.startsWith("/\\");if(!value.startsWith("https://")||!URL.canParse(value))return false;const url=new URL(value);return url.hostname!==""&&url.username===""&&url.password===""}var STOREFRONT_CONSENT_MODES=["regional","strict"];var modeField=z.enum(STOREFRONT_CONSENT_MODES);var privacyPolicyUrlField=z.string().trim().max(2048,"validation.storefront.privacy_policy_url_invalid").refine(isSafePrivacyUrl,"validation.storefront.privacy_policy_url_invalid").nullable();z.object({mode:modeField.default("regional"),privacyPolicyUrl:privacyPolicyUrlField.default(null)});z.object({siteId:z.uuid(),consentSettings:z.object({mode:modeField.optional(),privacyPolicyUrl:privacyPolicyUrlField.optional()})});var ACTIVE_RESERVATION_STATUSES=["confirmed","reserved","awaiting_payment"];new Set(ACTIVE_RESERVATION_STATUSES);var SCHEDULABLE_RESERVATION_STATUSES=[...ACTIVE_RESERVATION_STATUSES,"blocked"];new Set(SCHEDULABLE_RESERVATION_STATUSES);var VOLATILE_SYNC_STATUSES=["pending","pending_deletion","failed_deletion"];new Set(VOLATILE_SYNC_STATUSES);var CURRENCIES=["usd","eur","aud","gbp","cad","chf","cny","jpy","nzd","nok","mxn","thb","bgn","aed","inr","rub","brl","zar","sgd","hkd","xcd","xof","clp","dkk","try","bnd","xcg","shp","fkp","idr","ron","czk"];var ZERO_DECIMAL_CURRENCY_CODES=new Set(["bif","clp","djf","gnf","jpy","kmf","krw","mga","pyg","rwf","vnd","vuv","xaf","xof","xpf"]);new Set(CURRENCIES.filter(code=>ZERO_DECIMAL_CURRENCY_CODES.has(code)));var LIVE_PAYMENT_INTENT_STATUS_LIST=["succeeded","processing","requires_capture","refunded","disputed","reversed"];new Set(LIVE_PAYMENT_INTENT_STATUS_LIST);var BE_SITE_EXPERIMENT_VARIANTS=["a","b"];var ACTIVE_MIGRATION_RUN_STATUSES=["running","writing","finalizing","rolling_back"];new Set(ACTIVE_MIGRATION_RUN_STATUSES.filter(status=>status!=="rolling_back"));var experimentVariantSchema=z.enum(BE_SITE_EXPERIMENT_VARIANTS);var experimentAssignmentSchema=z.object({id:z.uuid(),variant:experimentVariantSchema});z.object({siteId:z.uuid()});z.object({siteId:z.uuid(),deploymentBId:z.uuid("validation.storefront.experiment_variant_required"),splitBPercent:z.number("validation.storefront.experiment_split_range").int("validation.storefront.experiment_split_range").min(1,"validation.storefront.experiment_split_range").max(99,"validation.storefront.experiment_split_range")});z.object({id:z.uuid(),winner:experimentVariantSchema.nullable()});z.object({id:z.uuid()});var clickId=z.string().min(1).max(512).regex(/^[\w.\-~]+$/);var storable=value=>!value.includes("\0")&&!/\p{Surrogate}/u.test(value);var utm=z.string().max(150).refine(storable).nullable();var attributionTouchSchema=z.object({ts:z.iso.datetime().max(40),landingPath:z.string().max(512).regex(/^\/[^?#]*$/).refine(storable),referrerHost:z.string().max(253).regex(/^[a-z0-9.-]+$/).nullable(),utmSource:utm,utmMedium:utm,utmCampaign:utm,utmTerm:utm,utmContent:utm,gclid:clickId.nullable(),gbraid:clickId.nullable(),wbraid:clickId.nullable(),fbclid:clickId.nullable(),msclkid:clickId.nullable(),paidClick:z.enum(PAID_CLICKS).nullable().default(null)});var attributionIdsSchema=z.object({gaClientId:z.string().max(64).regex(/^\d+\.\d+$/).nullable(),gaSessionId:z.string().max(32).regex(/^\d+$/).nullable(),fbp:z.string().max(128).regex(/^fb\.\d\.\d+\.\d+$/).nullable(),fbc:z.string().max(600).regex(/^fb\.\d\.\d+\.[\w-]+$/).nullable()});var storefrontAttributionInputSchema=z.object({first:attributionTouchSchema.nullable(),last:attributionTouchSchema.nullable(),ids:attributionIdsSchema,consent:consentStateSchema,experiment:experimentAssignmentSchema.optional()});var STORED_ATTRIBUTION_CHANNELS=[...STOREFRONT_CHANNELS,"ai_agent_mcp"];storefrontAttributionInputSchema.extend({firstChannel:z.enum(STORED_ATTRIBUTION_CHANNELS).nullable(),lastChannel:z.enum(STORED_ATTRIBUTION_CHANNELS),userAgent:z.string().max(512).nullable(),capturedAt:z.iso.datetime()});function withoutClickIds(touch){return {...touch,gclid:null,gbraid:null,wbraid:null,fbclid:null,msclkid:null,paidClick:paidClickOf(touch)}}var MAX_CHECKOUT_CUSTOM_FIELDS=10;var MAX_CHECKOUT_UPSELLS=12;var MAX_CHECKOUT_UPSELL_QUANTITY=50;var MAX_CHECKOUT_FIELD_LENGTH=2e3;var MAX_FIELD_KEY_LENGTH=40;var BOOKING_UPSELL_CHARGE_TYPES=["fixed_price","price_per_quantity","price_per_night","price_per_guest_per_night","free"];var localizedTextSchema=z.object({default:z.string().trim().min(1,"validation.required").max(200,"validation.max_length"),translations:z.record(z.string().min(2).max(10),z.string().max(200,"validation.max_length")).optional()});var fieldKeySchema=z.string().regex(new RegExp(`^[a-z][a-z0-9_]{0,${MAX_FIELD_KEY_LENGTH-1}}$`),"validation.storefront.extensions_invalid_key").refine(key=>!(key in Object.prototype),"validation.storefront.extensions_invalid_key");var boundSchema=z.number({error:"validation.number_required"}).int("validation.integer_required");var fieldBase={key:fieldKeySchema,label:localizedTextSchema,required:z.boolean()};var customFieldDefSchema=z.discriminatedUnion("type",[z.object({type:z.enum(["text","textarea"]),...fieldBase,maxLength:z.number({error:"validation.number_required"}).int("validation.integer_required").min(1,"validation.too_small").max(MAX_CHECKOUT_FIELD_LENGTH,"validation.too_large").default(500)}),z.object({type:z.literal("select"),...fieldBase,options:z.array(z.object({value:z.string().max(64).refine(value=>value.trim()!=="","validation.required"),label:localizedTextSchema})).min(1,"validation.storefront.extensions_select_needs_options").max(30,"validation.too_large").refine(options=>new Set(options.map(o=>o.value)).size===options.length,{message:"validation.storefront.extensions_duplicate_option"})}),z.object({type:z.literal("checkbox"),...fieldBase}),z.object({type:z.literal("number"),...fieldBase,min:boundSchema.optional(),max:boundSchema.optional()}),z.object({type:z.literal("date"),...fieldBase})]);z.object({customFields:z.array(customFieldDefSchema).max(MAX_CHECKOUT_CUSTOM_FIELDS,"validation.too_large").superRefine((fields,ctx)=>{const seen=new Set;fields.forEach((field,index)=>{if(seen.has(field.key)){ctx.addIssue({code:"custom",path:[index,"key"],message:"validation.storefront.extensions_duplicate_key"});}seen.add(field.key);if(field.type==="number"&&field.min!=null&&field.max!=null&&field.min>field.max){ctx.addIssue({code:"custom",path:[index,"max"],message:"validation.storefront.extensions_number_range_invalid"});}});}).default([]),upsells:z.object({portalUpsellIds:z.array(z.uuid()).max(MAX_CHECKOUT_UPSELLS,"validation.too_large").refine(ids=>new Set(ids).size===ids.length,{message:"validation.storefront.extensions_duplicate_upsell"}).default([])}).default({portalUpsellIds:[]})});var checkoutExtrasInputSchema=z.object({customFields:z.record(z.string().max(MAX_FIELD_KEY_LENGTH),z.union([z.string().max(MAX_CHECKOUT_FIELD_LENGTH),z.number(),z.boolean()])).refine(values=>Object.keys(values).length<=MAX_CHECKOUT_CUSTOM_FIELDS,{message:"validation.too_large"}).default({}),upsells:z.array(z.object({portalUpsellId:z.uuid(),quantity:z.number().int().min(1).max(MAX_CHECKOUT_UPSELL_QUANTITY)})).max(MAX_CHECKOUT_UPSELLS).default([])});var upsellOfferSchema=z.object({portalUpsellId:z.uuid(),title:z.string(),description:z.string().nullable(),imageUrl:z.string().nullable(),chargeType:z.enum(BOOKING_UPSELL_CHARGE_TYPES),unitMinor:z.number().int(),minQuantity:z.number().int(),maxQuantity:z.number().int(),quantifierLabel:z.string().nullable(),currency:z.string().length(3)});z.object({locale:z.string().max(35).optional().catch(void 0)});z.object({customFields:z.array(customFieldDefSchema),upsellOffers:z.array(upsellOfferSchema)});var checkoutSessionExtrasSchema=z.object({lines:z.array(z.object({portalUpsellId:z.uuid().nullable(),title:z.string(),quantity:z.number().int(),totalMinor:z.number().int()})),extrasTotalMinor:z.number().int(),heldTotalMinor:z.number().int()});var amountMinor=z.number().int().positive();var currency=z.string().length(3);var chargedByHost=z.literal("host");var checkoutMountDescriptorKnownSchema=z.discriminatedUnion("provider",[z.object({provider:z.literal("stripe"),publishableKey:z.string().min(1),stripeAccountId:z.string().nullable(),clientSecret:z.string().min(1),amountMinor,currency}),z.object({provider:z.literal("juspay"),publishableKey:z.string().min(1),providerBaseUrl:z.url(),clientSecret:z.string().min(1),profileId:z.string().min(1),amountMinor,currency}),z.object({provider:z.literal("guesty_pay"),guestyPartnerId:z.string().min(1),paymentProviderId:z.string().min(1),externalListingId:z.string().min(1),pmsQuoteId:z.string().nullable(),amountMinor,currency,chargedBy:chargedByHost.optional()}),z.object({provider:z.literal("pms_stripe"),publishableKey:z.string().min(1),stripeAccountId:z.string().min(1),clientSecret:z.string().min(1),amountMinor,currency,chargedBy:chargedByHost})]);var KNOWN_MOUNT_PROVIDERS=["stripe","juspay","guesty_pay","pms_stripe"];var checkoutMountDescriptorSchema=z.union([checkoutMountDescriptorKnownSchema,z.object({provider:z.string().refine(p=>!KNOWN_MOUNT_PROVIDERS.includes(p))}).loose()]);z.enum(BE_BOOKING_REQUEST_STATUSES);var bookingRequestStatusResponseSchema=openEnum(BE_BOOKING_REQUEST_STATUSES);var checkoutSessionQuoteSchema=z.object({listingId:z.uuid(),checkIn:z.iso.date(),checkOut:z.iso.date(),guests:z.number().int().positive(),ratePlanId:z.string(),totalMinor:z.number().int(),currency:z.string().length(3)});z.object({quoteRef:z.string().min(1).max(4096),ratePlanId:z.string().min(1).max(200).optional(),attribution:z.custom().optional(),extras:checkoutExtrasInputSchema.optional(),hostSessionId:z.uuid().optional()});var checkoutSessionSchema=z.object({id:z.uuid(),status:bookingRequestStatusResponseSchema,quote:checkoutSessionQuoteSchema,mount:checkoutMountDescriptorSchema.nullable(),chargedBy:chargedByHost.optional(),guestSaved:z.literal(true).optional(),extras:checkoutSessionExtrasSchema.optional(),extrasSessionId:z.uuid().optional(),expiresAt:z.iso.datetime()});var storefrontGuestInputSchema=z.object({firstName:z.string().trim().min(1,"validation.first_name_required").max(100),lastName:z.string().trim().min(1,"validation.last_name_required").max(100),email:requiredTrimmedEmailField,phone:z.string().trim().min(1,"validation.phone_required").max(40)});var storefrontConsentsSchema=z.object({emailMarketing:z.boolean().default(false),smsMarketing:z.boolean().default(false)}).default({emailMarketing:false,smsMarketing:false});var confirmCheckoutSessionInputSchema=z.object({quoteRef:z.string().min(1).max(4096),guest:storefrontGuestInputSchema,consents:storefrontConsentsSchema,paymentMethodId:z.string().min(1).max(255).optional(),language:z.string().max(35).optional().catch(void 0)});confirmCheckoutSessionInputSchema.pick({quoteRef:true,guest:true,consents:true,language:true});z.object({saved:z.boolean()});var bookingResultSchema=z.object({bookingRequestId:z.uuid(),confirmationToken:z.string(),status:bookingRequestStatusResponseSchema,confirmationCode:z.string().nullable()});var storefrontBookingSchema=z.object({id:z.uuid(),status:bookingRequestStatusResponseSchema,propertyId:z.uuid().nullable(),checkIn:z.iso.date().nullable(),checkOut:z.iso.date().nullable(),guestCount:z.number().int().nullable(),guestFirstName:z.string().nullable(),totalMinor:z.number().int().nullable(),currency:z.string().nullable(),confirmationCode:z.string().nullable(),lines:z.array(z.object({title:z.string(),quantity:z.number().int(),totalMinor:z.number().int()})).optional()});z.enum(STOREFRONT_KEY_ENVIRONMENTS);var STOREFRONT_KEY_RE=new RegExp(`^pk_(${STOREFRONT_KEY_ENVIRONMENTS.join("|")})_(${REGIONS.join("|")})_[0-9A-Za-z]{24}$`);function parseStorefrontKey(token){const match=STOREFRONT_KEY_RE.exec(token);if(!match)return null;return {environment:match[1],region:match[2]}}var ORIGIN_HOST_RE=/^(?:[a-z0-9-]+\.)*[a-z0-9-]+$|^\[[0-9a-f:.]+\]$/;function parseUrl(value){try{return new URL(value)}catch{return null}}z.string().refine(value=>{const url=parseUrl(value);if(!url)return false;return (url.protocol==="https:"||url.protocol==="http:")&&url.origin===value&&ORIGIN_HOST_RE.test(url.hostname)},"validation.storefront.origin_invalid");var CLIENT_CONVERSION_EVENT_NAMES=["begin_checkout","generate_lead","sign_up"];var STOREFRONT_EVENT_PATH_MAX=512;var base={eventId:z.uuid(),ts:z.number().int(),path:z.string().max(STOREFRONT_EVENT_PATH_MAX),referrerHost:z.string().max(253).nullable()};var currency2=z.string().length(3).regex(/^[a-z]{3}$/);var storefrontClientEventSchema=z.discriminatedUnion("name",[z.object({...base,name:z.literal("page_view")}),z.object({...base,name:z.literal("view_search_results"),checkIn:storefrontDateSchema.optional(),checkOut:storefrontDateSchema.optional(),guests:z.number().int().min(1).max(50).optional(),locationId:z.uuid().optional()}),z.object({...base,name:z.literal("view_item_list"),listName:z.string().max(64),itemCount:z.number().int().min(0).max(500)}),z.object({...base,name:z.literal("view_item"),listingId:z.uuid()}),z.object({...base,name:z.literal("view_quote"),listingId:z.uuid(),valueMinor:z.number().int().nonnegative(),currency:currency2,nights:z.number().int().min(1).max(365)}),z.object({...base,name:z.literal("begin_checkout"),checkoutSessionId:z.uuid()}),z.object({...base,name:z.literal("add_payment_info"),checkoutSessionId:z.uuid()}),z.object({...base,name:z.literal("generate_lead"),formId:z.string().max(64).optional()}),z.object({...base,name:z.literal("sign_up"),method:z.literal("newsletter")})]);var STOREFRONT_EVENT_BATCH_MAX=20;z.object({events:z.array(storefrontClientEventSchema).min(1).max(STOREFRONT_EVENT_BATCH_MAX)});z.object({events:z.array(z.object({eventId:z.uuid(),name:z.enum(CLIENT_CONVERSION_EVENT_NAMES),occurredAt:z.iso.datetime(),pageUrl:z.url({protocol:/^https?$/}).max(2048),checkoutSessionId:z.uuid().nullable(),userAgent:z.string().max(512).nullable(),attribution:storefrontAttributionInputSchema.nullable()})).min(1).max(STOREFRONT_EVENT_BATCH_MAX)});var storefrontGuideItemSchema=z.object({id:z.uuid(),title:z.string().nullable(),description:z.string().nullable(),address:z.string().nullable(),latitude:z.number().nullable(),longitude:z.number().nullable(),googleMapsUrl:z.string().nullable(),websiteUrl:z.string().nullable(),imageUrl:z.string().nullable(),categories:z.array(z.string()),priceLevel:z.number().int().min(1).max(4).nullable(),rating:z.number().nullable(),ratingsCount:z.number().int().nullable()});var storefrontGuideSchema=z.object({id:z.uuid(),name:z.string(),category:z.string().nullable(),coverImageUrl:z.string().nullable(),items:z.array(storefrontGuideItemSchema)});var EXPERIMENT_COOKIE="__so_exp";var COOKIE_RE=/(?:^|;\s*)__so_exp=([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.(a|b)(?:\s*;|\s*$)/;function readExperimentCookie(cookies){const match=COOKIE_RE.exec(cookies??"");return match?{id:match[1],variant:match[2]}:null}var ATTRIBUTION_COOKIE="so_attr";var ATTRIBUTION_COOKIE_MAX_AGE_SECONDS=90*24*60*60;var COOKIE_SCOPE="Path=/; SameSite=Lax; Secure";var ATTRIBUTION_COOKIE_ATTRIBUTES=`Max-Age=${ATTRIBUTION_COOKIE_MAX_AGE_SECONDS}; ${COOKIE_SCOPE}`;var ATTRIBUTION_COOKIE_MAX_BYTES=3584;var attributionCookieSchema=z.object({first:attributionTouchSchema.nullable(),last:attributionTouchSchema.nullable()});function toBase64Url(text){let binary="";for(const byte of new TextEncoder().encode(text))binary+=String.fromCharCode(byte);return btoa(binary).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function fromBase64Url(value){const binary=atob(value.replace(/-/g,"+").replace(/_/g,"/"));return new TextDecoder().decode(Uint8Array.from(binary,ch=>ch.charCodeAt(0)))}function encodeAttributionCookie(value){const encoded=toBase64Url(JSON.stringify(value));return encoded.length>ATTRIBUTION_COOKIE_MAX_BYTES?null:encoded}function serializeAttributionCookie(value){const encoded=encodeAttributionCookie(value);return encoded===null?null:`${ATTRIBUTION_COOKIE}=${encoded}; ${ATTRIBUTION_COOKIE_ATTRIBUTES}`}function decodeAttributionCookie(value){if(!value)return null;return attributionCookieSchema.parse(JSON.parse(fromBase64Url(value)))}function expiredAttributionCookies(cookies,consent){const revoked=[...consent.analytics?[]:[ATTRIBUTION_COOKIE,EXPERIMENT_COOKIE],...consent.ads?[]:["_fbc","_fbp"]];return revoked.filter(name=>readCookie(cookies,name)!==null).map(name=>`${name}=; Max-Age=0; ${COOKIE_SCOPE}`)}function strippedAttributionCookie(held){const clicked=t=>t!==null&&[t.gclid,t.gbraid,t.wbraid,t.fbclid,t.msclkid].some(id=>id!==null);if(!held||!(clicked(held.first)||clicked(held.last)))return null;return serializeAttributionCookie({first:held.first&&withoutClickIds(held.first),last:held.last&&withoutClickIds(held.last)})??`${ATTRIBUTION_COOKIE}=; Max-Age=0; ${COOKIE_SCOPE}`}function readCookie(header,name){if(!header)return null;for(const part of header.split(";")){const eq=part.indexOf("=");if(eq!==-1&&part.slice(0,eq).trim()===name)return part.slice(eq+1).trim()}return null}var MalformedCookieError=class extends Error{constructor(name){super(`${name} is malformed`);this.name="MalformedAttributionError";}};var NO_IDS={gaClientId:null,gaSessionId:null,fbp:null,fbc:null};function matchCookie(cookies,name,re,report){const value=name?readCookie(cookies,name):null;if(!value)return null;const match=re.exec(value);if(!match){report(new MalformedCookieError(name),name);return null}return match.slice(1).filter(Boolean).join(".")}function browserIdsFromCookies(cookies,consent,report){const sessionCookie=cookies.split(";").map(part=>part.split("=")[0].trim()).find(name=>name.startsWith("_ga_"))??null;const ga=consent.analytics;const ads=consent.ads;const ids={gaClientId:ga?matchCookie(cookies,"_ga",/^GA\d\.\d+\.(\d+)\.(\d+)$/,report):null,gaSessionId:ga?matchCookie(cookies,sessionCookie,/^(?:GS1\.\d+\.(\d+)\.|GS2\.\d+\.s(\d+)(?:\$|$))/,report):null,fbp:ads?matchCookie(cookies,"_fbp",/^(fb\.\d\.\d+\.\d+)$/,report):null,fbc:ads?matchCookie(cookies,"_fbc",/^(fb\.\d\.\d+\.[\w-]+)$/,report):null};const parsed=attributionIdsSchema.safeParse(ids);if(parsed.success)return parsed.data;report(parsed.error,"ids");return NO_IDS}var isDirect=touch=>classifyChannel({...touch,siteHost:globalThis.location?.hostname??""}).channel==="direct";var TOUCH_ELEMENT_ID="__suiteop_touch";var CONSENT_EVENT="suiteop:consent";var DENIED={analytics:false,ads:false,source:"default",region:"restricted",decidedAt:null};var defaultReport=(err,where)=>{console.warn(`[suiteop] ignored malformed attribution input (${where})`,err);};function pageConsent(){const read=globalThis.__suiteop?.consent?.get;const parsed=consentStateSchema.safeParse(typeof read==="function"?read():null);return parsed.success?parsed.data:DENIED}function pageTouch(report){const text=document.getElementById(TOUCH_ELEMENT_ID)?.textContent;if(!text)return null;try{return attributionTouchSchema.parse(JSON.parse(text))}catch(err){report(err,TOUCH_ELEMENT_ID);return null}}function storedCookie(cookies,report){try{return decodeAttributionCookie(readCookie(cookies,ATTRIBUTION_COOKIE))}catch(err){report(err,ATTRIBUTION_COOKIE);return null}}function getAttribution(opts={}){if(typeof document==="undefined")return null;const report=opts.report??defaultReport;const cookies=document.cookie;const consent=pageConsent();const stored=consent.analytics?storedCookie(cookies,report):null;const touch=pageTouch(report);const pageIsLast=touch!==null&&!(stored?.last&&(isDirect(touch)||Date.parse(stored.last.ts)>Date.parse(touch.ts)));const experiment=consent.analytics?readExperimentCookie(cookies):null;return {first:stored?.first??touch,last:pageIsLast?touch:stored?.last??null,ids:browserIdsFromCookies(cookies,consent,report),consent,...experiment?{experiment}:{}}}function watchAttributionConsent(opts={}){if(typeof window==="undefined")return ()=>{};const report=opts.report??defaultReport;const persist=consent=>{if(readCookie(document.cookie,ATTRIBUTION_COOKIE))return;const touch=pageTouch(report);if(!touch)return;const kept=consent.ads?touch:withoutClickIds(touch);const cookie=serializeAttributionCookie({first:kept,last:kept});if(cookie)document.cookie=cookie;};const withdraw=consent=>{for(const cookie of expiredAttributionCookies(document.cookie,consent)){document.cookie=cookie;}if(consent.analytics&&!consent.ads){const stripped=strippedAttributionCookie(storedCookie(document.cookie,report));if(stripped)document.cookie=stripped;}};const initial=pageConsent();let analytics=initial.analytics;if(initial.source==="user")withdraw(initial);if(analytics)persist(initial);const onConsent=event=>{const next=consentStateSchema.safeParse(event.detail);if(!next.success)return;const granted=!analytics&&next.data.analytics;analytics=next.data.analytics;withdraw(next.data);if(granted)persist(next.data);};window.addEventListener(CONSENT_EVENT,onConsent);return ()=>window.removeEventListener(CONSENT_EVENT,onConsent)}var EVENTS_ENDPOINT="/_suiteop/events";var FLUSH_INTERVAL_MS=2e3;var FLUSH_AT_EVENTS=10;var defaultReport2=err=>{console.warn("[suiteop] storefront events could not be sent",err);};function hostOf2(url){try{return new URL(url).hostname||null}catch{return null}}var META_EVENTS={begin_checkout:"InitiateCheckout",generate_lead:"Lead",sign_up:"CompleteRegistration",view_item:"ViewContent",view_search_results:"Search",add_payment_info:"AddPaymentInfo"};var GTAG_SKIP=new Set(["page_view","purchase"]);function mirrorToTags(event){const w=window;if(typeof w.gtag!=="function"&&typeof w.fbq!=="function")return;const consent=pageConsent();const{name,eventId,ts:_ts,path:_path,referrerHost:_ref,...params}=event;if(consent.analytics&&typeof w.gtag==="function"&&!GTAG_SKIP.has(name)){w.gtag("event",name,params);}const metaName=META_EVENTS[name];if(consent.ads&&typeof w.fbq==="function"&&metaName){w.fbq("track",metaName,{},{eventID:eventId});}}function trackPurchasePixel(booking){if(typeof window==="undefined")return;const fbq=window.fbq;if(typeof fbq!=="function"||!pageConsent().ads)return;const amount=typeof booking.totalMinor==="number"&&booking.currency?{value:booking.totalMinor/100,currency:booking.currency.toUpperCase()}:{};fbq("track","Purchase",amount,{eventID:booking.bookingRequestId});}var NOOP={track(){},pageView(){},flush(){},dispose(){}};function createAnalytics(opts){if(typeof window==="undefined")return NOOP;const report=opts.report??defaultReport2;const url=`${EVENTS_ENDPOINT}?key=${encodeURIComponent(opts.publishableKey)}`;let queue=[];let timer=null;let landing=true;let lastViewedHref=null;let disabled=false;let reported=false;const fail=err=>{if(reported)return;reported=true;report(err);};const send=(events,beacon)=>{const body=JSON.stringify({events});if(beacon&&typeof navigator.sendBeacon==="function"&&navigator.sendBeacon(url,body)){return}fetch(url,{method:"POST",body,keepalive:true,credentials:"same-origin",headers:{"content-type":"application/json"}}).then(response=>{if(response.status===404)disabled=true;else if(!response.ok)fail(new Error(`storefront events answered ${response.status}`));}).catch(fail);};const flush=({beacon=false}={})=>{if(timer)clearTimeout(timer);timer=null;if(disabled||queue.length===0)return;const pending=queue;queue=[];for(let i=0;i<pending.length;i+=STOREFRONT_EVENT_BATCH_MAX){send(pending.slice(i,i+STOREFRONT_EVENT_BATCH_MAX),beacon);}};const enqueue=(event,referrerHost)=>{const full={...event,eventId:crypto.randomUUID(),ts:Date.now(),path:location.pathname.slice(0,STOREFRONT_EVENT_PATH_MAX),referrerHost};try{mirrorToTags(full);}catch(err){fail(err);}if(disabled)return;queue.push(full);if(queue.length>=FLUSH_AT_EVENTS)flush();else timer??=setTimeout(()=>flush(),FLUSH_INTERVAL_MS);};const pageView=()=>{if(location.href===lastViewedHref)return;lastViewedHref=location.href;const referrerHost=landing?hostOf2(document.referrer):location.hostname;landing=false;enqueue({name:"page_view"},referrerHost);};const onPageHide=()=>flush({beacon:true});const onPageShow=event=>{if(!event.persisted)return;lastViewedHref=null;pageView();};window.addEventListener("pagehide",onPageHide);window.addEventListener("pageshow",onPageShow);return {track:event=>enqueue(event,location.hostname),pageView,flush,dispose:()=>{flush({beacon:true});window.removeEventListener("pagehide",onPageHide);window.removeEventListener("pageshow",onPageShow);}}}var shared=new Map;function analyticsFor(publishableKey){let instance=shared.get(publishableKey);if(!instance){instance=createAnalytics({publishableKey});if(instance!==NOOP)shared.set(publishableKey,instance);}return instance}function parsePublishableKey(key){if(typeof key==="string"&&key.trim().startsWith("sk_")){throw new StorefrontConfigError("A SuiteOp secret key (sk_\u2026) was passed as the publishable key. Secret keys must never be used in a browser or shipped in site code \u2014 revoke it now, then use a publishable key (pk_live_\u2026 / pk_test_\u2026) from the site settings.")}const parsed=typeof key==="string"?parseStorefrontKey(key.trim()):null;if(!parsed){throw new StorefrontConfigError("Invalid SuiteOp publishable key: expected pk_{live|test}_{us|eu|apac}_ followed by 24 letters or digits.")}return parsed}function defaultApiOrigin({environment,region}){return environment==="live"?`https://api-${region}.suiteop.com`:`https://api-${region}-staging.suiteop.com`}var SDK_VERSION="0.5.0";var STOREFRONT_API_VERSION="2026-09-27";var GET_RETRY_JITTER_MS=300;function buildUrl(base2,spec){const params=new URLSearchParams;for(const[key,value]of Object.entries(spec.query??{})){if(Array.isArray(value))for(const item of value)params.append(key,item);else if(value!==void 0&&value!==null)params.set(key,String(value));}const search=params.toString();return `${base2}${spec.path}${search?`?${search}`:""}`}function sleep(ms,signal){return new Promise((resolve,reject)=>{if(signal?.aborted)return reject(signal.reason);const onAbort=()=>{clearTimeout(timer);reject(signal?.reason);};const timer=setTimeout(()=>{signal?.removeEventListener("abort",onAbort);resolve();},ms);signal?.addEventListener("abort",onAbort,{once:true});})}function parseJson(text){if(!text)return void 0;try{return JSON.parse(text)}catch{return void 0}}function isRetryable(err){return err instanceof StorefrontNetworkError||err instanceof StorefrontError&&err.status>=500}function createTransport(opts){async function attempt(spec){const controller=new AbortController;let timedOut=false;const timer=setTimeout(()=>{timedOut=true;controller.abort(new DOMException("The request timed out","TimeoutError"));},spec.timeoutMs);const onCallerAbort=()=>controller.abort(spec.signal?.reason);if(spec.signal?.aborted)onCallerAbort();else spec.signal?.addEventListener("abort",onCallerAbort,{once:true});try{let response;let text;try{response=await opts.fetch(buildUrl(opts.baseUrl(),spec),{method:spec.method,headers:{...opts.headers,...spec.body===void 0?{}:{"Content-Type":"application/json"},...spec.headers},body:spec.body===void 0?void 0:JSON.stringify(spec.body),signal:controller.signal});text=await response.text();}catch(err){if(spec.signal?.aborted)throw spec.signal.reason;if(timedOut)throw new StorefrontTimeoutError(spec.timeoutMs);throw new StorefrontNetworkError(err)}const body=parseJson(text);if(!response.ok)throw errorFromResponse(response,body);const envelope=body;const meta=envelope?.meta??{};const requestId=typeof meta["requestId"]==="string"?meta["requestId"]:response.headers.get("x-request-id");if(!envelope||typeof envelope!=="object"||!("data"in envelope)){throw new StorefrontError({status:response.status,code:"invalid_response",message:"The Storefront API answered without a data envelope",requestId})}return {status:response.status,requestId,data:envelope.data,meta}}finally{clearTimeout(timer);spec.signal?.removeEventListener("abort",onCallerAbort);}}return {async send(spec){try{return await attempt(spec)}catch(err){if(spec.method!=="GET"||!isRetryable(err))throw err;await sleep(Math.random()*GET_RETRY_JITTER_MS,spec.signal);return attempt(spec)}}}}var STOREFRONT_API_PATH="/api/storefront/v1";var READ_TIMEOUT_MS=1e4;var WRITE_TIMEOUT_MS=2e4;function resolveBaseUrl(baseUrl,origin){if(baseUrl===void 0)return `${origin}${STOREFRONT_API_PATH}`;if(baseUrl==="same-origin"){const pageOrigin=globalThis.location?.origin;if(!pageOrigin||pageOrigin==="null"){throw new StorefrontConfigError("baseUrl 'same-origin' needs a page origin; pass an explicit baseUrl outside a browser.")}return `${pageOrigin}${STOREFRONT_API_PATH}`}let url;try{url=new URL(baseUrl);}catch{throw new StorefrontConfigError(`baseUrl must be an absolute URL or 'same-origin'.`)}const path=url.pathname.replace(/\/+$/,"");return `${url.origin}${path.endsWith(STOREFRONT_API_PATH)?path:`${path}${STOREFRONT_API_PATH}`}`}function uuidV4(){const c=globalThis.crypto;if(typeof c.randomUUID==="function")return c.randomUUID();const b=c.getRandomValues(new Uint8Array(16));b[6]=b[6]&15|64;b[8]=b[8]&63|128;const hex=Array.from(b,x=>x.toString(16).padStart(2,"0")).join("");return `${hex.slice(0,8)}-${hex.slice(8,12)}-${hex.slice(12,16)}-${hex.slice(16,20)}-${hex.slice(20)}`}function validate(schema,value,res){const parsed=schema.safeParse(value);if(parsed.success)return parsed.data;throw new StorefrontError({status:res.status,code:"invalid_response",message:"The Storefront API answered a shape this SDK version does not understand",requestId:res.requestId,details:{issues:parsed.error.issues.map(i=>({path:i.path,code:i.code}))}})}var paginationSchema=z.object({total:z.number().int(),limit:z.number().int(),offset:z.number().int()});var seg=value=>encodeURIComponent(value);var SLUG_OR_ID=/^[a-z0-9-]{1,120}$/;var slotOf=(quoteRef,ratePlanId)=>`${quoteRef}\0${ratePlanId??""}`;var RELEASED_SESSION_STATUSES=new Set(["expired","cancelled"]);var KEY_BOUND_ELSEWHERE="idempotency_key_reused";function endsSession(err){return err.code==="session_expired"||err.details["requiresNewSession"]===true}var attributionWatched=false;function createStorefrontClient(options){const key=parsePublishableKey(options.publishableKey);const baseUrl=resolveBaseUrl(options.baseUrl,defaultApiOrigin(key));const transport=createTransport({baseUrl:()=>baseUrl,fetch:(input,init)=>(options.fetch??globalThis.fetch)(input,init),headers:{Authorization:`Bearer ${options.publishableKey.trim()}`,Accept:"application/json","X-SuiteOp-SDK":`storefront-js/${SDK_VERSION}`,"X-SuiteOp-Api-Version":STOREFRONT_API_VERSION,...options.locale?{"Accept-Language":options.locale}:{}}});const keySlots=new Map;const sessionSlots=new Map;const release=(slot,key2)=>{if(keySlots.get(slot)===key2)keySlots.delete(slot);};const releaseSession=id=>{const entry=sessionSlots.get(id);if(!entry)return;sessionSlots.delete(id);release(...entry);};if(!attributionWatched&&typeof window!=="undefined"){attributionWatched=true;watchAttributionConsent();}const readTimeoutMs=options.timeoutMs??READ_TIMEOUT_MS;const writeTimeoutMs=options.timeoutMs??WRITE_TIMEOUT_MS;async function get(schema,path,opts,query){const res=await transport.send({method:"GET",path,query,timeoutMs:readTimeoutMs,signal:opts?.signal});return validate(schema,res.data,res)}async function post(schema,path,body,opts,headers){const res=await transport.send({method:"POST",path,body,headers,timeoutMs:writeTimeoutMs,signal:opts?.signal});return validate(schema,res.data,res)}return {publishableKey:options.publishableKey.trim(),baseUrl,site:{get:opts=>get(storefrontSiteSchema,"/site",opts)},listings:{async list(query,opts){const res=await transport.send({method:"GET",path:"/listings",query:{location:typeof query?.location==="string"?query.location:query?.location?.length?query.location.join(","):void 0,building:query?.building,guests:query?.guests,bedrooms:query?.bedrooms,currency:query?.currency,priceMin:query?.priceMin,priceMax:query?.priceMax,amenities:query?.amenities,bounds:typeof query?.bounds==="string"?query.bounds:query?.bounds?.join(","),sort:query?.sort,facets:query?.facets?1:void 0,limit:query?.limit,offset:query?.offset},timeoutMs:readTimeoutMs,signal:opts?.signal});const items=validate(z.array(storefrontListingSummarySchema),res.data,res);const pagination=validate(paginationSchema,res.meta["pagination"],res);const facets=res.meta["facets"]===void 0?void 0:validate(storefrontListingFacetsSchema,res.meta["facets"],res);return {items,...pagination,...facets?{facets}:{}}},get:(id,opts)=>get(storefrontListingSchema,`/listings/${seg(id)}`,opts)},buildings:{list:opts=>get(z.array(storefrontBuildingSchema),"/buildings",opts),get:(id,opts)=>get(storefrontBuildingSchema,`/buildings/${seg(id)}`,opts),async availability(id,query,opts){const res=await transport.send({method:"GET",path:`/buildings/${seg(id)}/availability`,query:{checkIn:query.checkIn,checkOut:query.checkOut,guests:query.guests,limit:query.limit,offset:query.offset},timeoutMs:readTimeoutMs,signal:opts?.signal});const items=validate(z.array(storefrontUnitAvailabilitySchema),res.data,res);const pagination=validate(paginationSchema,res.meta["pagination"],res);return {items,...pagination}}},locations:{list:opts=>get(z.array(storefrontLocationSchema),"/locations",opts)},guides:{list:opts=>get(z.array(storefrontGuideSchema),"/guides",opts),async get(id,opts){if(!storefrontIdSchema.safeParse(id).success)return null;try{return await get(storefrontGuideSchema,`/guides/${seg(id)}`,opts)}catch(err){if(err instanceof StorefrontError&&err.status===404)return null;throw err}}},contentModel:{get:opts=>get(storefrontContentModelSchema,"/content-model",opts)},collections:{async list(key2,query,opts){const res=await transport.send({method:"GET",path:`/collections/${seg(key2)}/items`,query:{limit:query?.limit,offset:query?.offset},timeoutMs:readTimeoutMs,signal:opts?.signal});const items=validate(z.array(storefrontContentItemSchema),res.data,res);const pagination=validate(paginationSchema,res.meta["pagination"],res);return {items,...pagination}},async get(key2,slugOrId,opts){if(!SLUG_OR_ID.test(slugOrId))return null;try{return await get(storefrontContentItemSchema,`/collections/${seg(key2)}/items/${seg(slugOrId)}`,opts)}catch(err){if(err instanceof StorefrontError&&err.status===404)return null;throw err}}},sections:{get:(key2,opts)=>get(storefrontContentItemSchema,`/sections/${seg(key2)}`,opts)},amenities:{list:opts=>get(z.array(z.string()),"/amenities",opts)},reviews:{list:(query,opts)=>get(z.array(storefrontReviewSchema),"/reviews",opts,{listingId:query?.listingId,limit:query?.limit,offset:query?.offset})},availability:{get:(listingId,stay,opts)=>get(storefrontAvailabilitySchema,`/listings/${seg(listingId)}/availability`,opts,{checkIn:stay.checkIn,checkOut:stay.checkOut,guests:stay.guests})},calendar:{get:(listingId,range,opts)=>get(storefrontCalendarSchema,`/listings/${seg(listingId)}/calendar`,opts,{from:range.from,to:range.to})},quotes:{create:(input,opts)=>post(storefrontQuoteSchema,"/quotes",input,opts)},checkoutSessions:{async create(input,opts){const slot=slotOf(input.quoteRef,input.ratePlanId);const idempotencyKey=opts?.idempotencyKey??keySlots.get(slot)??uuidV4();keySlots.set(slot,idempotencyKey);const attribution=input.attribution===void 0?getAttribution():input.attribution;const body=attribution?{...input,attribution}:input;try{const created=await post(checkoutSessionSchema,"/checkout-sessions",body,opts,{"Idempotency-Key":idempotencyKey});if(RELEASED_SESSION_STATUSES.has(created.status))release(slot,idempotencyKey);else sessionSlots.set(created.id,[slot,idempotencyKey]);return {...created,idempotencyKey}}catch(err){if(err instanceof StorefrontError){err.details["idempotencyKey"]=idempotencyKey;if(err.code===KEY_BOUND_ELSEWHERE)release(slot,idempotencyKey);}throw err}},get:(id,opts)=>get(checkoutSessionSchema,`/checkout-sessions/${seg(id)}`,opts),async confirm(id,input,opts){try{const result=await post(bookingResultSchema,`/checkout-sessions/${seg(id)}/confirm`,input,opts);return result}catch(err){if(err instanceof StorefrontError&&endsSession(err)){releaseSession(id);}throw err}},forget(quoteRef,ratePlanId){keySlots.delete(slotOf(quoteRef,ratePlanId));}},bookings:{get:(token,opts)=>get(storefrontBookingSchema,`/bookings/${seg(token)}`,opts)},contact:{async create(input,opts){await post(storefrontContactResultSchema,"/contact",input,opts);}}}}
8
+
9
+ export { SDK_VERSION, STOREFRONT_API_PATH, STOREFRONT_API_VERSION, analyticsFor, createAnalytics, createStorefrontClient, getAttribution, parsePublishableKey, trackPurchasePixel };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { d as StorefrontStay, S as StorefrontAvailability, c as StorefrontCalendarQuery, a as StorefrontCalendar } from './availability-CnzmxuV3.cjs';
2
+ import { e as StorefrontStay, a as StorefrontBuildingAvailabilityQuery, g as StorefrontUnitAvailability, S as StorefrontAvailability, d as StorefrontCalendarQuery, b as StorefrontCalendar } from './availability-Dh0yLSkj.cjs';
3
3
 
4
4
  declare const storefrontGuestInputSchema: z.ZodObject<{
5
5
  firstName: z.ZodString;
@@ -76,6 +76,8 @@ declare const storefrontListingSummarySchema: z.ZodObject<{
76
76
  latitude: z.ZodNullable<z.ZodNumber>;
77
77
  longitude: z.ZodNullable<z.ZodNumber>;
78
78
  bookable: z.ZodBoolean;
79
+ fromPriceMinor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
80
+ currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
79
81
  }, z.core.$strip>;
80
82
  type StorefrontListingSummary = z.infer<typeof storefrontListingSummarySchema>;
81
83
  declare const storefrontImageSchema: z.ZodObject<{
@@ -100,6 +102,8 @@ declare const storefrontListingSchema: z.ZodObject<{
100
102
  latitude: z.ZodNullable<z.ZodNumber>;
101
103
  longitude: z.ZodNullable<z.ZodNumber>;
102
104
  bookable: z.ZodBoolean;
105
+ fromPriceMinor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
106
+ currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
107
  buildingSlug: z.ZodString;
104
108
  buildingAddress: z.ZodUnknown;
105
109
  description: z.ZodNullable<z.ZodString>;
@@ -116,18 +120,45 @@ declare const storefrontListingSchema: z.ZodObject<{
116
120
  checkInTime: z.ZodNullable<z.ZodString>;
117
121
  checkOutTime: z.ZodNullable<z.ZodString>;
118
122
  beds: z.ZodNullable<z.ZodNumber>;
119
- fromPriceMinor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
120
- currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
121
123
  countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
122
124
  }, z.core.$strip>;
123
125
  type StorefrontListing = z.infer<typeof storefrontListingSchema>;
124
- declare const storefrontListingsQuerySchema: z.ZodObject<{
125
- location: z.ZodOptional<z.ZodString>;
126
- building: z.ZodOptional<z.ZodUUID>;
127
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
128
- offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
126
+ declare const STOREFRONT_LISTING_SORTS: readonly ["recommended", "price_asc", "price_desc", "rating"];
127
+ type StorefrontListingSort = (typeof STOREFRONT_LISTING_SORTS)[number];
128
+ interface StorefrontListingsQuery {
129
+ location?: string | readonly string[];
130
+ building?: string;
131
+ guests?: number;
132
+ bedrooms?: number;
133
+ currency?: string;
134
+ priceMin?: number;
135
+ priceMax?: number;
136
+ amenities?: readonly string[];
137
+ bounds?: readonly [number, number, number, number] | string;
138
+ sort?: StorefrontListingSort;
139
+ facets?: boolean;
140
+ limit?: number;
141
+ offset?: number;
142
+ }
143
+ declare const storefrontListingFacetsSchema: z.ZodObject<{
144
+ total: z.ZodNumber;
145
+ areas: z.ZodArray<z.ZodObject<{
146
+ id: z.ZodUUID;
147
+ slug: z.ZodNullable<z.ZodString>;
148
+ count: z.ZodNumber;
149
+ }, z.core.$strip>>;
150
+ bedrooms: z.ZodArray<z.ZodObject<{
151
+ bedrooms: z.ZodNumber;
152
+ count: z.ZodNumber;
153
+ }, z.core.$strip>>;
154
+ price: z.ZodNullable<z.ZodObject<{
155
+ min: z.ZodNumber;
156
+ max: z.ZodNumber;
157
+ currency: z.ZodNullable<z.ZodString>;
158
+ buckets: z.ZodArray<z.ZodNumber>;
159
+ }, z.core.$strip>>;
129
160
  }, z.core.$strip>;
130
- type StorefrontListingsQuery = z.infer<typeof storefrontListingsQuerySchema>;
161
+ type StorefrontListingFacets = z.infer<typeof storefrontListingFacetsSchema>;
131
162
  declare const storefrontBuildingSchema: z.ZodObject<{
132
163
  id: z.ZodUUID;
133
164
  locationId: z.ZodNullable<z.ZodUUID>;
@@ -442,6 +473,45 @@ declare const storefrontContentModelSchema: z.ZodObject<{
442
473
  }, z.core.$strip>;
443
474
  type StorefrontContentModel = z.infer<typeof storefrontContentModelSchema>;
444
475
 
476
+ declare const storefrontGuideItemSchema: z.ZodObject<{
477
+ id: z.ZodUUID;
478
+ title: z.ZodNullable<z.ZodString>;
479
+ description: z.ZodNullable<z.ZodString>;
480
+ address: z.ZodNullable<z.ZodString>;
481
+ latitude: z.ZodNullable<z.ZodNumber>;
482
+ longitude: z.ZodNullable<z.ZodNumber>;
483
+ googleMapsUrl: z.ZodNullable<z.ZodString>;
484
+ websiteUrl: z.ZodNullable<z.ZodString>;
485
+ imageUrl: z.ZodNullable<z.ZodString>;
486
+ categories: z.ZodArray<z.ZodString>;
487
+ priceLevel: z.ZodNullable<z.ZodNumber>;
488
+ rating: z.ZodNullable<z.ZodNumber>;
489
+ ratingsCount: z.ZodNullable<z.ZodNumber>;
490
+ }, z.core.$strip>;
491
+ type StorefrontGuideItem = z.infer<typeof storefrontGuideItemSchema>;
492
+ declare const storefrontGuideSchema: z.ZodObject<{
493
+ id: z.ZodUUID;
494
+ name: z.ZodString;
495
+ category: z.ZodNullable<z.ZodString>;
496
+ coverImageUrl: z.ZodNullable<z.ZodString>;
497
+ items: z.ZodArray<z.ZodObject<{
498
+ id: z.ZodUUID;
499
+ title: z.ZodNullable<z.ZodString>;
500
+ description: z.ZodNullable<z.ZodString>;
501
+ address: z.ZodNullable<z.ZodString>;
502
+ latitude: z.ZodNullable<z.ZodNumber>;
503
+ longitude: z.ZodNullable<z.ZodNumber>;
504
+ googleMapsUrl: z.ZodNullable<z.ZodString>;
505
+ websiteUrl: z.ZodNullable<z.ZodString>;
506
+ imageUrl: z.ZodNullable<z.ZodString>;
507
+ categories: z.ZodArray<z.ZodString>;
508
+ priceLevel: z.ZodNullable<z.ZodNumber>;
509
+ rating: z.ZodNullable<z.ZodNumber>;
510
+ ratingsCount: z.ZodNullable<z.ZodNumber>;
511
+ }, z.core.$strip>>;
512
+ }, z.core.$strip>;
513
+ type StorefrontGuide = z.infer<typeof storefrontGuideSchema>;
514
+
445
515
  declare const storefrontRatePlanQuoteSchema: z.ZodObject<{
446
516
  ratePlanId: z.ZodString;
447
517
  name: z.ZodString;
@@ -519,16 +589,23 @@ interface StorefrontClient {
519
589
  get(opts?: RequestOptions): Promise<StorefrontSite>;
520
590
  };
521
591
  listings: {
522
- list(query?: Partial<StorefrontListingsQuery>, opts?: RequestOptions): Promise<Page<StorefrontListingSummary>>;
592
+ list(query?: StorefrontListingsQuery, opts?: RequestOptions): Promise<Page<StorefrontListingSummary> & {
593
+ facets?: StorefrontListingFacets;
594
+ }>;
523
595
  get(id: string, opts?: RequestOptions): Promise<StorefrontListing>;
524
596
  };
525
597
  buildings: {
526
598
  list(opts?: RequestOptions): Promise<StorefrontBuilding[]>;
527
599
  get(id: string, opts?: RequestOptions): Promise<StorefrontBuilding>;
600
+ availability(id: string, query: StorefrontStay & Partial<Pick<StorefrontBuildingAvailabilityQuery, 'limit' | 'offset'>>, opts?: RequestOptions): Promise<Page<StorefrontUnitAvailability>>;
528
601
  };
529
602
  locations: {
530
603
  list(opts?: RequestOptions): Promise<StorefrontLocation[]>;
531
604
  };
605
+ guides: {
606
+ list(opts?: RequestOptions): Promise<StorefrontGuide[]>;
607
+ get(id: string, opts?: RequestOptions): Promise<StorefrontGuide | null>;
608
+ };
532
609
  contentModel: {
533
610
  get(opts?: RequestOptions): Promise<StorefrontContentModel>;
534
611
  };
@@ -569,4 +646,4 @@ interface StorefrontClient {
569
646
  }
570
647
  declare function createStorefrontClient(options: StorefrontClientOptions): StorefrontClient;
571
648
 
572
- export { type StorefrontSite as A, type BookingResult as B, type CheckoutMountDescriptor as C, createStorefrontClient as D, type Page as P, type RequestOptions as R, STOREFRONT_API_PATH as S, type CheckoutSession as a, type ConfirmCheckoutSessionInput as b, type ConfirmCheckoutSessionRequest as c, type ContentListQuery as d, type CreateCheckoutSessionInput as e, type CreateCheckoutSessionOptions as f, type CreatedCheckoutSession as g, type StorefrontBooking as h, type StorefrontBuilding as i, type StorefrontClient as j, type StorefrontClientOptions as k, type StorefrontContactInput as l, type StorefrontContentItem as m, type StorefrontContentModel as n, type StorefrontContentRef as o, type StorefrontGuestInput as p, type StorefrontImage as q, type StorefrontListing as r, type StorefrontListingSummary as s, type StorefrontListingsQuery as t, type StorefrontLocation as u, type StorefrontQuote as v, type StorefrontQuoteInput as w, type StorefrontRatePlanQuote as x, type StorefrontReview as y, type StorefrontReviewsQuery as z };
649
+ export { type StorefrontQuoteInput as A, type BookingResult as B, type CheckoutMountDescriptor as C, type StorefrontRatePlanQuote as D, type StorefrontReview as E, type StorefrontReviewsQuery as F, type StorefrontSite as G, createStorefrontClient as H, type Page as P, type RequestOptions as R, STOREFRONT_API_PATH as S, type CheckoutSession as a, type ConfirmCheckoutSessionInput as b, type ConfirmCheckoutSessionRequest as c, type ContentListQuery as d, type CreateCheckoutSessionInput as e, type CreateCheckoutSessionOptions as f, type CreatedCheckoutSession as g, type StorefrontBooking as h, type StorefrontBuilding as i, type StorefrontClient as j, type StorefrontClientOptions as k, type StorefrontContactInput as l, type StorefrontContentItem as m, type StorefrontContentModel as n, type StorefrontContentRef as o, type StorefrontGuestInput as p, type StorefrontGuide as q, type StorefrontGuideItem as r, type StorefrontImage as s, type StorefrontListing as t, type StorefrontListingFacets as u, type StorefrontListingSort as v, type StorefrontListingSummary as w, type StorefrontListingsQuery as x, type StorefrontLocation as y, type StorefrontQuote as z };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { d as StorefrontStay, S as StorefrontAvailability, c as StorefrontCalendarQuery, a as StorefrontCalendar } from './availability-CnzmxuV3.js';
2
+ import { e as StorefrontStay, a as StorefrontBuildingAvailabilityQuery, g as StorefrontUnitAvailability, S as StorefrontAvailability, d as StorefrontCalendarQuery, b as StorefrontCalendar } from './availability-Dh0yLSkj.js';
3
3
 
4
4
  declare const storefrontGuestInputSchema: z.ZodObject<{
5
5
  firstName: z.ZodString;
@@ -76,6 +76,8 @@ declare const storefrontListingSummarySchema: z.ZodObject<{
76
76
  latitude: z.ZodNullable<z.ZodNumber>;
77
77
  longitude: z.ZodNullable<z.ZodNumber>;
78
78
  bookable: z.ZodBoolean;
79
+ fromPriceMinor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
80
+ currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
79
81
  }, z.core.$strip>;
80
82
  type StorefrontListingSummary = z.infer<typeof storefrontListingSummarySchema>;
81
83
  declare const storefrontImageSchema: z.ZodObject<{
@@ -100,6 +102,8 @@ declare const storefrontListingSchema: z.ZodObject<{
100
102
  latitude: z.ZodNullable<z.ZodNumber>;
101
103
  longitude: z.ZodNullable<z.ZodNumber>;
102
104
  bookable: z.ZodBoolean;
105
+ fromPriceMinor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
106
+ currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
107
  buildingSlug: z.ZodString;
104
108
  buildingAddress: z.ZodUnknown;
105
109
  description: z.ZodNullable<z.ZodString>;
@@ -116,18 +120,45 @@ declare const storefrontListingSchema: z.ZodObject<{
116
120
  checkInTime: z.ZodNullable<z.ZodString>;
117
121
  checkOutTime: z.ZodNullable<z.ZodString>;
118
122
  beds: z.ZodNullable<z.ZodNumber>;
119
- fromPriceMinor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
120
- currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
121
123
  countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
122
124
  }, z.core.$strip>;
123
125
  type StorefrontListing = z.infer<typeof storefrontListingSchema>;
124
- declare const storefrontListingsQuerySchema: z.ZodObject<{
125
- location: z.ZodOptional<z.ZodString>;
126
- building: z.ZodOptional<z.ZodUUID>;
127
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
128
- offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
126
+ declare const STOREFRONT_LISTING_SORTS: readonly ["recommended", "price_asc", "price_desc", "rating"];
127
+ type StorefrontListingSort = (typeof STOREFRONT_LISTING_SORTS)[number];
128
+ interface StorefrontListingsQuery {
129
+ location?: string | readonly string[];
130
+ building?: string;
131
+ guests?: number;
132
+ bedrooms?: number;
133
+ currency?: string;
134
+ priceMin?: number;
135
+ priceMax?: number;
136
+ amenities?: readonly string[];
137
+ bounds?: readonly [number, number, number, number] | string;
138
+ sort?: StorefrontListingSort;
139
+ facets?: boolean;
140
+ limit?: number;
141
+ offset?: number;
142
+ }
143
+ declare const storefrontListingFacetsSchema: z.ZodObject<{
144
+ total: z.ZodNumber;
145
+ areas: z.ZodArray<z.ZodObject<{
146
+ id: z.ZodUUID;
147
+ slug: z.ZodNullable<z.ZodString>;
148
+ count: z.ZodNumber;
149
+ }, z.core.$strip>>;
150
+ bedrooms: z.ZodArray<z.ZodObject<{
151
+ bedrooms: z.ZodNumber;
152
+ count: z.ZodNumber;
153
+ }, z.core.$strip>>;
154
+ price: z.ZodNullable<z.ZodObject<{
155
+ min: z.ZodNumber;
156
+ max: z.ZodNumber;
157
+ currency: z.ZodNullable<z.ZodString>;
158
+ buckets: z.ZodArray<z.ZodNumber>;
159
+ }, z.core.$strip>>;
129
160
  }, z.core.$strip>;
130
- type StorefrontListingsQuery = z.infer<typeof storefrontListingsQuerySchema>;
161
+ type StorefrontListingFacets = z.infer<typeof storefrontListingFacetsSchema>;
131
162
  declare const storefrontBuildingSchema: z.ZodObject<{
132
163
  id: z.ZodUUID;
133
164
  locationId: z.ZodNullable<z.ZodUUID>;
@@ -442,6 +473,45 @@ declare const storefrontContentModelSchema: z.ZodObject<{
442
473
  }, z.core.$strip>;
443
474
  type StorefrontContentModel = z.infer<typeof storefrontContentModelSchema>;
444
475
 
476
+ declare const storefrontGuideItemSchema: z.ZodObject<{
477
+ id: z.ZodUUID;
478
+ title: z.ZodNullable<z.ZodString>;
479
+ description: z.ZodNullable<z.ZodString>;
480
+ address: z.ZodNullable<z.ZodString>;
481
+ latitude: z.ZodNullable<z.ZodNumber>;
482
+ longitude: z.ZodNullable<z.ZodNumber>;
483
+ googleMapsUrl: z.ZodNullable<z.ZodString>;
484
+ websiteUrl: z.ZodNullable<z.ZodString>;
485
+ imageUrl: z.ZodNullable<z.ZodString>;
486
+ categories: z.ZodArray<z.ZodString>;
487
+ priceLevel: z.ZodNullable<z.ZodNumber>;
488
+ rating: z.ZodNullable<z.ZodNumber>;
489
+ ratingsCount: z.ZodNullable<z.ZodNumber>;
490
+ }, z.core.$strip>;
491
+ type StorefrontGuideItem = z.infer<typeof storefrontGuideItemSchema>;
492
+ declare const storefrontGuideSchema: z.ZodObject<{
493
+ id: z.ZodUUID;
494
+ name: z.ZodString;
495
+ category: z.ZodNullable<z.ZodString>;
496
+ coverImageUrl: z.ZodNullable<z.ZodString>;
497
+ items: z.ZodArray<z.ZodObject<{
498
+ id: z.ZodUUID;
499
+ title: z.ZodNullable<z.ZodString>;
500
+ description: z.ZodNullable<z.ZodString>;
501
+ address: z.ZodNullable<z.ZodString>;
502
+ latitude: z.ZodNullable<z.ZodNumber>;
503
+ longitude: z.ZodNullable<z.ZodNumber>;
504
+ googleMapsUrl: z.ZodNullable<z.ZodString>;
505
+ websiteUrl: z.ZodNullable<z.ZodString>;
506
+ imageUrl: z.ZodNullable<z.ZodString>;
507
+ categories: z.ZodArray<z.ZodString>;
508
+ priceLevel: z.ZodNullable<z.ZodNumber>;
509
+ rating: z.ZodNullable<z.ZodNumber>;
510
+ ratingsCount: z.ZodNullable<z.ZodNumber>;
511
+ }, z.core.$strip>>;
512
+ }, z.core.$strip>;
513
+ type StorefrontGuide = z.infer<typeof storefrontGuideSchema>;
514
+
445
515
  declare const storefrontRatePlanQuoteSchema: z.ZodObject<{
446
516
  ratePlanId: z.ZodString;
447
517
  name: z.ZodString;
@@ -519,16 +589,23 @@ interface StorefrontClient {
519
589
  get(opts?: RequestOptions): Promise<StorefrontSite>;
520
590
  };
521
591
  listings: {
522
- list(query?: Partial<StorefrontListingsQuery>, opts?: RequestOptions): Promise<Page<StorefrontListingSummary>>;
592
+ list(query?: StorefrontListingsQuery, opts?: RequestOptions): Promise<Page<StorefrontListingSummary> & {
593
+ facets?: StorefrontListingFacets;
594
+ }>;
523
595
  get(id: string, opts?: RequestOptions): Promise<StorefrontListing>;
524
596
  };
525
597
  buildings: {
526
598
  list(opts?: RequestOptions): Promise<StorefrontBuilding[]>;
527
599
  get(id: string, opts?: RequestOptions): Promise<StorefrontBuilding>;
600
+ availability(id: string, query: StorefrontStay & Partial<Pick<StorefrontBuildingAvailabilityQuery, 'limit' | 'offset'>>, opts?: RequestOptions): Promise<Page<StorefrontUnitAvailability>>;
528
601
  };
529
602
  locations: {
530
603
  list(opts?: RequestOptions): Promise<StorefrontLocation[]>;
531
604
  };
605
+ guides: {
606
+ list(opts?: RequestOptions): Promise<StorefrontGuide[]>;
607
+ get(id: string, opts?: RequestOptions): Promise<StorefrontGuide | null>;
608
+ };
532
609
  contentModel: {
533
610
  get(opts?: RequestOptions): Promise<StorefrontContentModel>;
534
611
  };
@@ -569,4 +646,4 @@ interface StorefrontClient {
569
646
  }
570
647
  declare function createStorefrontClient(options: StorefrontClientOptions): StorefrontClient;
571
648
 
572
- export { type StorefrontSite as A, type BookingResult as B, type CheckoutMountDescriptor as C, createStorefrontClient as D, type Page as P, type RequestOptions as R, STOREFRONT_API_PATH as S, type CheckoutSession as a, type ConfirmCheckoutSessionInput as b, type ConfirmCheckoutSessionRequest as c, type ContentListQuery as d, type CreateCheckoutSessionInput as e, type CreateCheckoutSessionOptions as f, type CreatedCheckoutSession as g, type StorefrontBooking as h, type StorefrontBuilding as i, type StorefrontClient as j, type StorefrontClientOptions as k, type StorefrontContactInput as l, type StorefrontContentItem as m, type StorefrontContentModel as n, type StorefrontContentRef as o, type StorefrontGuestInput as p, type StorefrontImage as q, type StorefrontListing as r, type StorefrontListingSummary as s, type StorefrontListingsQuery as t, type StorefrontLocation as u, type StorefrontQuote as v, type StorefrontQuoteInput as w, type StorefrontRatePlanQuote as x, type StorefrontReview as y, type StorefrontReviewsQuery as z };
649
+ export { type StorefrontQuoteInput as A, type BookingResult as B, type CheckoutMountDescriptor as C, type StorefrontRatePlanQuote as D, type StorefrontReview as E, type StorefrontReviewsQuery as F, type StorefrontSite as G, createStorefrontClient as H, type Page as P, type RequestOptions as R, STOREFRONT_API_PATH as S, type CheckoutSession as a, type ConfirmCheckoutSessionInput as b, type ConfirmCheckoutSessionRequest as c, type ContentListQuery as d, type CreateCheckoutSessionInput as e, type CreateCheckoutSessionOptions as f, type CreatedCheckoutSession as g, type StorefrontBooking as h, type StorefrontBuilding as i, type StorefrontClient as j, type StorefrontClientOptions as k, type StorefrontContactInput as l, type StorefrontContentItem as m, type StorefrontContentModel as n, type StorefrontContentRef as o, type StorefrontGuestInput as p, type StorefrontGuide as q, type StorefrontGuideItem as r, type StorefrontImage as s, type StorefrontListing as t, type StorefrontListingFacets as u, type StorefrontListingSort as v, type StorefrontListingSummary as w, type StorefrontListingsQuery as x, type StorefrontLocation as y, type StorefrontQuote as z };
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkEVSAMV5K_cjs = require('./chunk-EVSAMV5K.cjs');
4
- var chunkLVFRVNT3_cjs = require('./chunk-LVFRVNT3.cjs');
4
+ var chunkEHQFWSP6_cjs = require('./chunk-EHQFWSP6.cjs');
5
5
  var react = require('react');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
 
8
- var monthFormat=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric",timeZone:"UTC"});var dayFormat=new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeZone:"UTC"});var WEEKDAYS=["Su","Mo","Tu","We","Th","Fr","Sa"];var utc=isoDate=>new Date(`${isoDate}T00:00:00Z`);var defaultLabels={dateRangePicker:{month:monthStart=>monthFormat.format(utc(monthStart)),weekday:dayIndex=>WEEKDAYS[dayIndex]??"",day:date=>dayFormat.format(utc(date)),previousMonth:"Previous month",nextMonth:"Next month"},guestPicker:{adults:"Adults",children:"Children",increment:field=>`Add ${field}`,decrement:field=>`Remove ${field}`},gallery:{region:"Photos",photo:(index,total)=>`Photo ${index+1} of ${total}`,previous:"Previous photo",next:"Next photo"}};function unavailableDates(days){return days.filter(d=>d.status!=="available").map(d=>d.date)}var DAY_MS=864e5;var toTime=date=>Date.parse(`${date}T00:00:00Z`);var fromTime=time=>new Date(time).toISOString().slice(0,10);var addDays=(date,days)=>fromTime(toTime(date)+days*DAY_MS);var monthOf=date=>`${date.slice(0,7)}-01`;function addMonths(monthStart,months){const d=new Date(toTime(monthStart));d.setUTCMonth(d.getUTCMonth()+months,1);return fromTime(d.getTime())}function localToday(){const now=new Date;const pad=n=>String(n).padStart(2,"0");return `${now.getFullYear()}-${pad(now.getMonth()+1)}-${pad(now.getDate())}`}function monthWeeks(monthStart,weekStartsOn){const lead=(new Date(toTime(monthStart)).getUTCDay()-weekStartsOn+7)%7;const next=addMonths(monthStart,1);const cells=Array.from({length:lead},()=>null);for(let d=monthStart;d<next;d=addDays(d,1))cells.push(d);while(cells.length%7)cells.push(null);return Array.from({length:cells.length/7},(_,w)=>cells.slice(w*7,w*7+7))}function DateRangePicker({value,onChange,unavailable,minNights=1,today:todayProp,defaultMonth,weekStartsOn=0,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.dateRangePicker,...labelsProp};const today=todayProp??localToday();const blocked=react.useMemo(()=>new Set(unavailable??[]),[unavailable]);const[focused,setFocused]=react.useState(()=>value.checkIn??today);const[month,setMonth]=react.useState(()=>defaultMonth?`${defaultMonth}-01`:monthOf(value.checkIn??today));const[shownCheckIn,setShownCheckIn]=react.useState(value.checkIn);if(value.checkIn!==shownCheckIn){setShownCheckIn(value.checkIn);if(value.checkIn!==null){setFocused(value.checkIn);setMonth(monthOf(value.checkIn));}}const grid=react.useRef(null);const moveFocus=react.useRef(false);react.useEffect(()=>{if(!moveFocus.current)return;moveFocus.current=false;grid.current?.querySelector(`[data-date="${focused}"]`)?.focus();},[focused,month]);const{checkIn,checkOut}=value;const pickingEnd=checkIn!==null&&checkOut===null;const nightFree=d=>d>=today&&!blocked.has(d);const validEnd=d=>{if(checkIn===null||d<=checkIn)return false;if((toTime(d)-toTime(checkIn))/DAY_MS<minNights)return false;for(let n=checkIn;n<d;n=addDays(n,1))if(!nightFree(n))return false;return true};const disabled=d=>pickingEnd&&checkIn!==null&&d>checkIn?!validEnd(d):!nightFree(d);function select(d){if(disabled(d))return;onChange(pickingEnd&&checkIn!==null&&d>checkIn?{checkIn,checkOut:d}:{checkIn:d,checkOut:null});}function stateOf(d){if(d===checkIn)return "start";if(d===checkOut)return "end";if(checkIn!==null&&checkOut!==null&&d>checkIn&&d<checkOut)return "in-range";return disabled(d)?"disabled":"available"}function focusDate(d){moveFocus.current=true;setFocused(d);setMonth(monthOf(d));}function onKeyDown(event,d){const step={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[event.key];if(step!==void 0){event.preventDefault();focusDate(addDays(d,step));}else if(event.key==="Enter"||event.key===" "){event.preventDefault();select(d);}}const tabStop=monthOf(focused)===month?focused:month;const weekdays=Array.from({length:7},(_,i)=>(i+weekStartsOn)%7);return jsxRuntime.jsxs("div",{className,children:[jsxRuntime.jsxs("div",{className:classNames.header,children:[jsxRuntime.jsx("button",{type:"button",className:classNames.nav,"aria-label":labels.previousMonth,onClick:()=>setMonth(addMonths(month,-1)),children:"\u2039"}),jsxRuntime.jsx("span",{className:classNames.title,"aria-live":"polite",children:labels.month(month)}),jsxRuntime.jsx("button",{type:"button",className:classNames.nav,"aria-label":labels.nextMonth,onClick:()=>setMonth(addMonths(month,1)),children:"\u203A"})]}),jsxRuntime.jsxs("table",{role:"grid","aria-label":labels.month(month),className:classNames.grid,ref:grid,children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsx("tr",{children:weekdays.map(i=>jsxRuntime.jsx("th",{scope:"col",className:classNames.weekday,children:labels.weekday(i)},i))})}),jsxRuntime.jsx("tbody",{children:monthWeeks(month,weekStartsOn).map((week,w)=>jsxRuntime.jsx("tr",{children:week.map((d,i)=>{if(d===null)return jsxRuntime.jsx("td",{role:"gridcell"},`pad-${i}`);const state=stateOf(d);return jsxRuntime.jsx("td",{role:"gridcell","data-date":d,"data-state":state,"data-today":d===today?"":void 0,className:classNames.day,tabIndex:d===tabStop?0:-1,"aria-label":labels.day(d),"aria-selected":state==="start"||state==="end"||state==="in-range","aria-disabled":disabled(d)||void 0,onClick:()=>select(d),onKeyDown:event=>onKeyDown(event,d),onFocus:()=>setFocused(d),children:Number(d.slice(8))},d)})},w))})]})]})}function isRecord(value){return typeof value==="object"&&value!==null}var firstString=(record,keys)=>keys.map(k=>record[k]).find(v=>typeof v==="string"&&v.length>0);function listingPhotos(listingOrPictures){if(isRecord(listingOrPictures)&&!Array.isArray(listingOrPictures)){const{images,pictures:pictures2}=listingOrPictures;if(images?.length){return images.map(({url,alt,width,height})=>({url,caption:alt,width,height}))}return listingPhotos(pictures2)}const pictures=listingOrPictures;if(!Array.isArray(pictures))return [];return pictures.flatMap(picture=>{if(typeof picture==="string")return picture?[{url:picture,caption:null}]:[];if(!isRecord(picture))return [];const url=firstString(picture,["original","url","large","regular","original_path","image_path","thumbnail","thumbnail_path"]);if(!url)return [];return [{url,caption:firstString(picture,["caption","description"])??null}]})}function Gallery({photos,onIndexChange,labels:labelsProp,sizes="100vw",className,classNames={}}){const labels={...defaultLabels.gallery,...labelsProp};const[index,setIndex]=react.useState(0);const total=photos.length;const current=Math.min(index,Math.max(0,total-1));const go=next=>{if(next<0||next>=total||next===current)return;setIndex(next);onIndexChange?.(next);};const onKeyDown=event=>{if(event.key==="ArrowLeft")go(current-1);else if(event.key==="ArrowRight")go(current+1);};return jsxRuntime.jsxs("section",{role:"region","aria-roledescription":"carousel","aria-label":labels.region,className,onKeyDown,children:[jsxRuntime.jsx("div",{className:classNames.viewport,"aria-live":"polite",children:photos.map((photo,i)=>jsxRuntime.jsx("div",{role:"group","aria-roledescription":"slide","aria-label":labels.photo(i,total),"data-state":i===current?"active":"inactive",hidden:i!==current,className:classNames.slide,children:jsxRuntime.jsx("img",{...chunkEVSAMV5K_cjs.cdnImageProps(photo.url,1080,sizes),...photo.width&&photo.height?{width:photo.width,height:photo.height}:{},alt:photo.caption||labels.photo(i,total),loading:i===0?"eager":"lazy",decoding:"async",className:classNames.image})},`${i}-${photo.url}`))}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.previous,disabled:current===0,onClick:()=>go(current-1),children:"\u2039"}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.next,disabled:current>=total-1,onClick:()=>go(current+1),children:"\u203A"})]})}function GuestPicker({value,onChange,max=chunkLVFRVNT3_cjs.STOREFRONT_MAX_GUESTS,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.guestPicker,...labelsProp};const id=react.useId();const fields=[{key:"adults",label:labels.adults,min:1,max:Math.max(value.adults,max-value.children)},{key:"children",label:labels.children,min:0,max:Math.max(value.children,max-value.adults)}];return jsxRuntime.jsx("div",{className,children:fields.map(field=>{const now=value[field.key];const set=next=>{const clamped=Math.min(field.max,Math.max(field.min,next));if(clamped!==now)onChange({...value,[field.key]:clamped});};const onKeyDown=event=>{const next={ArrowUp:now+1,ArrowRight:now+1,ArrowDown:now-1,ArrowLeft:now-1,Home:field.min,End:field.max}[event.key];if(next===void 0)return;event.preventDefault();set(next);};const labelId=`${id}-${field.key}`;return jsxRuntime.jsxs("div",{className:classNames.field,"data-field":field.key,children:[jsxRuntime.jsx("span",{id:labelId,className:classNames.label,children:field.label}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.decrement(field.label),disabled:now<=field.min,onClick:()=>set(now-1),children:"\u2212"}),jsxRuntime.jsx("div",{role:"spinbutton",tabIndex:0,className:classNames.value,"aria-labelledby":labelId,"aria-valuenow":now,"aria-valuemin":field.min,"aria-valuemax":field.max,onKeyDown,children:now}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.increment(field.label),disabled:now>=field.max,onClick:()=>set(now+1),children:"+"})]},field.key)})})}var usable=(lat,lng)=>typeof lat==="number"&&typeof lng==="number"&&Number.isFinite(lat)&&Number.isFinite(lng)&&Math.abs(lat)<=90&&Math.abs(lng)<=180;function Map({listings,children}){const markers=[];for(const listing of listings){if(usable(listing.latitude,listing.longitude)){markers.push({id:listing.id,lat:listing.latitude,lng:listing.longitude,listing});}}const bounds=markers.length===0?null:{north:Math.max(...markers.map(m=>m.lat)),south:Math.min(...markers.map(m=>m.lat)),east:Math.max(...markers.map(m=>m.lng)),west:Math.min(...markers.map(m=>m.lng))};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:children({markers,bounds})})}
8
+ var monthFormat=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric",timeZone:"UTC"});var dayFormat=new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeZone:"UTC"});var WEEKDAYS=["Su","Mo","Tu","We","Th","Fr","Sa"];var utc=isoDate=>new Date(`${isoDate}T00:00:00Z`);var defaultLabels={dateRangePicker:{month:monthStart=>monthFormat.format(utc(monthStart)),weekday:dayIndex=>WEEKDAYS[dayIndex]??"",day:date=>dayFormat.format(utc(date)),previousMonth:"Previous month",nextMonth:"Next month"},guestPicker:{adults:"Adults",children:"Children",increment:field=>`Add ${field}`,decrement:field=>`Remove ${field}`},gallery:{region:"Photos",photo:(index,total)=>`Photo ${index+1} of ${total}`,previous:"Previous photo",next:"Next photo"}};function unavailableDates(days){return days.filter(d=>d.status!=="available").map(d=>d.date)}var DAY_MS=864e5;var toTime=date=>Date.parse(`${date}T00:00:00Z`);var fromTime=time=>new Date(time).toISOString().slice(0,10);var addDays=(date,days)=>fromTime(toTime(date)+days*DAY_MS);var monthOf=date=>`${date.slice(0,7)}-01`;function addMonths(monthStart,months){const d=new Date(toTime(monthStart));d.setUTCMonth(d.getUTCMonth()+months,1);return fromTime(d.getTime())}function localToday(){const now=new Date;const pad=n=>String(n).padStart(2,"0");return `${now.getFullYear()}-${pad(now.getMonth()+1)}-${pad(now.getDate())}`}function monthWeeks(monthStart,weekStartsOn){const lead=(new Date(toTime(monthStart)).getUTCDay()-weekStartsOn+7)%7;const next=addMonths(monthStart,1);const cells=Array.from({length:lead},()=>null);for(let d=monthStart;d<next;d=addDays(d,1))cells.push(d);while(cells.length%7)cells.push(null);return Array.from({length:cells.length/7},(_,w)=>cells.slice(w*7,w*7+7))}function DateRangePicker({value,onChange,unavailable,minNights=1,today:todayProp,defaultMonth,weekStartsOn=0,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.dateRangePicker,...labelsProp};const today=todayProp??localToday();const blocked=react.useMemo(()=>new Set(unavailable??[]),[unavailable]);const[focused,setFocused]=react.useState(()=>value.checkIn??today);const[month,setMonth]=react.useState(()=>defaultMonth?`${defaultMonth}-01`:monthOf(value.checkIn??today));const[shownCheckIn,setShownCheckIn]=react.useState(value.checkIn);if(value.checkIn!==shownCheckIn){setShownCheckIn(value.checkIn);if(value.checkIn!==null){setFocused(value.checkIn);setMonth(monthOf(value.checkIn));}}const grid=react.useRef(null);const moveFocus=react.useRef(false);react.useEffect(()=>{if(!moveFocus.current)return;moveFocus.current=false;grid.current?.querySelector(`[data-date="${focused}"]`)?.focus();},[focused,month]);const{checkIn,checkOut}=value;const pickingEnd=checkIn!==null&&checkOut===null;const nightFree=d=>d>=today&&!blocked.has(d);const validEnd=d=>{if(checkIn===null||d<=checkIn)return false;if((toTime(d)-toTime(checkIn))/DAY_MS<minNights)return false;for(let n=checkIn;n<d;n=addDays(n,1))if(!nightFree(n))return false;return true};const disabled=d=>pickingEnd&&checkIn!==null&&d>checkIn?!validEnd(d):!nightFree(d);function select(d){if(disabled(d))return;onChange(pickingEnd&&checkIn!==null&&d>checkIn?{checkIn,checkOut:d}:{checkIn:d,checkOut:null});}function stateOf(d){if(d===checkIn)return "start";if(d===checkOut)return "end";if(checkIn!==null&&checkOut!==null&&d>checkIn&&d<checkOut)return "in-range";return disabled(d)?"disabled":"available"}function focusDate(d){moveFocus.current=true;setFocused(d);setMonth(monthOf(d));}function onKeyDown(event,d){const step={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[event.key];if(step!==void 0){event.preventDefault();focusDate(addDays(d,step));}else if(event.key==="Enter"||event.key===" "){event.preventDefault();select(d);}}const tabStop=monthOf(focused)===month?focused:month;const weekdays=Array.from({length:7},(_,i)=>(i+weekStartsOn)%7);return jsxRuntime.jsxs("div",{className,children:[jsxRuntime.jsxs("div",{className:classNames.header,children:[jsxRuntime.jsx("button",{type:"button",className:classNames.nav,"aria-label":labels.previousMonth,onClick:()=>setMonth(addMonths(month,-1)),children:"\u2039"}),jsxRuntime.jsx("span",{className:classNames.title,"aria-live":"polite",children:labels.month(month)}),jsxRuntime.jsx("button",{type:"button",className:classNames.nav,"aria-label":labels.nextMonth,onClick:()=>setMonth(addMonths(month,1)),children:"\u203A"})]}),jsxRuntime.jsxs("table",{role:"grid","aria-label":labels.month(month),className:classNames.grid,ref:grid,children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsx("tr",{children:weekdays.map(i=>jsxRuntime.jsx("th",{scope:"col",className:classNames.weekday,children:labels.weekday(i)},i))})}),jsxRuntime.jsx("tbody",{children:monthWeeks(month,weekStartsOn).map((week,w)=>jsxRuntime.jsx("tr",{children:week.map((d,i)=>{if(d===null)return jsxRuntime.jsx("td",{role:"gridcell"},`pad-${i}`);const state=stateOf(d);return jsxRuntime.jsx("td",{role:"gridcell","data-date":d,"data-state":state,"data-today":d===today?"":void 0,className:classNames.day,tabIndex:d===tabStop?0:-1,"aria-label":labels.day(d),"aria-selected":state==="start"||state==="end"||state==="in-range","aria-disabled":disabled(d)||void 0,onClick:()=>select(d),onKeyDown:event=>onKeyDown(event,d),onFocus:()=>setFocused(d),children:Number(d.slice(8))},d)})},w))})]})]})}function isRecord(value){return typeof value==="object"&&value!==null}var firstString=(record,keys)=>keys.map(k=>record[k]).find(v=>typeof v==="string"&&v.length>0);function listingPhotos(listingOrPictures){if(isRecord(listingOrPictures)&&!Array.isArray(listingOrPictures)){const{images,pictures:pictures2}=listingOrPictures;if(images?.length){return images.map(({url,alt,width,height})=>({url,caption:alt,width,height}))}return listingPhotos(pictures2)}const pictures=listingOrPictures;if(!Array.isArray(pictures))return [];return pictures.flatMap(picture=>{if(typeof picture==="string")return picture?[{url:picture,caption:null}]:[];if(!isRecord(picture))return [];const url=firstString(picture,["original","url","large","regular","original_path","image_path","thumbnail","thumbnail_path"]);if(!url)return [];return [{url,caption:firstString(picture,["caption","description"])??null}]})}function Gallery({photos,onIndexChange,labels:labelsProp,sizes="100vw",className,classNames={}}){const labels={...defaultLabels.gallery,...labelsProp};const[index,setIndex]=react.useState(0);const total=photos.length;const current=Math.min(index,Math.max(0,total-1));const go=next=>{if(next<0||next>=total||next===current)return;setIndex(next);onIndexChange?.(next);};const onKeyDown=event=>{if(event.key==="ArrowLeft")go(current-1);else if(event.key==="ArrowRight")go(current+1);};return jsxRuntime.jsxs("section",{role:"region","aria-roledescription":"carousel","aria-label":labels.region,className,onKeyDown,children:[jsxRuntime.jsx("div",{className:classNames.viewport,"aria-live":"polite",children:photos.map((photo,i)=>jsxRuntime.jsx("div",{role:"group","aria-roledescription":"slide","aria-label":labels.photo(i,total),"data-state":i===current?"active":"inactive",hidden:i!==current,className:classNames.slide,children:jsxRuntime.jsx("img",{...chunkEVSAMV5K_cjs.cdnImageProps(photo.url,1080,sizes),...photo.width&&photo.height?{width:photo.width,height:photo.height}:{},alt:photo.caption||labels.photo(i,total),loading:i===0?"eager":"lazy",decoding:"async",className:classNames.image})},`${i}-${photo.url}`))}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.previous,disabled:current===0,onClick:()=>go(current-1),children:"\u2039"}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.next,disabled:current>=total-1,onClick:()=>go(current+1),children:"\u203A"})]})}function GuestPicker({value,onChange,max=chunkEHQFWSP6_cjs.STOREFRONT_MAX_GUESTS,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.guestPicker,...labelsProp};const id=react.useId();const fields=[{key:"adults",label:labels.adults,min:1,max:Math.max(value.adults,max-value.children)},{key:"children",label:labels.children,min:0,max:Math.max(value.children,max-value.adults)}];return jsxRuntime.jsx("div",{className,children:fields.map(field=>{const now=value[field.key];const set=next=>{const clamped=Math.min(field.max,Math.max(field.min,next));if(clamped!==now)onChange({...value,[field.key]:clamped});};const onKeyDown=event=>{const next={ArrowUp:now+1,ArrowRight:now+1,ArrowDown:now-1,ArrowLeft:now-1,Home:field.min,End:field.max}[event.key];if(next===void 0)return;event.preventDefault();set(next);};const labelId=`${id}-${field.key}`;return jsxRuntime.jsxs("div",{className:classNames.field,"data-field":field.key,children:[jsxRuntime.jsx("span",{id:labelId,className:classNames.label,children:field.label}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.decrement(field.label),disabled:now<=field.min,onClick:()=>set(now-1),children:"\u2212"}),jsxRuntime.jsx("div",{role:"spinbutton",tabIndex:0,className:classNames.value,"aria-labelledby":labelId,"aria-valuenow":now,"aria-valuemin":field.min,"aria-valuemax":field.max,onKeyDown,children:now}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.increment(field.label),disabled:now>=field.max,onClick:()=>set(now+1),children:"+"})]},field.key)})})}var usable=(lat,lng)=>typeof lat==="number"&&typeof lng==="number"&&Number.isFinite(lat)&&Number.isFinite(lng)&&Math.abs(lat)<=90&&Math.abs(lng)<=180;function Map({listings,children}){const markers=[];for(const listing of listings){if(usable(listing.latitude,listing.longitude)){markers.push({id:listing.id,lat:listing.latitude,lng:listing.longitude,listing});}}const bounds=markers.length===0?null:{north:Math.max(...markers.map(m=>m.lat)),south:Math.min(...markers.map(m=>m.lat)),east:Math.max(...markers.map(m=>m.lng)),west:Math.min(...markers.map(m=>m.lng))};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:children({markers,bounds})})}
9
9
 
10
10
  exports.DateRangePicker = DateRangePicker;
11
11
  exports.Gallery = Gallery;
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { b as StorefrontCalendarDay } from './availability-CnzmxuV3.cjs';
3
+ import { c as StorefrontCalendarDay } from './availability-Dh0yLSkj.cjs';
4
4
  import 'zod';
5
5
 
6
6
  declare const defaultLabels: {
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { b as StorefrontCalendarDay } from './availability-CnzmxuV3.js';
3
+ import { c as StorefrontCalendarDay } from './availability-Dh0yLSkj.js';
4
4
  import 'zod';
5
5
 
6
6
  declare const defaultLabels: {
@@ -1,5 +1,5 @@
1
1
  import { cdnImageProps } from './chunk-A43EXKPY.js';
2
- import { STOREFRONT_MAX_GUESTS } from './chunk-6NFURJXI.js';
2
+ import { STOREFRONT_MAX_GUESTS } from './chunk-IBCBDAGY.js';
3
3
  import { useMemo, useState, useRef, useEffect, useId } from 'react';
4
4
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
5
 
package/dist/config.cjs CHANGED
@@ -3,12 +3,19 @@
3
3
  var chunkZLAOY6IF_cjs = require('./chunk-ZLAOY6IF.cjs');
4
4
  var zod = require('zod');
5
5
 
6
- var STOREFRONT_LOCALES=["en","fr","es","de","it","pt","nl"];var REQUIRED="validation.required";var TOO_LONG="validation.max_length";var TOO_MANY="validation.too_large";var INVALID="validation.invalid";var text=max=>zod.z.string(INVALID).max(max,TOO_LONG);var localeSchema=zod.z.enum(STOREFRONT_LOCALES,"validation.storefront.locale_unsupported");var hexSchema=zod.z.string(INVALID).regex(/^#[0-9A-Fa-f]{6}$/,"validation.storefront.color_hex");var assetUrlSchema=zod.z.url({protocol:/^https$/,error:"validation.storefront.url_https"});var localizedSchema=zod.z.partialRecord(localeSchema,text(200),INVALID);var linkSchema=zod.z.object({label:localizedSchema,href:text(500).regex(/^(\/(?!\/)|https:\/\/)/,"validation.storefront.link_href")},INVALID);var fontSchema=zod.z.enum(chunkZLAOY6IF_cjs.STOREFRONT_FONTS,"validation.invalid_option");var storefrontSiteConfigSchema=zod.z.object({brand:zod.z.object({name:text(80).min(1,REQUIRED),logoUrl:assetUrlSchema.nullable(),faviconUrl:assetUrlSchema.nullable()},INVALID),colors:zod.z.object({primary:hexSchema,primaryForeground:hexSchema,background:hexSchema,foreground:hexSchema,accent:hexSchema},INVALID),fonts:zod.z.object({heading:fontSchema,body:fontSchema},INVALID),nav:zod.z.array(linkSchema,INVALID).max(8,TOO_MANY),footer:zod.z.object({text:localizedSchema,links:zod.z.array(linkSchema,INVALID).max(12,TOO_MANY)},INVALID),defaultLocale:localeSchema,locales:zod.z.array(localeSchema,INVALID).min(1,REQUIRED).max(STOREFRONT_LOCALES.length,TOO_MANY),seo:zod.z.object({titleTemplate:text(80).includes("%s",{error:"validation.storefront.title_template_placeholder"}),defaultDescription:localizedSchema,ogImageUrl:assetUrlSchema.nullable()},INVALID)},INVALID).refine(c=>c.locales.includes(c.defaultLocale),{path:["defaultLocale"],message:"validation.storefront.default_locale_not_listed"});function defineSuiteOpConfig(config){return storefrontSiteConfigSchema.parse(config)}
6
+ var STOREFRONT_LOCALES=["en","fr","es","de","it","pt","nl"];var STOREFRONT_LAYOUTS=["listings","locations","areas","single"];var STOREFRONT_THEMES=["folio","hearth","circuit","tide","noir","fjord"];var REQUIRED="validation.required";var TOO_LONG="validation.max_length";var TOO_MANY="validation.too_large";var INVALID="validation.invalid";var text=max=>zod.z.string(INVALID).max(max,TOO_LONG);var localeSchema=zod.z.enum(STOREFRONT_LOCALES,"validation.storefront.locale_unsupported");var hexSchema=zod.z.string(INVALID).regex(/^#[0-9A-Fa-f]{6}$/,"validation.storefront.color_hex");var assetUrlSchema=zod.z.url({protocol:/^https$/,error:"validation.storefront.url_https"});var localizedSchema=zod.z.partialRecord(localeSchema,text(200),INVALID);var linkSchema=zod.z.object({label:localizedSchema,href:text(500).regex(/^(\/(?!\/)|https:\/\/)/,"validation.storefront.link_href")},INVALID);var fontSchema=zod.z.enum(chunkZLAOY6IF_cjs.STOREFRONT_FONTS,"validation.invalid_option");var storefrontSiteConfigSchema=zod.z.object({layout:zod.z.enum(STOREFRONT_LAYOUTS).optional().catch(void 0),theme:zod.z.enum(STOREFRONT_THEMES).optional().catch(void 0),brand:zod.z.object({name:text(80).min(1,REQUIRED),logoUrl:assetUrlSchema.nullable(),logoOnDarkUrl:assetUrlSchema.nullable().optional(),faviconUrl:assetUrlSchema.nullable()},INVALID),colors:zod.z.object({primary:hexSchema,secondary:hexSchema.nullable().optional(),primaryForeground:hexSchema.optional(),background:hexSchema.optional(),foreground:hexSchema.optional(),accent:hexSchema.optional()},INVALID),fonts:zod.z.object({heading:fontSchema.optional(),body:fontSchema.optional()},INVALID).optional(),nav:zod.z.array(linkSchema,INVALID).max(8,TOO_MANY),footer:zod.z.object({text:localizedSchema,links:zod.z.array(linkSchema,INVALID).max(12,TOO_MANY)},INVALID),defaultLocale:localeSchema,locales:zod.z.array(localeSchema,INVALID).min(1,REQUIRED).max(STOREFRONT_LOCALES.length,TOO_MANY),seo:zod.z.object({titleTemplate:text(80).includes("%s",{error:"validation.storefront.title_template_placeholder"}),defaultDescription:localizedSchema,ogImageUrl:assetUrlSchema.nullable()},INVALID)},INVALID).refine(c=>c.locales.includes(c.defaultLocale),{path:["defaultLocale"],message:"validation.storefront.default_locale_not_listed"});var DEFAULT_STOREFRONT_LAYOUT="listings";var DEFAULT_STOREFRONT_THEME="tide";var STOREFRONT_THEME_RECIPES={folio:{mode:"light",fonts:{heading:"eb_garamond",body:"libre_franklin"},radius:{sm:0,md:0,lg:0,btn:0},btn:{size:12,w:600,ls:"0.14em",tt:"uppercase",h:46},type:{display:[88,1,400,"-0.015em"],h1:[56,1.05,400,"-0.01em"],h2:[36,1.15,400,"0"],h3:[24,1.25,500,"0"],body:[18,1.6,400,"0"],small:[14,1.5,400,"0"],label:[11,1.3,600,"0.16em","uppercase"]},space:{section:144,gutter:32},neutral:{hue:null,mix:0,c:.006},L:{bg:.985,surface:1,surface2:.955,tint:.95,border:.87,ink:.19,muted:.47,dark:.22},C:{ink:.02,dark:.04,tint:.022},shadow:false},hearth:{mode:"light",fonts:{heading:"lora",body:"karla"},radius:{sm:6,md:12,lg:18,btn:8},btn:{size:15,w:700,ls:"0",tt:"none",h:48},type:{display:[64,1.08,500,"-0.01em"],h1:[48,1.12,500,"-0.01em"],h2:[32,1.2,500,"0"],h3:[22,1.3,600,"0"],body:[17,1.6,400,"0"],small:[14,1.5,400,"0"],label:[12,1.3,700,"0.1em","uppercase"]},space:{section:112,gutter:28},neutral:{hue:75,mix:.85,c:.014},L:{bg:.972,surface:.99,surface2:.945,tint:.935,border:.885,ink:.25,muted:.48,dark:.28},C:{ink:.025,dark:.05,tint:.032},shadow:true},circuit:{mode:"light",fonts:{heading:"space_grotesk",body:"ibm_plex_sans"},radius:{sm:8,md:12,lg:16,btn:999},btn:{size:15,w:600,ls:"-0.005em",tt:"none",h:44},type:{display:[64,1.02,600,"-0.035em"],h1:[44,1.08,600,"-0.03em"],h2:[30,1.15,600,"-0.02em"],h3:[20,1.3,600,"-0.01em"],body:[16,1.55,400,"0"],small:[14,1.45,400,"0"],label:[12,1.3,600,"0.02em"]},space:{section:88,gutter:20},neutral:{hue:null,mix:0,c:.004},L:{bg:1,surface:.975,surface2:.958,tint:.958,border:.915,ink:.17,muted:.48,dark:.19},C:{ink:.012,dark:.03,tint:.035},shadow:true},tide:{mode:"light",fonts:{heading:"outfit",body:"mulish"},radius:{sm:12,md:20,lg:28,btn:999},btn:{size:15,w:700,ls:"0.01em",tt:"none",h:50},type:{display:[76,1.02,300,"-0.02em"],h1:[48,1.1,400,"-0.015em"],h2:[34,1.15,400,"-0.01em"],h3:[21,1.3,500,"0"],body:[17,1.6,400,"0"],small:[14,1.5,400,"0"],label:[12,1.3,700,"0.08em","uppercase"]},space:{section:120,gutter:24},neutral:{hue:null,mix:0,c:.005},L:{bg:.99,surface:.968,surface2:.945,tint:.95,border:.905,ink:.26,muted:.48,dark:.29},C:{ink:.035,dark:.055,tint:.028},shadow:true},noir:{mode:"dark",fonts:{heading:"cormorant_garamond",body:"manrope"},radius:{sm:0,md:2,lg:2,btn:0},btn:{size:11,w:600,ls:"0.22em",tt:"uppercase",h:48},type:{display:[84,1,300,"0.02em","uppercase"],h1:[56,1.05,300,"0.01em"],h2:[38,1.15,400,"0"],h3:[24,1.25,500,"0.02em"],body:[16,1.7,400,"0"],small:[13,1.55,400,"0.01em"],label:[11,1.3,600,"0.24em","uppercase"]},space:{section:152,gutter:32},neutral:{hue:null,mix:0,c:.016},L:{bg:.165,surface:.205,surface2:.245,tint:.24,border:.34,ink:.94,muted:.76,dark:.12},C:{ink:.01,dark:.014,tint:.035},shadow:false},fjord:{mode:"light",fonts:{heading:"dm_sans",body:"dm_sans"},radius:{sm:2,md:4,lg:6,btn:4},btn:{size:14,w:500,ls:"0",tt:"none",h:44},type:{display:[60,1.05,500,"-0.03em"],h1:[42,1.1,500,"-0.025em"],h2:[28,1.2,500,"-0.015em"],h3:[19,1.35,500,"-0.005em"],body:[16,1.6,400,"0"],small:[13,1.5,400,"0"],label:[12,1.3,500,"0"]},space:{section:128,gutter:24},neutral:{hue:85,mix:.85,c:.006},L:{bg:.976,surface:.995,surface2:.948,tint:.945,border:.895,ink:.23,muted:.49,dark:.26},C:{ink:.008,dark:.02,tint:.022},shadow:false}};var clamp=(v,a,b)=>Math.min(b,Math.max(a,v));var toLin=c=>c<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4);var toGam=c=>c<=.0031308?12.92*c:1.055*Math.pow(c,1/2.4)-.055;var hexToRgb=hex=>{const h=hex.replace("#","");return [0,2,4].map(i=>parseInt(h.slice(i,i+2),16)/255)};var rgbToHex=rgb=>"#"+rgb.map(v=>Math.round(clamp(v,0,1)*255).toString(16).padStart(2,"0")).join("").toUpperCase();function hexToOklch(hex){const[r,g,b]=hexToRgb(hex).map(toLin);const l=Math.cbrt(.4122214708*r+.5363325363*g+.0514459929*b);const m=Math.cbrt(.2119034982*r+.6806995451*g+.1073969566*b);const s=Math.cbrt(.0883024619*r+.2817188376*g+.6299787005*b);const L=.2104542553*l+.793617785*m-.0040720468*s;const A=1.9779984951*l-2.428592205*m+.4505937099*s;const B=.0259040371*l+.7827717662*m-.808675766*s;let H=Math.atan2(B,A)*180/Math.PI;if(H<0)H+=360;return [L,Math.sqrt(A*A+B*B),H]}function oklchToLinear(L,C,H){const a=C*Math.cos(H*Math.PI/180);const b=C*Math.sin(H*Math.PI/180);const l=(L+.3963377774*a+.2158037573*b)**3;const m=(L-.1055613458*a-.0638541728*b)**3;const s=(L-.0894841775*a-1.291485548*b)**3;return [4.0767416621*l-3.3077115913*m+.2309699292*s,-1.2684380046*l+2.6097574011*m-.3413193965*s,-0.0041960863*l-.7034186147*m+1.707614701*s]}var inGamut=rgb=>rgb.every(v=>v>=-1e-4&&v<=1.0001);function oklchToHex(lightness,C,H){const L=clamp(lightness,0,1);let rgb=oklchToLinear(L,C,H);if(!inGamut(rgb)){let lo=0;let hi=C;for(let i=0;i<22;i++){const mid=(lo+hi)/2;if(inGamut(oklchToLinear(L,mid,H)))lo=mid;else hi=mid;}rgb=oklchToLinear(L,lo,H);}return rgbToHex(rgb.map(v=>toGam(clamp(v,0,1))))}var luminance=hex=>{const[r,g,b]=hexToRgb(hex).map(toLin);return .2126*r+.7152*g+.0722*b};function contrastRatio(a,b){const x=luminance(a);const y=luminance(b);return (Math.max(x,y)+.05)/(Math.min(x,y)+.05)}var minContrast=(hex,grounds)=>Math.min(...grounds.map(g=>contrastRatio(hex,g)));var rgba=(hex,alpha)=>{const[r,g,b]=hexToRgb(hex).map(v=>Math.round(v*255));return `rgba(${r},${g},${b},${alpha})`};var mixHue=(a,b,t)=>{const d=(b-a+540)%360-180;return (a+d*t+360)%360};function fit(lightness,C,H,grounds,target,dir){let L=lightness;let hex=oklchToHex(L,C,H);let steps=0;while(minContrast(hex,grounds)<target&&steps<100){L=clamp(L+dir*.01,0,1);hex=oklchToHex(L,C,H);steps++;}return {hex,L,steps}}var SERIF_FONTS=new Set(["playfair_display","merriweather","bitter","fraunces","cormorant_garamond","eb_garamond","lora","crimson_pro","source_serif_4","ibm_plex_serif"]);function storefrontFontStack(font){return `'${chunkZLAOY6IF_cjs.STOREFRONT_FONT_FAMILIES[font]}', ${SERIF_FONTS.has(font)?"serif":"sans-serif"}`}var AA=4.5;var INK=7;function derivePalette(recipe,brandHex,secondary,overrides){const[bL,bC,bH]=hexToOklch(brandHex);const nh=recipe.neutral.hue==null?bH:mixHue(bH,recipe.neutral.hue,recipe.neutral.mix);const nc=recipe.neutral.c;const{L,C}=recipe;const dark=recipe.mode==="dark";const dir=dark?1:-1;const N=(l,c=nc)=>oklchToHex(l,c,nh);const bg=overrides.background?.toUpperCase()??N(L.bg);const surface=N(L.surface,L.surface>=.999?0:nc);const surface2=N(L.surface2);const tint=oklchToHex(L.tint,Math.min(bC,C.tint),bH);const border=N(L.border,nc*1.5);const borderStrong=N(dark?L.border+.12:L.border-.2,nc*1.5);const grounds=[bg,surface,surface2,tint];const ink=overrides.foreground?.toUpperCase()??fit(L.ink,C.ink,nh,grounds,INK,dir).hex;const muted=fit(L.muted,nc*2.5,nh,grounds,AA,dir).hex;const brandText=fit(bL,bC,bH,grounds,AA,dir);const accentText=overrides.accent?.toUpperCase()??brandText.hex;const notes=[];let p;let on;if(!dark){const white=oklchToHex(.995,.003,bH);if(contrastRatio(brandHex,white)>=AA){p={hex:brandHex.toUpperCase(),L:bL};on=white;}else if(bL>=.7&&contrastRatio(brandHex,ink)>=AA){p={hex:brandHex.toUpperCase(),L:bL};on=ink;notes.push({code:"light_brand_ink_label",text:"Light brand: button keeps the colour and takes an ink label"});}else {p=fit(bL,bC,bH,[white],AA,-1);on=white;notes.push({code:"button_darkened",from:round2(bL),to:round2(p.L),text:`Button darkened L ${bL.toFixed(2)} \u2192 ${p.L.toFixed(2)} for a white label`});}}else {on=bg;p=fit(Math.max(bL,.72),bC,bH,[bg,surface],AA,1);if(p.L>bL+.005){notes.push({code:"brand_lifted",from:round2(bL),to:round2(p.L),text:`Brand lifted L ${bL.toFixed(2)} \u2192 ${p.L.toFixed(2)} to read on dark`});}}const onPrimary=overrides.primaryForeground?.toUpperCase()??on;let primaryHover=oklchToHex(p.L+(dark?.05:-0.06),bC,bH);if(contrastRatio(primaryHover,onPrimary)<AA){primaryHover=oklchToHex(p.L+(dark?-0.04:.04),bC,bH);}const darkToken=oklchToHex(L.dark,Math.min(bC,C.dark),bH);const phBg=dark?oklchToHex(.27,Math.min(bC,.03),bH):oklchToHex(L.tint-.045,Math.min(bC,.03),bH);const t={bg,surface,surface2,tint,border,borderStrong,ink,muted,primary:p.hex,onPrimary,primaryHover,accentText,dark:darkToken,onDark:oklchToHex(.97,.008,bH),onDarkMuted:fit(.82,.012,bH,[darkToken],AA,1).hex,darkAccent:fit(Math.max(bL,.72),bC,bH,[darkToken],AA,1).hex,focus:dark?p.hex:accentText,phBg,phText:fit(dark?.7:.48,.02,bH,[phBg],AA,dir).hex};if(secondary)t.accent2=fit(...hexToOklch(secondary),grounds,AA,dir).hex;if(!dark&&brandText.steps>0&&accentText===brandText.hex){notes.push({code:"brand_text_darkened",steps:brandText.steps,text:`Brand text darkened ${brandText.steps} step${brandText.steps>1?"s":""} to reach 4.5:1`});}return {t,notes}}var round2=n=>Math.round(n*100)/100;function failingOverride(t,overrides){const grounds=[t.bg,t.surface,t.surface2,t.tint];if(overrides.foreground){const ratio=minContrast(t.ink,grounds);if(ratio<AA)return {field:"foreground",ratio,against:"background"}}if(overrides.accent){const ratio=minContrast(t.accentText,grounds);if(ratio<AA)return {field:"accent",ratio,against:"background"}}if(overrides.primaryForeground){const ratio=contrastRatio(t.onPrimary,t.primary);if(ratio<AA)return {field:"primaryForeground",ratio,against:"button"}}if(overrides.background){const ratio=Math.min(contrastRatio(t.ink,t.bg),contrastRatio(t.muted,t.bg));if(ratio<AA)return {field:"background",ratio,against:"text"}}return null}function deriveStorefrontTheme(theme,brandHex,opts={}){const recipe=STOREFRONT_THEME_RECIPES[theme];const overrides={...opts.overrides};const problems=[];let palette=derivePalette(recipe,brandHex,opts.secondary,overrides);for(let problem=failingOverride(palette.t,overrides);problem;){problems.push({...problem,ratio:Math.round(problem.ratio*10)/10});delete overrides[problem.field];palette=derivePalette(recipe,brandHex,opts.secondary,overrides);problem=failingOverride(palette.t,overrides);}const{t,notes}=palette;const r=recipe.radius;const px=n=>`${n}px`;const vars={"--so-bg":t.bg,"--so-surface":t.surface,"--so-surface-2":t.surface2,"--so-tint":t.tint,"--so-border":t.border,"--so-border-strong":t.borderStrong,"--so-ink":t.ink,"--so-muted":t.muted,"--so-primary":t.primary,"--so-on-primary":t.onPrimary,"--so-primary-hover":t.primaryHover,"--so-accent-text":t.accentText,"--so-dark":t.dark,"--so-on-dark":t.onDark,"--so-on-dark-muted":t.onDarkMuted,"--so-dark-accent":t.darkAccent,"--so-focus":t.focus,"--so-ph-bg":t.phBg,"--so-ph-text":t.phText,"--so-ph-line":rgba(t.phText,.16),"--so-accent-2":t.accent2??t.accentText,"--so-scrim":`linear-gradient(180deg, ${rgba(t.dark,.55)} 0%, ${rgba(t.dark,0)} 26%, ${rgba(t.dark,0)} 40%, ${rgba(t.dark,.72)} 100%)`,"--so-scrim-solid":rgba(t.dark,.45),"--so-shadow":recipe.shadow?`0 1px 2px ${rgba(t.dark,.06)}, 0 10px 30px ${rgba(t.dark,.1)}`:"none","--so-shadow-float":`0 2px 6px ${rgba(t.dark,.08)}, 0 18px 50px ${rgba(t.dark,.18)}`,"--so-font-heading":storefrontFontStack(opts.heading??recipe.fonts.heading),"--so-font-body":storefrontFontStack(opts.body??recipe.fonts.body),"--so-r-sm":px(r.sm),"--so-r-md":px(r.md),"--so-r-lg":px(r.lg),"--so-r-btn":px(r.btn),"--so-btn-size":px(recipe.btn.size),"--so-btn-w":String(recipe.btn.w),"--so-btn-ls":recipe.btn.ls,"--so-btn-tt":recipe.btn.tt,"--so-btn-h":px(recipe.btn.h),"--so-section":px(recipe.space.section),"--so-gutter":px(recipe.space.gutter)};for(const[step,[size,lh,w,ls,tt]]of Object.entries(recipe.type)){vars[`--t-${step}-size`]=px(size);vars[`--t-${step}-lh`]=String(lh);vars[`--t-${step}-w`]=String(w);vars[`--t-${step}-ls`]=ls;vars[`--t-${step}-tt`]=tt??"none";}const grade=x=>x>=7?"AAA":x>=AA?"AA":"Fail";const checks=[["Body text",t.ink,t.bg],["Muted text",t.muted,t.surface2],["Button label",t.onPrimary,t.primary],["Brand text",t.accentText,t.bg],["On dark section",t.onDark,t.dark],["Brand on dark",t.darkAccent,t.dark]].map(([label,a,b])=>{const x=Math.round(contrastRatio(a,b)*10)/10;return {label,ratio:x.toFixed(1),grade:grade(x),pass:x>=AA}});return {theme,tokens:t,vars,checks,notes,problems}}function storefrontThemeFonts(theme,fonts){const pair=STOREFRONT_THEME_RECIPES[theme].fonts;return {heading:fonts?.heading??pair.heading,body:fonts?.body??pair.body}}function resolveStorefrontTheme(config){const theme=config.theme??DEFAULT_STOREFRONT_THEME;const fonts=storefrontThemeFonts(theme,config.fonts);const{primary,secondary,background,foreground,accent,primaryForeground}=explicitThemeChoices(config).colors;const derived=deriveStorefrontTheme(theme,primary,{secondary,...fonts,overrides:{background,foreground,accent,primaryForeground}});return {theme,layout:config.layout??DEFAULT_STOREFRONT_LAYOUT,fonts,derived,cssVariables:derived.vars}}var OVERRIDE_TOKENS={background:"bg",foreground:"ink",accent:"accentText",primaryForeground:"onPrimary"};var OVERRIDES=Object.keys(OVERRIDE_TOKENS);function legacyButtonLabel(primary,t){if(contrastRatio(t.onPrimary,primary)>=AA)return t.onPrimary;const reads=[t.onDark,t.ink,t.dark,t.bg].filter(hex=>contrastRatio(hex,primary)>=AA);return (reads.length?reads:["#FFFFFF","#000000"]).reduce((best,hex)=>contrastRatio(hex,primary)>contrastRatio(best,primary)?hex:best)}function explicitThemeChoices(config){const theme=config.theme??DEFAULT_STOREFRONT_THEME;const given=pickOverrides(config.colors);const colors={...config.colors};for(const field of OVERRIDES){const value=given[field];if(!value)continue;const others={...given};delete others[field];const{tokens}=deriveStorefrontTheme(theme,config.colors.primary,{overrides:others});const derived=field==="primaryForeground"?[tokens.onPrimary,legacyButtonLabel(config.colors.primary,tokens)]:[tokens[OVERRIDE_TOKENS[field]]];if(derived.includes(value.toUpperCase()))delete colors[field];}const pair=STOREFRONT_THEME_RECIPES[theme].fonts;const fonts={...config.fonts?.heading&&config.fonts.heading!==pair.heading?{heading:config.fonts.heading}:{},...config.fonts?.body&&config.fonts.body!==pair.body?{body:config.fonts.body}:{}};const{fonts:_fonts,...rest}=config;return {...rest,colors,...fonts.heading||fonts.body?{fonts}:{}}}function pickOverrides(colors){const{background,foreground,accent,primaryForeground}=colors;return Object.fromEntries(Object.entries({background,foreground,accent,primaryForeground}).filter(([,v])=>!!v))}function defineSuiteOpConfig(config){return storefrontSiteConfigSchema.parse(config)}
7
7
 
8
8
  Object.defineProperty(exports, "STOREFRONT_FONT_FAMILIES", {
9
9
  enumerable: true,
10
10
  get: function () { return chunkZLAOY6IF_cjs.STOREFRONT_FONT_FAMILIES; }
11
11
  });
12
+ exports.DEFAULT_STOREFRONT_LAYOUT = DEFAULT_STOREFRONT_LAYOUT;
13
+ exports.DEFAULT_STOREFRONT_THEME = DEFAULT_STOREFRONT_THEME;
14
+ exports.STOREFRONT_LAYOUTS = STOREFRONT_LAYOUTS;
12
15
  exports.STOREFRONT_LOCALES = STOREFRONT_LOCALES;
16
+ exports.STOREFRONT_THEMES = STOREFRONT_THEMES;
17
+ exports.STOREFRONT_THEME_RECIPES = STOREFRONT_THEME_RECIPES;
13
18
  exports.defineSuiteOpConfig = defineSuiteOpConfig;
19
+ exports.deriveStorefrontTheme = deriveStorefrontTheme;
20
+ exports.resolveStorefrontTheme = resolveStorefrontTheme;
14
21
  exports.storefrontSiteConfigSchema = storefrontSiteConfigSchema;