"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[51180],{51180:(e,n,t)=>{t.r(n),t.d(n,{AddonModAssignFeedbackCommentsComponent:()=>x});var o=t(10467),i=t(5505),s=t(88436),a=t(4175),d=t(55554),c=t(95867),m=t(66016),l=t(69534),r=t(41450),p=t(86654),u=t(54438),g=t(89417),f=t(60177),_=t(2910),k=t(58197);const _c0=e=>({userid:e,action:"grade"});function AddonModAssignFeedbackCommentsComponent_ion_item_0_Template(e,n){if(1&e){const e=u.RV6();u.j41(0,"ion-item",2),u.bIt("click",(function AddonModAssignFeedbackCommentsComponent_ion_item_0_Template_ion_item_click_0_listener(n){u.eBV(e);const t=u.XpG();return u.Njj(t.open(n))})),u.j41(1,"ion-label")(2,"p",3),u.EFF(3),u.k0s(),u.j41(4,"p",4),u.nrm(5,"core-format-text",5),u.k0s()()()}if(2&e){const e=u.XpG();u.Y8G("detail",!0),u.R7$(3),u.JRh(e.plugin.name),u.R7$(2),u.Y8G("component",e.component)("componentId",e.assign.cmid)("text",e.text)("contextInstanceId",e.assign.cmid)("courseId",e.assign.course)("sanitize",!e.isSent)}}function AddonModAssignFeedbackCommentsComponent_ion_item_1_Template(e,n){if(1&e&&(u.j41(0,"ion-item",6)(1,"ion-label",7)(2,"p",3),u.EFF(3),u.k0s()(),u.nrm(4,"core-rich-text-editor",8),u.k0s()),2&e){const e=u.XpG();u.R7$(3),u.JRh(e.plugin.name),u.R7$(),u.Y8G("control",e.control)("placeholder",e.plugin.name)("component",e.component)("componentId",e.assign.cmid)("autoSave",!0)("contextInstanceId",e.assign.cmid)("draftExtraParams",u.eq3(8,_c0,e.userId))}}let x=(()=>{var e;class AddonModAssignFeedbackCommentsComponent extends c.S{constructor(e,n){super(),this.fb=n,this.component=m.It,this.text="",this.isSent=!1,this.loaded=!1,this.element=e.nativeElement}ngOnInit(){var e=this;return(0,o.A)((function*(){try{e.text=yield e.getText(),e.edit&&(e.control=e.fb.control(e.text,{nonNullable:!0}))}finally{e.loaded=!0}}))()}open(e){e.preventDefault(),e.stopPropagation(),l.m.viewText(this.plugin.name,this.text,{component:this.component,componentId:this.assign.cmid,filter:!0,contextLevel:"module",instanceId:this.assign.cmid,courseId:this.assign.course})}getText(){var e=this;return(0,o.A)((function*(){var n;const t=yield d.g.ignoreErrors(a.AddonModAssignOffline.getSubmissionGrade(e.assign.id,e.userId),void 0);if(null!=t&&null!==(n=t.plugindata)&&void 0!==n&&n.assignfeedbackcomments_editor){const n=t.plugindata;return e.isSent=!1,e.replacePluginfileUrls(n.assignfeedbackcomments_editor.text)}return e.isSent=!0,i.AddonModAssign.getSubmissionPluginText(e.plugin)}))()}replacePluginfileUrls(e){return s.CoreFileHelper.replacePluginfileUrls(e,this.plugin.fileareas&&this.plugin.fileareas[0]&&this.plugin.fileareas[0].files||[])}}return(e=AddonModAssignFeedbackCommentsComponent).ɵfac=function AddonModAssignFeedbackCommentsComponent_Factory(n){return new(n||e)(u.rXU(u.aKT),u.rXU(g.ok))},e.ɵcmp=u.VBU({type:e,selectors:[["addon-mod-assign-feedback-comments"]],standalone:!0,features:[u.Vt3,u.aNF],decls:2,vars:2,consts:[["class","ion-text-wrap","button","",3,"detail","click",4,"ngIf"],["class","ion-text-wrap",4,"ngIf"],["button","",1,"ion-text-wrap",3,"click","detail"],[1,"item-heading"],[1,"collapse-content"],["contextLevel","module",3,"component","componentId","text","contextInstanceId","courseId","sanitize"],[1,"ion-text-wrap"],["position","stacked"],["name","assignfeedbackcomments_editor","contextLevel","module","elementId","assignfeedbackcomments_editor",3,"control","placeholder","component","componentId","autoSave","contextInstanceId","draftExtraParams"]],template:function AddonModAssignFeedbackCommentsComponent_Template(e,n){1&e&&u.DNE(0,AddonModAssignFeedbackCommentsComponent_ion_item_0_Template,6,8,"ion-item",0)(1,AddonModAssignFeedbackCommentsComponent_ion_item_1_Template,5,10,"ion-item",1),2&e&&(u.Y8G("ngIf",n.text&&!n.edit),u.R7$(),u.Y8G("ngIf",n.edit&&n.loaded))},dependencies:[p.n,f.bT,_.uz,_.he,k.B,r.CoreEditorRichTextEditorComponent],encapsulation:2}),AddonModAssignFeedbackCommentsComponent})()}}]);