1import{a as k,b as q}from"./chunk-TFD3SBAM.js";import{b as $}from"./chunk-P3H4SO67.js";import{a as B}from"./chunk-OMNSDORR.js";import"./chunk-GA7O5I5V.js";import"./chunk-BH7NVO3Q.js";import"./chunk-DYGIJMH5.js";import"./chunk-X2JZKHEP.js";import"./chunk-VL535XO5.js";import"./chunk-JT56XV4L.js";import"./chunk-A6HZI6PM.js";import"./chunk-IBUXDNQ5.js";import"./chunk-5I6OFETK.js";import"./chunk-4FF3BGHT.js";import"./chunk-B55SYQY7.js";import"./chunk-TZHNCWZR.js";import"./chunk-KGQDXD4T.js";import"./chunk-OT3GNXIR.js";import"./chunk-PUS2OTT7.js";import"./chunk-5N5NZQBH.js";import"./chunk-2WEWNZ7T.js";import"./chunk-LMVGYRVN.js";import"./chunk-HJHBSEUQ.js";import{a as T,k as F}from"./chunk-2JX4BFIU.js";import{$ as E,Da as m,Eb as u,Gb as w,H as v,Kb as S,Lb as _,Mb as g,Mc as G,Nb as h,Qb as d,Zb as I,eb as a,ec as D,fc as x,ka as p,lc as f,m as l,mb as A,q as c,qb as L,u as s,vc as C,wc as y,z as b}from"./chunk-7H2WKIDS.js";var P=["container"];function j(n,t){if(n&1&&d(0,"app-widget-lane",2),n&2){let e=t.$implicit,i=I();u("widget",e)("renderh1",!1)("caller","embedded")("blacklistArticleIds",i.relatedArticleIds())}}function N(n,t){if(n&1&&d(0,"app-widget-video-gallery",3),n&2){let e=t.$implicit;u("id",e)}}var M=class n{document=p(T);pageSerice=p(B);container=A.required("container");element=m.required();relatedArticleIds=m([]);#e=new l([]);lanes$=this.#e.asObservable().pipe(E(t=>b([...t.filter(e=>e.type==="lane").map(e=>this.pageSerice.getHelperPage(e.url).pipe(v(()=>c(null)),s(i=>i?.content.filter(r=>r.type==="lane").at(0)??null))),...t.filter(e=>e.type==="articlelane").map(e=>c(this.createWidgetLaneConfig(e.headline,e.articleIds)))])),s(t=>t.filter(e=>!!e)));#t=new l([]);videoGalleries$=this.#t.asObservable();constructor(){G(()=>{if(this.container().nativeElement.replaceChildren(),this.#e.next([]),this.#t.next([]),this.element().data.embedcode.length){let t=this.document.createRange().createContextualFragment(this.element().data.embedcode);t=k(t),t=this.processLanes(t),t=this.processVideoGalleries(t),this.container().nativeElement.appendChild(t)}})}processLanes(t){let e=[];return t.querySelectorAll("lane").forEach(i=>{let r=i.getAttribute("url")?.trim()??"";r.length&&e.push({type:"lane",url:r}),t.removeChild(i)}),t.querySelectorAll("articlelane").forEach(i=>{let r=i.getAttribute("idlist")?.split(",").map(W=>+W)??[],o=i.getAttribute("headline")??"";r.length&&e.push({type:"articlelane",articleIds:r,headline:o}),t.removeChild(i)}),e.length&&this.#e.next(e),t}createWidgetLaneConfig(t,e){return{content:e.map(i=>({subType:"article",id:i,article_id:i.toString()})),highlight:"0",laneName:t,id:new Date().getTime(),type:"lane",loadMore:"0",link:""}}processVideoGalleries(t){let e=[];return t.querySelectorAll("video-gallery").forEach(i=>{let r=i.getAttribute("id")?.trim()??"";r.length&&e.push(r),t.removeChild(i)}),e.length&&this.#t.next(e),t}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=L({type:n,selectors:[["app-article-embedded-code"]],viewQuery:function(e,i){e&1&&D(i.container,P,5),e&2&&x()},inputs:{element:[1,"element"],relatedArticleIds:[1,"relatedArticleIds"]},decls:10,vars:6,consts:[["container",""],[1,"w-full"],[3,"widget","renderh1","caller","blacklistArticleIds"],[3,"id"]],template:function(e,i){if(e&1&&(f(0),C(1,"async"),f(2),C(3,"async"),d(4,"div",1,0),g(6,j,1,4,"app-widget-lane",2,S),g(8,N,1,1,"app-widget-video-gallery",3,_)),e&2){let r=y(1,2,i.lanes$),o=y(3,4,i.videoGalleries$);a(4),w("widget",!(r!=null&&r.length)),a(2),h(r),a(2),h(o)}},dependencies:[$,F,q],encapsulation:2,changeDetection:0})};export{M as ArticleEmbeddedCodeComponent};
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.