1"use strict";(self.webpackChunkthor_app=self.webpackChunkthor_app||[]).push([[189],{80189:function(e,t,i){i.r(t),i.d(t,{ContentLandingPagesModule:function(){return j}});var a=i(92674),r=i(16151),s=i(13074),n=i(62415),o=i(64084),c=i(37632),d=i(89477),h=i(68076),l=i(95178),g=i(17291),u=i(21597),p=i(35666),m=i(90839),f=i(5183);function v(e,t){if(1&e&&(n.\u0275\u0275elementStart(0,"div",9),n.\u0275\u0275element(1,"img",10),n.\u0275\u0275elementEnd()),2&e){const e=n.\u0275\u0275nextContext();n.\u0275\u0275advance(1),n.\u0275\u0275property("src",e.image,n.\u0275\u0275sanitizeUrl)}}function y(e,t){if(1&e&&(n.\u0275\u0275elementStart(0,"span",11),n.\u0275\u0275text(1),n.\u0275\u0275elementEnd()),2&e){const e=n.\u0275\u0275nextContext();n.\u0275\u0275advance(1),n.\u0275\u0275textInterpolate1("",e.title," ")}}let _=(()=>{class e{constructor(e,t,i,a,r,s,n,o,c){this.Authentication=e,this.route=t,this.ExploreUtils=i,this.CardUtils=a,this.Analytics=r,this.GeneralUtils=s,this.ShareData=n,this.ListsUtils=o,this.q=c,this.options=this.ExploreUtils.initOptions(),this.query=this.ExploreUtils.initQuery(this.options.pageType),this.isFavourites=!1,this.device=this.ShareData.getProperty("device"),this.devices=this.GeneralUtils.devices,this.rude=this.GeneralUtils.rudeFiltersState(),this.gridData={allAdverts:[],cards:[],hideBasket:!1,hidePrice:!1,itemOption:null,cardVariation:null,revealAll:!1,ignoreCards:0},this.callList={endOfList:!1,loadingCards:!0,currentPage:null,firstPage:!0},this.image=null,this.images=null,this.showTitle=!1,this.showImage=!1,this.search={},this.deferred=this.q.defer(),this.socialCards=this.q.defer()}ngOnInit(){this.Authentication.isFullUserLoggedIn();const e=this.route.snapshot.queryParamMap.get("format");e&&this.GeneralUtils.serviceOptions.then(({card_variations:t})=>{this.gridData.cardVariation=t.find(({format:t})=>t===e)}),this.Authentication.ensureAnyUser(void 0).then(()=>{this.init()}).catch(e=>console.log(e)),this.event2=this.ShareData.listen("device-change",e=>{this.device=e}),this.ShareData.listen("callExploreList",e=>{this.query.page.number=e,this.getCards()}),this.query.criteria.excluded_tags=this.rude?[]:["rude"],this.ShareData.listen("this.rude",(e,t)=>{(!1===t||!0===t)&&e!==t&&this.route.snapshot.queryParams.exclude&&(this.query.criteria.excluded_tags=t?[]:["rude"]);const i=this.query.criteria.excluded_tags.indexOf("rude");!0===e&&i>=0?(this.query.criteria.excluded_tags.splice(i,1),this._relaunchSearch(void 0)):!1===e&&-1===i&&(this.query.criteria.excluded_tags.push("rude"),this._relaunchSearch(void 0))})}ngOnDestroy(){this.ShareData.trigger("PromoBannerUpdate"),this.event2.unsubscribe(),this.dataObj.unsubscribe()}init(){this.dataObj=this.route.data.subscribe(e=>{this.routeData=e.page_info,this.checkData(),this.setImage();for(const t of Object.keys(this.search))this.query.criteria[t]=this.search[t];this._setDefaultOptions(),this.filterCards(),this.getCards()})}checkData(){this.routeData&&(this.routeData.images&&(this.showImage=!0,this.images=this.routeData.images),this.routeData.explore.active&&(this.routeData.explore.title&&(this.showTitle=!0,this.title=this.routeData.explore.title),this.routeData.explore.search&&(this.search=this.routeData.explore.search)))}setImage(){if(this.images)switch(this.device){case"mobile":case"mobile-large":this.image=this.images.mobile;break;case"tablet":case"desktop":case"desktop-large":this.image=this.images.desktop}}filterCards(){if(this.route.snapshot.queryParamMap.get("cardId")){let e=[];e=decodeURIComponent(this.route.snapshot.queryParamMap.get("cardId")).split(","),this.ListsUtils.getCardsByIds(e).then(e=>this.deferred.promise.then(t=>(t.slice(0,4).map(t=>{e.some((i,a)=>{if(i.card_id===t.card_id)return e.splice(a,1),!0})}),this.gridData.ignoreCards=e.length,this.gridData.ignoreCards&&(this.cardCount+=this.gridData.ignoreCards),this.socialCards.resolve(e)))).catch(e=>{this.socialCards.resolve([])})}else this.socialCards.resolve([])}getCards(){this.options.dataLoaded=!1,this.callList.loadingCards=!0,this.CardUtils.getCards(this.query).then(e=>{0===this.query.page.number?(this.callList.firstPage=!0,this.deferred.resolve(e.cards)):this.callList.firstPage=!1,(2===this.query.page.number||(this.query.page.number+1)%5==0)&&this.Analytics.customEvent("Explore","Page Loaded",this.query.page.number+1),this.socialCards.promise.then(t=>{setTimeout(()=>{this.gridData.cards=this.callList.firstPage?t.concat(e.cards):e.cards,this.ShareData.trigger("updateThorGrid"),this.callList.loadingCards=!1},50)}),e.cards.forEach(t=>{t.explore_query_id=e.id}),this.cardCount=e.total_elements+this.gridData.ignoreCards}).catch(e=>{console.log("ERROR:",e),this.ShareData.trigger("showError",e.data&&400===e.data.status?"invali
1dPage":"serverError")})}scrollToTheFirstCard(){const e=document.querySelector(".thor-grid-wrapper").offsetTop-180;window.scrollTo({top:e})}_setDefaultOptions(){this.gridData.ignoreCards=0}_relaunchSearch(e){this.query.page.number=0,document.getSelection().removeAllRanges(),document.body.blur(),this.scrollToTheFirstCard(),this._setDefaultOptions(),this.loadMore=!1,this.loadMoreClicked=!1,this.getCards()}}return e.\u0275fac=function(t){return new(t||e)(n.\u0275\u0275directiveInject(o.Vy),n.\u0275\u0275directiveInject(s.gz),n.\u0275\u0275directiveInject(c.q),n.\u0275\u0275directiveInject(d.Q),n.\u0275\u0275directiveInject(h.c),n.\u0275\u0275directiveInject(l.w),n.\u0275\u0275directiveInject(g.u),n.\u0275\u0275directiveInject(u.Z),n.\u0275\u0275directiveInject(p.Q))},e.\u0275cmp=n.\u0275\u0275defineComponent({type:e,selectors:[["content-landing-page"]],decls:10,vars:4,consts:[["id","explore",1,"yorkshire"],[1,"header-container","content"],["class","hero-image",4,"ngIf"],[1,"text-container"],[1,"page-header"],["class","headline-display",4,"ngIf"],[1,"wrapper","content"],[1,"content",2,"height","33px","padding","0 20px"],[3,"gridData","callList"],[1,"hero-image"],[3,"src"],[1,"headline-display"]],template:function(e,t){1&e&&(n.\u0275\u0275elementStart(0,"div",0),n.\u0275\u0275elementStart(1,"div",1),n.\u0275\u0275template(2,v,2,1,"div",2),n.\u0275\u0275elementStart(3,"div",3),n.\u0275\u0275elementStart(4,"h1",4),n.\u0275\u0275template(5,y,2,1,"span",5),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(6,"div",6),n.\u0275\u0275elementStart(7,"div",7),n.\u0275\u0275element(8,"thor-rude-filter"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(9,"thor-grid",8),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd()),2&e&&(n.\u0275\u0275advance(2),n.\u0275\u0275property("ngIf",t.showImage),n.\u0275\u0275advance(3),n.\u0275\u0275property("ngIf",t.title),n.\u0275\u0275advance(4),n.\u0275\u0275property("gridData",t.gridData)("callList",t.callList))},directives:[a.O5,m.B,f.d],styles:[".yorkshire[_ngcontent-%COMP%] .header-container.content[_ngcontent-%COMP%]{margin-bottom:28px}.yorkshire[_ngcontent-%COMP%] .header-container.content[_ngcontent-%COMP%] .hero-image[_ngcontent-%COMP%]{overflow:hidden;line-height:0}.yorkshire[_ngcontent-%COMP%] .header-container.content[_ngcontent-%COMP%] .hero-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%}"]}),e})();var C=i(13486),x=i(33393),D=i(65426),P=i(58267),b=i(38592),I=i(36951);let S=(()=>{class e{constructor(e,t){this.apiService=e,this.endpointService=t}fetchLandingPage(e){return this.apiService.request(this.endpointService.exploreLandingPage,{data:{url:`/${e}`},dataFormat:"urlParams",useApiKeys:!0},!0).map(this.mapResponseToLandingPageEntity).pipe((0,P.K)(()=>(0,C.of)(null)))}mapResponseToLandingPageEntity(e){const t=e.images.find(e=>"HEADER_IMAGE"===e.image_type)||{platform_images:[]},i=(e.images.find(e=>"THANK_YOU_IMAGE"===e.image_type)||{platform_images:[]}).platform_images.find(e=>"mobile"===e.image_name),a=t.platform_images.find(e=>"desktop"===e.image_name),r=t.platform_images.find(e=>"mobile"===e.image_name),{keywords:s,categories:n,tags:o,excluded_tags:c}=e.explore.explore_criteria,d=e.explore.explore_title;return{meta:{image:i&&i.image,title:d},images:{mobile:r&&r.image,desktop:a&&a.image},explore:{title:d,active:e.explore.active,search:{keywords:s,categories:n,tags:o,excluded_tags:c}}}}}return e.\u0275fac=function(t){return new(t||e)(n.\u0275\u0275inject(b.V),n.\u0275\u0275inject(I.F))},e.\u0275prov=n.\u0275\u0275defineInjectable({token:e,factory:e.\u0275fac}),e})(),q=(()=>{class e{constructor(e,t){this.contentLandingPagesService=e,this.router=t}resolve(e){const{url:t}=e.data,i=e.paramMap.get("landing-page-id")||t;return this.contentLandingPagesService.fetchLandingPage(i).pipe((0,D.b)(e=>!e&&this.router.navigate(["/page-not-found"]))).mergeMap(e=>e?(0,C.of)(e):x.E)}}return e.\u0275fac=function(t){return new(t||e)(n.\u0275\u0275inject(S),n.\u0275\u0275inject(s.F0))},e.\u0275prov=n.\u0275\u0275defineInjectable({token:e,factory:e.\u0275fac}),e})();const E=[{path:"",pathMatch:"full",redirectTo:"/page-not-found"},{path:":landing-page-id",component:_,resolve:{page_info:q}}];let O=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.\u0275\u0275defineNgModule({type:e}),e.\u0275inj=n.\u0275\u0275defineInjector({imports:[[s.Bz.forChild(E)],s.Bz]}),e})();var L=i(83913),k=i(69109),w=i(50716);let j=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.\u0275\u0275defineNgModule({type:e}),e.\u0275inj=n.\u0275\u0275defineInjector({providers:[q,S],imports:[[a.ez,r.r,O,k.SP,L.V,w.W]]}),e})()}}]);
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.