@garagem-ai/site-sdk 0.13.5 → 0.13.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -146,17 +146,22 @@ interface GetShareLinkOptions {
146
146
  */
147
147
  declare function getShareLink(options: GetShareLinkOptions): Promise<ShareLinkResult>;
148
148
 
149
- /**
150
- * Site analytics catalog events. The SDK only announces an event on
151
- * `window`; the `SiteAnalytics` client that Studio publish installs owns
152
- * consent, the visitor cookie and the site id, and posts it to `/api/t`.
153
- * Without that listener (server render, other hosts) nothing is sent.
154
- */
155
-
156
149
  declare const SITE_ANALYTICS_EVENT = "garagem:site-event";
157
150
  /** Call once per listing page in the browser (an effect keyed on `listing.id`). */
158
151
  declare function trackListingView(listing: Pick<Listing, "id" | "listingCode" | "businessType" | "property" | "location">): void;
159
152
 
153
+ /**
154
+ * A visit is a location, a listing, or a static page. Filter paths and
155
+ * `page` greater than 1 are the crawl space Studio's catch-all answers.
156
+ * `analyticsDocumentGuardSource()` is the same check pasted into the
157
+ * generated client, which cannot import this helper from the pinned tarball.
158
+ * Prompts must not name `isAnalyticsDocumentUrl`.
159
+ */
160
+ /** `true` when this URL is a page a person opened, not a crawl of filters. */
161
+ declare function isAnalyticsDocumentUrl(href: string): boolean;
162
+ /** Source paste of `isAnalyticsDocumentUrl` for the generated Studio client. */
163
+ declare function analyticsDocumentGuardSource(): string;
164
+
160
165
  /**
161
166
  * Visit-lead schedule: hours in, slots out. Pure — no fetch, no React.
162
167
  * Calendar dates are civil dates in `timeZone` (America/Sao_Paulo), never
@@ -760,7 +765,7 @@ declare const STUDIO_SDK_CONTRACT: {
760
765
  * they move into `searchExports`. Independent of the 0.4.12 filter helpers
761
766
  * already listed in `searchExports`.
762
767
  */
763
- readonly unpublishedSearchExports: readonly ["searchChromeModel", "rangeDraftFromPath", "unknownSearchLocation"];
768
+ readonly unpublishedSearchExports: readonly ["searchChromeModel", "rangeDraftFromPath", "unknownSearchLocation", "isAnalyticsDocumentUrl"];
764
769
  /**
765
770
  * maps.fndn.ai helpers (static map, street view, boundaries, travel
766
771
  * time) plus friendly map search. They ship in npm 0.9.0 (`mapsSince`).
@@ -1554,4 +1559,4 @@ declare function resolveMatchedCoverPhoto(photo: MatchedListingPhoto | null | un
1554
1559
  */
1555
1560
  declare function applyMatchedPhotoCover<T extends Listing>(cards: ReadonlyArray<T>, photoResults: PhotoSearchResult | ReadonlyArray<PhotoSearchItem> | null | undefined, options?: ApplyMatchedPhotoCoverOptions): Array<T & ListingWithMatchedPhoto>;
1556
1561
 
1557
- export { AMENITY_FALLBACK_LABELS, type AmenityLabelDictionary, type AmenityLabelOption, AppliedSearchChange, AppliedSearchQuery, type ApplyMatchedPhotoCoverOptions, BoundaryCity, BoundaryLayer, BoundaryLayerOptions, CmsCollection, CmsEntriesResult, CmsEntry, type ContactLeadInput, type CreateGaragemClientOptions, DEFAULT_MAPS_BASE_URL, DEFAULT_PHONE_COUNTRY_CODE, FetchLike, type GaragemClient, type GetLeadUiOptions, type GetListingMarketPositionOptions, type GetNeighborhoodSummaryOptions, type GetShareLinkOptions, type GetSimilarByPhotoOptions, type HHmm, LISTING_AMENITY_TITLES, LISTING_DESCRIPTION_CLAMP, type LeadContact, type LeadField, type LeadFieldId, LeadSubmitError, type LeadSubmitErrorCode, type LeadSubmitResult, type LeadUi, Listing, type ListingAmenityGroup, type ListingAmenityGroupKey, type ListingAmenitySource, type ListingBreadcrumbCrumb, type ListingDescriptionPreview, ListingDetail, type ListingDetailFieldsModel, type ListingDetailFieldsSource, type ListingDetailModel, type ListingFact, ListingFilters, ListingLocation, type ListingLocationBlock, type ListingMarketPosition, ListingMedia, type ListingMediaOverlay, type ListingPhotoGroup, type ListingValue, type ListingVisualHighlightsOptions, ListingWithLocation, ListingWithMatchedPhoto, ListingsResult, type LocationFilterInput, MAPS_MAX_IMAGE_EDGE, MAPS_SITE_HEADER, MATCHED_PHOTO_COVER_MAX_DISTANCE, MAX_NATIONAL_PHONE_DIGITS, MapsCoordinates, MapsFetchOptions, type MarketListingType, type MarketPriceBand, type MarketPropertyType, type MarketUnavailableReason, MatchedListingPhoto, NeighborhoodBoundary, NeighborhoodBoundaryOptions, type NeighborhoodSummary, type NeighborhoodSummaryQuery, PHONE_COUNTRIES, PHOTO_GROUP_OTHER_KEY, PHOTO_GROUP_OTHER_LABEL, PHOTO_SEARCH_MIN_QUERY_LENGTH, type ParsedPhoneInput, type PhoneCountry, PhotoSearchItem, PhotoSearchParams, PhotoSearchResult, type PriceEstimate, type PriceEstimateConfidence, type PriceEstimateInput, QueryListingsFilters, QueryListingsParams, QueryListingsResult, RequestNextOptions, type RequestPriceEstimateOptions, type ResolvePublicSiteIdOptions, SELLER_LEAD_PHOTO_MAX_BYTES, SELLER_LEAD_PHOTO_MAX_COUNT, SELLER_LEAD_PHOTO_TYPES, SITE_ANALYTICS_EVENT, STUDIO_DEFAULT_PHOTO_SCHEDULE_CONFIG, STUDIO_DEFAULT_VISIT_SCHEDULE, STUDIO_SDK_CONTRACT, STUDIO_SDK_PACKAGE, STUDIO_SITE_LAYOUT, type SearchListingPhotosOptions, SearchListingsParams, SearchListingsResult, SearchPathFilters, SearchUi, SearchUiDictionary, type SellerAddressErrors, type SellerAddressField, type SellerBusinessType, type SellerLeadAddress, type SellerLeadInput, type SellerLeadProperty, type SellerPhotoScheduleConfig, type ShareEntityType, type ShareLinkError, type ShareLinkErrorReason, type ShareLinkResult, type ShareLinkSuccess, type ShareLinkToken, type ShareListingEntity, type SimilarByPhotoItem, type SimilarByPhotoResult, SimilarListingsResult, type SimilarPhotoMatch, Site, StaticMapOptions, StreetViewAvailability, StreetViewAvailabilityOptions, StreetViewOptions, type StudioSdkContract, TravelDestination, TravelMode, TravelTime, TravelTimeCache, TravelTimeCacheOptions, TravelTimeElement, TravelTimeOptions, TravelTimesOptions, type UploadSellerLeadPhotoInput, VISIT_TIME_ZONE, type VisitHours, type VisitLeadInput, type VisitSchedule, type VisitScheduleConfig, applyMatchedPhotoCover, boundaryCitySlug, boundaryLayerId, boundaryLayerUrl, clearTravelTimeCache, coarsenCoordinates, coerceNpmVersion, collapseDuplicatedBrazilianMobileNine, compareSemver, composeSearchPublicHref, composeSearchPublicPath, coordinateDecimals, createClient, createGaragemClient, createTravelTimeCache, defaultPhoneCountry, expandVisitSchedule, expandVisitTimeSlots, findPhoneCountry, formatAreaM2, formatGroupedInteger, formatListingPrice, formatPhoneNational, getBoundaryLayer, getLeadUi, getListingMarketPosition, getNeighborhoodSummary, getShareLink, getSimilarByPhoto, hasShowcaseLeadsPostUrl, isAnalyticsOnPin, isPhotoSearchOnPin, isSellerLeadOnPin, isShareLinkOnPin, isStudioPreviewHost, isValidEmail, isValidName, isValidPhone, isVisitSlotAllowed, labelAmenities, listingAmenityGroups, listingBreadcrumb, listingBusinessLabel, listingCoordinates, listingDescriptionPreview, listingDetailFieldsModel, listingDetailModel, listingFacts, listingLocationBlock, listingLookupKey, listingMapsHref, listingMediaOverlays, listingPhotoGroups, listingPublicPath, listingStaticMapUrl, listingStreetViewAvailable, listingStreetViewMetadataUrl, listingStreetViewUrl, listingValues, listingVisualHighlights, mapsExportsPublished, marketExportsAvailableAt, marketPositionLabel, maxZoomForCoordinates, mergeAppliedSearchQueryIntoSearch, nationalPhoneDigits, neighborhoodBoundaryLayer, neighborhoodBoundaryUrl, normalizeMapsBaseUrl, normalizeVisitDate, normalizeVisitTime, parseAppliedSearchQuery, parseGroupedInteger, parsePhoneInput, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, phoneCountrySearchValue, photoRoomLabel, photoSearchUrl, priceBandLabel, reduceAppliedSearchQuery, remaskPhoneForCountry, requestPriceEstimate, resolveMatchedCoverPhoto, resolvePublicSiteId, resolveTravelDestination, searchListingPhotos, sellerAddressErrors, sellerPhotoSchedule, serializeAppliedSearchQuery, slotsForDate, studioAmenityInstruction, studioChromeInstruction, studioCodegenContractViolations, studioDefaultLeadUi, studioLayoutInstruction, studioLeadInstruction, studioListingCardInstruction, studioListingDetailInstruction, studioListingViewInstruction, studioMapSearchInstruction, studioMapsInstruction, studioMarketInstruction, studioPhotoInstruction, studioPhotoInstructionFor, studioPhotoSearchInstruction, studioPublishableKeyInstruction, studioSdkPinInstruction, studioSearchInstruction, studioSearchLandmarkInstruction, studioSellerLeadSdkInstruction, studioShareLinkInstruction, studioSiteWidthCss, submitContactLead, submitSellerLead, submitVisitLead, toE164, trackListingView, travelTimeCacheKey, travelTimeFromListing, travelTimesFromListing, truncateNationalPhoneDigits, unavailableReactImports, uploadSellerLeadPhoto };
1562
+ export { AMENITY_FALLBACK_LABELS, type AmenityLabelDictionary, type AmenityLabelOption, AppliedSearchChange, AppliedSearchQuery, type ApplyMatchedPhotoCoverOptions, BoundaryCity, BoundaryLayer, BoundaryLayerOptions, CmsCollection, CmsEntriesResult, CmsEntry, type ContactLeadInput, type CreateGaragemClientOptions, DEFAULT_MAPS_BASE_URL, DEFAULT_PHONE_COUNTRY_CODE, FetchLike, type GaragemClient, type GetLeadUiOptions, type GetListingMarketPositionOptions, type GetNeighborhoodSummaryOptions, type GetShareLinkOptions, type GetSimilarByPhotoOptions, type HHmm, LISTING_AMENITY_TITLES, LISTING_DESCRIPTION_CLAMP, type LeadContact, type LeadField, type LeadFieldId, LeadSubmitError, type LeadSubmitErrorCode, type LeadSubmitResult, type LeadUi, Listing, type ListingAmenityGroup, type ListingAmenityGroupKey, type ListingAmenitySource, type ListingBreadcrumbCrumb, type ListingDescriptionPreview, ListingDetail, type ListingDetailFieldsModel, type ListingDetailFieldsSource, type ListingDetailModel, type ListingFact, ListingFilters, ListingLocation, type ListingLocationBlock, type ListingMarketPosition, ListingMedia, type ListingMediaOverlay, type ListingPhotoGroup, type ListingValue, type ListingVisualHighlightsOptions, ListingWithLocation, ListingWithMatchedPhoto, ListingsResult, type LocationFilterInput, MAPS_MAX_IMAGE_EDGE, MAPS_SITE_HEADER, MATCHED_PHOTO_COVER_MAX_DISTANCE, MAX_NATIONAL_PHONE_DIGITS, MapsCoordinates, MapsFetchOptions, type MarketListingType, type MarketPriceBand, type MarketPropertyType, type MarketUnavailableReason, MatchedListingPhoto, NeighborhoodBoundary, NeighborhoodBoundaryOptions, type NeighborhoodSummary, type NeighborhoodSummaryQuery, PHONE_COUNTRIES, PHOTO_GROUP_OTHER_KEY, PHOTO_GROUP_OTHER_LABEL, PHOTO_SEARCH_MIN_QUERY_LENGTH, type ParsedPhoneInput, type PhoneCountry, PhotoSearchItem, PhotoSearchParams, PhotoSearchResult, type PriceEstimate, type PriceEstimateConfidence, type PriceEstimateInput, QueryListingsFilters, QueryListingsParams, QueryListingsResult, RequestNextOptions, type RequestPriceEstimateOptions, type ResolvePublicSiteIdOptions, SELLER_LEAD_PHOTO_MAX_BYTES, SELLER_LEAD_PHOTO_MAX_COUNT, SELLER_LEAD_PHOTO_TYPES, SITE_ANALYTICS_EVENT, STUDIO_DEFAULT_PHOTO_SCHEDULE_CONFIG, STUDIO_DEFAULT_VISIT_SCHEDULE, STUDIO_SDK_CONTRACT, STUDIO_SDK_PACKAGE, STUDIO_SITE_LAYOUT, type SearchListingPhotosOptions, SearchListingsParams, SearchListingsResult, SearchPathFilters, SearchUi, SearchUiDictionary, type SellerAddressErrors, type SellerAddressField, type SellerBusinessType, type SellerLeadAddress, type SellerLeadInput, type SellerLeadProperty, type SellerPhotoScheduleConfig, type ShareEntityType, type ShareLinkError, type ShareLinkErrorReason, type ShareLinkResult, type ShareLinkSuccess, type ShareLinkToken, type ShareListingEntity, type SimilarByPhotoItem, type SimilarByPhotoResult, SimilarListingsResult, type SimilarPhotoMatch, Site, StaticMapOptions, StreetViewAvailability, StreetViewAvailabilityOptions, StreetViewOptions, type StudioSdkContract, TravelDestination, TravelMode, TravelTime, TravelTimeCache, TravelTimeCacheOptions, TravelTimeElement, TravelTimeOptions, TravelTimesOptions, type UploadSellerLeadPhotoInput, VISIT_TIME_ZONE, type VisitHours, type VisitLeadInput, type VisitSchedule, type VisitScheduleConfig, analyticsDocumentGuardSource, applyMatchedPhotoCover, boundaryCitySlug, boundaryLayerId, boundaryLayerUrl, clearTravelTimeCache, coarsenCoordinates, coerceNpmVersion, collapseDuplicatedBrazilianMobileNine, compareSemver, composeSearchPublicHref, composeSearchPublicPath, coordinateDecimals, createClient, createGaragemClient, createTravelTimeCache, defaultPhoneCountry, expandVisitSchedule, expandVisitTimeSlots, findPhoneCountry, formatAreaM2, formatGroupedInteger, formatListingPrice, formatPhoneNational, getBoundaryLayer, getLeadUi, getListingMarketPosition, getNeighborhoodSummary, getShareLink, getSimilarByPhoto, hasShowcaseLeadsPostUrl, isAnalyticsDocumentUrl, isAnalyticsOnPin, isPhotoSearchOnPin, isSellerLeadOnPin, isShareLinkOnPin, isStudioPreviewHost, isValidEmail, isValidName, isValidPhone, isVisitSlotAllowed, labelAmenities, listingAmenityGroups, listingBreadcrumb, listingBusinessLabel, listingCoordinates, listingDescriptionPreview, listingDetailFieldsModel, listingDetailModel, listingFacts, listingLocationBlock, listingLookupKey, listingMapsHref, listingMediaOverlays, listingPhotoGroups, listingPublicPath, listingStaticMapUrl, listingStreetViewAvailable, listingStreetViewMetadataUrl, listingStreetViewUrl, listingValues, listingVisualHighlights, mapsExportsPublished, marketExportsAvailableAt, marketPositionLabel, maxZoomForCoordinates, mergeAppliedSearchQueryIntoSearch, nationalPhoneDigits, neighborhoodBoundaryLayer, neighborhoodBoundaryUrl, normalizeMapsBaseUrl, normalizeVisitDate, normalizeVisitTime, parseAppliedSearchQuery, parseGroupedInteger, parsePhoneInput, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, phoneCountrySearchValue, photoRoomLabel, photoSearchUrl, priceBandLabel, reduceAppliedSearchQuery, remaskPhoneForCountry, requestPriceEstimate, resolveMatchedCoverPhoto, resolvePublicSiteId, resolveTravelDestination, searchListingPhotos, sellerAddressErrors, sellerPhotoSchedule, serializeAppliedSearchQuery, slotsForDate, studioAmenityInstruction, studioChromeInstruction, studioCodegenContractViolations, studioDefaultLeadUi, studioLayoutInstruction, studioLeadInstruction, studioListingCardInstruction, studioListingDetailInstruction, studioListingViewInstruction, studioMapSearchInstruction, studioMapsInstruction, studioMarketInstruction, studioPhotoInstruction, studioPhotoInstructionFor, studioPhotoSearchInstruction, studioPublishableKeyInstruction, studioSdkPinInstruction, studioSearchInstruction, studioSearchLandmarkInstruction, studioSellerLeadSdkInstruction, studioShareLinkInstruction, studioSiteWidthCss, submitContactLead, submitSellerLead, submitVisitLead, toE164, trackListingView, travelTimeCacheKey, travelTimeFromListing, travelTimesFromListing, truncateNationalPhoneDigits, unavailableReactImports, uploadSellerLeadPhoto };
package/dist/index.d.ts CHANGED
@@ -146,17 +146,22 @@ interface GetShareLinkOptions {
146
146
  */
147
147
  declare function getShareLink(options: GetShareLinkOptions): Promise<ShareLinkResult>;
148
148
 
149
- /**
150
- * Site analytics catalog events. The SDK only announces an event on
151
- * `window`; the `SiteAnalytics` client that Studio publish installs owns
152
- * consent, the visitor cookie and the site id, and posts it to `/api/t`.
153
- * Without that listener (server render, other hosts) nothing is sent.
154
- */
155
-
156
149
  declare const SITE_ANALYTICS_EVENT = "garagem:site-event";
157
150
  /** Call once per listing page in the browser (an effect keyed on `listing.id`). */
158
151
  declare function trackListingView(listing: Pick<Listing, "id" | "listingCode" | "businessType" | "property" | "location">): void;
159
152
 
153
+ /**
154
+ * A visit is a location, a listing, or a static page. Filter paths and
155
+ * `page` greater than 1 are the crawl space Studio's catch-all answers.
156
+ * `analyticsDocumentGuardSource()` is the same check pasted into the
157
+ * generated client, which cannot import this helper from the pinned tarball.
158
+ * Prompts must not name `isAnalyticsDocumentUrl`.
159
+ */
160
+ /** `true` when this URL is a page a person opened, not a crawl of filters. */
161
+ declare function isAnalyticsDocumentUrl(href: string): boolean;
162
+ /** Source paste of `isAnalyticsDocumentUrl` for the generated Studio client. */
163
+ declare function analyticsDocumentGuardSource(): string;
164
+
160
165
  /**
161
166
  * Visit-lead schedule: hours in, slots out. Pure — no fetch, no React.
162
167
  * Calendar dates are civil dates in `timeZone` (America/Sao_Paulo), never
@@ -760,7 +765,7 @@ declare const STUDIO_SDK_CONTRACT: {
760
765
  * they move into `searchExports`. Independent of the 0.4.12 filter helpers
761
766
  * already listed in `searchExports`.
762
767
  */
763
- readonly unpublishedSearchExports: readonly ["searchChromeModel", "rangeDraftFromPath", "unknownSearchLocation"];
768
+ readonly unpublishedSearchExports: readonly ["searchChromeModel", "rangeDraftFromPath", "unknownSearchLocation", "isAnalyticsDocumentUrl"];
764
769
  /**
765
770
  * maps.fndn.ai helpers (static map, street view, boundaries, travel
766
771
  * time) plus friendly map search. They ship in npm 0.9.0 (`mapsSince`).
@@ -1554,4 +1559,4 @@ declare function resolveMatchedCoverPhoto(photo: MatchedListingPhoto | null | un
1554
1559
  */
1555
1560
  declare function applyMatchedPhotoCover<T extends Listing>(cards: ReadonlyArray<T>, photoResults: PhotoSearchResult | ReadonlyArray<PhotoSearchItem> | null | undefined, options?: ApplyMatchedPhotoCoverOptions): Array<T & ListingWithMatchedPhoto>;
1556
1561
 
1557
- export { AMENITY_FALLBACK_LABELS, type AmenityLabelDictionary, type AmenityLabelOption, AppliedSearchChange, AppliedSearchQuery, type ApplyMatchedPhotoCoverOptions, BoundaryCity, BoundaryLayer, BoundaryLayerOptions, CmsCollection, CmsEntriesResult, CmsEntry, type ContactLeadInput, type CreateGaragemClientOptions, DEFAULT_MAPS_BASE_URL, DEFAULT_PHONE_COUNTRY_CODE, FetchLike, type GaragemClient, type GetLeadUiOptions, type GetListingMarketPositionOptions, type GetNeighborhoodSummaryOptions, type GetShareLinkOptions, type GetSimilarByPhotoOptions, type HHmm, LISTING_AMENITY_TITLES, LISTING_DESCRIPTION_CLAMP, type LeadContact, type LeadField, type LeadFieldId, LeadSubmitError, type LeadSubmitErrorCode, type LeadSubmitResult, type LeadUi, Listing, type ListingAmenityGroup, type ListingAmenityGroupKey, type ListingAmenitySource, type ListingBreadcrumbCrumb, type ListingDescriptionPreview, ListingDetail, type ListingDetailFieldsModel, type ListingDetailFieldsSource, type ListingDetailModel, type ListingFact, ListingFilters, ListingLocation, type ListingLocationBlock, type ListingMarketPosition, ListingMedia, type ListingMediaOverlay, type ListingPhotoGroup, type ListingValue, type ListingVisualHighlightsOptions, ListingWithLocation, ListingWithMatchedPhoto, ListingsResult, type LocationFilterInput, MAPS_MAX_IMAGE_EDGE, MAPS_SITE_HEADER, MATCHED_PHOTO_COVER_MAX_DISTANCE, MAX_NATIONAL_PHONE_DIGITS, MapsCoordinates, MapsFetchOptions, type MarketListingType, type MarketPriceBand, type MarketPropertyType, type MarketUnavailableReason, MatchedListingPhoto, NeighborhoodBoundary, NeighborhoodBoundaryOptions, type NeighborhoodSummary, type NeighborhoodSummaryQuery, PHONE_COUNTRIES, PHOTO_GROUP_OTHER_KEY, PHOTO_GROUP_OTHER_LABEL, PHOTO_SEARCH_MIN_QUERY_LENGTH, type ParsedPhoneInput, type PhoneCountry, PhotoSearchItem, PhotoSearchParams, PhotoSearchResult, type PriceEstimate, type PriceEstimateConfidence, type PriceEstimateInput, QueryListingsFilters, QueryListingsParams, QueryListingsResult, RequestNextOptions, type RequestPriceEstimateOptions, type ResolvePublicSiteIdOptions, SELLER_LEAD_PHOTO_MAX_BYTES, SELLER_LEAD_PHOTO_MAX_COUNT, SELLER_LEAD_PHOTO_TYPES, SITE_ANALYTICS_EVENT, STUDIO_DEFAULT_PHOTO_SCHEDULE_CONFIG, STUDIO_DEFAULT_VISIT_SCHEDULE, STUDIO_SDK_CONTRACT, STUDIO_SDK_PACKAGE, STUDIO_SITE_LAYOUT, type SearchListingPhotosOptions, SearchListingsParams, SearchListingsResult, SearchPathFilters, SearchUi, SearchUiDictionary, type SellerAddressErrors, type SellerAddressField, type SellerBusinessType, type SellerLeadAddress, type SellerLeadInput, type SellerLeadProperty, type SellerPhotoScheduleConfig, type ShareEntityType, type ShareLinkError, type ShareLinkErrorReason, type ShareLinkResult, type ShareLinkSuccess, type ShareLinkToken, type ShareListingEntity, type SimilarByPhotoItem, type SimilarByPhotoResult, SimilarListingsResult, type SimilarPhotoMatch, Site, StaticMapOptions, StreetViewAvailability, StreetViewAvailabilityOptions, StreetViewOptions, type StudioSdkContract, TravelDestination, TravelMode, TravelTime, TravelTimeCache, TravelTimeCacheOptions, TravelTimeElement, TravelTimeOptions, TravelTimesOptions, type UploadSellerLeadPhotoInput, VISIT_TIME_ZONE, type VisitHours, type VisitLeadInput, type VisitSchedule, type VisitScheduleConfig, applyMatchedPhotoCover, boundaryCitySlug, boundaryLayerId, boundaryLayerUrl, clearTravelTimeCache, coarsenCoordinates, coerceNpmVersion, collapseDuplicatedBrazilianMobileNine, compareSemver, composeSearchPublicHref, composeSearchPublicPath, coordinateDecimals, createClient, createGaragemClient, createTravelTimeCache, defaultPhoneCountry, expandVisitSchedule, expandVisitTimeSlots, findPhoneCountry, formatAreaM2, formatGroupedInteger, formatListingPrice, formatPhoneNational, getBoundaryLayer, getLeadUi, getListingMarketPosition, getNeighborhoodSummary, getShareLink, getSimilarByPhoto, hasShowcaseLeadsPostUrl, isAnalyticsOnPin, isPhotoSearchOnPin, isSellerLeadOnPin, isShareLinkOnPin, isStudioPreviewHost, isValidEmail, isValidName, isValidPhone, isVisitSlotAllowed, labelAmenities, listingAmenityGroups, listingBreadcrumb, listingBusinessLabel, listingCoordinates, listingDescriptionPreview, listingDetailFieldsModel, listingDetailModel, listingFacts, listingLocationBlock, listingLookupKey, listingMapsHref, listingMediaOverlays, listingPhotoGroups, listingPublicPath, listingStaticMapUrl, listingStreetViewAvailable, listingStreetViewMetadataUrl, listingStreetViewUrl, listingValues, listingVisualHighlights, mapsExportsPublished, marketExportsAvailableAt, marketPositionLabel, maxZoomForCoordinates, mergeAppliedSearchQueryIntoSearch, nationalPhoneDigits, neighborhoodBoundaryLayer, neighborhoodBoundaryUrl, normalizeMapsBaseUrl, normalizeVisitDate, normalizeVisitTime, parseAppliedSearchQuery, parseGroupedInteger, parsePhoneInput, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, phoneCountrySearchValue, photoRoomLabel, photoSearchUrl, priceBandLabel, reduceAppliedSearchQuery, remaskPhoneForCountry, requestPriceEstimate, resolveMatchedCoverPhoto, resolvePublicSiteId, resolveTravelDestination, searchListingPhotos, sellerAddressErrors, sellerPhotoSchedule, serializeAppliedSearchQuery, slotsForDate, studioAmenityInstruction, studioChromeInstruction, studioCodegenContractViolations, studioDefaultLeadUi, studioLayoutInstruction, studioLeadInstruction, studioListingCardInstruction, studioListingDetailInstruction, studioListingViewInstruction, studioMapSearchInstruction, studioMapsInstruction, studioMarketInstruction, studioPhotoInstruction, studioPhotoInstructionFor, studioPhotoSearchInstruction, studioPublishableKeyInstruction, studioSdkPinInstruction, studioSearchInstruction, studioSearchLandmarkInstruction, studioSellerLeadSdkInstruction, studioShareLinkInstruction, studioSiteWidthCss, submitContactLead, submitSellerLead, submitVisitLead, toE164, trackListingView, travelTimeCacheKey, travelTimeFromListing, travelTimesFromListing, truncateNationalPhoneDigits, unavailableReactImports, uploadSellerLeadPhoto };
1562
+ export { AMENITY_FALLBACK_LABELS, type AmenityLabelDictionary, type AmenityLabelOption, AppliedSearchChange, AppliedSearchQuery, type ApplyMatchedPhotoCoverOptions, BoundaryCity, BoundaryLayer, BoundaryLayerOptions, CmsCollection, CmsEntriesResult, CmsEntry, type ContactLeadInput, type CreateGaragemClientOptions, DEFAULT_MAPS_BASE_URL, DEFAULT_PHONE_COUNTRY_CODE, FetchLike, type GaragemClient, type GetLeadUiOptions, type GetListingMarketPositionOptions, type GetNeighborhoodSummaryOptions, type GetShareLinkOptions, type GetSimilarByPhotoOptions, type HHmm, LISTING_AMENITY_TITLES, LISTING_DESCRIPTION_CLAMP, type LeadContact, type LeadField, type LeadFieldId, LeadSubmitError, type LeadSubmitErrorCode, type LeadSubmitResult, type LeadUi, Listing, type ListingAmenityGroup, type ListingAmenityGroupKey, type ListingAmenitySource, type ListingBreadcrumbCrumb, type ListingDescriptionPreview, ListingDetail, type ListingDetailFieldsModel, type ListingDetailFieldsSource, type ListingDetailModel, type ListingFact, ListingFilters, ListingLocation, type ListingLocationBlock, type ListingMarketPosition, ListingMedia, type ListingMediaOverlay, type ListingPhotoGroup, type ListingValue, type ListingVisualHighlightsOptions, ListingWithLocation, ListingWithMatchedPhoto, ListingsResult, type LocationFilterInput, MAPS_MAX_IMAGE_EDGE, MAPS_SITE_HEADER, MATCHED_PHOTO_COVER_MAX_DISTANCE, MAX_NATIONAL_PHONE_DIGITS, MapsCoordinates, MapsFetchOptions, type MarketListingType, type MarketPriceBand, type MarketPropertyType, type MarketUnavailableReason, MatchedListingPhoto, NeighborhoodBoundary, NeighborhoodBoundaryOptions, type NeighborhoodSummary, type NeighborhoodSummaryQuery, PHONE_COUNTRIES, PHOTO_GROUP_OTHER_KEY, PHOTO_GROUP_OTHER_LABEL, PHOTO_SEARCH_MIN_QUERY_LENGTH, type ParsedPhoneInput, type PhoneCountry, PhotoSearchItem, PhotoSearchParams, PhotoSearchResult, type PriceEstimate, type PriceEstimateConfidence, type PriceEstimateInput, QueryListingsFilters, QueryListingsParams, QueryListingsResult, RequestNextOptions, type RequestPriceEstimateOptions, type ResolvePublicSiteIdOptions, SELLER_LEAD_PHOTO_MAX_BYTES, SELLER_LEAD_PHOTO_MAX_COUNT, SELLER_LEAD_PHOTO_TYPES, SITE_ANALYTICS_EVENT, STUDIO_DEFAULT_PHOTO_SCHEDULE_CONFIG, STUDIO_DEFAULT_VISIT_SCHEDULE, STUDIO_SDK_CONTRACT, STUDIO_SDK_PACKAGE, STUDIO_SITE_LAYOUT, type SearchListingPhotosOptions, SearchListingsParams, SearchListingsResult, SearchPathFilters, SearchUi, SearchUiDictionary, type SellerAddressErrors, type SellerAddressField, type SellerBusinessType, type SellerLeadAddress, type SellerLeadInput, type SellerLeadProperty, type SellerPhotoScheduleConfig, type ShareEntityType, type ShareLinkError, type ShareLinkErrorReason, type ShareLinkResult, type ShareLinkSuccess, type ShareLinkToken, type ShareListingEntity, type SimilarByPhotoItem, type SimilarByPhotoResult, SimilarListingsResult, type SimilarPhotoMatch, Site, StaticMapOptions, StreetViewAvailability, StreetViewAvailabilityOptions, StreetViewOptions, type StudioSdkContract, TravelDestination, TravelMode, TravelTime, TravelTimeCache, TravelTimeCacheOptions, TravelTimeElement, TravelTimeOptions, TravelTimesOptions, type UploadSellerLeadPhotoInput, VISIT_TIME_ZONE, type VisitHours, type VisitLeadInput, type VisitSchedule, type VisitScheduleConfig, analyticsDocumentGuardSource, applyMatchedPhotoCover, boundaryCitySlug, boundaryLayerId, boundaryLayerUrl, clearTravelTimeCache, coarsenCoordinates, coerceNpmVersion, collapseDuplicatedBrazilianMobileNine, compareSemver, composeSearchPublicHref, composeSearchPublicPath, coordinateDecimals, createClient, createGaragemClient, createTravelTimeCache, defaultPhoneCountry, expandVisitSchedule, expandVisitTimeSlots, findPhoneCountry, formatAreaM2, formatGroupedInteger, formatListingPrice, formatPhoneNational, getBoundaryLayer, getLeadUi, getListingMarketPosition, getNeighborhoodSummary, getShareLink, getSimilarByPhoto, hasShowcaseLeadsPostUrl, isAnalyticsDocumentUrl, isAnalyticsOnPin, isPhotoSearchOnPin, isSellerLeadOnPin, isShareLinkOnPin, isStudioPreviewHost, isValidEmail, isValidName, isValidPhone, isVisitSlotAllowed, labelAmenities, listingAmenityGroups, listingBreadcrumb, listingBusinessLabel, listingCoordinates, listingDescriptionPreview, listingDetailFieldsModel, listingDetailModel, listingFacts, listingLocationBlock, listingLookupKey, listingMapsHref, listingMediaOverlays, listingPhotoGroups, listingPublicPath, listingStaticMapUrl, listingStreetViewAvailable, listingStreetViewMetadataUrl, listingStreetViewUrl, listingValues, listingVisualHighlights, mapsExportsPublished, marketExportsAvailableAt, marketPositionLabel, maxZoomForCoordinates, mergeAppliedSearchQueryIntoSearch, nationalPhoneDigits, neighborhoodBoundaryLayer, neighborhoodBoundaryUrl, normalizeMapsBaseUrl, normalizeVisitDate, normalizeVisitTime, parseAppliedSearchQuery, parseGroupedInteger, parsePhoneInput, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, phoneCountrySearchValue, photoRoomLabel, photoSearchUrl, priceBandLabel, reduceAppliedSearchQuery, remaskPhoneForCountry, requestPriceEstimate, resolveMatchedCoverPhoto, resolvePublicSiteId, resolveTravelDestination, searchListingPhotos, sellerAddressErrors, sellerPhotoSchedule, serializeAppliedSearchQuery, slotsForDate, studioAmenityInstruction, studioChromeInstruction, studioCodegenContractViolations, studioDefaultLeadUi, studioLayoutInstruction, studioLeadInstruction, studioListingCardInstruction, studioListingDetailInstruction, studioListingViewInstruction, studioMapSearchInstruction, studioMapsInstruction, studioMarketInstruction, studioPhotoInstruction, studioPhotoInstructionFor, studioPhotoSearchInstruction, studioPublishableKeyInstruction, studioSdkPinInstruction, studioSearchInstruction, studioSearchLandmarkInstruction, studioSellerLeadSdkInstruction, studioShareLinkInstruction, studioSiteWidthCss, submitContactLead, submitSellerLead, submitVisitLead, toE164, trackListingView, travelTimeCacheKey, travelTimeFromListing, travelTimesFromListing, truncateNationalPhoneDigits, unavailableReactImports, uploadSellerLeadPhoto };
package/dist/index.js CHANGED
@@ -53,6 +53,7 @@ __export(src_exports, {
53
53
  STUDIO_SITE_LAYOUT: () => STUDIO_SITE_LAYOUT,
54
54
  TOOLBAR_PRIMARY_FILTER_IDS: () => TOOLBAR_PRIMARY_FILTER_IDS,
55
55
  VISIT_TIME_ZONE: () => VISIT_TIME_ZONE,
56
+ analyticsDocumentGuardSource: () => analyticsDocumentGuardSource,
56
57
  applyMatchedPhotoCover: () => applyMatchedPhotoCover,
57
58
  applyPathFilter: () => applyPathFilter,
58
59
  boundaryCitySlug: () => boundaryCitySlug,
@@ -106,6 +107,7 @@ __export(src_exports, {
106
107
  hrefForAppliedChange: () => hrefForAppliedChange,
107
108
  hrefForPathFilters: () => hrefForPathFilters,
108
109
  hrefWithExplicitPage: () => hrefWithExplicitPage,
110
+ isAnalyticsDocumentUrl: () => isAnalyticsDocumentUrl,
109
111
  isAnalyticsOnPin: () => isAnalyticsOnPin,
110
112
  isListingDetailPath: () => isListingDetailPath,
111
113
  isMapBounds: () => isMapBounds,
@@ -710,6 +712,75 @@ async function getShareLink(options) {
710
712
  );
711
713
  }
712
714
 
715
+ // src/analytics-document.ts
716
+ var FILTER_SEGMENT_SOURCE = "(?:^|-)(?:quartos|banheiros|suites|suite|vagas)$|(?:^|-)(?:reais|m2)$|^mapa$";
717
+ var CLICK_ID_SOURCE = "^(?:fbclid|gclid|gbraid|wbraid|msclkid|ttclid|igshid|yclid|twclid|mc_eid|mc_cid|gad_source|_gl)$";
718
+ var DOCUMENT_QUERY_KEYS = ["q", "ordenar", "page", "pagina"];
719
+ var FILTER_SEGMENT = new RegExp(FILTER_SEGMENT_SOURCE, "i");
720
+ var CLICK_ID = new RegExp(CLICK_ID_SOURCE);
721
+ function isAnalyticsDocumentUrl(href) {
722
+ let url;
723
+ try {
724
+ url = new URL(href, "https://site.invalid");
725
+ } catch {
726
+ return true;
727
+ }
728
+ const pageRaw = param(url, "page") ?? param(url, "pagina");
729
+ if (pageRaw != null && pageRaw !== "") {
730
+ const page = Number(pageRaw);
731
+ if (!Number.isInteger(page) || page !== 1) return false;
732
+ }
733
+ const path = url.pathname.replace(/\/+$/, "").toLowerCase() || "/";
734
+ if (path !== "/imoveis" && !path.startsWith("/imoveis/")) return true;
735
+ for (const key of url.searchParams.keys()) {
736
+ if (ignoredQuery(key.toLowerCase())) continue;
737
+ return false;
738
+ }
739
+ const segments = path.split("/").filter(Boolean).slice(1);
740
+ return segments.every((segment) => !FILTER_SEGMENT.test(segment));
741
+ }
742
+ function param(url, name) {
743
+ for (const [key, value] of url.searchParams) {
744
+ if (key.toLowerCase() === name) return value;
745
+ }
746
+ return null;
747
+ }
748
+ function ignoredQuery(key) {
749
+ return DOCUMENT_QUERY_KEYS.includes(key) || key.startsWith("utm_") || CLICK_ID.test(key);
750
+ }
751
+ function analyticsDocumentGuardSource() {
752
+ return `const FILTER_SEGMENT = /${FILTER_SEGMENT_SOURCE}/i;
753
+ const CLICK_ID = /${CLICK_ID_SOURCE}/;
754
+ const DOCUMENT_QUERY = ["q", "ordenar", "page", "pagina"];
755
+
756
+ function documentUrl(href) {
757
+ let url;
758
+ try {
759
+ url = new URL(href, "https://site.invalid");
760
+ } catch {
761
+ return true;
762
+ }
763
+ let pageRaw = null;
764
+ for (const [key, value] of url.searchParams) {
765
+ const name = key.toLowerCase();
766
+ if (pageRaw == null && (name === "page" || name === "pagina")) pageRaw = value;
767
+ }
768
+ if (pageRaw != null && pageRaw !== "") {
769
+ const page = Number(pageRaw);
770
+ if (!Number.isInteger(page) || page !== 1) return false;
771
+ }
772
+ const path = url.pathname.replace(/\\/+$/, "").toLowerCase() || "/";
773
+ if (path !== "/imoveis" && !path.startsWith("/imoveis/")) return true;
774
+ for (const key of url.searchParams.keys()) {
775
+ const name = key.toLowerCase();
776
+ if (DOCUMENT_QUERY.includes(name) || name.startsWith("utm_") || CLICK_ID.test(name)) continue;
777
+ return false;
778
+ }
779
+ const segments = path.split("/").filter(Boolean).slice(1);
780
+ return segments.every((segment) => !FILTER_SEGMENT.test(segment));
781
+ }`;
782
+ }
783
+
713
784
  // ../search-url/types.ts
714
785
  var SEARCH_BASE_ROUTE = "imoveis";
715
786
  var MAX_PAGE = 1e4;
@@ -1586,8 +1657,17 @@ function searchChromeModel(schema, pathFilters, locationNames) {
1586
1657
 
1587
1658
  // src/analytics.ts
1588
1659
  var SITE_ANALYTICS_EVENT = "garagem:site-event";
1660
+ function browserPageHref() {
1661
+ if (typeof window === "undefined") return null;
1662
+ const location = window.location;
1663
+ return typeof location?.href === "string" ? location.href : null;
1664
+ }
1589
1665
  function emitSiteEvent(event, properties) {
1590
1666
  if (typeof window === "undefined") return;
1667
+ const href = browserPageHref();
1668
+ if (href && event !== "lead_generated" && !isAnalyticsDocumentUrl(href)) {
1669
+ return;
1670
+ }
1591
1671
  window.dispatchEvent(
1592
1672
  new CustomEvent(SITE_ANALYTICS_EVENT, { detail: { event, properties } })
1593
1673
  );
@@ -3515,7 +3595,10 @@ var STUDIO_SDK_CONTRACT = {
3515
3595
  "rangeDraftFromPath",
3516
3596
  // `unknownSearchLocation` is in git. Prompts inline the same check with
3517
3597
  // `parseSearchPublicPath` + `locationsPath` until this name is on the pin.
3518
- "unknownSearchLocation"
3598
+ "unknownSearchLocation",
3599
+ // In git. The installed client inlines the check. Naming it in a prompt
3600
+ // makes v0 import it from the pinned tarball, which does not export it.
3601
+ "isAnalyticsDocumentUrl"
3519
3602
  ],
3520
3603
  /**
3521
3604
  * maps.fndn.ai helpers (static map, street view, boundaries, travel
@@ -5255,6 +5338,7 @@ function applyMatchedPhotoCover(cards, photoResults, options = {}) {
5255
5338
  STUDIO_SITE_LAYOUT,
5256
5339
  TOOLBAR_PRIMARY_FILTER_IDS,
5257
5340
  VISIT_TIME_ZONE,
5341
+ analyticsDocumentGuardSource,
5258
5342
  applyMatchedPhotoCover,
5259
5343
  applyPathFilter,
5260
5344
  boundaryCitySlug,
@@ -5308,6 +5392,7 @@ function applyMatchedPhotoCover(cards, photoResults, options = {}) {
5308
5392
  hrefForAppliedChange,
5309
5393
  hrefForPathFilters,
5310
5394
  hrefWithExplicitPage,
5395
+ isAnalyticsDocumentUrl,
5311
5396
  isAnalyticsOnPin,
5312
5397
  isListingDetailPath,
5313
5398
  isMapBounds,