1import{c as J,d as G,f as E,g as R,h as X,i as Z}from"./chunk-GA7O5I5V.js";import{c as Y}from"./chunk-DYGIJMH5.js";import{a as K}from"./chunk-X2JZKHEP.js";import"./chunk-VL535XO5.js";import"./chunk-JT56XV4L.js";import"./chunk-A6HZI6PM.js";import"./chunk-IBUXDNQ5.js";import"./chunk-4FF3BGHT.js";import"./chunk-B55SYQY7.js";import{b as z}from"./chunk-TZHNCWZR.js";import"./chunk-KGQDXD4T.js";import"./chunk-OT3GNXIR.js";import"./chunk-PUS2OTT7.js";import{a as W}from"./chunk-5N5NZQBH.js";import"./chunk-2WEWNZ7T.js";import"./chunk-LMVGYRVN.js";import"./chunk-HJHBSEUQ.js";import{k as H}from"./chunk-2JX4BFIU.js";import{$ as V,Ca as k,Da as O,E as L,Eb as g,Gb as U,Jb as $,L as j,Mb as x,Nb as b,Ob as o,Pb as a,Qb as q,Ub as C,X as F,Yb as p,Zb as d,ca as B,eb as c,hc as s,ic as P,jb as _,l as N,lc as y,mc as S,nc as M,pc as I,q as T,qb as v,ra as m,sa as u,u as f,ub as Q,vc as w,wc as h,z as D}from"./chunk-7H2WKIDS.js";var oe=(r,e)=>e.categoryId;function ae(r,e){if(r&1){let t=C();o(0,"div",7)(1,"input",9),p("change",function(n){let l=m(t).$implicit,ie=d();return u(ie.onCategoryChange(+l.categoryId,n))}),a(),o(2,"label",10),s(3),a()()}if(r&2){let t=e.$implicit,i=d();c(),g("id",t.categoryId)("value",t.categoryId)("checked",i.categories.includes(+t.categoryId)),c(),g("for",t.categoryId),c(),P(t.title)}}var A=class r{senderCategories;userCategories;categoriesSaved=k();closed=k();categories=[];ngOnInit(){this.categories=[...this.userCategories]}onCategoryChange(e,t){t.target.checked?this.categories.push(e):this.categories=this.categories.filter(n=>n!==e)}saveCategories(){this.categoriesSaved.emit(this.categories)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=v({type:r,selectors:[["app-my-area-news-categories"]],inputs:{senderCategories:"senderCategories",userCategories:"userCategories"},outputs:{categoriesSaved:"categoriesSaved",closed:"closed"},decls:15,vars:0,consts:[[1,"fixed","top-0","left-0","w-full","h-full","bg-black","bg-opacity-50","z-[1000]","flex","flex-col","items-center","justify-center"],[1,"w-[90%]","md:w-[400px]","bg-white","flex","flex-col","items-start","justify-center"],[1,"w-full","flex","flex-row","p-4","items-center","justify-between","border-b","border-gray-200"],[1,"text-xl"],[1,"material-symbols-outlined","text-[1.5rem]",3,"click"],[1,"p-4","flex","flex-col","items-start","justify-center"],[1,"flex","flex-col","my-6","pl-2"],[1,"flex","flex-row","items-center","gap-2"],[1,"button","primary","w-full",3,"click"],["type","checkbox",1,"w-4","h-4",3,"change","id","value","checked"],[1,"flex","flex-row-reverse","items-center","gap-2",3,"for"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2",3),s(4,"Kategorien ausw\xE4hlen"),a(),o(5,"button",4),p("click",function(){return i.closed.emit(!0)}),s(6," close "),a()(),o(7,"div",5)(8,"p"),s(9,"W\xE4hle die Kategorien, die du in diesem Bereich sehen m\xF6chtest."),a(),o(10,"div",6),x(11,ae,4,5,"div",7,oe),a(),o(13,"button",8),p("click",function(){return i.saveCategories()}),s(14,"Speichern"),a()()()()),t&2&&(c(11),b(i.senderCategories))},encapsulation:2,changeDetection:0})};var ee=()=>[],se=(r,e)=>e.id;function ce(r,e){if(r&1&&q(0,"app-widget-lane-article",11),r&2){let t=e.$implicit;g("article",t)("highlight",!1)("@animation",void 0)}}function le(r,e){if(r&1&&(o(0,"section",10),x(1,ce,1,3,"app-widget-lane-article",11,se),a()),r&2){let t=d(),i=M(0);U("lg:grid-cols-3",t.stationId()!=="rami"),c(),b(i)}}function de(r,e){if(r&1){let t=C();o(0,"app-my-area-news-categories",12),p("closed",function(){m(t);let n=d();return u(n.showConfigurationMenu$.next(!1))})("categoriesSaved",function(n){m(t);let l=d();return u(l.onSavedCategories(n))}),a()}if(r&2){let t,i;d();let n=M(2),l=M(4);g("senderCategories",(t=n)!==null&&t!==void 0?t:I(2,ee))("userCategories",(i=l)!==null&&i!==void 0?i:I(3,ee))}}
1var te=class r{constructor(e,t,i){this.articleService=e;this.metadatatoolService=t;this.quantyooService=i}user;stationId=O();articles$;senderCategories$;userCategories$;userCategoriesUpdated$=new N;showConfigurationMenu$=new N;ngOnInit(){this.senderCategories$=this.metadatatoolService.metadata$.pipe(f(e=>e.myAreaNewsCatefories),f(e=>e.slice(0,6))),this.userCategories$=L(this.quantyooService.getNewsCategories(this.user),this.userCategoriesUpdated$.asObservable()).pipe(B(this.senderCategories$),f(([e,t])=>{let i=e.filter(n=>t.some(l=>+l.categoryId===n));return i.length?i:t.map(n=>+n.categoryId)}),F()),this.articles$=this.userCategories$.pipe(V(e=>e.length===0?T([]):D(e.map(t=>this.articleService.getArticles(t,1,6)))),f(e=>{switch(e.length){case 1:return[...e[0]];case 2:return[...e[0].slice(0,3),...e[1].slice(0,3)];case 3:return[...e[0].slice(0,2),...e[1].slice(0,2),...e[2].slice(0,2)];case 4:return[...e[0].slice(0,2),...e[1].slice(0,2),...e[2].slice(0,1),...e[3].slice(0,1)];case 5:return[...e[0].slice(0,2),...e[1].slice(0,1),...e[2].slice(0,1),...e[3].slice(0,1),...e[4].slice(0,1)];case 6:return[...e[0].slice(0,1),...e[1].slice(0,1),...e[2].slice(0,1),...e[3].slice(0,1),...e[4].slice(0,1),...e[5].slice(0,1)];default:return e.flat().slice(0,6)}}))}onSavedCategories(e){this.quantyooService.setNewsCategories(this.user,e).pipe(j(1)).subscribe(t=>{t.success&&this.userCategoriesUpdated$.next(e)}),this.showConfigurationMenu$.next(!1)}static \u0275fac=function(t){return new(t||r)(_(K),_(W),_(z))};static \u0275cmp=v({type:r,selectors:[["app-my-area-news"]],inputs:{user:"user",stationId:[1,"stationId"]},decls:25,vars:13,consts:[[1,"pl-4","containerwidth:pl-0","flex","flex-row","w-full","justify-between"],[1,"flex","flex-row","w-full","items-center","gap-1"],[1,"tooltip-container","relative"],["aria-label","Hilfsmeldung \xF6ffnen",1,"material-symbols-outlined","text-[1.2rem]","md:text-[1.5rem]"],[1,"tooltip-content"],["aria-label","Bereich konfigurieren",1,"flex","flex-row","items-center","font-bold","whitespace-nowrap","gap-1",3,"click"],[1,"hidden","md:inline-block"],[1,"material-symbols-outlined","text-[1.5rem]","pr-2"],[1,"pl-0","containerwidth:pl-0","grid","gap-4","grid-cols-1","md:grid-cols-2",3,"lg:grid-cols-3"],[3,"senderCategories","userCategories"],[1,"pl-0","containerwidth:pl-0","grid","gap-4","grid-cols-1","md:grid-cols-2"],[3,"article","highlight"],[3,"closed","categoriesSaved","senderCategories","userCategories"]],template:function(t,i){if(t&1){let n=C();y(0),w(1,"async"),y(2),w(3,"async"),y(4),w(5,"async"),y(6),w(7,"async"),o(8,"div",0)(9,"div",1)(10,"h2"),s(11,"News f\xFCr Dich"),a(),o(12,"div",2)(13,"span",3),s(14," info "),a(),o(15,"div",4),s(16," Hier haben wir nach Deinen W\xFCnschen die aktuellsten News aus Deinen Interessen ausgew\xE4hlt. Du kannst es jederzeit in den Einstellungen \xE4ndern. "),a()()(),o(17,"div")(18,"button",5),p("click",function(){return m(n),u(i.showConfigurationMenu$.next(!0))}),o(19,"span",6),s(20,"Bereich konfigurieren"),a(),o(21,"span",7),s(22," settings "),a()()()(),Q(23,le,3,2,"section",8)(24,de,1,4,"app-my-area-news-categories",9)}if(t&2){let n=S(h(1,2,i.articles$));c(2),S(h(3,5,i.senderCategories$)),c(2),S(h(5,8,i.userCategories$));let l=h(7,11,i.showConfigurationMenu$);c(19),$(n&&n.length>0?23:-1),c(),$(l?24:-1)}},dependencies:[Y,H,A],encapsulation:2,data:{animation:[J("animation",[R("* <=> *",[X(":enter",[E({opacity:0,transform:"scale(0.9)"}),Z(100,[G("250ms ease-in",E({opacity:1,transform:"scale(1)"}))])],{optional:!0})])])]},changeDetection:0})};export{te as MyAreaNewsComponent};
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.