1(self.webpackChunkjet2holidays=self.webpackChunkjet2holidays||[]).push([[9374],{29841:(t,e,r)=>{"use strict";r.d(e,{X:()=>a});var a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return new Promise((function(r){t.style.transition="opacity ".concat(e,"ms ease"),t.style.opacity=0,setTimeout((function(){r()}),e)}))}},64789:(t,e,r)=>{"use strict";r.r(e),r.d(e,{View:()=>c});var a=r(80887),n=r(11247);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},i.apply(null,arguments)}function s(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,d(a.key),a)}}function l(t,e,r){return e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,e||"default");if("object"!=o(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}var c=l((function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.element=e;new a.Ay(i({el:e,name:"RecentShortlists",propsData:{maxNumberOfCardsToDisplay:r.maxResultsDisplayed,tripAdvisorLabel:r.tripAdvisorLabel,dictionary:r.dictionary}},n.RecentShortlistsViewModel))}))},74073:(t,e,r)=>{"use strict";r.r(e),r.d(e,{deleteCard:()=>i,getAccountCards:()=>n,getCardUrl:()=>o,getHotels:()=>s});var a=r(40599),n=function(){return a.Ay.getJson("/client/scapi/shortlists/shortlistCard/cards")},o=function(t){return a.Ay.postJson("/client/scapi/shortlists/shortlistcard/cardurl",{card:t.card})},i=function(t,e){return a.Ay.postJson("/client/scapi/shortlists/shortlistcard/card",{cardId:t,shortlistId:e})},s=function(t){return a.Ay.getJson("/client/scapi/searchresults/hotelcontent/gethotelsforrecentsearches",{data:{hotelIds:t}})}},11247:(t,e,r)=>{"use strict";r.r(e),r.d(e,{RecentShortlistsViewModel:()=>s});var a=r(74073),n=r(29841),o=r(57992),i=r(89463).Ay.create("recentShortlists"),s={props:{maxNumberOfCardsToDisplay:{type:Number,required:!1,default:3},tripAdvisorLabel:{type:String,required:!0},dictionary:{type:Object,required:!0}},data:function(){return{shortlistCards:[],hotels:[],mostRecentCards:[],initialPageLoadTrackingComplete:!1}},created:function(){i.debug("RecentShortlists created"),this.loadData()},methods:{viewAll:function(t,e){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Streamlined_homepage",category:"Recently shortlisted",action:"Click",label:e}),window.location.href=t},loadData:function(){var t=this;i.debug("Loading data. Calling getAccountCards"),a.getAccountCards().then((function(e){if(i.debug("Response from getAccountCards: ".concat(e)),e&&e.length){t.shortlistCards=e.sort((function(t,e){return new Date(Date.parse(e.lastModified))-new Date(Date.parse(t.lastModified))}));var r=t.getHotelIdsFromShortlistCards().splice(0,t.maxNumberOfCardsToDisplay);i.debug("Calling getHotels"),a.getHotels(r).then((function(e){i.debug("Response from getHotels: ".concat(e)),t.hotels=e||[]})).then((function(){t.buildMostRecentCards()})).catch(t.handleError)}})).catch(this.handleError)},getHotelIdsFromShortlistCards:function(){var t=[];return this.shortlistCards.forEach((function(e){null!=e.hotel?t.push(e.hotel.hotelId):null!=e.holiday&&null!=e.holiday.hotel&&t.push(e.holiday.hotel.hotelId)})),Array.from(new Set(t))},buildMostRecentCards:function(){var t=this,e=this.shortlistCards.slice(0,this.maxNumberOfCardsToDisplay).map((function(e){var r=null!==e.hotel?e.hotel.hotelId:e.holiday.hotel.hotelId,a=t.hotels.find((function(t){return t.Id===r}));
1return a?{cardId:e.cardId,shortlistId:e.shortlistId,brandDescription:a.BrandDescription,brandCssClass:a.BrandCssClass,heroImage:a.HeroImage,name:a.Name,resort:a.Resort,region:a.Region,lastModified:(0,o.px)(e.lastModified,t.dictionary),rating:a.Rating,tripAdvisorRatingImage:a.TripAdvisorRatingImage,tripAdvisorReviewCount:a.TripAdvisorReviewCount,showRating:!a.IsVilla,showTripAdvisorRating:null!=a.TripAdvisorRating&&null!=a.TripAdvisorRatingImage,departureDate:e.holiday?new Date(e.holiday.departureDateTime):null,card:e}:null})).filter((function(t){return null!==t}));if(this.mostRecentCards=e,!this.initialPageLoadTrackingComplete&&this.mostRecentCards.length){var r={event:"Streamlined_homepage",category:"Recently shortlisted",action:"Impression",label:this.mostRecentCards.length.toString()};this.addToDataLayer(r),this.initialPageLoadTrackingComplete=!0}},ratingStars:function(t){return Math.floor(t)},isPlusRating:function(t){return t%1==.5},parseTripAdvisorCaption:function(t){return this.tripAdvisorLabel.replace("{0}",t)},addToDataLayer:function(t){window.dataLayer=window.dataLayer||[],window.dataLayer.push(t)},pushRemoveCardAnalytics:function(t){var e=new Date,r={event:"Streamlined_homepage",category:"Recently shortlisted",action:"Click",label:t.departureDate?t.departureDate>e?"Not interested - In - Date Search":"Not interested - Expired Search":"Not interested - Hotel Details",departure_date:t.departureDate?(0,o.ST)(t.departureDate):"",hotel:t.name,arrival_location:"".concat(t.resort,", ").concat(t.region),last_searched:t.lastModified};this.addToDataLayer(r)},removeCard:function(t){var e=this;this.pushRemoveCardAnalytics(t),a.deleteCard(t.cardId,t.shortlistId);var r=document.getElementById("shortlist-card-"+t.cardId);r&&(0,n.X)(r).then((function(){e.shortlistCards=e.shortlistCards.filter((function(e){return e.cardId!==t.cardId}));var r=e.getHotelIdsFromShortlistCards().splice(0,e.maxNumberOfCardsToDisplay),n=r.filter((function(t){return!function(t){return e.hotels.map((function(t){return t.Id})).includes(t)}(t)}));n.length>0?(i.debug("Calling getHotels"),a.getHotels(n).then((function(t){i.debug("Response from getHotels: ".concat(t)),e.hotels=t?e.hotels.concat(t):e.hotels})).then((function(){e.buildMostRecentCards()})).catch(e.handleError)):e.buildMostRecentCards()}))},selectCard:function(t){var e=new Date,r={event:"Streamlined_homepage",category:"Recently shortlisted",action:"Click",label:t.departureDate?t.departureDate>e?"Open In-Date Search":"Open Expired Search":"Open Hotel Details",departure_date:t.departureDate?(0,o.ST)(t.departureDate):"",hotel:t.name,arrival_location:"".concat(t.resort,", ").concat(t.region),last_searched:t.lastModified};this.addToDataLayer(r),a.getCardUrl(t).then((function(t){i.debug("Response from getCardUrl: ".concat(t.url)),window.location.href=t.url})).catch(this.handleError)},handleError:function(t){i.error(t),this.mostRecentCards=[]}},computed:{cardsToDisplay:function(){return this.mostRecentCards&&this.mostRecentCards.length?this.mostRecentCards:[]}}}},45273:()=>{}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.