(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[352],{xyEF:function(e,t,s){"use strict";s.r(t);var i=function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("tb-w-section",{directives:[{name:"show",rawName:"v-show",value:!this.loaderSuspense,expression:"!loaderSuspense"}],scopedSlots:this._u([{key:"content",fn:function(){return[t("skeleton-loader",{attrs:{width:"100%",height:"25rem",animation:"fade",type:"rect",radius:6,rounded:!0}})]},proxy:!0}])}),this._v(" "),t("transition",{attrs:{name:"fade"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:this.loaderSuspense,expression:"loaderSuspense"}]},[this.mergedSnowReports.length?t("tb-w-article-detail-snow-reports",{attrs:{"snow-reports":this.mergedSnowReports,"hide-headline":""}}):this._e()],1)])],1)};i._withStripped=!0;var o=s("m5nq"),r={props:{id:{type:String,required:!0},type:{type:String,required:!0}},data:()=>({article:null,snowReports:[],snowReportsInherited:[],loaderSuspense:!1}),computed:{visibleInheritedSnowReports(){var e,t;let s=this.snowReportsInherited;return s.length?(null!==(e=this.article)&&void 0!==e&&null!==(t=e.snowReportsHidden)&&void 0!==t&&t.length&&(s=s.filter(e=>!this.article.snowReportsHidden.includes(e.id))),s):[]},mergedSnowReports(){return[...this.snowReports,...this.visibleInheritedSnowReports]}},methods:{async fetchArticle(e,t){this.article=null;try{const s=await this.articleRepository.fetch(e,{language:this.$store.state.language},t);this.article=s.payload}catch(e){console.error(e)}},async fetchSnowReports(e,t){try{const s=await this.articleRepository.snowReports(e,t);this.snowReports=s.payload}catch(e){console.error(e)}},async fetchSnowReportsInherited(e,t){try{const s=await this.articleRepository.snowReportsInherited(e,t);this.snowReportsInherited=s.payload}catch(e){console.error(e)}},async fetchArticleAndSnowReports(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;const t="skiArea"===this.type?o.a.VERSION_2:o.a.VERSION_1,s=[];this.articleRepository&&s.push(this.fetchArticle(e,t)),this.articleRepository&&t===o.a.VERSION_2?s.push(this.fetchSnowReports(e,t)):this.articleRepository&&s.push(this.fetchSnowReports(e,t),this.fetchSnowReportsInherited(e,t)),await Promise.all(s)}},watch:{article(){this.article&&setTimeout(()=>{this.loaderSuspense=!0},300)},id:{immediate:!0,handler(e){this.fetchArticleAndSnowReports(e)}}}},n=s("KHd+"),a=Object(n.a)(r,i,[],!1,null,null,null);a.options.__file="node_modules/@newland/toubiz-widget/src/routes/snow-report.vue";t.default=a.exports}}]);