{"version":3,"file":"inspiration-CnHiOO3z.js","sources":["../../../scripts/components/pages/inspiration-landing-page.vue","../../../scripts/components/pages/topic-front.vue","../../../scripts/entry-points/inspiration.ts"],"sourcesContent":["<template>\r\n <div v-if=\"isReady\">\r\n <h1 class=\"container px-lg-0 my-2\">Inspiration</h1>\r\n\r\n <section>\r\n <div class=\"container px-lg-0\">\r\n <feature-cards class=\"destination-catalogs\" :content=\"contentCards\"></feature-cards>\r\n </div>\r\n </section>\r\n\r\n <find-an-advisor-cta></find-an-advisor-cta>\r\n\r\n <div class=\"ad-zone\">\r\n <broadstreet-zone zone-id=\"78463\"></broadstreet-zone>\r\n </div>\r\n\r\n <product-cards-component :content=\"productCardsHotels\" class=\"product-cards-container\"></product-cards-component>\r\n <product-cards-component :content=\"productCardsCruises\" :class=\"['product-cards-container', { 'pt-0': productCardsHotels.productCards.length }]\"></product-cards-component>\r\n <product-cards-component :content=\"productCardsTours\" :class=\"['product-cards-container', { 'pt-0': (productCardsHotels.productCards.length || productCardsCruises.productCards.length ) }]\"></product-cards-component>\r\n </div>\r\n <LogoSplash v-else />\r\n</template>\r\n\r\n\r\n<script setup lang=\"ts\">\r\n import FindAnAdvisorCta from \"components/advisor/find-an-advisor-cta.vue\";\r\n import ProductCardsComponent from \"components/products/product-cards.vue\";\r\n import FeatureCards from \"components/shared/feature-cards.vue\";\r\n import LogoSplash from \"components/shared/logo-splash.vue\";\r\n import { FeatureCard, ProductCards } from \"interfaces/card\";\r\n import { ProductType } from \"interfaces/enums\";\r\n import { DotCMSHtmlPageAsset } from \"interfaces/html\";\r\n import { getCmsContent } from \"services/api/cms\";\r\n import { baseImageUrl } from \"services/cms/cms\";\r\n import { toastError } from \"services/helpers/toasts\";\r\n import { getProductCards, getViewAllLabel } from \"services/product-cards\";\r\n import { cobrandLink } from \"virtuoso-shared-web-ui\";\r\n import { Ref, ref } from \"vue\";\r\n\r\n const isReady = ref(false);\r\n // Show inspiration links in a grid\r\n const contentCards: Ref<FeatureCard[]> = ref<FeatureCard[]>([]);\r\n\r\n const productCardsCruises: Ref<ProductCards> = ref<ProductCards>({\r\n header: \"Cruises\",\r\n productCards: [],\r\n productType: ProductType.CRUISES,\r\n viewAllLink: cobrandLink(\"/travel/luxury-cruises\"),\r\n viewAllText: \"See More Cruises\"\r\n });\r\n\r\n const productCardsHotels: Ref<ProductCards> = ref<ProductCards>({\r\n header: \"Hotels\",\r\n productCards: [],\r\n productType: ProductType.HOTELS,\r\n viewAllLink: cobrandLink(\"/travel/luxury-hotels/search\"),\r\n viewAllText: \"See More Hotels\"\r\n });\r\n\r\n const productCardsTours: Ref<ProductCards> = ref<ProductCards>({\r\n header: \"Tours & Experiences\",\r\n productCards: [],\r\n productType: ProductType.TOURS,\r\n viewAllLink: cobrandLink(\"/travel/luxury-tours/search\"),\r\n viewAllText: \"See More Tours & Experiences\"\r\n });\r\n\r\n\r\n // Get the pages in the /inspiration/ directory (minus specific ones)\r\n getCmsContent<DotCMSHtmlPageAsset[]>({\r\n contentTypes: [\"htmlpageasset\"],\r\n limit: 20,\r\n queryClauses: [\r\n \"+(conFolder:5fd9f7b5-c6bf-410d-9215-bb3a897bccd1)\",\r\n \"+(htmlpageasset.showOnMenu:true)\"\r\n ],\r\n sort: \"title\"\r\n }).then((pagesJSON) => {\r\n if (pagesJSON?.length) {\r\n\r\n // Transform into a simple shape\r\n pagesJSON.forEach((page) => {\r\n contentCards.value.push({\r\n imageUrl: baseImageUrl + page.image,\r\n name: page.title,\r\n url: cobrandLink(`/travel/${page.friendlyName}`)\r\n });\r\n });\r\n\r\n\r\n // Get random products\r\n getProductCards(ProductType.CRUISES, { rowsLimit: 3 }).then((productCards) => {\r\n if (productCards.productCards.length) {\r\n productCardsCruises.value.productCards = productCards.productCards;\r\n productCardsCruises.value.viewAllText = getViewAllLabel(ProductType.CRUISES, productCards.totalResults, 3);\r\n }\r\n });\r\n\r\n getProductCards(ProductType.HOTELS, { rowsLimit: 3 }).then((productCards) => {\r\n if (productCards.productCards.length) {\r\n productCardsHotels.value.productCards = productCards.productCards;\r\n productCardsHotels.value.viewAllText = getViewAllLabel(ProductType.HOTELS, productCards.totalResults, 3);\r\n }\r\n });\r\n\r\n getProductCards(ProductType.TOURS, { rowsLimit: 3 }).then((productCards) => {\r\n if (productCards.productCards.length) {\r\n productCardsTours.value.productCards = productCards.productCards;\r\n productCardsTours.value.viewAllText = getViewAllLabel(ProductType.TOURS, productCards.totalResults, 3);\r\n }\r\n });\r\n\r\n isReady.value = true;\r\n\r\n } else {\r\n console.error(\"No inspiration pages found\", pagesJSON);\r\n }\r\n }).catch((err) => {\r\n\r\n // TODO -- display something useful if it 404s (which it shouldn't)\r\n toastError(\"Error retrieving data\");\r\n console.error(\"Error retrieving inspiration pages\", err);\r\n });\r\n\r\n</script>\r\n","<template>\r\n <div v-if=\"isReady\">\r\n <div class=\"container px-lg-0 pb-0 my-2\">\r\n <h1 v-html=\"pageTitle\"></h1>\r\n </div>\r\n\r\n <section class=\"mb-3\">\r\n <featured-article-component v-if=\"featuredArticle\" :content=\"featuredArticle\" class=\"container px-0\" :page-name=\"pageName\"></featured-article-component>\r\n <div v-else class=\"container px-lg-0 mb-6\">No articles found.</div>\r\n </section>\r\n\r\n <section class=\"container px-lg-0\">\r\n <article-cards-component :event-start-index=\"2\" header-text=\"\" :page-name=\"pageName\" :lazy-load=\"true\" :search-criteria=\"articleSearchCriteria\"></article-cards-component>\r\n </section>\r\n\r\n <section v-if=\"hasHtmlBlobs\" :class=\"htmlBlobContent[0].containerClasses\" data-testid=\"blob-section\">\r\n <template v-for=\"(htmlBlob, blobIndex) in htmlBlobs\" :key=\"blobIndex\">\r\n <html-blob-component :html=\"htmlBlob.toString()\"></html-blob-component>\r\n </template>\r\n </section>\r\n\r\n <find-an-advisor-cta-component></find-an-advisor-cta-component>\r\n\r\n <div class=\"ad-zone\"><broadstreet-zone zone-id=\"78463\"></broadstreet-zone></div>\r\n\r\n <section v-if=\"featuredDestinations.length\" class=\"container-xl px-1 px-lg-0\">\r\n <h2 class=\"text--serif mb-2\" v-html=\"featuredDestinationsHeader\"></h2>\r\n <feature-cards-component class=\"featured-destinations\" :content=\"featuredDestinations\" :use-destination-tracking=\"true\"></feature-cards-component>\r\n </section>\r\n\r\n <product-cards-component :content=\"hotels\" class=\"product-cards-container\"></product-cards-component>\r\n <product-cards-component :content=\"cruises\" :class=\"['product-cards-container', { 'pt-0': hotels.productCards.length }]\"></product-cards-component>\r\n <product-cards-component :content=\"tours\" :class=\"['product-cards-container', { 'pt-0': (hotels.productCards.length || cruises.productCards.length ) }]\"></product-cards-component>\r\n </div>\r\n <AppError v-else-if=\"hasError\" />\r\n <LogoSplash v-else />\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\n import FindAnAdvisorCtaComponent from \"components/advisor/find-an-advisor-cta.vue\";\r\n import ArticleCardsComponent from \"components/article/article-cards.vue\";\r\n import FeaturedArticleComponent from \"components/article/featured-article.vue\";\r\n import ProductCardsComponent from \"components/products/product-cards.vue\";\r\n import AppError from \"components/shared/app-error.vue\";\r\n import FeatureCardsComponent from \"components/shared/feature-cards.vue\";\r\n import HtmlBlobComponent from \"components/shared/html-blob-allow-side-effects.vue\";\r\n import LogoSplash from \"components/shared/logo-splash.vue\";\r\n import { DotCMSFeaturedDestinationsResponse } from \"interfaces/responses/destination-responses\";\r\n import { DotCMSBasicArticleResponse, DotCMSDestinationsResponse } from \"interfaces/responses/dotcms-responses\";\r\n import { ArticleCard, FeatureCard, ProductCards } from \"interfaces/card\";\r\n import { CmsPageContainer, CmsSearchCriteria, ProductQuery } from \"interfaces/cms\";\r\n import { DestinationDetails, DestinationSelectedFacets } from \"interfaces/destination\";\r\n import { ProductType } from \"interfaces/enums\";\r\n import { addToShownArticleIdList, getArticles } from \"services/api/articles\";\r\n import { getCmsContent, getCmsPage } from \"services/api/cms\";\r\n import { getDestinationInfo } from \"services/api/destinations\";\r\n import { getDestinationQueryClauseValue, transformDotCMSPageContainers } from \"services/cms/cms\";\r\n import { getCategoryVar } from \"services/helpers/categories\";\r\n import { buildDestinationPageURL, buildFacetedProductSearchUrl } from \"services/helpers/destinations\";\r\n import { generateCmsImageUrl } from \"services/helpers/images\";\r\n import { toastError } from \"services/helpers/toasts\";\r\n import { transformCmsBasicArticleToArticleCard } from \"services/transformers/article\";\r\n import { getProductCards, getViewAllLabel } from \"services/product-cards\";\r\n import { cobrandLink } from \"virtuoso-shared-web-ui\";\r\n import { ref } from \"vue\";\r\n\r\n const props = defineProps({\r\n topicKey: {\r\n type: String,\r\n required: true\r\n },\r\n destinationKey: {\r\n type: String,\r\n required: false,\r\n default: \"\"\r\n }\r\n });\r\n\r\n const category = getCategoryVar(props.topicKey);\r\n // Virtuoso, The Magazine category tag was renamed from Virtuoso Life but the dotCMS variable cannot be changed\r\n // Use the appropriate dotCMS variable reference here so it pulls the correct articles\r\n const pageCategory = (category === \"virtuosoTheMagazine\") ? \"virtuosoLife\" : category;\r\n\r\n const pageTitle = ref(\"\");\r\n const featuredDestinations = ref<FeatureCard[]>([]);\r\n const featuredDestinationsHeader = ref(\"\");\r\n\r\n const cruises = ref<ProductCards>({\r\n header: \"Cruises\",\r\n productCards: [],\r\n productType: ProductType.CRUISES,\r\n viewAllLink: cobrandLink(\"/travel/luxury-cruises/search/#\"),\r\n viewAllText: \"See More Cruises\"\r\n });\r\n\r\n const hotels = ref<ProductCards>({\r\n header: \"Hotels\",\r\n productCards: [],\r\n productType: ProductType.HOTELS,\r\n viewAllLink: cobrandLink(\"/travel/luxury-hotels/search/#\"),\r\n viewAllText: \"See More Hotels\"\r\n });\r\n\r\n const tours = ref<ProductCards>({\r\n header: \"Tours & Experiences\",\r\n productCards: [],\r\n productType: ProductType.TOURS,\r\n viewAllLink: cobrandLink(\"/travel/luxury-tours/search/#\"),\r\n viewAllText: \"See More Tours & Experiences\"\r\n });\r\n\r\n const pageName = ref(`Inspiration: ${pageTitle.value}`);\r\n const cruisesQuery = ref<ProductQuery>({ rowsLimit: 3, selectedFacets: [] });\r\n const hotelsQuery = ref<ProductQuery>({ rowsLimit: 3, selectedFacets: [] });\r\n const toursQuery = ref<ProductQuery>({ rowsLimit: 3, selectedFacets: [] });\r\n const hasCruises = ref(false); // This is true if the destinations call returns with with selected facets for the product\r\n const hasHotels = ref(false);\r\n const hasTours = ref(false);\r\n const shouldShowCruises = ref(false); // This is true only for a subset of category/product combinations, otherwise we don't show some/all product types\r\n const shouldShowHotels = ref(false); // Currently we're not showing any cruises because there aren't appropriate catalog filters\r\n const shouldShowTours = ref(false); // Accordingly, a topic front may show no products, only tours, only hotels, or only hotels and tours\r\n const isReady = ref(false);\r\n const hasError = ref(false);\r\n\r\n const htmlBlobContent = ref<CmsPageContainer<CmsPageContainer<string>[]>[]>([]);\r\n const htmlBlobs = ref<string[]>([]);\r\n const hasHtmlBlobs = ref(false);\r\n\r\n const featuredArticleId = ref(\"\");\r\n const featuredArticle = ref<ArticleCard>(undefined);\r\n const articleSearchCriteria = ref<CmsSearchCriteria>({});\r\n\r\n getCmsPage(`/inspiration/${props.topicKey}`).then((cmsPageResponse) => {\r\n\r\n const cmsPage = transformDotCMSPageContainers(cmsPageResponse);\r\n\r\n pageTitle.value = cmsPage.title;\r\n\r\n let destinationDetailsPromise;\r\n let destinationDetails = ref<DestinationDetails>(undefined);\r\n if (props.destinationKey) {\r\n\r\n destinationDetailsPromise = getDestinationInfo(`/${props.destinationKey.replace(/\\|/g, \"/\")}`);\r\n destinationDetailsPromise.then((destDetails: DestinationDetails) => {\r\n\r\n if (destDetails.name) {\r\n pageTitle.value += ` in ${destDetails.name}`;\r\n\r\n // Filtered to destinations, ignore the featured article\r\n cmsPage.containers = (cmsPage.containers).filter((container) => container.friendlyName !== \"featured-article\");\r\n destinationDetails.value = destDetails;\r\n } else {\r\n // Invalid destination, redirect to the non-filtered topic front instead\r\n console.error(\"Invalid destination name: \", destDetails?.name);\r\n location.href = cobrandLink(`/travel/${window.VIRTUOSO.topicKey}`);\r\n }\r\n\r\n }, () => {\r\n // Invalid destination, redirect to the non-filtered topic front instead\r\n console.error(\"Invalid destination, no data returned for: \", window.VIRTUOSO.destinationKey.replace(/|/g, \"/\"));\r\n location.href = cobrandLink(`/travel/${window.VIRTUOSO.topicKey}`);\r\n });\r\n }\r\n\r\n htmlBlobContent.value = (cmsPage.containers).filter((container) => container.friendlyName === \"html-blob\") as CmsPageContainer<CmsPageContainer<string>[]>[];\r\n if (htmlBlobContent.value.length) {\r\n (htmlBlobContent.value).forEach((htmlBlob) => {\r\n if (htmlBlob.content && htmlBlob.content.length) {\r\n (htmlBlob.content).forEach((htmlString) => {\r\n if (htmlString.content) {\r\n htmlBlobs.value.push(htmlString.content);\r\n hasHtmlBlobs.value = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n\r\n let articlePullPromise; // If we need to look up the latest article, we need to wait for it to resolve before we pull the other articles\r\n const destinationCmsQueryClause = (props.destinationKey) ? `+ConsumerArticleBasic.tags:(${getDestinationQueryClauseValue(props.destinationKey)})` : \"\"; // Add destination filter if needed\r\n\r\n // Featured Article\r\n const featuredArticleContainer: CmsPageContainer<DotCMSBasicArticleResponse[]>[] = (cmsPage.containers).filter((container) => container.friendlyName === \"featured-article\") as CmsPageContainer<DotCMSBasicArticleResponse[]>[];\r\n\r\n if (cmsPage.containers.length && featuredArticleContainer.length && featuredArticleContainer[0].content.length) {\r\n // There is a selected article, pass it through\r\n const articleCmsContent = featuredArticleContainer[0].content[0];\r\n\r\n // Transform into a simple shape\r\n featuredArticle.value = transformCmsBasicArticleToArticleCard(articleCmsContent, {});\r\n featuredArticleId.value = articleCmsContent.identifier;\r\n } else {\r\n\r\n // None selected, query and get a random, recent, non-sponsored article\r\n if (pageCategory) {\r\n articlePullPromise = getArticles({\r\n contentTypes: [\"ConsumerArticleBasic\"],\r\n limit: 5,\r\n queryClauses: [\r\n `+(categories:${pageCategory})`,\r\n \"+(!ConsumerArticleBasic.isSponsoredContent:1)\",\r\n destinationCmsQueryClause\r\n ],\r\n sort: \"ConsumerArticleBasic.publish desc\"\r\n }, false);\r\n\r\n articlePullPromise.then((articleJSON) => {\r\n if (articleJSON.articles.length) {\r\n\r\n const randomNumber = Math.floor(Math.random() * articleJSON.articles.length) + 1;\r\n const articleCmsContent = articleJSON.articles[randomNumber - 1];\r\n\r\n featuredArticle.value = transformCmsBasicArticleToArticleCard(articleCmsContent, {});\r\n\r\n featuredArticleId.value = articleCmsContent.identifier;\r\n addToShownArticleIdList([featuredArticleId.value]);\r\n }\r\n }).catch(() => {\r\n toastError(\"Error retrieving articles\");\r\n });\r\n } else {\r\n console.error(\"Invalid category\");\r\n }\r\n }\r\n\r\n\r\n // Wait for automatic latest story pull, if necessary, to happen so we can exclude it from the \"more stories\" query\r\n Promise.all([destinationDetailsPromise, articlePullPromise]).then(() => {\r\n // More Stories (with paging)\r\n articleSearchCriteria.value = {\r\n contentTypes: [\"ConsumerArticleBasic\"],\r\n queryClauses: [\r\n `+(categories:${pageCategory})`,\r\n `-(identifier:${featuredArticleId.value})`,\r\n destinationCmsQueryClause\r\n ],\r\n sort: \"ConsumerArticleBasic.publish desc\"\r\n };\r\n\r\n // Featured Destinations (optional)\r\n const featuredDestinationContainers: CmsPageContainer<DotCMSDestinationsResponse[]>[] = (cmsPage.containers).filter((container) => container.friendlyName === \"featured-destinations\") as CmsPageContainer<DotCMSDestinationsResponse[]>[];\r\n\r\n if (featuredDestinationContainers.length) { // There shouldn't be more than one of these, but what the heck\r\n featuredDestinationContainers.forEach((container) => {\r\n if (container.content.length && container.content[0].identifier) {\r\n\r\n featuredDestinationsHeader.value = (container.content && container.content[0] && container.content[0].title) ? container.content[0].title : `${cmsPage.title} Destinations We Love`;\r\n\r\n getCmsContent<DotCMSFeaturedDestinationsResponse[]>({\r\n contentTypes: [\"FeaturedDestinations\"],\r\n depth: 1,\r\n limit: 1,\r\n queryClauses: [\r\n `+(identifier:${container.content[0].identifier})`\r\n ]\r\n }).then((dests) => {\r\n if (dests?.length && dests[0].destinations && dests[0].destinations.length) {\r\n\r\n // Transform into a simple shape\r\n // TODO: Only populate if there are exactly 5???\r\n (dests[0].destinations).forEach((featuredDest) => {\r\n featuredDestinations.value.push({\r\n imageUrl: generateCmsImageUrl(featuredDest.gridImage),\r\n url: buildDestinationPageURL(featuredDest.destinationTag, featuredDest.isArbitraryDestination),\r\n name: featuredDest.title\r\n });\r\n });\r\n }\r\n }, () => {\r\n // It's okay if there's none, we just don't display anything\r\n });\r\n\r\n }\r\n });\r\n }\r\n\r\n // Add additional filters for specific categories\r\n // Currently not using any Communities filters\r\n let cruiseFacets: DestinationSelectedFacets[] = [];\r\n let tourFacets: DestinationSelectedFacets[] = [];\r\n let hotelFacets: DestinationSelectedFacets[] = [];\r\n switch (pageCategory) {\r\n case \"adventure\":\r\n hotelFacets.push({ category: \"property_experiences\", name: \"Adventure\" });\r\n tourFacets.push({ category: \"tour_experiences\", name: \"Adventure\" });\r\n shouldShowHotels.value = shouldShowTours.value = true;\r\n break;\r\n case \"artsCulture\":\r\n tourFacets.push({ category: \"rout_experiences\", name: \"Culture, History & Arts\" });\r\n shouldShowTours.value = true;\r\n break;\r\n case \"family\":\r\n tourFacets.push({ category: \"tour_experiences\", name: \"Family Vacations\" });\r\n shouldShowTours.value = true;\r\n break;\r\n case \"foodWine\":\r\n tourFacets.push({ category: \"tour_experiences\", name: \"Food & Win\" });\r\n shouldShowTours.value = true;\r\n break;\r\n case \"sustainableTravel\":\r\n hotelFacets.push({ category: \"property_experiences\", name: \"Ecotourism\" });\r\n shouldShowHotels.value = true;\r\n break;\r\n case \"ultraluxe\":\r\n hotelFacets.push({ category: \"product_community_list\", name: \"Virtuoso Ultraluxe Travel\" });\r\n cruiseFacets.push({ category: \"product_community_list\", name: \"Virtuoso Ultraluxe Travel\" });\r\n tourFacets.push({ category: \"product_community_list\", name: \"Virtuoso Ultraluxe Travel\" });\r\n shouldShowHotels.value = shouldShowTours.value = shouldShowCruises.value = true;\r\n break;\r\n case \"wellness\":\r\n hotelFacets.push({ category: \"property_experiences\", name: \"Wellness\" });\r\n tourFacets.push({ category: \"tour_experiences\", name: \"Wellness\" });\r\n shouldShowHotels.value = shouldShowTours.value = true;\r\n break;\r\n }\r\n\r\n\r\n if (destinationDetails.value) { // Only filter by destination if, well, we're filtered by destination\r\n hasHotels.value = destinationDetails.value.hotelTile?.count > 0;\r\n hasCruises.value = destinationDetails.value.cruiseTile?.count > 0;\r\n hasTours.value = destinationDetails.value.tourTile?.count > 0;\r\n\r\n hotelsQuery.value.selectedFacets.push(...destinationDetails.value.hotelTile?.selectedFacets.map((facet) => ({ category: facet.category, name: facet.name, selected: true })) ?? []);\r\n cruisesQuery.value.selectedFacets.push(...destinationDetails.value.cruiseTile?.selectedFacets.map((facet) => ({ category: facet.category, name: facet.name, selected: true })) ?? []);\r\n toursQuery.value.selectedFacets.push(...destinationDetails.value.tourTile?.selectedFacets.map((facet) => ({ category: facet.category, name: facet.name, selected: true })) ?? []);\r\n\r\n hotelFacets.push(...(destinationDetails.value.hotelTile?.selectedFacets ?? []));\r\n cruiseFacets.push(...(destinationDetails.value.cruiseTile?.selectedFacets ?? []));\r\n tourFacets.push(...(destinationDetails.value.tourTile?.selectedFacets ?? []));\r\n }\r\n\r\n const hotelSearchLink = buildFacetedProductSearchUrl(ProductType.HOTELS, hotelFacets);\r\n const cruiseSearchLink = buildFacetedProductSearchUrl(ProductType.CRUISES, cruiseFacets);\r\n const tourSearchLink = buildFacetedProductSearchUrl(ProductType.TOURS, tourFacets);\r\n\r\n if (shouldShowCruises.value && (hasCruises.value || !destinationDetails.value)) {\r\n getProductCards(ProductType.CRUISES, cruisesQuery.value).then((cards) => {\r\n if (cards.productCards.length) {\r\n cruises.value.productCards = cards.productCards;\r\n cruises.value.viewAllText = getViewAllLabel(ProductType.CRUISES, cards.totalResults, cruisesQuery.value.rowsLimit);\r\n cruises.value.viewAllLink = (cards.totalResults <= cruisesQuery.value.rowsLimit) ? cobrandLink(\"/travel/luxury-cruises/search\") : cruiseSearchLink;\r\n }\r\n });\r\n }\r\n\r\n if (shouldShowHotels.value && (hasHotels.value || !destinationDetails.value)) {\r\n getProductCards(ProductType.HOTELS, hotelsQuery.value).then((cards) => {\r\n if (cards.productCards.length) {\r\n hotels.value.productCards = cards.productCards;\r\n hotels.value.viewAllText = getViewAllLabel(ProductType.HOTELS, cards.totalResults, hotelsQuery.value.rowsLimit);\r\n hotels.value.viewAllLink = (cards.totalResults <= hotelsQuery.value.rowsLimit) ? cobrandLink(\"/travel/luxury-hotels/search\") : hotelSearchLink;\r\n }\r\n });\r\n }\r\n\r\n if (shouldShowTours.value && (hasTours.value || !destinationDetails.value)) {\r\n getProductCards(ProductType.TOURS, toursQuery.value).then((cards) => {\r\n if (cards.productCards.length) {\r\n tours.value.productCards = cards.productCards;\r\n tours.value.viewAllText = getViewAllLabel(ProductType.TOURS, cards.totalResults, toursQuery.value.rowsLimit);\r\n tours.value.viewAllLink = (cards.totalResults <= toursQuery.value.rowsLimit) ? cobrandLink(\"/travel/luxury-tours/search\") : tourSearchLink;\r\n }\r\n });\r\n }\r\n\r\n isReady.value = true;\r\n });\r\n }, (e) => {\r\n toastError(\"Error retrieving data\");\r\n console.error(\"Error retrieving data for topicKey: \", props.topicKey, e);\r\n hasError.value = true;\r\n });\r\n</script>\r\n","/* eslint-disable vue/one-component-per-file */\r\n\r\nimport DynamicPage from \"components/pages/dynamic/dynamic-page.vue\";\r\nimport InspirationLandingPage from \"components/pages/inspiration-landing-page.vue\";\r\nimport TopicFrontComponent from \"components/pages/topic-front.vue\";\r\nimport { trackEvent } from \"services/analytics\";\r\nimport { cobrandLink } from \"virtuoso-shared-web-ui\";\r\nimport { createApp } from \"vue\";\r\nimport { mountApp } from \"vue-app\";\r\n\r\n\r\nif (window.VIRTUOSO.topicKey && window.VIRTUOSO.topicKey !== \"index\") {\r\n if (window.VIRTUOSO.topicKey === \"virtuoso-life\") {\r\n // Immediate, redirect to virtuoso the magazine topic front instead\r\n location.href = cobrandLink(\"/travel/virtuoso-the-magazine\");\r\n }\r\n\r\n if (window.VIRTUOSO.topicKey === \"sustainable-travel\") {\r\n const app = createApp(DynamicPage,\r\n {\r\n cmsPageEndpointPath: `/inspiration/${window.VIRTUOSO.topicKey}`\r\n }\r\n );\r\n mountApp(app, \"page-app\");\r\n } else {\r\n const app = createApp(TopicFrontComponent,\r\n {\r\n topicKey: window.VIRTUOSO.topicKey,\r\n destinationKey: window.VIRTUOSO.destinationKey\r\n });\r\n mountApp(app, \"page-app\");\r\n }\r\n\r\n} else { // index -- inspiration landing page\r\n mountApp(createApp(InspirationLandingPage), \"page-app\");\r\n trackEvent(\"entry_view\", { item_name: \"Inspiration_Home\", item_category: \"Inspiration\" });\r\n}\r\n"],"names":["isReady","ref","contentCards","productCardsCruises","ProductType","cobrandLink","productCardsHotels","productCardsTours","getCmsContent","pagesJSON","page","baseImageUrl","getProductCards","productCards","getViewAllLabel","err","toastError","props","__props","category","getCategoryVar","pageCategory","pageTitle","featuredDestinations","featuredDestinationsHeader","cruises","hotels","tours","pageName","cruisesQuery","hotelsQuery","toursQuery","hasCruises","hasHotels","hasTours","shouldShowCruises","shouldShowHotels","shouldShowTours","hasError","htmlBlobContent","htmlBlobs","hasHtmlBlobs","featuredArticleId","featuredArticle","articleSearchCriteria","getCmsPage","cmsPageResponse","cmsPage","transformDotCMSPageContainers","destinationDetailsPromise","destinationDetails","getDestinationInfo","destDetails","container","htmlBlob","htmlString","articlePullPromise","destinationCmsQueryClause","getDestinationQueryClauseValue","featuredArticleContainer","articleCmsContent","transformCmsBasicArticleToArticleCard","getArticles","articleJSON","randomNumber","addToShownArticleIdList","featuredDestinationContainers","dests","featuredDest","generateCmsImageUrl","buildDestinationPageURL","cruiseFacets","tourFacets","hotelFacets","_a","_b","_c","_d","facet","_e","_f","_g","_h","_i","hotelSearchLink","buildFacetedProductSearchUrl","cruiseSearchLink","tourSearchLink","cards","e","app","createApp","DynamicPage","mountApp","TopicFrontComponent","InspirationLandingPage","trackEvent"],"mappings":"o5CAuCU,MAAAA,EAAUC,EAAI,EAA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