1import{A as t,b as e,d as i,i as s}from"./pp-accordion-CA6w9In6.js";import{F as r,o as n}from"./pp-social-media-newsroom-XnZulFRf.js";import{B as a,i as o}from"./pp-highcharts-D5Crk9o0.js";import"./pp-facet-dropdown-FY1eeaHH.js";import"./bootstrap-collapse-tT-5TXrK.js";import"./pp-slider-BLQQXShl.js";import"./pp-process-CNG5NvVa.js";class p extends(r(s)){static get properties(){return{headlinePrefix:{type:String,attribute:"headline-prefix"},gridInitial:{type:Number,attribute:"grid-initial"},gridAdd:{type:Number,attribute:"grid-add"},progressButtonText:{type:String,attribute:"progress-button-text"},progressButtonSrText:{type:String,attribute:"progress-button-sr-text"},collapseButtonText:{type:String,attribute:"collapse-button-text"},collapseButtonTextToggled:{type:String,attribute:"collapse-button-text-toggled"},grid:{type:Object,attribute:!1},ariaBusy:{type:Boolean}}}articlesList=t;errorMessage=t;grid=t;sortOrder="desc";constructor(){super(),this.headlinePrefix="Antwort zu",this.gridInitial=5,this.gridAdd=10,this.progressButtonText="Weitere Antworten anzeigen",this.progressButtonSrText="Weitere Inhalte aufklappen",this.collapseButtonText="Mehr lesen",this.collapseButtonTextToggled="Weniger lesen"}async firstUpdated(){this.initEvents(),await this.resolveApiRequestsAndRenderArticles()}async resolveApiRequestsAndRenderArticles(){this.ariaBusy=!0;try{const t=await this.fetchArticles();if(this.posts=t.posts,this.nextPaginationEntry=t?.pagination?.older,0===this.posts.length)return void(this.errorMessage=e`<div class="qs-social-media-error mt-40 typ-body-2 text-tarawera text-center" role="status">${this.noContentErrorText}</div>`);await this.updateSortAndGroupPosts()}catch{this.errorMessage=e`<div class="qs-social-media-error mt-40 typ-body-2 text-tarawera text-center" role="status">${this.serviceUnavailableErrorText}</div>`}this.ariaBusy=!1}loadNextPaginationEntry=async()=>{this.nextPaginationEntry&&fetch(this.nextPaginationEntry).then(async t=>{!t.ok||t.status;const e=await t.json();this.posts=this.posts.concat(e.posts),this.nextPaginationEntry=e?.pagination?.older,await this.updateSortAndGroupPosts()})};async updateSortAndGroupPosts(){this.errorMessage=t,this.articlesList=t,this.grid=t,this.requestUpdate(),await this.updateComplete;const e=this.groupArticles(this.posts),i=this.sortArticles(e);this.articlesList=this.renderTestimonials(i),this.grid=this.renderGrid(),this.requestUpdate(),await this.updateComplete}initEvents(){window.addEventListener(a,async t=>{"testimonial-sort-button"===t.detail.id&&(this.sortOrder=t.detail.customEventDetail,await this.updateSortAndGroupPosts())}),this.addEventListener(o,async()=>{this.gridInitial+=this.gridAdd,await this.loadNextPaginationEntry()})}formatTime(t){return new Date(t).toLocaleDateString("de-de",{day:"numeric",month:"long",year:"numeric"})}buildHeadline(t){return`${this.headlinePrefix} ${t.split(":")[0]}`}groupArticles(t){return t.reduce((t,e)=>{const i=t;if(e?.sourceId){const t=/\/\d+/,s=e.sourceId.match(t)[0].substring(1);i[s]=i[s]||[],i[s].push(e)}else i.push([e]);return i},[]).filter(t=>void 0!==t)}sortArticles(t){return t.toSorted((t,e)=>{const i=new Date(t[0].publishedAt),s=new Date(e[0].publishedAt);return"asc"===this.sortOrder?i-s:s-i})}get collapseBlockquoteButton(){return`\n <template data-slot="pp-button">\n <pp-button\n text="${this.collapseButtonText}"\n inline-icon="chevron-down"\n variant="quaternary"\n emit-click-event="true"\n custom-event-detail="testimonial-toggle"\n is-toggle-button="true"\n group="${i()}"\n toggle-text="${this.collapseButtonTextToggled}"\n inline-icon-toggled="chevron-up"\n aria-hidden="true"\n tabindex="-1"\n >\n </pp-button>\n </template>\n `}get progressButton(){return`\n <template data-slot="pp-button-progress">\n <pp-button-progress\n text="${this.progressButtonText}"\n sr-only-text="${this.collapseButtonTextToggled}"\n data-slot="pp-button-progress">\n </pp-button-progress>\n </template>\n `}createTestimonial(t){return`\n <template data-slot="pp-testimonial">\n <pp-testimonial>\n <pp-text-with-icon icon="clock-with-bg" data-slot="pp-text-with-icon">\n <div data-slot="pp-text">\n <p><time datetime="${this.formatTime(t[0].publishedAt)}">\n ${this.formatTime(t[0].publishedAt)}\n </time></p>\n </div>\n </pp-text-with-icon>
1\n <span data-slot="pp-text-inline-author">\n ${t[0]?.from?.name}\n </span>\n <pp-list direction="column" ordered-list="false" data-slot="pp-list">\n ${t.map(t=>`\n <pp-background-container remove-padding-y data-slot="pp-background-container">\n <h3 data-slot="pp-headline">${this.buildHeadline(t.title)}</h3>\n <div data-slot="html-collection">\n <pp-blockquote variant="large" author="" is-expandable="true" data-slot="pp-blockquote">\n <div data-slot="pp-text-quote">\n <p class="text">${t.textRich}</p>\n </div>\n ${this.collapseBlockquoteButton}\n </pp-blockquote>\n </div>\n </pp-background-container>\n `).join("")}\n </pp-list>\n </pp-testimonial>\n </template>\n `}renderTestimonials(t){return t.map(t=>e` 2 ${n(this.createTestimonial(t))} 3 `)}renderGrid(){return e` 4 <pp-grid columns="1" items-initial="${this.gridInitial}" items-add="${this.gridAdd}" vertical-separator="true" data-slot="pp-grid" aria-live="polite" no-vertical-gap aria-busy=${this.ariaBusy}> 5 ${n(this.progressButton)} 6 <div data-slot="html-collection" class="mt-40"> 7 ${this.articlesList} 8 </div> 9 </pp-grid> 10 `}render(){return e` 11 <aside class="relative mx-breakout w-screen"> 12 <div class="container"> 13 <div class="row"> 14 <div class="col-12 min-h-495"> 15 ${this.errorMessage} 16 ${this.grid} 17 </div> 18 </div> 19 </div> 20 </aside> 21 `}createRenderRoot(){return this}}customElements.define("pp-testimonial-data",p);export{p as default};
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.