{"version":3,"sources":["webpack:///./src/modules/RelatedItemsModule/RelatedItemsModule.types.ts","webpack:///./src/modules/RelatedItemsModule/RelatedItemsModule.vue?96a1","webpack:///./src/modules/RelatedItemsModule/RelatedItemsModule.ts?1217","webpack:///./src/modules/RelatedItemsModule/RelatedItemsModule.ts","webpack:///./src/modules/RelatedItemsModule/RelatedItemsModule.vue"],"names":["convertToGridConfig","data","Cards","Items","Paging","Total","length","PageSize","PageSizeMedium","PageSizeSmall","ViewCounts","LoadMoreButton","Title","ViewMoreText","Link","AppliedFilters","wasInteracted","spaceBetween","this","threeOrLess","slidesPerView","speed","centeredSlides","loop","simulateTouch","freeMode","wrapperClass","slideClass","observeParents","observer","mousewheel","forceToAxis","invert","scrollbar","el","uuid","draggable","snapOnRelease","breakpoints","sm","lg","on","slideChange","onModuleInteraction","touchStart","type","SegmentElement","sendEvent","component_name","p","CardType","module_type_id","$attrs","module_type_name","interaction_type","position","swiper","activeIndex","Category","toLowerCase","isInBreakpoint","RelatedItemsModule","components","GenericCard","FilterableGridModule","props","TitleSmall","IsGrid","BookLink","ViewMoreLink","Image","Url","Alt","Price","Days","IsNew","SpecialOffers","Highlights","Months","Locations","Wishlist","Type","ContentType","Watch","Date","ArticleLink","SwiperMixin","component","_vm","_h","$createElement","_c","_self","staticClass","class","_v","_s","_e","attrs","GridConfig","fourOrMore","ref","padding","isItinerary","swiperOption","_l","item","index","key","directives","name","rawName","arg","value","expression","hideScrollbar","hideScrollBar","slot"],"mappings":"+FAmBO,SAASA,EAAoBC,GAClC,MAAO,CACLC,MAAOD,EAAKE,MACZC,OAAQ,CACNC,MAAOJ,EAAKE,MAAMG,OAClBC,SAAU,GACVC,eAAgB,EAChBC,cAAe,EACfC,YAAY,EACZC,eAAgB,CACdC,MAAOX,EAAKY,cAAgB,wBAC5BC,KAAM,MAGVC,eAAgB,MAdpB,0D,wCCnBA,I,gGCAsI,ECuDtI,uE,OAEE,EAAAC,eAAgB,E,EA8FlB,OAhGgD,iBAI9C,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,KAAKF,YAAY4E,EAAIS,MAAM,IACtoD,IGWpB,EACA,KACA,KACA,MAIa,UAAAV,E","file":"22.d1e1c204109ad82ee515.js","sourcesContent":["import ArticleCard from '@/common/interfaces/modules/ArticleCard';\nimport { ItineraryCard } from '@/components/ItineraryCard/ItineraryCard.types';\nimport LinkItem from '@/common/interfaces/LinkItem';\nimport {\n FilterableGridViewModel,\n IGridCard,\n} from '@/modules/FilterableGridModule/FilterableGridModule.types';\n\nexport interface RelatedItemsModuleViewModel {\n Title?: string;\n TitleSmall?: string;\n // We need a way to define category that gets passed for a layout perspective on the front-end. Will explain further at a later date\n Category?: string;\n Link?: LinkItem;\n Items: Array;\n IsGrid?: boolean;\n ViewMoreText?: string;\n}\n\nexport function convertToGridConfig(data: RelatedItemsModuleViewModel): FilterableGridViewModel {\n return {\n Cards: data.Items as IGridCard[],\n Paging: {\n Total: data.Items.length,\n PageSize: 12,\n PageSizeMedium: 8,\n PageSizeSmall: 4,\n ViewCounts: false,\n LoadMoreButton: {\n Title: data.ViewMoreText || 'View more Itineraries',\n Link: '#',\n },\n },\n AppliedFilters: null\n };\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:\"related-items module module--mb\",class:{ 'non-offers container': !_vm.p.IsGrid }},[(_vm.p.Items.length)?_c('header',{staticClass:\"related-items__header\"},[(_vm.p.Title)?_c('h2',{staticClass:\"related-items__title text-uppercase\"},[_vm._v(_vm._s(_vm.p.Title))]):_vm._e(),(_vm.p.TitleSmall)?_c('h3',{staticClass:\"related-items__headline h2 text-uppercase\",class:{ 'related-items__headline--lg-title': _vm.p.Title }},[_vm._v(\"\\n \"+_vm._s(_vm.p.TitleSmall)+\"\\n \")]):_vm._e()]):_vm._e(),(_vm.p.IsGrid)?_c('FilterableGridModule',{attrs:{\"p\":_vm.GridConfig}}):_c('div',{class:{ threeOrLess: _vm.threeOrLess, fourOrMore: _vm.fourOrMore }},[_c('swiper',{ref:\"swiper\",class:{ padding: !_vm.isItinerary && !_vm.threeOrLess, threeOrLess: _vm.threeOrLess },attrs:{\"options\":_vm.swiperOption}},[_vm._l((_vm.p.Items),function(item,index){return _c('swiper-slide',{key:index},[_c('GenericCard',{directives:[{name:\"segment\",rawName:\"v-segment:moduleClicked\",arg:\"moduleClicked\"},{name:\"segment\",rawName:\"v-segment:params\",value:({position: index + 1, component_name: 'Article'}),expression:\"{position: index + 1, component_name: 'Article'}\",arg:\"params\"}],attrs:{\"card\":item}})],1)}),_c('div',{staticClass:\"swiper-scrollbar related-items__scrollbar\",class:{ hideScrollbar: _vm.hideScrollBar },attrs:{\"slot\":\"scrollbar\",\"id\":(\"c-\" + _vm.uuid + \"-swiper-scrollbar\")},slot:\"scrollbar\"})],2)],1),(_vm.p.Link)?_c('div',{staticClass:\"related-items__button\"},[_c('a',{staticClass:\"button button--tertiary\",attrs:{\"href\":_vm.p.Link.Link}},[_vm._v(_vm._s(_vm.p.Link.Title))])]):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/ts-loader/index.js??ref--0!./RelatedItemsModule.ts?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/ts-loader/index.js??ref--0!./RelatedItemsModule.ts?vue&type=script&lang=ts&\"","import { Component, Vue } from 'vue-property-decorator';\nimport { getComponentProps } from '@/utils/vueUtils';\nimport { RelatedItemsModuleViewModel, convertToGridConfig } from './RelatedItemsModule.types';\nimport ContentType from '@/common/interfaces/enums/ContentType';\nimport { SwiperOptions } from '@/utils/swiperUtils';\n\nimport { getResizeImage } from '@/utils/commonUtils';\n\nimport GenericCard from '@/components/GenericCard/GenericCard.vue';\nimport SizeBreakpoints, { BREAKPOINTS } from '@/common/interfaces/SizeBreakpoints';\nimport { Getter } from 'vuex-class';\nimport { mixins } from 'vue-class-component';\nimport SwiperMixin from '@/mixins/SwiperMixin';\nimport { SegmentElement } from '@/plugins/utm/SegmentElement';\n\n@Component({\n components: {\n GenericCard,\n FilterableGridModule: () => import('@/modules/FilterableGridModule/FilterableGridModule.vue'),\n },\n props: getComponentProps({\n Title: '',\n TitleSmall: 'Special offers',\n Link: { Title: 'View all articles', Link: '#' },\n Category: '',\n IsGrid: false,\n Items: [\n {\n CardType: 'Itinerary',\n BookLink: '#',\n ViewMoreLink: '#',\n Image: {\n Url: getResizeImage('whale.jpg'),\n Alt: 'Whale',\n },\n Title: 'A remarkable journey to Alaska, British Columbia & Haida gwaii',\n Price: '$10,900',\n Days: 15,\n IsNew: false,\n SpecialOffers: [],\n Highlights: ['Land of mist shrouded fjords', 'Tidewater glaciers'],\n Months: ['May', 'Aug', 'Sep'],\n Locations: ['Alaska'],\n Wishlist: true,\n },\n {\n CardType: 'Article',\n Type: ContentType.Watch,\n Image: { Url: getResizeImage('moose.jpg'), Alt: 'Moose' },\n Date: 'Jun 2019',\n ArticleLink: { Title: 'Small Tracks, Big Impacts...', Link: '#' },\n },\n ],\n }),\n})\nexport default class RelatedItemsModule extends mixins(SwiperMixin) {\n readonly p!: RelatedItemsModuleViewModel;\n wasInteracted = false;\n\n get swiperOption(): SwiperOptions {\n return {\n spaceBetween: this.threeOrLess ? 0 : 20,\n slidesPerView: this.threeOrLess ? 'auto' : 3.5,\n speed: 250,\n centeredSlides: false,\n loop: false,\n simulateTouch: true,\n freeMode: true,\n wrapperClass: 'swiper-wrapper',\n slideClass: 'swiper-slide',\n observeParents: true,\n observer: true,\n mousewheel: {\n forceToAxis: true,\n invert: true,\n },\n scrollbar: {\n el: `#c-${this.uuid}-swiper-scrollbar`,\n draggable: true,\n snapOnRelease: false,\n },\n breakpoints: {\n // breakpoints work down from these values not up\n [BREAKPOINTS.sm]: {\n freeMode: true,\n slidesPerView: 'auto',\n },\n [BREAKPOINTS.lg]: {\n freeMode: true,\n scrollbar: {\n el: `#c-${this.uuid}-swiper-scrollbar`,\n snapOnRelease: false,\n },\n },\n },\n on: {\n slideChange: () => this.onModuleInteraction('change'),\n touchStart: () => this.onModuleInteraction(),\n },\n };\n }\n\n onModuleInteraction(type?: string) {\n if (!this.wasInteracted) {\n SegmentElement.sendEvent('moduleInteraction', {\n component_name: this.p.Items[0]?.CardType,\n module_type_id: this.$attrs['data-segmentid'],\n module_type_name: this.$attrs.type,\n interaction_type: 'carousel',\n position: type === 'change' ? this.swiper.activeIndex : this.swiper.activeIndex + 1,\n })\n this.wasInteracted = true;\n }\n }\n\n // relating to Edge issue where scrolbar drags in the wrong direction as touch screen type is computed incorrectly\n // need this to be incorporated into swiper but can't change the node file as it isn't tracked.\n // works if you replace the touch: section in the swiper.js file (line 971)\n // https://github.com/nolimits4web/swiper/issues/3232\n\n // touch: (win.Modernizr && win.Modernizr.touch === true) || (function checkTouch() {\n // return (('ontouchstart' in window)\n // || (navigator.MaxTouchPoints > 0)\n // || (navigator.msMaxTouchPoints > 0));\n // }()),\n\n get threeOrLess() {\n return this.p.Items.length <= 3;\n }\n\n get fourOrMore() {\n return this.p.Items.length >= 4;\n }\n\n get Category() {\n const cat = this.p.Category.toLowerCase();\n return cat;\n }\n\n get isItinerary() {\n return this.p.Items[0]?.CardType === 'Itinerary';\n }\n\n @Getter isInBreakpoint!: (breakpoints: SizeBreakpoints[] | SizeBreakpoints) => boolean;\n get hideScrollBar() {\n return this.threeOrLess && this.isInBreakpoint(['lg', 'xl', 'xxl']);\n }\n\n get GridConfig() {\n return convertToGridConfig(this.p);\n }\n}\n","import { render, staticRenderFns } from \"./RelatedItemsModule.vue?vue&type=template&id=1dd2362c&\"\nimport script from \"./RelatedItemsModule.ts?vue&type=script&lang=ts&\"\nexport * from \"./RelatedItemsModule.ts?vue&type=script&lang=ts&\"\nimport style0 from \"./RelatedItemsModule.scss?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}