"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[77820],{77820:(e,n,o)=>{o.r(n),o.d(n,{AddonBlockSiteMainMenuComponent:()=>k});var t=o(10467),i=o(52749),l=o(44682),s=o(94247),c=o(70526),a=o(8979),d=o(3484),r=o(86654),m=o(98054),u=o(54438),p=o(60177),_=o(2910),M=o(64422),C=o(58197),f=o(73955);function AddonBlockSiteMainMenuComponent_ion_list_6_ion_item_1_Template(e,n){if(1&e&&(u.j41(0,"ion-item",6)(1,"ion-label"),u.nrm(2,"core-format-text",7),u.k0s()()),2&e){const e=u.XpG(2);u.R7$(2),u.Y8G("text",e.mainMenuBlock.summary)("component",e.component)("componentId",e.siteHomeId)("contextInstanceId",e.siteHomeId)}}function AddonBlockSiteMainMenuComponent_ion_list_6_ng_container_2_core_course_module_1_Template(e,n){if(1&e&&u.nrm(0,"core-course-module",9),2&e){const e=u.XpG().$implicit,n=u.XpG(2);u.Y8G("module",e)("section",n.mainMenuBlock)}}function AddonBlockSiteMainMenuComponent_ion_list_6_ng_container_2_Template(e,n){if(1&e&&(u.qex(0),u.DNE(1,AddonBlockSiteMainMenuComponent_ion_list_6_ng_container_2_core_course_module_1_Template,1,2,"core-course-module",8),u.bVm()),2&e){const e=n.$implicit,o=u.XpG(2);u.R7$(),u.Y8G("ngIf",o.isModule(e))}}function AddonBlockSiteMainMenuComponent_ion_list_6_Template(e,n){if(1&e&&(u.j41(0,"ion-list",3),u.DNE(1,AddonBlockSiteMainMenuComponent_ion_list_6_ion_item_1_Template,3,4,"ion-item",4)(2,AddonBlockSiteMainMenuComponent_ion_list_6_ng_container_2_Template,2,1,"ng-container",5),u.k0s()),2&e){const e=u.XpG();u.R7$(),u.Y8G("ngIf",e.mainMenuBlock.summary),u.R7$(),u.Y8G("ngForOf",e.mainMenuBlock.contents)}}let k=(()=>{var e;class AddonBlockSiteMainMenuComponent extends d.d{constructor(){super("AddonBlockSiteMainMenuComponent"),this.component="AddonBlockSiteMainMenu",this.siteHomeId=1,this.isModule=l.sectionContentIsModule,this.fetchContentDefaultError="Error getting main menu data."}ngOnInit(){var _superprop_getNgOnInit=()=>super.ngOnInit,e=this;return(0,t.A)((function*(){e.siteHomeId=i.CoreSites.getCurrentSiteHomeId(),_superprop_getNgOnInit().call(e)}))()}invalidateContent(){var e=this;return(0,t.A)((function*(){var n;const o=[];o.push(l.CoreCourse.invalidateSections(e.siteHomeId)),o.push(c.CoreSiteHome.invalidateNewsForum(e.siteHomeId)),null!==(n=e.mainMenuBlock)&&void 0!==n&&n.contents.length&&o.push(a.CoreCourseModulePrefetchDelegate.invalidateModules(l.CoreCourse.getSectionsModules([e.mainMenuBlock]),e.siteHomeId)),yield Promise.all(o)}))()}fetchContent(){var e=this;return(0,t.A)((function*(){const n=(yield l.CoreCourse.getSections(e.siteHomeId,!1,!0)).find((e=>0==e.section));if(!n)return;const o=i.CoreSites.getCurrentSite(),t=o&&o.getStoredConfig()||{};if(!t.frontpageloggedin)return;const a=t.frontpageloggedin.split(",").find((e=>parseInt(e,10)==c.FrontPageItemNames.NEWS_ITEMS)),d=yield s.CoreCourseHelper.addHandlerDataForModules([n],e.siteHomeId,void 0,void 0,!0);if(e.mainMenuBlock=d.sections[0],a&&e.mainMenuBlock.hasContent)try{const n=yield c.CoreSiteHome.getNewsForum(e.siteHomeId),o=e.mainMenuBlock.contents.findIndex((e=>(0,l.sectionContentIsModule)(e)&&"forum"==e.modname&&e.instance==n.id));o>=0&&e.mainMenuBlock.contents.splice(o,1)}catch{}}))()}}return(e=AddonBlockSiteMainMenuComponent).ɵfac=function AddonBlockSiteMainMenuComponent_Factory(n){return new(n||e)},e.ɵcmp=u.VBU({type:e,selectors:[["addon-block-sitemainmenu"]],standalone:!0,features:[u.Vt3,u.aNF],decls:7,vars:7,consts:[[3,"sticky"],["placeholderType","column","placeholderHeight","48px",3,"hideUntil","placeholderLimit"],["class","core-course-module-list-wrapper list-item-limited-width",4,"ngIf"],[1,"core-course-module-list-wrapper","list-item-limited-width"],["class","ion-text-wrap",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"ion-text-wrap"],["contextLevel","course",3,"text","component","componentId","contextInstanceId"],[3,"module","section",4,"ngIf"],[3,"module","section"]],template:function AddonBlockSiteMainMenuComponent_Template(e,n){1&e&&(u.j41(0,"ion-item-divider",0)(1,"ion-label")(2,"h2"),u.EFF(3),u.nI1(4,"translate"),u.k0s()()(),u.j41(5,"core-loading",1),u.DNE(6,AddonBlockSiteMainMenuComponent_ion_list_6_Template,3,2,"ion-list",2),u.k0s()),2&e&&(u.Y8G("sticky",!0),u.R7$(3),u.JRh(u.bMT(4,5,"addon.block_sitemainmenu.pluginname")),u.R7$(2),u.Y8G("hideUntil",n.loaded)("placeholderLimit",8),u.R7$(),u.Y8G("ngIf",n.mainMenuBlock))},dependencies:[r.n,p.Sq,p.bT,_.uz,_.Dg,_.he,_.nf,M.R,C.B,f.D9,m.CoreCourseModuleComponent],encapsulation:2}),AddonBlockSiteMainMenuComponent})()}}]);