"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[46526,24145,91288],{46526:(t,e,n)=>{n.d(e,{U:()=>v});var o=n(10467),a=n(54438),s=n(21413),i=n(91768),r=n(74978),c=n(32832),d=n(15324),l=n(49882),u=n(52749),h=n(57085),p=n(86654),C=n(25572),g=n(79555),m=n(64422);const f=["compile"];let v=(()=>{var t;class CoreSitePluginsPluginContentComponent{constructor(t){this.component="",this.data={},this.onContentLoaded=new a.bkB,this.onLoadingContent=new a.bkB,this.content="",this.javascript="",this.dataLoaded=!1,this.invalidateObservable=new s.B,this.differ=t.find([]).create()}ngOnInit(){this.fetchContent()}ngDoCheck(){if(!this.data||!this.jsData)return;this.differ.diff(this.data)&&(this.jsData=Object.assign(this.jsData,this.data))}fetchContent(t){var e=this;return(0,o.A)((function*(){e.onLoadingContent.emit(t),e.forceCompile=!1;const n=Object.assign({},e.preSets);n.component=n.component||e.component;try{const o=yield c.CoreSitePlugins.getContent(e.component,e.method,e.args,n);e.content=o.templates.length?o.templates[0].html:"",e.javascript=o.javascript,e.otherData=o.otherdata,e.data=e.data||{},e.forceCompile=!0,e.jsData={...e.args,...e.data,...c.CoreSitePlugins.createDataForJS(e.initResult,o)},e.jsData.fetchContent=t=>e.fetchContent(t),e.jsData.openContent=(t,n,o,a,s,i,r)=>e.openContent(t,n,o,a,s,i,r),e.jsData.refreshContent=t=>e.refreshContent(t),e.jsData.updateContent=(t,n,o,a,s)=>e.updateContent(t,n,o,a,s),e.jsData.updateModuleCourseContent=(t,n)=>e.updateModuleCourseContent(t,n),e.jsData.updateCachedContent=()=>e.updateCachedContent(),e.onContentLoaded.emit({refresh:!!t,success:!0,content:e.content})}catch(n){e.content="<div></div>",e.onContentLoaded.emit({refresh:!!t,success:!1,content:e.content}),C.CoreAlerts.showError(n,{default:g.HT.instant("core.errorloadingcontent")})}finally{e.dataLoaded=!0}}))()}openContent(t,e={},n,o,a,s,r,c){!0===a&&(a=this.data),n=n||this.component,o=o||this.method;const l=i.VV.hashAsciiStr(JSON.stringify(e));d.CoreNavigator.navigateToSitePath(`siteplugins/content/${n}/${o}/${l}`,{params:{title:t,args:e,initResult:this.initResult,jsData:a,preSets:s,ptrEnabled:r,contextLevel:(null==c?void 0:c.contextLevel)||this.contextLevel,contextInstanceId:(null==c?void 0:c.contextInstanceId)||this.contextInstanceId,courseId:(null==c?void 0:c.courseId)||this.courseId}})}refreshContent(t=!0){var e=this;return(0,o.A)((function*(){t&&(e.dataLoaded=!1),e.invalidateObservable.next();try{yield c.CoreSitePlugins.invalidateContent(e.component,e.method,e.args)}finally{yield e.fetchContent(!0)}}))()}updateContent(t,e,n,o,a){this.component=e||this.component,this.method=n||this.method,this.args=t,this.dataLoaded=!1,this.preSets=a||this.preSets,this.data&&o&&Object.assign(this.data,o),this.fetchContent()}callComponentFunction(t,e){var n;return null===(n=this.compileComponent)||void 0===n?void 0:n.callComponentFunction(t,e)}updateModuleCourseContent(t,e){l.z.trigger(h.Vs,{cmId:t,alreadyFetched:e})}updateCachedContent(){var t=this;return(0,o.A)((function*(){yield c.CoreSitePlugins.getContent(t.component,t.method,t.args,u.CoreSites.getReadingStrategyPreSets(2))}))()}}return(t=CoreSitePluginsPluginContentComponent).ɵfac=function CoreSitePluginsPluginContentComponent_Factory(e){return new(e||t)(a.rXU(a.MKu))},t.ɵcmp=a.VBU({type:t,selectors:[["core-site-plugins-plugin-content"]],viewQuery:function CoreSitePluginsPluginContentComponent_Query(t,e){if(1&t&&a.GBs(f,5),2&t){let t;a.mGM(t=a.lsd())&&(e.compileComponent=t.first)}},hostVars:2,hostBindings:function CoreSitePluginsPluginContentComponent_HostBindings(t,e){2&t&&a.HbH(e.component)},inputs:{component:"component",method:"method",args:"args",initResult:"initResult",data:"data",preSets:"preSets",pageTitle:"pageTitle",contextLevel:"contextLevel",contextInstanceId:"contextInstanceId",courseId:"courseId"},outputs:{onContentLoaded:"onContentLoaded",onLoadingContent:"onLoadingContent"},standalone:!0,features:[a.aNF],decls:3,vars:6,consts:[["compile",""],[3,"hideUntil","fullscreen"],[3,"text","javascript","jsData","forceCompile"]],template:function CoreSitePluginsPluginContentComponent_Template(t,e){1&t&&(a.j41(0,"core-loading",1),a.nrm(1,"core-compile-html",2,0),a.k0s()),2&t&&(a.Y8G("hideUntil",e.dataLoaded)("fullscreen",!1),a.R7$(),a.Y8G("text",e.content)("javascript",e.javascript)("jsData",e.jsData)("forceCompile",e.forceCompile))},dependencies:[p.n,m.R,r.h],styles:["[_nghost-%COMP%]{display:contents}"]}),CoreSitePluginsPluginContentComponent})()}}]);