{"version":3,"file":"destinations-DwRmgj0s.js","sources":["../../../scripts/components/pages/destinations-landing-page.vue","../../../scripts/entry-points/destinations.ts"],"sourcesContent":["<template>\r\n    <div v-if=\"isReady\">\r\n        <destination-header-component :content=\"headerContent\"></destination-header-component>\r\n\r\n        <!-- Featured Destinations -->\r\n        <section v-if=\"featuredDestinations.content.length\" class=\"container px-lg-0 pb-0 my-4\">\r\n            <h2 class=\"text--serif mb-2\">{{ featuredDestinations.header }}</h2>\r\n            <feature-cards-component class=\"featured-destinations\" :content=\"featuredDestinations.content\" :use-paging=\"true\" @feature-card-click=\"trackFeatureCardDestination\"></feature-cards-component>\r\n        </section>\r\n\r\n        <!-- Regions -->\r\n        <section v-if=\"regions.content.length\" class=\"container px-lg-0 pb-0 my-4\">\r\n            <h2 class=\"text--serif mb-2\">{{ regions.header }}</h2>\r\n            <feature-cards-component class=\"destinations-regions\" :content=\"regions.content\" @feature-card-click=\"trackFeatureCardDestination\"></feature-cards-component>\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        <!-- Themed Articles -->\r\n        <section v-if=\"themedArticles.content.length\" class=\"container px-lg-0 pb-0 my-4\">\r\n            <h2 class=\"text--serif mb-2\" v-html=\"themedArticles.header\"></h2>\r\n            <content-tiles-component :content-tiles=\"themedArticles.content\" class=\"themed-articles\" :layout-class=\"getColumnClass(themedArticles.content.length) + ' -tall -featured'\" :should-track-content-tile-views=\"true\"></content-tiles-component>\r\n        </section>\r\n\r\n        <!-- Featured Articles -->\r\n        <section v-if=\"featuredArticles.content.length\" class=\"container px-lg-0 pb-0 my-4\">\r\n            <h2 class=\"text--serif mb-2\" v-html=\"featuredArticles.header\"></h2>\r\n            <content-tiles-component :content-tiles=\"featuredArticles.content\" class=\"featured-articles\" :layout-class=\"getColumnClass(featuredArticles.content.length) + ' -tall -flush'\" :should-track-content-tile-views=\"true\"></content-tiles-component>\r\n        </section>\r\n\r\n        <!-- Products -->\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    <LogoSplash v-else />\r\n</template>\r\n\r\n\r\n<script setup lang=\"ts\">\r\n    import FindAnAdvisorCtaComponent from \"components/advisor/find-an-advisor-cta.vue\";\r\n    import DestinationHeaderComponent from \"components/destination/destination-header.vue\";\r\n    import ProductCardsComponent from \"components/products/product-cards.vue\";\r\n    import ContentTilesComponent from \"components/shared/content-tiles.vue\";\r\n    import FeatureCardsComponent from \"components/shared/feature-cards.vue\";\r\n    import LogoSplash from \"components/shared/logo-splash.vue\";\r\n    import { DotCMSBasicArticleResponse, DotCMSDestinationsLandingPageResponse, DotCMSDestinationsResponse } from \"interfaces/responses/dotcms-responses\";\r\n    import { ContentSection, ContentTile, FeatureCard, ProductCards, ProductCardSearchResult } from \"interfaces/card\";\r\n    import { ProductType } from \"interfaces/enums\";\r\n    import { PageHeader } from \"interfaces/render\";\r\n    import { getCmsContent } from \"services/api/cms\";\r\n    import { extractCategories } from \"services/helpers/categories\";\r\n    import { buildDestinationPageURL } from \"services/helpers/destinations\";\r\n    import { generateCmsImageUrl } from \"services/helpers/images\";\r\n    import { trackEvent } from \"services/analytics\";\r\n    import { getSponsoredAndRandomProducts, 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 isReady = ref(false);\r\n    const headerContent = ref<PageHeader>({\r\n        title: \"\",\r\n        subhead: \"\",\r\n        backgroundImageUrl: \"\",\r\n        backgroundImageCropFocus: \"\",\r\n        backgroundImageDesktopUrl: \"\",\r\n        backgroundImageDesktopCropFocus: \"\",\r\n        metadata: {\r\n            description: \"\",\r\n            keywords: \"\",\r\n            title: \"Destinations\"\r\n        }\r\n    });\r\n\r\n    const featuredDestinations = ref<ContentSection<FeatureCard[]>>({\r\n        header: \"Popular Destinations\",\r\n        content: []\r\n    });\r\n\r\n    const regions = ref<ContentSection<FeatureCard[]>>({\r\n        header: \"Browse Destinations\",\r\n        content: []\r\n    });\r\n\r\n    const themedArticles = ref<ContentSection<ContentTile[]>>({\r\n        header: \"Fun Destinations\",\r\n        content: []\r\n    });\r\n    const featuredArticles = ref<ContentSection<ContentTile[]>>({\r\n        header: \"Get Inspired\",\r\n        content: []\r\n    });\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 trackFeatureCardDestination = (featuredCard: FeatureCard): void => {\r\n            trackEvent(\"select_item\", {\r\n                item_id: featuredCard.url,\r\n                item_name: featuredCard.name,\r\n                item_category: \"Destination\"\r\n            });\r\n    };\r\n\r\n    getCmsContent<DotCMSDestinationsLandingPageResponse[]>({\r\n        contentTypes: [\"DestinationsLandingPage\"],\r\n        depth: 1,\r\n        limit: 1\r\n    }).then((destinationJSON) => {\r\n\r\n        if (destinationJSON?.length) {\r\n\r\n            // Transform all the returned data into simple shapes\r\n            const dest = destinationJSON[0];\r\n\r\n            // Get products, sponsored + random\r\n            getSponsoredAndRandomProducts(ProductType.CRUISES, { rowsLimit: 3 }, dest.sponsoredCruiseIds).then((prods: ProductCardSearchResult) => {\r\n                cruises.value.productCards = prods.productCards;\r\n                cruises.value.viewAllText = getViewAllLabel(ProductType.CRUISES, prods.totalResults, 3);\r\n            });\r\n            getSponsoredAndRandomProducts(ProductType.HOTELS, { rowsLimit: 3 }, dest.sponsoredHotelIds).then((prods: ProductCardSearchResult) => {\r\n                hotels.value.productCards = prods.productCards;\r\n                hotels.value.viewAllText = getViewAllLabel(ProductType.HOTELS, prods.totalResults, 3);\r\n            });\r\n\r\n            getSponsoredAndRandomProducts(ProductType.TOURS, { rowsLimit: 3 }, dest.sponsoredTourIds).then((prods: ProductCardSearchResult) => {\r\n                tours.value.productCards = prods.productCards;\r\n                cruises.value.viewAllText = getViewAllLabel(ProductType.TOURS, prods.totalResults, 3);\r\n            });\r\n\r\n            // Destination header\r\n            headerContent.value = {\r\n                title: dest.title,\r\n                subhead: (dest.tagline && dest.tagline !== \"\") ? dest.tagline : \"\",\r\n                backgroundImageUrl: (dest.headerImage && dest.headerImage !== \"\") ? generateCmsImageUrl(dest.headerImage) : \"\",\r\n                backgroundImageCropFocus: (dest.headerImageCropFocus && dest.headerImageCropFocus !== \"\") ? dest.headerImageCropFocus : \"\",\r\n                backgroundImageDesktopUrl: (dest.headerImageDesktop && dest.headerImageDesktop !== \"\") ? generateCmsImageUrl(dest.headerImageDesktop) : \"\",\r\n                backgroundImageDesktopCropFocus: (dest.headerImageDesktopCropFocus && dest.headerImageDesktopCropFocus !== \"\") ? dest.headerImageDesktopCropFocus : \"\",\r\n                metadata: {\r\n                    description: (dest.metaDescription && dest.metaDescription !== \"\") ? dest.metaDescription : \"\",\r\n                    keywords: (dest.metaKeywords && dest.metaKeywords !== \"\") ? dest.metaKeywords : \"\",\r\n                    title: (dest.metaHeadline && dest.metaHeadline !== \"\") ? dest.metaHeadline : \"Destinations\"\r\n                }\r\n            };\r\n\r\n            // Featured Destinations\r\n            featuredDestinations.value.header = dest.featuredDestinationsHeader;\r\n            (dest.featuredDestinations).forEach((featuredDest: DotCMSDestinationsResponse) => {\r\n                featuredDestinations.value.content.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            // // Region Destinations\r\n            regions.value.header = dest.regionsHeader;\r\n            (dest.regions).forEach((region: DotCMSDestinationsResponse) => {\r\n                regions.value.content.push({\r\n                    imageUrl: generateCmsImageUrl(region.gridImage),\r\n                    url: buildDestinationPageURL(region.destinationTag, region.isArbitraryDestination),\r\n                    name: region.title\r\n                });\r\n            });\r\n\r\n            // // Themed Articles\r\n            themedArticles.value.header = dest.themedArticlesHeader;\r\n            (dest.themedArticles).forEach((article: DotCMSBasicArticleResponse) => {\r\n                themedArticles.value.content.push({\r\n                    categories: (article.categories) ? extractCategories(article.categories) : [],\r\n                    identifier: article.identifier,\r\n                    imageCropFocus: article.previewImageCropFocus,\r\n                    imageUrl: generateCmsImageUrl(article.previewImage, { width: 596 }),\r\n                    title: article.headline,\r\n                    url: cobrandLink(`/travel/articles/${article.articleUrl}`)\r\n                });\r\n            });\r\n\r\n            // // Featured Articles\r\n            featuredArticles.value.header = dest.featuredArticlesHeader;\r\n            (dest.featuredArticles).forEach((article: DotCMSBasicArticleResponse) => {\r\n                featuredArticles.value.content.push({\r\n                    categories: [],\r\n                    identifier: article.identifier,\r\n                    imageCropFocus: article.previewImageCropFocus,\r\n                    imageUrl: generateCmsImageUrl(article.previewImage, { width: 596 }),\r\n                    title: article.headline,\r\n                    url: cobrandLink(`/travel/articles/${article.articleUrl}`)\r\n                });\r\n            });\r\n            isReady.value = true;\r\n        }\r\n    });\r\n\r\n    const getColumnClass = (numItems: number): string => {\r\n        return (numItems % 3 === 0) ? \"-threecols\" : \"-twocols\";\r\n    };\r\n</script>\r\n","import DestinationsLandingPageComponent from \"components/pages/destinations-landing-page.vue\";\r\nimport DestinationsPageComponent from \"components/pages/destinations-page.vue\";\r\nimport { App, createApp } from \"vue\";\r\nimport { mountApp } from \"vue-app\";\r\n\r\nlet app: App;\r\nif (window.VIRTUOSO.destinationKey) {\r\n    app = createApp(DestinationsPageComponent, { destinationKey: window.VIRTUOSO.destinationKey });\r\n} else {\r\n    app = createApp(DestinationsLandingPageComponent);\r\n}\r\n\r\nmountApp(app, \"page-app\");"],"names":["isReady","ref","headerContent","featuredDestinations","regions","themedArticles","featuredArticles","cruises","ProductType","cobrandLink","hotels","tours","trackFeatureCardDestination","featuredCard","trackEvent","getCmsContent","destinationJSON","dest","getSponsoredAndRandomProducts","prods","getViewAllLabel","generateCmsImageUrl","featuredDest","buildDestinationPageURL","region","article","extractCategories","getColumnClass","numItems","app","createApp","DestinationsPageComponent","DestinationsLandingPageComponent","mountApp"],"mappings":"w6DA6DU,MAAAA,EAAUC,EAAI,EAAK,EACnBC,EAAgBD,EAAgB,CAClC,MAAO,GACP,QAAS,GACT,mBAAoB,GACpB,yBAA0B,GAC1B,0BAA2B,GAC3B,gCAAiC,GACjC,SAAU,CACN,YAAa,GACb,SAAU,GACV,MAAO,cACX,CAAA,CACH,EAEKE,EAAuBF,EAAmC,CAC5D,OAAQ,uBACR,QAAS,CAAC,CAAA,CACb,EAEKG,EAAUH,EAAmC,CAC/C,OAAQ,sBACR,QAAS,CAAC,CAAA,CACb,EAEKI,EAAiBJ,EAAmC,CACtD,OAAQ,mBACR,QAAS,CAAC,CAAA,CACb,EACKK,EAAmBL,EAAmC,CACxD,OAAQ,eACR,QAAS,CAAC,CAAA,CACb,EAEKM,EAAUN,EAAkB,CAC9B,OAAQ,UACR,aAAc,CAAC,EACf,YAAaO,EAAY,QACzB,YAAaC,EAAY,+BAA+B,EACxD,YAAa,kBAAA,CAChB,EAEKC,EAAST,EAAkB,CAC7B,OAAQ,SACR,aAAc,CA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