1import{a as ot}from"./chunk-VJGTDB4G.js";import{a as lt,b as pt,f as dt}from"./chunk-WLA2FFGE.js";import{a as st,c as ct}from"./chunk-FCXMBZKZ.js";import{a as rt}from"./chunk-ELJSD7JO.js";import{a as R}from"./chunk-5FN4AVCW.js";import{a as ve}from"./chunk-2WI6YUWV.js";import"./chunk-CIJUSKZC.js";import{e as at}from"./chunk-MQFIFXJH.js";import{a as Ze,b as et,d as tt,e as it}from"./chunk-4WTEHIBD.js";import{b as re,e as oe,f as se,i as ce,l as le,m as pe,n as de}from"./chunk-4BMJLKVI.js";import{b as Je}from"./chunk-J5NQYXPW.js";import"./chunk-N34O2GJO.js";import{a as U}from"./chunk-7U4LHETY.js";import{a as _e,c as ue,d as nt,e as Ce}from"./chunk-EDHZDPCP.js";import{a as ze}from"./chunk-ZX473E7K.js";import{a as je}from"./chunk-DBIVKRDD.js";import{b as We,f as Qe,g as he,k as Ye}from"./chunk-IHZGCAZ3.js";import{b as Ke}from"./chunk-EWNYEC2V.js";import"./chunk-OZEYFL2C.js";import"./chunk-BLAIYN42.js";import{i as Xe,k as N,m as E}from"./chunk-Z2DB4BHG.js";import"./chunk-V7MTXOXS.js";import{c as ee,g as te,k as ie,z as ne}from"./chunk-O3EJIWJK.js";import{h as B,i as Ue,l as $e}from"./chunk-EJILD4HA.js";import"./chunk-XSTXKUXO.js";import{a as me}from"./chunk-7ALBCXC7.js";import{h as G,j as q}from"./chunk-B6NHCOLE.js";import{a as I,b as D}from"./chunk-BMEDUSQH.js";import{l as He,q as ae}from"./chunk-OPSBMBUF.js";import"./chunk-VXJMLLKH.js";import"./chunk-Y56OZ6HC.js";import"./chunk-5KJNBGCD.js";import"./chunk-DNSVJODJ.js";import{k as Ge,l as qe,n as J,p as Ne,q as Z}from"./chunk-KLT57EFM.js";import{Ab as g,E as Le,Ga as Re,Gb as L,Gc as V,Ic as f,Jc as Ve,Lc as p,Mb as j,Mc as T,Nc as x,Oc as $,Pa as Fe,Qc as W,R as Ie,Rc as X,Sc as Q,Wc as Be,Xc as K,Zc as w,_c as O,a as Ae,ac as d,ad as Y,b as Te,bc as m,cd as De,dc as y,ec as b,fc as k,g as P,gc as S,hc as r,ia as Ee,ic as o,jc as A,pc as H,qc as v,rb as a,uc as u,wc as l,ya as h,z as Oe,za as _}from"./chunk-P43IKVHK.js";function vt(i,c){i&1&&A(0,"app-loader")}function gt(i,c){if(i&1){let e=v();r(0,"button",6),u("click",function(){h(e);let t=l(2);return _(t.BackFromCategories())}),r(1,"mat-icon"),p(2,"arrow_back"),o(),p(3," Back "),o()}}function ft(i,c){if(i&1&&(r(0,"div",2),d(1,gt,4,0,"button",5),r(2,"p"),p(3,"The shiurim below are offered by the same speaker similar to your selected title:"),o(),r(4,"h4")(5,"q"),p(6),o(),p(7),o()()),i&2){let e=l();a(),m(e.parent==="browse"&&e.bs.selectedBrowseCategory||e.parent==="archive"&&e.bs.selectedArchiveCategory?1:-1),a(5),T(e.parent==="browse"?e.bs.selectedRCBrowseLectureTitle:e.bs.selectedRCArchiveLectureTitle),a(),x(" by ",e.parent==="archive"?e.bs.selectedRCArchiveLectureSpeaker:e.bs.selectedRCBrowseLectureSpeaker," ")}}function xt(i,c){i&1&&(r(0,"div",14),p(1,"Loading categories . . ."),o())}function St(i,c){if(i&1){let e=v();r(0,"button",17),u("click",function(){let t=h(e).$implicit,s=l(2).$implicit,C=l(2);return _(C.getRelatedLectures(s.id,t.ID))}),p(1),o()}if(i&2){let e=c.$implicit,n=l(4);f("hide",n.isLoadingRC),a(),T(e.Name)}}function bt(i,c){i&1&&(r(0,"div",16),p(1,"No categories found."),o())}function kt(i,c){if(i&1){let e=v();r(0,"app-lecture-card",9),u("cardSelected",function(t){h(e);let s=l(3);return _(s.onLectureCardSelected(t))})("playbackSelected",function(t){h(e);let s=l(3);return _(s.onLecturePlaybackSelected(t))})("playlistToggleRequested",function(t){h(e);let s=l(3);return _(s.onLecturePlaylistToggle(t))})("downloadRequested",function(t){h(e);let s=l(3);return _(s.onLectureDownloadRequested(t))})("relatedCategoriesRequested",function(t){h(e);let s=l(3);return _(s.onRelatedCategoriesRequested(t))}),o(),r(1,"mat-menu",10,0)(3,"div")(4,"div",11),p(5,"Your selected title:"),A(6,"br"),r(7,"strong"),p(8),o(),A(9,"br"),p(10," by "),r(11,"strong"),p(12),o()(),r(13,"div",12),p(14,"Is associated with multiple iTorah Categories:"),o(),r(15,"div",13),d(16,xt,2,0,"div",14),b(17,St,2,3,"button",15,y),d(19,bt,2,0,"div",16),o()()()}if(i&2){let e=V(2),n=l().$implicit,t=l(2);S("card",c)("titleActivatesCard",t.isMobile)("relatedMenu",e),a(),S("overlapTrigger",!1),a(7),T(n.title),a(4),T(n.speaker),a(4),m(t.isLoadingRC?16:-1),a(),k(t.parent==="browse"?t.bs.relatedBrowseCategories:t.bs.relatedArchiveCategories),a(2),m(t.noCats?19:-1)}}function Mt(i,c){if(i&1&&d(0,kt,20,8),i&2){let e,n=c.$implicit,t=l(2);m((e=t.lectureCardFor(n))?0:-1,e)}}function Pt(i,c){i&1&&(r(0,"div",8),p(1," No lectures found for this query. "),o())}function wt(i,c){if(i&1&&(r(0,"div",7),b(1,Mt,1,1,null,null,y),d(3,Pt,2,0,"div",8),o()),i&2){let e=l();f("mobile",e.isMobile),a(),k(e.bs.selectedBrowseCategory?e.bs.browseRelatedLectures:e.bs.selectedArchiveCategory?e.bs.archiveRelatedLectures:e.lectures),a(2),m(e.lectures.length?-1:3)}}function yt(i,c){if(i&1){let e=v();r(0,"div",4)(1,"app-paginator",18),u("selectedPageIndex",function(t){h(e);let s=l();return _(s.paginatorChange.emit(t))}),o()()}if(i&2){let e=l();a(),S("pageIndex",e.lecturesRes.pageNumber)("totalItems",e.lecturesRes.totalResultCount)("totalPages",e.lecturesRes.totalPageCount)("isMobile",e.isMobile)}}var z=(()=>{class i{constructor(e,n,t,s,C,M,F,ye){this.appSrv=e,this.dialog=n,this.ps=t,this.queueSrv=s,this.bs=C,this.shiurimSrv=M,this.downloadSrv=F,this.notifySrv=ye,this.paginatorChange=new Re,this.lectureCardCache=new WeakMap,this.invalidLectureCards=new WeakSet}ngOnInit(){this.isMobile=this.appSrv.isMobile,this.lectures=this.parent==="browse"&&this.bs.browseRelatedLectures?this.bs.browseRelatedLectures:this.parent==="archive"&&this.bs.archiveRelatedLectures?this.bs.archiveRelatedLectures:this.lectures,this.lectures||(this.lecturesRes=this.lecturesRes),this.ps.getToken()&&(this.queueSrv.getUserQueue(),this.playlistSub=this.queueSrv.getQueue().subscribe({next:n=>this.queueSrv.playlist=n,error:n=>console.error(n)}))}ngOnChanges(){this.lectures=this.parent==="browse"&&this.bs.browseRelatedLectures?this.bs.browseRelatedLectures:this.parent==="archive"&&this.bs.archiveRelatedLectures?this.bs.archiveRelatedLectures:this.lectures}isInPlaylist(e){return this.queueSrv.playlist?this.queueSrv.playlist.findIndex(n=>n.id===e)>=0:!1}lectureCardFor(e){if(this.invalidLectureCards.has(e))return null;let n=this.lectureCardCache.get(e);if(!n)try{n=dt(e,{sourceId:e.sourceID??1,playlist:!0,download:!!e.sourceID&&!!e.audio&&!this.isMobile,relatedCategories:!!e.categoryCount,speakerName:e.speaker||"Unknown Speaker"}),this.lectureCardCache.set(e,n)}catch(s){return this.invalidLectureCards.add(e),console.error("Could not normalize Home Archive lecture card",e,s),null}let t=!!e.added||this.isInPlaylist(n.identity.mediaId);return n.playlistAdded!==t&&(n=Te(Ae({},n),{playlistAdded:t}),this.lectureCardCache.set(e,n)),n}onLectureCardSelected(e){if(!this.isMobile)return;let n=this.lectureForCard(e);n&&this.playMedia(n)}onLecturePlaybackSelected(e){let n=this.lectureForCard(e.card);n&&this.playMedia(n,e.resource.kind==="audio")}onLecturePlaylistToggle(e){let n=this.lectureForCard(e);n&&(n.added||this.isInPlaylist(e.identity.mediaId)?this.removeFromPlaylist(n):this.addToPlaylist(n))}onLectureDownloadRequested(e){let n=this.lectureForCard(e.card);n&&this.downloadShirium(n)}onRelatedCategoriesRequested(e){let n=this.lectureForCard(e);n&&this.getRelatedCategories(n.id,n.speaker,n.title)}lectureForCard(e){return(this.bs.selectedBrowseCategory?this.bs.browseRelatedLectures:this.bs.selectedArchiveCategory?this.bs.archiveRelatedLectures:this.lectures)?.find(t=>
1t.id===e.identity.mediaId&&(t.sourceID??1)===e.identity.sourceId)}addToPlaylist(e){let n=this.ps.getToken();n?this.queueSrv.addToPlaylist(n,[{itemID:e.id,sourceID:e.sourceID??1}]).subscribe({next:t=>{t==="Success"&&(this.queueSrv.playlist=this.queueSrv.playlist?[...this.queueSrv.playlist,e]:[e],e.added=!0,this.queueSrv.playlist&&this.queueSrv.playlist.filter(s=>s.id===e.id).map(s=>{s.added=!0}),this.notifySrv.showNotification({Success:"Added to Playlist"}),this.queueSrv.setItem(e,e.speaker?e.speaker:""))},error:t=>{console.error(t),this.notifySrv.showNotification({Error:"Error adding to Playlist"})}}):this.appSrv.openAuthDialog()}removeFromPlaylist(e){let n=this.ps.getToken();n?this.queueSrv.removeFromPlaylist(n,[{itemID:e.id,sourceID:e.sourceID??1}]).subscribe({next:t=>{t==="Success"&&(this.queueSrv.playlist=this.queueSrv.playlist.filter(s=>s.id!==e.id),e.added=!1,this.notifySrv.showNotification({Success:"Removed from Playlist"}),this.queueSrv.removeItem(e))},error:t=>{console.error(t),this.notifySrv.showNotification({Error:"Error removing from Playlist"})}}):this.appSrv.openAuthDialog()}handleMobileCardClick(e,n){if(!this.isMobile)return;let t=n.target;t.tagName==="BUTTON"||t.closest("button")||this.playMedia(e)}playMedia(e,n){if(this.isMobile&&e.audio&&e.video&&n===void 0)this.openMobilePlayOptions(e);else{let t={title:e.title,url:n?e.audio:e.video,sponsor:e.sponsor,sourceId:e.sourceID??0,mediaId:e.id,isOnlyAudio:n,speaker:e.speaker,shiurCode:e.shiurCode};this.ps.playMedia(t)}}openMobilePlayOptions(e){let n=this.lectureCardFor(e),t=n?.playback.find(C=>C.kind==="audio"&&!C.label),s=n?.playback.find(C=>C.kind==="video"&&!C.label);!n||!t||!s||this.dialog.open(lt,{width:"32rem",maxWidth:"calc(100vw - 2rem)",data:{card:n,audio:t,video:s},panelClass:"custom-dialog"}).afterClosed().subscribe(C=>{C&&this.onLecturePlaybackSelected({card:n,resource:C})})}downloadShirium(e){if(e.sourceID){if(!this.ps.getToken()){this.appSrv.openAuthDialog();return}this.downloadSrv.downloadShirium(e.id,e.sourceID,!!e.sponsor)}}getRelatedCategories(e,n,t){this.parent==="browse"?(this.bs.selectedRCBrowseLectureSpeaker=n,this.bs.selectedRCBrowseLectureTitle=t):this.parent==="archive"&&(this.bs.selectedRCArchiveLectureSpeaker=n,this.bs.selectedRCArchiveLectureTitle=t),this.isLoadingRC=!0,this.parent==="browse"?this.bs.relatedBrowseCategoriesSub=this.shiurimSrv.relatedCategories(e).subscribe({next:s=>{this.bs.relatedBrowseCategories=s,this.isLoadingRC=!1,s.length?this.noCats=!1:this.noCats=!0},error:s=>console.error(s)}):this.parent==="archive"&&(this.bs.relatedArchiveCategoriesSub=this.shiurimSrv.relatedCategories(e).subscribe({next:s=>{this.bs.relatedArchiveCategories=s,this.isLoadingRC=!1,s.length?this.noCats=!1:this.noCats=!0},error:s=>console.error(s)}))}getRelatedLectures(e,n){this.isLoadingRL=!0,this.parent==="browse"?this.bs.selectedBrowseCategory=this.bs.relatedBrowseCategories.find(t=>t.ID===n).Name:this.parent==="archive"&&(this.bs.selectedArchiveCategory=this.bs.relatedArchiveCategories.find(t=>t.ID===n).Name),this.shiurimSrv.relatedBrowse(e,n).subscribe({next:t=>{this.parent==="browse"?(this.bs.browseRelatedLectures=t,this.bs.archiveRelatedLectures=null):this.parent==="archive"&&(this.bs.archiveRelatedLectures=t,this.bs.browseRelatedLectures=null),this.isLoadingRL=!1},error:t=>{console.error(t),this.isLoadingRL=!1}})}BackFromCategories(){this.parent==="browse"?(this.bs.browseRelatedLectures=null,this.bs.selectedBrowseCategory=""):this.parent==="archive"&&(this.bs.archiveRelatedLectures=null,this.bs.selectedArchiveCategory="")}ngOnDestroy(){this.playlistSub&&this.playlistSub.unsubscribe()}static{this.\u0275fac=function(n){return new(n||i)(g(E),g(He),g(Ye),g(We),g(R),g(Qe),g(Je),g(me))}}static{this.\u0275cmp=L({type:i,selectors:[["app-lectures"]],inputs:{parent:"parent",lecturesRes:"lecturesRes",lectures:"lectures",loading:"loading"},outputs:{paginatorChange:"paginatorChange"},features:[Fe],decls:5,vars:4,consts:[["rc","matMenu"],[1,"flxCol"],[1,"filter-row","mt1","p1","flxAlgnCen","gap16","flxFlexAuto","flxLayGtLgRow","flxLayLtXlCol"],[1,"archives-lectures","grid","gap16","grid-2-gtmd","grid-1-ltlg",3,"mobile"],[1,"flxAlgnCen","flxFlexAuto"],["mat-raised-button","","color","primary",1,"back"],["mat-raised-button","","color","primary",1,"back",3,"click"],[1,"archives-lectures","grid","gap16","grid-2-gtmd","grid-1-ltlg"],[1,"no-results"],[3,"cardSelected","playbackSelected","playlistToggleRequested","downloadRequested","relatedCategoriesRequested","card","titleActivatesCard","relatedMenu"],[3,"overlapTrigger"],[1,"popover-title"],[1,"popover-subtitle"],[1,"rc-list"],[1,"p1-0","txt-center"],["mat-menu-item","",3,"hide"],[1,"p1"],["mat-menu-item","",3,"click"],[1,"w100",3,"selectedPageIndex","pageIndex","totalItems","totalPages","isMobile"]],template:function(n,t){n&1&&(r(0,"div",1),d(1,vt,1,0,"app-loader"),d(2,ft,8,3,"div",2),d(3,wt,4,3,"div",3),d(4,yt,2,4,"div",4),o()),n&2&&(a(),m(t.isLoadingRL?1:-1),a(),m(!t.isLoadingRL&&t.parent==="browse"&&t.bs.browseRelatedLectures&&t.bs.selectedBrowseCategory||t.parent==="archive"&&t.bs.archiveRelatedLectures&&t.bs.selectedArchiveCategory?2:-1),a(),m(t.lectures&&!t.loading?3:-1),a(),m(!t.loading&&t.lectures&&t.lecturesRes&&t.lecturesRes.totalPageCount>1&&!t.bs.browseRelatedLectures&&!t.bs.archiveRelatedLectures?4:-1))},dependencies:[I,Ce,ue,_e,ve,q,G,ae,U,pt],styles:["[_nghost-%COMP%] .remove[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .done[_ngcontent-%COMP%]{display:block}[_nghost-%COMP%] .in-playlist[_ngcontent-%COMP%]:hover > .remove[_ngcontent-%COMP%]{display:block}[_nghost-%COMP%] .in-playlist[_ngcontent-%COMP%]:hover > .done[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .filter-row[_ngcontent-%COMP%]{background:#fff7d8;
1color:#333}[_nghost-%COMP%] .archives-lectures[_ngcontent-%COMP%]{padding:1rem;max-width:100%;background:#fff}[_nghost-%COMP%] .archives-lectures[_ngcontent-%COMP%] .lecture[_ngcontent-%COMP%]{width:100%;flex:0 0 calc((100% - 16px)/2);border-radius:6px;border:1px solid #eee;padding:.5rem 1rem;box-sizing:border-box;background:#f6f6f6;color:#333}[_nghost-%COMP%] .archives-lectures[_ngcontent-%COMP%] .lecture[_ngcontent-%COMP%] .lecture-data[_ngcontent-%COMP%]{font-size:.8rem;color:#7b7a7a}[_nghost-%COMP%] .archives-lectures[_ngcontent-%COMP%] .lecture[_ngcontent-%COMP%] .lecture-title[_ngcontent-%COMP%]{min-height:30px}[_nghost-%COMP%] .archives-lectures[_ngcontent-%COMP%] .lecture[_ngcontent-%COMP%] button.mat-mini-fab{width:26px;height:26px}[_nghost-%COMP%] .archives-lectures[_ngcontent-%COMP%] .lecture[_ngcontent-%COMP%] button.mat-mini-fab span.mat-button-wrapper{padding:0!important}[_nghost-%COMP%] .archives-lectures[_ngcontent-%COMP%] .lecture[_ngcontent-%COMP%] button.mat-mini-fab span.mat-button-wrapper mat-icon{font-size:17px;width:20px;height:30px;color:#333}[_nghost-%COMP%] .archives-lectures[_ngcontent-%COMP%] .lecture[_ngcontent-%COMP%]:hover{background:#fff6dc}[_nghost-%COMP%] .archives-lectures.mobile[_ngcontent-%COMP%]{background:#fff;overflow-y:scroll;padding-bottom:1rem}button.more[_ngcontent-%COMP%]{line-height:1.7rem;border:none;background:transparent}.popover-title[_ngcontent-%COMP%]{padding:3px 14px;margin:0;font-size:14px!important;background-color:#11233e;border-bottom:0;border-radius:5px 5px 0 0;color:#fff!important}.popover-subtitle[_ngcontent-%COMP%]{list-style-type:none;background-color:#e9e9e9;padding:2px 14px;border-bottom:1px solid #000}.hide[_ngcontent-%COMP%]{display:none!important}.no-results[_ngcontent-%COMP%]{padding:2rem 0 2.5rem;font-size:1.5rem;text-align:center}"]})}}return i})();var Se=i=>({iSpeaker:i});function Lt(i,c){if(i&1){let e=v();r(0,"mat-icon",18),u("click",function(){h(e);let t=l(2);return _(t.clearSearch())}),p(1,"close"),o()}}function It(i,c){if(i&1){let e=v();r(0,"mat-form-field",14)(1,"mat-label"),p(2,"Search Speakers"),o(),r(3,"input",15),u("input",function(){h(e);let t=l();return _(t.searchSpeakers())}),Q("ngModelChange",function(t){h(e);let s=l();return X(s.searchText,t)||(s.searchText=t),_(t)}),o(),r(4,"mat-icon",16),p(5,"search"),o(),d(6,Lt,2,0,"mat-icon",17),o()}if(i&2){let e=l();f("mobile",e.appSrv.isMobile)("p0-1",e.appSrv.isMobile),a(3),W("ngModel",e.searchText),a(3),m(e.searchText?6:-1)}}function Et(i,c){if(i&1){let e=v();r(0,"mat-form-field",19)(1,"mat-label"),p(2,"Sort by:"),o(),r(3,"mat-select",20),Q("valueChange",function(t){h(e);let s=l();return X(s.selectedSort,t)||(s.selectedSort=t),_(t)}),u("selectionChange",function(t){h(e);let s=l();return _(s.sortSpeakers(t))}),r(4,"mat-option",21),p(5,"Author Ascending"),o(),r(6,"mat-option",22),p(7,"Author Descending"),o()(),r(8,"mat-icon",16),p(9,"sort"),o()()}if(i&2){let e=l();f("mobile",e.appSrv.isMobile)("p0-1",e.appSrv.isMobile),a(3),W("value",e.selectedSort)}}function Rt(i,c){i&1&&H(0)}function Ft(i,c){if(i&1&&(r(0,"span",23),j(1,Rt,1,0,"ng-container",24),o()),i&2){let e=c.$implicit;l(2);let n=V(22);a(),S("ngTemplateOutlet",n)("ngTemplateOutletContext",K(2,Se,e))}}function Vt(i,c){if(i&1&&(r(0,"div",11),b(1,Ft,2,4,"span",23,y),w(3,"slice"),o()),i&2){let e=l();a(),k(Y(3,0,c,e.pageIndex===1?0:e.pageIndex*e.speakersPerPage-e.speakersPerPage,e.pageIndex*e.speakersPerPage))}}function Bt(i,c){i&1&&H(0)}function Dt(i,c){if(i&1&&(r(0,"span",23),j(1,Bt,1,0,"ng-container",24),o()),i&2){let e=c.$implicit;l(2);let n=V(22);a(),S("ngTemplateOutlet",n)("ngTemplateOutletContext",K(2,Se,e))}}function Gt(i,c){i&1&&(r(0,"div",11),b(1,Dt,2,4,"span",23,y),o()),i&2&&(a(),k(c))}function qt(i,c){i&1&&H(0)}function Nt(i,c){if(i&1&&(r(0,"span",23),j(1,qt,1,0,"ng-container",24),o()),i&2){let e=c.$implicit;l(2);let n=V(22);a(),S("ngTemplateOutlet",n)("ngTemplateOutletContext",K(2,Se,e))}}function Ut(i,c){i&1&&(r(0,"h2",25),p(1," No favorite speakers! "),o())}function $t(i,c){if(i&1&&(r(0,"div",11),b(1,Nt,2,4,"span",23,y),w(3,"slice"),d(4,Ut,2,0,"h2",25),o()),i&2){let e=l();a(),k(Y(3,1,c,e.pageIndex===1?0:e.pageIndex*e.speakersPerPage-e.speakersPerPage,e.pageIndex*e.speakersPerPage)),a(3),m(e.speakersSrv.favSpeakers.length?-1:4)}}function jt(i,c){i&1&&H(0)}function zt(i,c){if(i&1&&(r(0,"span",23),j(1,jt,1,0,"ng-container",24),o()),i&2){let e=c.$implicit;l(2);let n=V(22);a(),S("ngTemplateOutlet",n)("ngTemplateOutletContext",K(2,Se,e))}}function Ht(i,c){i&1&&(r(0,"h2",26),p(1,"No speakers found for that query!"),o())}function Wt(i,c){if(i&1&&(r(0,"div",11),b(1,zt,2,4,"span",23,y),w(3,"slice"),d(4,Ht,2,0,"h2",26),o()),i&2){let e=l();a(),k(Y(3,1,e.filteredSpeakers,e.pageIndex===1?0:e.pageIndex*e.speakersPerPage-e.speakersPerPage,e.pageIndex*e.speakersPerPage)),a(3),m(e.filteredSpeakers.length?-1:4)}}function Xt(i,c){if(i&1){let e=v();r(0,"div",12)(1,"app-paginator",27),u("selectedPageIndex",function(t){h(e);let s=l();return _(s.paginatorChange(t))}),o()()}if(i&2){let e=l();a(),S("pageIndex",e.pageIndex)("totalItems",e.totalItems)("totalPages",e.totalItems/e.speakersPerPage)("isMobile",e.appSrv.isMobile)}}function Qt(i,c){if(i&1){let e=v();r(0,"app-lectures",28),u("paginatorChange",function(t){h(e);let s=l();return s.scroll(),_(s.lecturePaginatorChange(t))}),o()}if(i&2){let e=l();S("lectures",e.lectures)("lecturesRes",e.lecturesRes)("loading",e.loading)("parent","archive")}}function Kt(i,c){i&1&&A(0,"app-loader")}function Yt(i,c){if(i&1){let e=v();r(0,"mat-icon",32),u("click",function(){h(e);let t=l().iSpeaker,s=l();return _(s.manageFavorites(t,!0))}),p(1,"star"),o()}if(i&2){let e=l().iSpeaker;S("matTooltip","Remove "+e.Speaker+" from your favorites.")}}function Jt(i,c){if(i&1){let e=v();r(0,"mat-icon",32),u("click",function(){h(e);let t=l().iSpeaker,s=l();return _(s.manageFavorites(t,!1))}),p(1,"star_border"),o()}if(i&2){let e=l().iSpeaker;S("matTooltip","Add "+e.Speaker+" to your favorites.")}}function Zt(i,c){if(i&1){let e=v();d(0,Yt,2,1,"mat-icon",29)(1,Jt,2,1,"mat-icon",29),r(2,"span",30),u("click",function(){let t=h(e).iSpeaker,s=l();return _(s.getSpeakerLectures(t,!0))}),p(3),r(4,"span",31),p(5),o()()}if(i&2){let e=c.iSpeaker;m(e!=null&&e.isMySpeaker?0:1),a(3),x(" ",e.Speaker," "),a(2),x("(",e.TotalShiurim,")")}}var mt=(()=>{class i{constructor(e,n,t,s,C,M,F){this.router=e,this.appSrv=n,this.speakersSrv=t,this.notifySrv=s,this.browseSrv=C,this.helperSrv=M,this.socialLoginSrv=F,this.loading=!0,this.activeGroup="main",this.selectedSort="1",this.speakersPerPage=25,this.pageIndex=1,this.tapExecuted=!1,this.activeSort="1",this.socialLoginSrv.endSessionEvent.subscribe(ye=>{this.speakersSrv.resetMySpeakers()})}ngOnInit(){return P(this,null,function*(){this.appSrv.isMobile&&(this.speakersPerPage=12),this.get
1Speakers("main",!0,"2").subscribe()})}getSpeakers(e,n,t){return this.tapExecuted&&t==="2"?this.speakersSrv.getSpeakersByGroup(e):this.speakersSrv.getSpeakersByGroup(e).pipe(Ee(s=>{s&&s?.length&&(this.tapExecuted=!0,n&&e===this.activeGroup&&(this.totalItems=this.calculateTotalItems(s,e)),this.loading=!1)}),Ie(s=>(console.error("Failed to get speakers:",s),Oe(()=>new Error("Failed to get speaker names")))))}calculateTotalItems(e,n){switch(n){case"all":return e.length;case"main":return e.filter(t=>t.isMainSpeaker).length;case"favorite":return e.filter(t=>t.isMySpeaker).length;default:return 0}}manageFavorites(e,n){return P(this,null,function*(){if(yield this.socialLoginSrv.checkAuthStatus("Active Speakers Compopnent - manageFavorites()")){if(this.requesting)return;this.requesting=!0,n?this.speakersSrv.removeSpeakerFromFavorites(e.ID).subscribe({next:s=>{s==="Deleted"?(this.notifySrv.showNotification({Success:"Speaker removed from favorites"}),e.isMySpeaker=!1):this.notifySrv.showNotification({Error:"Error removing speaker from favorites"}),this.speakersSrv.favSpeakers&&(this.speakersSrv.favSpeakers.forEach(C=>{if(this.speakersSrv.favSpeakers){let M=this.speakersSrv.favSpeakers.findIndex(F=>+F.ID==+e.ID);M>=0&&(this.speakersSrv.favSpeakers.length===1?this.speakersSrv.favSpeakers=[]:(this.speakersSrv.favSpeakers.splice(M,1),this.totalItems=this.totalItems-1,this.totalItems%this.speakersPerPage===0&&this.pageIndex>1&&(this.pageIndex=this.pageIndex-1)))}this.requesting=!1}),this.speakersSrv.mainSpeakers&&this.speakersSrv.mainSpeakers.forEach(C=>{C.ID===e.ID&&(C.isMySpeaker=!1)}),this.speakersSrv.allSpeakers&&this.speakersSrv.allSpeakers.forEach(C=>{C.ID===e.ID&&(C.isMySpeaker=!1)}))},error:s=>{this.notifySrv.showNotification({Error:"Error removing speaker from favorites."}),this.requesting=!1,console.error(s)}}):this.speakersSrv.addSpeakerToFavorites(e.ID).subscribe({next:s=>{s==="Saved"?(this.notifySrv.showNotification({Success:"Speaker added to favorites"}),e.isMySpeaker=!0,this.speakersSrv.allSpeakers||(this.speakersSrv.allSpeakers=[]),this.speakersSrv.favSpeakers.push(e),this.requesting=!1):this.notifySrv.showNotification({Error:"Error adding speaker to favorites"})},error:s=>{this.notifySrv.showNotification({Error:"Error adding speaker to favorites."}),this.requesting=!1,console.error(s)}})}else{this.appSrv.openAuthDialog();return}})}changeGroup(e){return P(this,null,function*(){let n=yield this.socialLoginSrv.checkAuthStatus("Active Speakers Component - changeGroup()");if(e==="favorite"&&!n){this.appSrv.openAuthDialog();return}else this.activeGroup=e,this.loading=!0,this.lectures=null,this.filteredSpeakers=null,this.pageIndex=1,this.getSpeakers(e,!0,"3").subscribe()})}paginatorChange(e){this.pageIndex=e}searchSpeakers(){return P(this,null,function*(){this.loading=!0,this.pageIndex=1,this.totalItems=0,this.filteredSpeakers=yield this.filterSpeakers(),this.totalItems=this.filteredSpeakers.length,setTimeout(()=>{this.loading=!1},100)})}sortSpeakers(e){this.activeSort=e.value;let n="";this.activeGroup==="all"?n="allSpeakers":this.activeGroup==="main"?n="mainSpeakers":n="favSpeakers";let t=this.filteredSpeakers?this.filteredSpeakers:this.speakersSrv[n];!t||t.length===0||(t.sort((s,C)=>{let M=`${s.FirstName.toUpperCase()} ${s.LastName.toUpperCase()} `,F=`${C.FirstName.toUpperCase()} ${C.LastName.toUpperCase()} `;return M===F?0:e.value==="1"&&M<F||e.value==="2"&&M>F?-1:1}),this.speakersSrv[n]=t)}filterSpeakers(){return P(this,null,function*(){return new Promise(e=>{let n=this.searchText.toLowerCase().split(" ").filter(t=>t);e(this.speakersSrv.allSpeakers.filter(t=>{let s=`${t.FirstName} ${t.LastName}`.toLowerCase();return n.every(C=>s.includes(C))}))})})}clearSearch(){this.searchText="",this.searchSpeakers()}getSpeakerLectures(e,n){this.loading=!0,this.browseSrv.getLecturesByQueryParameters({PageIndex:1,PageSize:12,SpeakerID:e.ID},!0,"speakers").then(t=>P(this,null,function*(){this.activeSpeakerID=e.ID,this.lectures=t?.shiurList||null,this.lecturesRes=t,this.loading=!1,setTimeout(()=>{this.helperSrv.performScroll("archives-group-0")},200)})).catch(t=>{console.error(t),this.loading=!1})}lecturePaginatorChange(e){this.loading=!0,this.pageIndex=e,this.browseSrv.getLecturesByQueryParameters({PageIndex:e,PageSize:12,SpeakerID:this.activeSpeakerID},!0,"speakers").then(n=>{this.lectures=n?.shiurList||null,this.lecturesRes=n,this.loading=!1}
1).catch(n=>{console.error(n),this.loading=!1})}scroll(){setTimeout(()=>{this.helperSrv.performScroll("speakers-container")},100)}navigateToAux(){let e=this.router.url,n=e.includes("archives:speakers")?e.replace(/archives:speakers.*$/,`archives:speakers/${this.activeGroup.toLowerCase()})`):`${e}(archives:speakers/${this.activeGroup.toLowerCase()})`;this.router.navigateByUrl(n)}static{this.\u0275fac=function(n){return new(n||i)(g(B),g(E),g(he),g(me),g(R),g(N),g(Xe))}}static{this.\u0275cmp=L({type:i,selectors:[["app-archive-speakers"]],inputs:{currentArchiveSpeakerGroupURL:"currentArchiveSpeakerGroupURL"},decls:23,vars:24,consts:[["speakerCard",""],["id","speakers-container",1,"flxCol"],[1,"archive-content-header","flxLayGtMdRow","flxLayLtLgCol","gap16","w100"],[1,"btns-wrap","gap12","grid","grid-3","grid-2-ltsm"],["mat-button","",1,"p0-05",3,"click"],["mat-button","",1,"",3,"click"],["mat-button","",1,"flxHideLtSm",3,"click"],[3,"color"],[1,"flxLayGtXsRow","flxLayColLtSm","flxAlgnCen","flxGap16","flxFlexLtSm100"],["appearance","outline",1,"w100","search-form","white-bg",3,"mobile","p0-1"],["appearance","outline",1,"w100","sort-form","white-bg",3,"mobile","p0-1"],[1,"archives-content","flxRowWrap"],[1,"flxAlgnCen","flxFlexAuto"],[3,"lectures","lecturesRes","loading","parent"],["appearance","outline",1,"w100","search-form","white-bg"],["matInput","","type","text",3,"input","ngModelChange","ngModel"],["matPrefix","","color","primary"],["matSuffix","",1,"error","pointer"],["matSuffix","",1,"error","pointer",3,"click"],["appearance","outline",1,"w100","sort-form","white-bg"],[3,"valueChange","selectionChange","value"],["value","1","role","option"],["value","2","role","option"],[1,"flxRow","flxAlgnCen","gap8","flxFlexGtMd20","flxFlexLtMd33","flxFlexLtSm100"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"flxRow","flxAlgnCen"],[1,"p1"],[1,"w100",3,"selectedPageIndex","pageIndex","totalItems","totalPages","isMobile"],[3,"paginatorChange","lectures","lecturesRes","loading","parent"],["color","accent",1,"pointer",3,"matTooltip"],[1,"pointer","speaker",3,"click"],[1,"total","flxHideLtSm"],["color","accent",1,"pointer",3,"click","matTooltip"]],template:function(n,t){if(n&1&&(r(0,"div",1)(1,"div",2)(2,"div",3)(3,"button",4),u("click",function(){return t.changeGroup("main")}),p(4," MAIN SPEAKERS"),o(),r(5,"button",5),u("click",function(){return t.changeGroup("all")}),p(6," ALL SPEAKERS"),o(),r(7,"button",6),u("click",function(){return t.changeGroup("favorite")}),r(8,"mat-icon",7),p(9,"star_filled"),o(),p(10," FAVORITE SPEAKERS"),o()(),r(11,"div",8),d(12,It,7,6,"mat-form-field",9),d(13,Et,10,5,"mat-form-field",10),o()(),d(14,Vt,4,4,"div",11),d(15,Gt,3,0,"div",11),d(16,$t,5,5,"div",11),d(17,Wt,5,5,"div",11),d(18,Xt,2,4,"div",12),d(19,Qt,1,4,"app-lectures",13),d(20,Kt,1,0,"app-loader"),o(),j(21,Zt,6,3,"ng-template",null,0,De)),n&2){let s,C,M;f("mobile",t.appSrv.isMobile),a(),f("light-grey-bg",!t.appSrv.isMobile)("mobile",t.appSrv.isMobile),a(),f("light-grey-bg",t.appSrv.isMobile),a(),f("accent-bg",t.activeGroup==="main"),a(2),f("accent-bg",t.activeGroup==="all"),a(2),f("accent-bg",t.activeGroup==="favorite"),a(),S("color",t.activeGroup==="favorite"?"primary":"accent"),a(4),m(t.lectures?-1:12),a(),m(t.lectures?-1:13),a(),m((s=!t.loading&&!t.lectures&&!t.filteredSpeakers&&t.activeGroup==="all"&&t.speakersSrv.allSpeakers)?14:-1,s),a(),m((C=!t.loading&&!t.lectures&&!t.filteredSpeakers&&t.activeGroup==="main"&&t.speakersSrv.mainSpeakers)?15:-1,C),a(),m((M=!t.loading&&!t.lectures&&!t.filteredSpeakers&&t.activeGroup==="favorite"&&t.speakersSrv.favSpeakers)?16:-1,M),a(),m(!t.loading&&!t.lectures&&t.filteredSpeakers?17:-1),a(),m(t.activeGroup!=="main"&&!t.loading&&!t.lectures&&(t.speakersSrv.allSpeakers.length||t.speakersSrv.favSpeakers.length||t.speakersSrv.mainSpeakers.length)&&t.totalItems&&t.speakersPerPage&&t.totalItems>t.speakersPerPage?18:-1),a(),m(t.lectures?19:-1),a(),m(t.loading?20:-1)}},dependencies:[q,G,D,I,le,ce,re,oe,se,ne,ee,te,ie,ct,st,at,ve,z,U,ze,je,de,pe,Ge,ae,Ne],styles:["[_nghost-%COMP%] #speakers-container[_ngcontent-%COMP%]{scroll-margin-top:140px;background:#fff;margin:auto}[_nghost-%COMP%] #speakers-container[_ngcontent-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%]{flex-grow:1!important}[_nghost-%COMP%] #speakers-container[_ngcontent-%COMP%] .archive-content-header[_ngcontent-%COMP%]{padding:.5rem 1rem;min-height:60px}[_nghost-%COMP%] #speakers-container[_ngcontent-%COMP%] .archive-content-header[_ngcontent-%COMP%] .btns-wrap[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-height:56px;padding:0 1rem!important}[_nghost-%COMP%] #speakers-container[_ngcontent-%COMP%] .archive-content-header[_ngcontent-%COMP%] mat-form-field.sort-form .mat-form-field-wrapper, [_nghost-%COMP%] #speakers-container[_ngcontent-%COMP%] .archive-content-header[_ngcontent-%COMP%] mat-form-field.search-form .mat-form-field-wrapper{padding:0;margin:0}[_nghost-%COMP%] #speakers-container[_ngcontent-%COMP%] .archive-content-header[_ngcontent-%COMP%] mat-form-field.sort-form .mat-form-field-wrapper .mat-form-field-outline, [_nghost-%COMP%] #speakers-container[_ngcontent-%COMP%] .archive-content-header[_ngcontent-%COMP%] mat-form-field.search-form .mat-form-field-wrapper .mat-form-field-outline{background:#fff}[_nghost-%COMP%] #speakers-container[_ngcontent-%COMP%] .archives-content[_ngcontent-%COMP%]{background:#fff;padding:1rem;color:#333}[_nghost-%COMP%] #speakers-container[_ngcontent-%COMP%] .archives-content[_ngcontent-%COMP%] .speaker[_ngcontent-%COMP%]{font-size:1rem;padding:.5rem;color:var(--primary)}[_nghost-%COMP%] #speakers-container[_ngcontent-%COMP%] .archives-content[_ngcontent-%COMP%] .speaker[_ngcontent-%COMP%]:hover{color:var(--light-blue)}[_nghost-%COMP%] #speakers-container.mobile[_ngcontent-%COMP%] .archive-content-header[_ngcontent-%COMP%]{width:100%;min-height:auto;padding:1rem;border-bottom:1px solid #eee;padding:1rem 0}[_nghost-%COMP%] #speakers-container[_ngcontent-%COMP%] .total[_ngcontent-%COMP%]{font-size:80%;font-weight:300}@media screen and (min-width:600px)and (max-width:814px){[_nghost-%COMP%] .speaker[_ngcontent-%COMP%] span.total[_ngcontent-%COMP%]{display:none!important;font-size:.85rem}[_nghost-%COMP%] .speaker[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{scale:90%}}"]})}}return i})();var ei=()=>[],be=(i,c)=>c.id;function ti(i,c){if(i&1){let e=v();r(0,"span",9),u("click",function(){h(e);let t=l(2);return t.activeSubCategory=null,t.lecturesRes=null,_(t.getSubcategories(t.activeMainCategory,!0))}),r(1,"mat-icon"),p(2,"keyboard_arrow_right"),o(),r(3,"strong"),p(4),r(5,"span",10),p(6),o()()()}if(i&2){let e=l(2);a(3),f("light-blue",e.activeMainCategory&&!e.activeSubCategory),a(),x("",e.activeMainCategory.name," "),a(2),x(" (",e.activeMainCategory.shiurCount,") ")}}function ii(i,c){if(i&1&&(r(0,"span",8)(1,"mat-icon"),p(2,"keyboard_arrow_right"),o(),r(3,"strong"),p(4),r(5,"span",10),p(6),o()()()),i&2){let e=l(2);a(3),f("light-blue",e.activeMainCategory&&e.activeSubCategory),a(),x("",e.activeSubCategory.name," "),a(2),x(" (",e.activeSubCategory.shiurCount,") ")}}function ni(i,c){if(i&1){let e=v();r(0,"div",6)(1,"mat-icon",7),u("click",function(){h(e);let t=l();return _(t.goToArchiveTopicsHome())}),p(2,"home"),o(),d(3,ti,7,4,"span",8),d(4,ii,7,4,"span",8),o()}if(i&2){let e=l();f("mobile",e.appSrv.isMobile),a(),f("light-blue",!e.activeMainCategory&&!e.activeSubCategory),a(2),m(e.activeMainCategory?3:-1),a(),m(e.activeSubCategory?4:-1)}}function ai(i,c){if(i&1){let e=v();r(0,"mat-icon",15),u("click",function(){h(e);let t=l(2);return t.searchText="",_(t.searchTopics())}),p(1,"close"),o()}}function ri(i,c){if(i&1){let e=v();r(0,"mat-form-field",11)(1,"mat-label"),p(2,"Search Topic/Subtopic"),o(),r(3,"input",12),u("input",function(){h(e);let t=l();return _(t.searchTopics())}),Q("ngModelChange",function(t){h(e);let s=l();return X(s.searchText,t)||(s.searchText=t),_(t)}),o(),r(4,"mat-icon",13),p(5,"search"),o(),d(6,ai,2,0,"mat-icon",14),o()}if(i&2){let e=l();Ve(e.appSrv.isMobile?"padding: 0 1rem; width:100%":""),a(3),W("ngModel",e.searchText),a(3),m(e.searchText?6:-1)}}function oi(i,c){if(i&1){let e=v();r(0,"span",17),u("click",function(){let t=h(e).$implicit,s=l(2);return _(s.getSubcategories(t,!0))}),p(1),o()}if(i&2){let e=c.$implicit;a(),$(" ",e.name," (",e.shiurCount,") ")}}function si(i,c){if(i&1&&(r(0,"div",4),b(1,oi,2,2,"span",16,be),o()),i&2){let e=l();a(),k(e.lectureCategoriesSrv.allCategories)}}function ci(i,c){if(i&1){let e=v();r(0,"span",17),u("click",function(){let t=h(e).$implicit,s=l(2);return _(s.getSubcategories(t,!0))}),p(1),o()}if(i&2){let e=c.$implicit;a(),$(" ",e.name," (",e.shiurCount,") ")}}function li(i,c){i&1&&(r(0,"h2",18),p(1," No categories found for that query! "),o())}function pi(i,c){if(i&1&&(r(0,"div",4),b(1,ci,2,2,"span",16,be),d(3,li,2,0,"h2",18),o()),i&2){let e=l();a(),k(e.filteredMainCategories),a(2),m(e.filteredMainCategories.length?-1:3)}}function di(i,c){if(i&1){let e=v();r(0,"span",17),u("click",function(){let t=h(e).$implicit,s=l(2);return _(s.getLectures(t,1,s.pageSize,!0))}),p(1),o()}if(i&2){let e=c.$implicit;a(),$(" ",e.name," (",e.shiurCount,") ")}}function mi(i,c){if(i&1&&(r(0,"div",4),b(1,di,2,2,"span",16,be),o()),i&2){let e=l();a(),k(e.subcategories)}}function hi(i,c){if(i&1){let e=v();r(0,"span",17),u("click",function(){let t=h(e).$implicit,s=l(2);return _(s.getLectures(t,1,s.pageSize,!0))}),p(1),o()}if(i&2){let e=c.$implicit;a(),$(" ",e.name," (",e.shiurCount,") ")}}function _i(i,c){i&1&&(r(0,"h2",18),p(1,"No categories found for that query! "),o())}function ui(i,c){if(i&1&&(r(0,"div",4),b(1,hi,2,2,"span",16,be),d(3,_i,2,0,"h2",18),o()),i&2){let e=c;a(),k(e),a(2),m(e!=null&&e.length?-1:3)}}function Ci(i,c){if(i&1){let e=v();r(0,"app-lectures",19),u("paginatorChange",function(t){h(e);let s=l();return s.scroll(),_(s.paginatorChange(t))}),o()}if(i&2){let e=l();S("loading",e.loading)("lectures",e.lecturesRes&&e.lecturesRes!==null?e.lecturesRes.shiurList:Be(4,ei))("lecturesRes",e.lecturesRes)("parent","archive")}}function vi(i,c){i&1&&A(0,"app-loader")}var ht=(()=>{class i{constructor(e,n,t,s,C){this.router=e,this.appSrv=n,this.lectureCategoriesSrv=t,this.browseSrv=s,this.helperSrv=C,this.activeMainCategory=null,this.activeSubCategory=null,this.pageSize=12,this.loading=!0}ngOnInit(){this.lectureCategoriesSrv.categories||this.getMainCategories()}getMainCategories(){this.lectureCategoriesSrv.getLectureCategories(0).then(()=>this.initActiveCategories()).catch(e=>console.error(e))}initActiveCategories(){this.currentArchiveTopicsCategoryURL?this.lectureCategoriesSrv.allCategories.filter(e=>P(this,null,function*(){(yield this.appSrv.urlOptimizeText(e.name))===this.currentArchiveTopicsCategoryURL&&(yield this.get
1Subcategories(e),this.currentArchiveTopicsSubcategoryURL&&this.subcategories?this.subcategories.filter(t=>P(this,null,function*(){(yield this.appSrv.urlOptimizeText(t.name))===this.currentArchiveTopicsSubcategoryURL&&this.getLectures(t,1,this.pageSize)})):this.loading=!1)})):this.loading=!1}getSubcategories(e,n){return new Promise((t,s)=>P(this,null,function*(){this.loading=!0;try{this.activeMainCategory?.id!==e.id&&(this.activeMainCategory=e,this.subcategories=yield this.lectureCategoriesSrv.getLectureSubcategories(e.id)),this.loading=!1,t()}catch(C){this.loading=!1,s()}}))}getLectures(e,n,t,s){return P(this,null,function*(){this.loading=!0,this.activeSubCategory=e;try{let C=yield this.browseSrv.getLecturesByQueryParameters({PageIndex:n,PageSize:t,SubCategoryID:e.id},!0,"archives");this.lecturesRes=C}catch(C){console.error(C)}finally{this.loading=!1}})}paginatorChange(e){this.activeSubCategory&&(this.getLectures(this.activeSubCategory,e,this.pageSize),this.pageIndex=e)}scroll(){let e=document.querySelector("#topics-container");if(!e)return;let n=window.pageYOffset+e.getBoundingClientRect().top-110-65;this.helperSrv.scrollTo(n,"Archive Topics - Scroll()")}goToArchiveTopicsHome(){this.activeMainCategory=null,this.activeSubCategory=null,this.subcategories=null,this.lecturesRes=null}searchTopics(){this.activeMainCategory?this.activeMainCategory&&this.subcategories?.length&&(this.filteredSubcategories=this.subcategories.filter(e=>e.name.toLowerCase().includes(this.searchText.toLowerCase()))):this.filteredMainCategories=this.lectureCategoriesSrv.allCategories.filter(e=>e.name.toLowerCase().includes(this.searchText.toLowerCase()))}static{this.\u0275fac=function(n){return new(n||i)(g(B),g(E),g(rt),g(R),g(N))}}static{this.\u0275cmp=L({type:i,selectors:[["app-archive-topics"]],inputs:{currentArchiveTopicsCategoryURL:"currentArchiveTopicsCategoryURL",currentArchiveTopicsSubcategoryURL:"currentArchiveTopicsSubcategoryURL",pageIndex:"pageIndex",totalItems:"totalItems"},decls:10,vars:12,consts:[["id","topics-container flxCol"],[1,"archive-content-header","light-grey-bg","flxGtXsRow","flxLayLtSmCol","gap16"],[1,"breadcrumb","flxRowGtSm","flxLayColLtMd","flxAlgnCen","gap10",3,"mobile"],["appearance","outline",1,"search-form","white-bg","mt05",3,"style"],[1,"archives-content","flxRowWrap"],[3,"loading","lectures","lecturesRes","parent"],[1,"breadcrumb","flxRowGtSm","flxLayColLtMd","flxAlgnCen","gap10"],[1,"pointer","inactive",3,"click"],[1,"pointer","inactive","flxRow","flxAlgnCen"],[1,"pointer","inactive","flxRow","flxAlgnCen",3,"click"],[1,"total"],["appearance","outline",1,"search-form","white-bg","mt05"],["matInput","","type","text",3,"input","ngModelChange","ngModel"],["matPrefix",""],["matSuffix","",1,"error","pointer"],["matSuffix","",1,"error","pointer",3,"click"],[1,"pointer","topic","flxFlexGtSm33","flxFlexGtXs50","flxFlexLtSm100"],[1,"pointer","topic","flxFlexGtSm33","flxFlexGtXs50","flxFlexLtSm100",3,"click"],[1,"flxRow","flxAlgnCen"],[3,"paginatorChange","loading","lectures","lecturesRes","parent"]],template:function(n,t){if(n&1&&(r(0,"div",0)(1,"div",1),d(2,ni,5,6,"div",2),d(3,ri,7,4,"mat-form-field",3),o(),d(4,si,3,0,"div",4),d(5,pi,4,1,"div",4),d(6,mi,3,0,"div",4),d(7,ui,4,1,"div",4),d(8,Ci,1,5,"app-lectures",5),d(9,vi,1,0,"app-loader"),o()),n&2){let s;f("mobile",t.appSrv.isMobile),a(),f("mobile",t.appSrv.isMobile),a(),m(t.activeMainCategory?2:-1),a(),m(t.activeSubCategory?-1:3),a(),m(!t.loading&&!t.filteredMainCategories&&!t.activeMainCategory&&t.lectureCategoriesSrv.allCategories?4:-1),a(),m(!t.loading&&!t.activeMainCategory&&t.lectureCategoriesSrv.allCategories&&t.filteredMainCategories?5:-1),a(),m(!t.loading&&!t.filteredSubcategories&&!t.activeSubCategory&&t.activeMainCategory&&t.subcategories?6:-1),a(),m((s=!t.loading&&!t.activeSubCategory&&t.activeMainCategory&&t.subcategories&&t.filteredSubcategories)?7:-1,s),a(),m(t.lecturesRes&&(t.lecturesRes||t.browseSrv.archiveRelatedLectures)?8:-1),a(),m(t.loading?9:-1)}},dependencies:[D,I,ne,ee,te,ie,le,ce,re,oe,se,z,U,de,pe],styles:["[_nghost-%COMP%] #topics-container[_ngcontent-%COMP%]{scroll-margin-top:140px;background:#fff}[_nghost-%COMP%] .archive-content-header[_ngcontent-%COMP%]{padding:0 1rem;min-height:54px}[_nghost-%COMP%] .archive-content-header[_ngcontent-%COMP%] mat-form-field.search-form{margin-bottom:.5rem;padding:0!important}[_nghost-%COMP%] .archive-content-header[_ngcontent-%COMP%] mat-form-field.search-form .mat-form-field-wrapper{padding:0;margin:0}[_nghost-%COMP%] .archive-content-header[_ngcontent-%COMP%] mat-form-field.search-form .mat-form-field-wrapper .mat-form-field-outline{background:#fff}[_nghost-%COMP%] .archives-content[_ngcontent-%COMP%]{padding:1rem;background:#fff;color:#333}
1[_nghost-%COMP%] .archives-content[_ngcontent-%COMP%] .topic[_ngcontent-%COMP%]{font-size:1.2rem;padding:.7rem}[_nghost-%COMP%] .archives-content[_ngcontent-%COMP%] .topic[_ngcontent-%COMP%]:hover{font-weight:700;color:var(--light-blue);background:#f5f6fa}[_nghost-%COMP%] .archives-content.mobile[_ngcontent-%COMP%]{max-height:50vh;overflow:scroll}[_nghost-%COMP%] .total[_ngcontent-%COMP%]{font-size:75%;font-weight:300}[_nghost-%COMP%] .breadcrumb[_ngcontent-%COMP%]{margin-bottom:.5rem!important}[_nghost-%COMP%] .breadcrumb.mobile[_ngcontent-%COMP%]{margin-top:1rem!important;margin-bottom:0!important}"]})}}return i})();function fi(i,c){if(i&1&&(r(0,"span",10)(1,"mat-icon"),p(2,"keyboard_arrow_right"),o(),r(3,"strong"),p(4),r(5,"span",9),p(6),o()()()),i&2){let e=l(2);a(3),f("light-blue",e.activeParasha&&e.activeParashaSpeaker),a(),x("",e.activeParashaSpeaker.speaker," "),a(2),x(" (",e.activeParashaSpeaker.totalShiurim,") ")}}function xi(i,c){if(i&1){let e=v();r(0,"div",1)(1,"div",6)(2,"mat-icon",7),u("click",function(){h(e);let t=l();return _(t.goToArchiveParashaHome())}),p(3,"home"),o(),r(4,"span",8),u("click",function(){h(e);let t=l();return t.activeParashaSpeaker=null,t.lectures=null,_(t.getSpeakersByParasha(t.activeParasha,!0))}),r(5,"mat-icon"),p(6,"keyboard_arrow_right"),o(),r(7,"strong"),p(8),r(9,"span",9),p(10),w(11,"number"),o()()(),d(12,fi,7,4,"span",10),o()()}if(i&2){let e=l();a(),f("mobile",e.appSrv.isMobile),a(6),f("light-blue",e.activeParasha&&!e.activeParashaSpeaker),a(),x(" ",e.activeParasha.Name," "),a(2),x("(",O(11,7,e.totalLectures),")"),a(2),m(e.activeParashaSpeaker?12:-1)}}function Si(i,c){if(i&1){let e=v();r(0,"button",11),u("click",function(){h(e);let t=l();return _(t.getAllLecturesByParasha(1))}),p(1,"SHOW ALL "),r(2,"span",12),p(3),o(),p(4,"LECTURES"),o()}if(i&2){let e=l();a(3),x("",e.activeParasha.Name.toUpperCase()," ")}}function bi(i,c){if(i&1){let e=v();r(0,"div",14),u("click",function(){let t=h(e).$implicit,s=l(2);return _(s.getSpeakersByParasha(t))}),r(1,"div"),p(2),o(),r(3,"div"),p(4),o()()}if(i&2){let e=c.$implicit;a(2),T(e.Name),a(2),T(e.HebrewName)}}function ki(i,c){if(i&1&&(r(0,"div",4),b(1,bi,5,2,"div",13,y),o()),i&2){let e=l();a(),k(e.parashas)}}function Mi(i,c){if(i&1){let e=v();r(0,"div",16),u("click",function(){let t=h(e).$implicit,s=l(2);return _(s.getLecturesBySpeakerAndParasha(t,1))}),p(1),o()}if(i&2){let e=c.$implicit;a(),$(" ",e.speaker," (",e.totalShiurim,") ")}}function Pi(i,c){if(i&1&&(r(0,"div",4),b(1,Mi,2,2,"div",15,y),o()),i&2){let e=l();a(),k(e.parashaSpeakers)}}function wi(i,c){if(i&1){let e=v();r(0,"app-lectures",17),u("paginatorChange",function(t){h(e);let s=l();return s.scroll(),_(s.paginatorChange(t))}),o()}if(i&2){let e=l();S("loading",e.loading)("lectures",e.lectures)("lecturesRes",e.lecturesRes)("parent","archive")}}function yi(i,c){i&1&&A(0,"app-loader")}var _t=(()=>{class i{constructor(e,n,t,s,C,M){this.router=e,this.appSrv=n,this.parashaSrv=t,this.speakersSrv=s,this.browseSrv=C,this.helperSrv=M,this.loading=!0,this.pageIndex=1}ngOnInit(){this.getParashas()}getParashas(){this.loading=!0,this.parashaSrv.getAllParashas().subscribe({next:e=>{this.parashas=e,this.loading=!1},error:e=>{console.error(e),this.loading=!1}})}goToArchiveParashaHome(){this.activeParasha=null,this.parashaSpeakers=null,this.activeParashaSpeaker=null,this.lectures=null,this.router.navigateByUrl(this.router.url.replace(/archives:parasha.*$/,"archives:parasha)"))}getSpeakersByParasha(e,n){this.loading=!0,this.speakersSrv.getSpeakersByParasha([e.Categories]).subscribe({next:t=>P(this,null,function*(){this.activeParasha=e,this.parashaSpeakers=t,yield this.countAllLecturesFromActiveCategory(),this.loading=!1}),error:t=>{this.loading=!1,console.error(t)}})}countAllLecturesFromActiveCategory(){return P(this,null,function*(){let e=0;if(this.parashaSpeakers){for(let[n,t]of this.parashaSpeakers.entries())if(e+=t.totalShiurim,n+1===this.parashaSpeakers.length){this.totalLectures=e;return}}})}getLecturesBySpeakerAndParasha(e,n){this.loading=!0;let t=this.activeParasha?.Categories||[];this.browseSrv.getLecturesByQueryParameters({PageIndex:n,PageSize:12,SpeakerID:e.id,CategoryID:t.toString()},!0,"parasha").then(s=>{this.lectures=s.shiurList??s,this.lecturesRes=s,this.activeParashaSpeaker=e,this.loading=!1}
1).catch(s=>{this.loading=!1,console.error(s)})}getAllLecturesByParasha(e){let n=this.activeParasha?.Categories||[];this.browseSrv.getLecturesByQueryParameters({PageIndex:e,PageSize:12,CategoryID:n.toString()},!0,"parasha").then(t=>{this.loading=!1,this.lectures=t.shiurList??t}).catch(t=>{this.loading=!1,console.error(t)})}scroll(){let e=document.querySelector("#parasha-container");if(!e)return;let n=window.pageYOffset+e.getBoundingClientRect().top-110-65;this.helperSrv.scrollTo(n,"Archive Parasha - Scroll()")}paginatorChange(e){this.activeParashaSpeaker?this.getLecturesBySpeakerAndParasha(this.activeParashaSpeaker,e):this.activeParasha?.Categories&&!this.activeParashaSpeaker&&this.getAllLecturesByParasha(e),this.pageIndex=e}static{this.\u0275fac=function(n){return new(n||i)(g(B),g(E),g(ot),g(he),g(R),g(N))}}static{this.\u0275cmp=L({type:i,selectors:[["app-archive-parashas"]],decls:8,vars:8,consts:[["id","parasha-container flxCol"],[1,"parasha-content-header","flxGtXsRow","light-grey-bg","flxLayLtSmCol","gap16"],[1,"parasha-content"],["mat-stroked-button","",1,"show-all"],[1,"flxRowWrap","flxAlgnCen"],[3,"loading","lectures","lecturesRes","parent"],[1,"breadcrumb","flxRow","flxAlgnCen","gap8"],[1,"pointer","inactive",3,"click"],[1,"pointer","inactive","flxRow","flxAlgnCen",3,"click"],[1,"total"],[1,"pointer","inactive","flxRow","flxAlgnCen"],["mat-stroked-button","",1,"show-all",3,"click"],[1,"primary"],[1,"parasha","pointer","flxCol","flxFlexGtMd1666","flxFlexMd25","flxFlexSm50","flxFlexXs100"],[1,"parasha","pointer","flxCol","flxFlexGtMd1666","flxFlexMd25","flxFlexSm50","flxFlexXs100",3,"click"],[1,"speaker","pointer","flxFlexGtMd20","flxFlexMd25","flxFlexSm50","flxFlexXs100"],[1,"speaker","pointer","flxFlexGtMd20","flxFlexMd25","flxFlexSm50","flxFlexXs100",3,"click"],[3,"paginatorChange","loading","lectures","lecturesRes","parent"]],template:function(n,t){n&1&&(r(0,"div",0),d(1,xi,13,9,"div",1),r(2,"div",2),d(3,Si,5,1,"button",3),d(4,ki,3,0,"div",4),d(5,Pi,3,0,"div",4),d(6,wi,1,4,"app-lectures",5),d(7,yi,1,0,"app-loader"),o()()),n&2&&(f("mobile",t.appSrv.isMobile),a(),m(t.activeParasha?1:-1),a(2),m(t.parashas&&t.activeParasha&&t.parashaSpeakers&&!t.activeParashaSpeaker&&!t.lectures&&!t.loading?3:-1),a(),m(t.parashas&&!t.activeParasha&&!t.parashaSpeakers&&!t.activeParashaSpeaker&&!t.lectures&&!t.loading?4:-1),a(),m(t.parashas&&t.activeParasha&&t.parashaSpeakers&&!t.activeParashaSpeaker&&!t.lectures&&!t.loading?5:-1),a(),m(t.parashas&&t.parashaSpeakers&&t.lectures?6:-1),a(),m(t.loading?7:-1))},dependencies:[Z,D,I,z,U,q,G,J],styles:["[_nghost-%COMP%] #parasha-container[_ngcontent-%COMP%]{scroll-margin-top:140px;background:#fff}[_nghost-%COMP%] #parasha-container.mobile[_ngcontent-%COMP%] .parasha-content-header[_ngcontent-%COMP%]{min-height:auto;padding:0;background:#eaeeff}[_nghost-%COMP%] #parasha-container.mobile[_ngcontent-%COMP%] .breadcrumb[_ngcontent-%COMP%]{margin-bottom:0!important}[_nghost-%COMP%] #parasha-container.mobile[_ngcontent-%COMP%] .breadcrumb.mobile[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .parasha-content-header[_ngcontent-%COMP%]{padding:1rem;min-height:60px}[_nghost-%COMP%] .parasha-content[_ngcontent-%COMP%]{padding:1rem;background:#fff}[_nghost-%COMP%] .parasha-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin:1rem 1.5rem}[_nghost-%COMP%] .parasha-content[_ngcontent-%COMP%] .parasha[_ngcontent-%COMP%], [_nghost-%COMP%] .parasha-content[_ngcontent-%COMP%] .speaker[_ngcontent-%COMP%]{color:#333;padding:.75rem 2rem;font-size:1rem}[_nghost-%COMP%] .parasha-content[_ngcontent-%COMP%] .parasha[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .parasha-content[_ngcontent-%COMP%] .speaker[_ngcontent-%COMP%]:hover{color:var(--light-blue);background:#f5f6fa}[_nghost-%COMP%] .total[_ngcontent-%COMP%]{font-size:75%;font-weight:300}"]})}}return i})();function Ai(i,c){i&1&&(r(0,"mat-icon"),p(1,"expand_more"),o())}function Ti(i,c){i&1&&(r(0,"mat-icon"),p(1,"expand_less"),o())}function Oi(i,c){if(i&1&&(r(0,"span",18),p(1),w(2,"number"),o()),i&2){let e=l();a(),x(" ",O(2,1,e==null||e.Counters[0]==null?null:e.Counters[0].Count)," ")}}function Li(i,c){if(i&1&&(r(0,"span",20),p(1," LearnTorah Archives "),o()),i&2){let e=l(2);f("mob-sub-title",!e.appSrv.isMobile)}}function Ii(i,c){if(i&1&&(r(0,"span",7),d(1,Oi,3,3,"span",18),d(2,Li,2,2,"span",19),o()),i&2){let e=c;a(),m(e.Counters!=null&&e.Counters.length?1:-1),a(),m(e.Counters!=null&&e.Counters.length?2:-1)}}function Ei(i,c){if(i&1&&(r(0,"span",21),p(1),o()),i&2){let e=l(2);a(),T(e.dedication)}}function Ri(i,c){if(i&1&&d(0,Ei,2,1,"span",21),i&2){let e=l();
1m(e.appSrv.isMobile?0:-1)}}function Fi(i,c){if(i&1){let e=v();r(0,"div",22),u("click",function(t){h(e);let s=l();return t.stopPropagation(),_(s.sponsorSection(12))}),p(1," Click to sponsor this section"),o()}if(i&2){let e=l();f("mb1",e.appSrv.isMobile)}}function Vi(i,c){if(i&1&&(r(0,"span"),p(1),w(2,"number"),o()),i&2){let e=l().$implicit;a(),x(" (",O(2,1,e.total),") ")}}function Bi(i,c){if(i&1){let e=v();r(0,"button",29),u("click",function(){let t=h(e).$index,s=l(2);return _(s.selectArchive(t))}),r(1,"span",30),p(2,"Search "),o(),p(3),d(4,Vi,3,3,"span"),o()}if(i&2){let e=c.$implicit,n=l(2);f("active",e.name===(n.currentArchive==null?null:n.currentArchive.name)),a(3),x(" ",e.name," "),a(),m(e.total&&+e.total!=0?4:-1)}}function Di(i,c){if(i&1&&(r(0,"span"),p(1),w(2,"number"),o()),i&2){let e=l(2);a(),x(" (",O(2,1,e.currentArchive.total),") ")}}function Gi(i,c){if(i&1&&(r(0,"span"),p(1),w(2,"number"),o()),i&2){let e=l().$implicit;a(),x("(",O(2,1,e.total),")")}}function qi(i,c){if(i&1){let e=v();r(0,"button",31),u("click",function(){let t=h(e).$index,s=l(2);return _(s.selectArchive(t))}),p(1),d(2,Gi,3,3,"span"),o()}if(i&2){let e=c.$implicit;a(),x(" ",e.name," "),a(),m(e.total&&+e.total!=0?2:-1)}}function Ni(i,c){if(i&1&&(r(0,"div",9)(1,"button",23),p(2,"SEARCH ALL "),o(),r(3,"div",24),b(4,Bi,5,4,"button",25,y),o(),r(6,"div",26)(7,"button",27)(8,"mat-icon"),p(9,"expand_more"),o(),r(10,"span"),p(11),o(),d(12,Di,3,3,"span"),o(),r(13,"mat-menu",null,0),b(15,qi,3,2,"button",28,y),o()()()),i&2){let e=V(14),n=l();a(4),k(n.archives),a(3),S("matMenuTriggerFor",e),a(4),x(" ",n.currentArchive==null?null:n.currentArchive.name," "),a(),m(n.currentArchive&&+n.currentArchive.total!=0?12:-1),a(3),k(n.archives)}}function Ui(i,c){if(i&1&&(r(0,"div",10)(1,"span",32),p(2),o()()),i&2){let e=l();a(2),T(e.dedication)}}function $i(i,c){if(i&1){let e=v();r(0,"button",33),u("click",function(){h(e);let t=l();return _(t.selectArchive(1))}),p(1,"SEARCH ALL"),o()}}function ji(i,c){i&1&&(r(0,"mat-icon"),p(1,"expand_more"),o())}function zi(i,c){i&1&&(r(0,"mat-icon"),p(1,"expand_less"),o())}function Hi(i,c){if(i&1&&(r(0,"span"),p(1),o()),i&2){let e=l();a(),x("",e.name," ")}}function Wi(i,c){if(i&1&&(r(0,"span"),p(1),w(2,"number"),o()),i&2){let e=l();a(),x(" (",O(2,1,e.total),")")}}function Xi(i,c){if(i&1&&(r(0,"span",5),d(1,Hi,2,1,"span"),d(2,Wi,3,3,"span"),o()),i&2){let e=c;a(),m(e.name?1:-1),a(),m(e.total&&+e.total!=0?2:-1)}}function Qi(i,c){if(i&1){let e=v();r(0,"button",34),u("click",function(){h(e);let t=l();return _(t.selectArchive(0))}),r(1,"div",35),d(2,ji,2,0,"mat-icon"),d(3,zi,2,0,"mat-icon"),d(4,Xi,3,2,"span",5),o()()}if(i&2){let e,n=l();f("inactive",!n.isArchiveSelected(0)),a(2),m(n.isArchiveSelected(0)?-1:2),a(),m(n.isArchiveSelected(0)?3:-1),a(),m((e=n.archives[0])?4:-1,e)}}function Ki(i,c){if(i&1&&A(0,"app-archive-speakers",14),i&2){let e=l();S("currentArchiveSpeakerGroupURL",e.currentArchiveSpeakerGroupURL)}}function Yi(i,c){i&1&&(r(0,"mat-icon"),p(1,"expand_more"),o())}function Ji(i,c){i&1&&(r(0,"mat-icon"),p(1,"expand_less"),o())}function Zi(i,c){if(i&1&&(r(0,"span"),p(1),o()),i&2){let e=l();a(),x("",e.name," ")}}function en(i,c){if(i&1&&(r(0,"span"),p(1),w(2,"number"),o()),i&2){let e=l();a(),x(" (",O(2,1,e.total),")")}}function tn(i,c){if(i&1&&(r(0,"span",5),d(1,Zi,2,1,"span"),d(2,en,3,3,"span"),o()),i&2){let e=c;a(),m(e.name?1:-1),a(),m(e.total&&+e.total!=0?2:-1)}}function nn(i,c){if(i&1){let e=v();r(0,"button",36),u("click",function(){h(e);let t=l();return _(t.selectArchive(1))}),r(1,"div",35),d(2,Yi,2,0,"mat-icon"),d(3,Ji,2,0,"mat-icon"),d(4,tn,3,2,"span",5),o()()}if(i&2){let e,n=l();f("inactive",!n.isArchiveSelected(1)),a(2),m(n.isArchiveSelected(1)?-1:2),a(),m(n.isArchiveSelected(1)?3:-1),a(),m((e=n.archives[1])?4:-1,e)}}function an(i,c){if(i&1&&A(0,"app-archive-topics",16),i&2){let e=l();S("currentArchiveTopicsCategoryURL",e.currentArchiveTopicsCategoryURL)("currentArchiveTopicsSubcategoryURL",e.currentArchiveTopicsSubcategoryURL)}}function rn(i,c){i&1&&(r(0,"mat-icon"),p(1,"expand_more"),o())}function on(i,c){i&1&&(r(0,"mat-icon"),p(1,"expand_less"),o())}function sn(i,c){if(i&1&&(r(0,"span"),p(1),o()),i&2){let e=l();a(),x("",e.name," ")}}function cn(i,c){if(i&1&&(r(0,"span"),p(1),w(2,"number"),o()),i&2){let e=l();a(),x(" (",O(2,1,e.total),")")}}function ln(i,c){if(i&1&&(r(0,"span",5),d(1,sn,2,1,"span"),d(2,cn,3,3,"span"),o()),i&2){let e=c;a(),m(e.name?1:-1),a(),m(e.total&&+e.total!=0?2:-1)}}function pn(i,c){if(i&1){let e=v();r(0,"button",37),u("click",function(){h(e);let t=l();return _(t.selectArchive(2))}),r(1,"div",35),d(2,rn,2,0,"mat-icon"),d(3,on,2,0,"mat-icon"),d(4,ln,3,2,"span",5),o()()}if(i&2){let e,n=l();f("inactive",!n.isArchiveSelected(2)),a(2),m(n.isArchiveSelected(2)?-1:2),a(),m(n.isArchiveSelected(2)?3:-1),a(),m((e=n.archives[2])?4:-1,e)}}function dn(i,c){i&1&&A(0,"app-archive-parashas")}var wa=(()=>{class i{constructor(e,n,t,s,C){this.router=e,this.appSrv=n,this.homeSrv=t,this.browseSrv=s,this.helperSrv=C,this.archives=[{id:1,name:"by Speaker",total:0,route:"speakers"},{id:2,name:"by Topic",total:0,route:"topics"},{id:4,name:"by Parasha",total:0,route:"parasha"}],this.panelOpenState=!0,this.iTorahSections=[],this.dedication=""}isArchiveSelected(e){return this.currentArchive?.name===this.archives[e].name}ngOnInit(){this.currentArchive=this.archives[this.currentArchiveIndex-1],this.homeSrv.homeDataV3.pipe(Le(e=>e)).subscribe({next:e=>{this.iTorahSections=e.iTorahSections||[],this.dedication=this.getSectionDedication(12)||"";let n=e.Counters;n&&(this.archives[0]&&(this.archives[0].total=n.find(t=>t.Entity==="Speaker Count")?.Count||0),this.archives[1]&&(this.archives[1].total=n.find(t=>t.Entity==="Topic Count")?.Count||0),this.archives[2]&&(this.archives[2].total=n.find(t=>t.Entity==="Parasha Count")?.Count||0))},error:e=>console.error(e)})}getSectionDedication(e){return this.iTorahSections?.find(t=>
1t.SectionId===e)?.SectionDedication}selectArchive(e){this.panelOpenState=!0,this.browseSrv.archiveRelatedLectures=null,this.browseSrv.selectedArchiveCategory=null,this.appSrv.isMobile&&this.currentArchive===this.archives[e]?this.currentArchive=null:(this.helperSrv.performScroll("archives-group-"+e,"selectArchive()"),this.currentArchive=this.archives[e])}togglePanel(){this.panelOpenState=!this.panelOpenState}sponsorSection(e){let n=`sponsor/day?sectionId=${e}`;this.homeSrv.getUserToken()?this.router.navigate(["/sponsor/day"],{queryParams:{sectionId:e}}):this.appSrv.openAuthDialog(n)}static{this.\u0275fac=function(n){return new(n||i)(g(B),g(E),g(Ke),g(R),g(N))}}static{this.\u0275cmp=L({type:i,selectors:[["app-archives"]],inputs:{currentArchiveIndex:"currentArchiveIndex",currentArchiveSpeakerGroupURL:"currentArchiveSpeakerGroupURL",currentArchiveTopicsCategoryURL:"currentArchiveTopicsCategoryURL",currentArchiveTopicsSubcategoryURL:"currentArchiveTopicsSubcategoryURL"},decls:24,vars:42,consts:[["menu","matMenu"],["id","archives-panel","disabled","","hideToggle","",1,"primary-bg",3,"expanded"],[1,"primary-bg","flxRow"],[1,"flxFill",3,"click"],[1,"accent","pointer","flxRow","flxAlgnCen","gap18","flxFill"],[1,"flxFill"],[1,"m0","gap8","flxWrap"],[1,"flxLayRowGtMd","flxLayColLtLg","flxAlgnCen","gap8"],[1,"pointer","white","mt05","fs14","sponsor-prompt",3,"mb1"],[1,"flxRow","gap8","flxAlgnEnd"],[1,"desktop-dedication"],[1,"flxCol","gap16"],["mat-raised-button","","color","accent","routerLink","/browse-lectures/all",1,"mobile-archive-btn","flxRow","mb1"],["mat-raised-button","","color","accent","id","archives-group-0",1,"mobile-archive-btn","flxRow",3,"inactive"],[3,"currentArchiveSpeakerGroupURL"],["mat-raised-button","","color","accent","id","archives-group-1",1,"mobile-archive-btn","flxRow",3,"inactive"],[3,"currentArchiveTopicsCategoryURL","currentArchiveTopicsSubcategoryURL"],["mat-raised-button","","color","accent","id","archives-group-2",1,"mobile-archive-btn","flxRow",3,"inactive"],[1,"total-num","fw6","fs1"],[1,"fw3",3,"mob-sub-title"],[1,"fw3"],[1,"white","mt05","fs14","fw3"],[1,"pointer","white","mt05","fs14","sponsor-prompt",3,"click"],["mat-raised-button","","color","accent","routerLink","/browse-lectures/all",1,"search-btn-lt"],[1,"flxRow","flxAlgnCen","gap12","flxHideLtLg","pl1"],["mat-stroked-button","",1,"card-header-btn",3,"active"],[1,"archive-selector","gap20","flxFlexLtSm100","flxHideGtMd","pl1"],["mat-raised-button","","color","accent",3,"matMenuTriggerFor"],["mat-menu-item",""],["mat-stroked-button","",1,"card-header-btn",3,"click"],[1,"flxHideLtSm"],["mat-menu-item","",3,"click"],[1,"white","fs14"],["mat-raised-button","","color","accent","routerLink","/browse-lectures/all",1,"mobile-archive-btn","flxRow","mb1",3,"click"],["mat-raised-button","","color","accent","id","archives-group-0",1,"mobile-archive-btn","flxRow",3,"click"],[1,"flxRow","flxAlgnCen"],["mat-raised-button","","color","accent","id","archives-group-1",1,"mobile-archive-btn","flxRow",3,"click"],["mat-raised-button","","color","accent","id","archives-group-2",1,"mobile-archive-btn","flxRow",3,"click"]],template:function(n,t){if(n&1&&(r(0,"mat-expansion-panel",1)(1,"mat-expansion-panel-header",2)(2,"mat-panel-title",3),u("click",function(){return t.togglePanel()}),r(3,"div",4),d(4,Ai,2,0,"mat-icon"),d(5,Ti,2,0,"mat-icon"),r(6,"div",5)(7,"h2",6)(8,"span"),p(9,"CLASSES/SHIURIM"),o(),d(10,Ii,3,2,"span",7),w(11,"async"),o(),d(12,Ri,1,1)(13,Fi,2,2,"div",8),o()()(),d(14,Ni,17,3,"div",9),d(15,Ui,3,1,"div",10),o(),r(16,"div",11),d(17,$i,2,0,"button",12),d(18,Qi,5,5,"button",13),d(19,Ki,1,1,"app-archive-speakers",14),d(20,nn,5,5,"button",15),d(21,an,1,2,"app-archive-topics",16),d(22,pn,5,5,"button",17),d(23,dn,1,0,"app-archive-parashas"),o()()),n&2){let s;f("open",t.panelOpenState)("mobile",t.appSrv.isMobile),S("expanded",t.panelOpenState),a(),f("desktop",!t.appSrv.isMobile)("hasDedication",t.dedication)("mobile",t.appSrv.isMobile),a(3),m(t.panelOpenState?-1:4),a(),m(t.panelOpenState?5:-1),a(),f("flxCol",t.appSrv.isMobile)("flxAlgnCen",t.appSrv.isMobile),a(),f("flxLayCol",t.appSrv.isMobile)("flxLayRow",!t.appSrv.isMobile)("flxAlgnCen",t.appSrv.isMobile),a(3),m((s=O
1(11,40,t.homeSrv.homeDataV3))?10:-1,s),a(2),m(t.dedication?12:13),a(2),m(t.appSrv.isMobile?-1:14),a(),m(!t.appSrv.isMobile&&t.dedication?15:-1),a(),f("mobile",t.appSrv.isMobile)("primary-bg",t.appSrv.isMobile)("white-bg",!t.appSrv.isMobile),a(),m(t.appSrv.isMobile?17:-1),a(),m(t.appSrv.isMobile?18:-1),a(),m((t.currentArchive==null?null:t.currentArchive.id)===1?19:-1),a(),m(t.appSrv.isMobile?20:-1),a(),m((t.currentArchive==null?null:t.currentArchive.id)===2?21:-1),a(),m(t.appSrv.isMobile?22:-1),a(),m((t.currentArchive==null?null:t.currentArchive.id)===4?23:-1)}},dependencies:[$e,Ue,Z,it,Ze,et,tt,D,I,Ce,ue,_e,nt,mt,ht,_t,q,G,qe,J],styles:["[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%]{border-radius:6px;padding:0;scroll-margin-top:72px}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] mat-expansion-panel-header{height:75px!important;padding:0 .5rem .1rem 1rem!important;position:relative}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] mat-expansion-panel-header.desktop.hasDedication{height:100px!important;padding:0 .5rem 2.5rem 1rem!important}@media(max-width:1280px){[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] mat-expansion-panel-header.desktop.hasDedication{height:110px!important;padding:0 .5rem 2.5rem 1rem!important}}@media(max-width:480px){[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] mat-expansion-panel-header.mobile.hasDedication{height:180px!important;padding:0 .5rem 0rem 1rem!important}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] mat-expansion-panel-header.mobile{height:130px!important;padding:0 .5rem 0rem 1rem!important}}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] mat-expansion-panel-header .desktop-dedication{padding-right:.5rem;position:absolute;bottom:16px!important;left:3.3rem}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] mat-expansion-panel-header h2{width:100%;font-family:Outfit,sans-serif;font-size:var(--text-base);font-weight:500;letter-spacing:.1rem}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] mat-expansion-panel-header h2 span.txt-center{width:100%}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] mat-expansion-panel-header button.card-header-btn{color:#969cbe;font-size:var(--text-sm)!important;white-space:nowrap}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] mat-expansion-panel-header button.card-header-btn.active{background-color:#204494;color:#fff;border:1px solid var(--light-blue)}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] mat-expansion-panel-header .search-btn-lt{min-width:110px;font-size:var(--text-sm)}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] .mat-expansion-panel-body{padding:0}[_nghost-%COMP%] #archives-panel.mobile[_ngcontent-%COMP%]{border-radius:0;margin:0}[_nghost-%COMP%] #archives-panel.mobile[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{text-align:left;font-size:var(--text-lg)}[_nghost-%COMP%] #archives-panel.mobile.open[_ngcontent-%COMP%]{padding-bottom:1.75rem}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] .mobile-archive-btn[_ngcontent-%COMP%]{padding:.5rem;max-width:260px;width:100%;margin:auto;margin-bottom:25px!important}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] .mobile-archive-btn.inactive[_ngcontent-%COMP%]{background:#ffc800cc}[_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] #archives-group-0[_ngcontent-%COMP%], [_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] #archives-group-1[_ngcontent-%COMP%], [_nghost-%COMP%] #archives-panel[_ngcontent-%COMP%] #archives-group-2[_ngcontent-%COMP%]{scroll-margin-top:96px}"]})}}return i})();export{wa as ArchivesComponent};
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.