1"use strict";(self.webpackChunklms_frontend=self.webpackChunklms_frontend||[]).push([[6417],{26417:(N,c,o)=>{o.r(c),o.d(c,{routes:()=>b});var m=o(57565),d=o(13414),g=o(16368),p=o(39289),n=o(45109),u=o(79020),l=o(1595),v=o(9580),t=o(70106),f=o(42227),h=o(23037),T=o(22529),C=o(10480),S=o(58437),U=o(50027);const I=()=>({standalone:!0});function X(s,k){if(1&s&&t.nrm(0,"ems-frontend-form-validator",15),2&s){const e=t.XpG(2);t.Y8G("control",e.form.controls.title)}}function j(s,k){if(1&s){const e=t.RV6();t.qex(0),t.j41(1,"div",2)(2,"span",3)(3,"span",4),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.utilsService.goBack())}),t.k0s(),t.EFF(4),t.k0s(),t.nrm(5,"p-divider"),t.j41(6,"form",5)(7,"div",6)(8,"div",7)(9,"label",8),t.EFF(10,"Title"),t.k0s(),t.nrm(11,"input",9),t.DNE(12,X,1,1,"ems-frontend-form-validator",10),t.k0s(),t.j41(13,"div",11)(14,"label",8),t.EFF(15,"Color"),t.k0s(),t.j41(16,"p-colorPicker",12),t.mxI("ngModelChange",function(i){t.eBV(e);const a=t.XpG();return t.DH7(a.color,i)||(a.color=i),t.Njj(i)}),t.k0s()()(),t.j41(17,"p-button",13),t.bIt("onClick",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.upsertTag())}),t.k0s(),t.j41(18,"p-button",14),t.bIt("onClick",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.initializeForm())}),t.k0s()()(),t.bVm()}if(2&s){const e=t.XpG();t.R7$(4),t.SpI(" ",e.form.value.id?"Update":"Create"," Tag "),t.R7$(2),t.Y8G("formGroup",e.form),t.R7$(6),t.Y8G("ngIf",e.submitted),t.R7$(4),t.R50("ngModel",e.color),t.Y8G("ngModelOptions",t.lJ4(8,I))("inline",!0),t.R7$(),t.FS9("label",e.form.value.id?"Save":"Create"),t.R7$(),t.FS9("label",e.form.value.id?"Undo":"Reset")}}const b=[{path:"",component:(()=>{class s{constructor(e,r,i,a,F,G,x,R,B){this.formBuilder=e,this.tagService=r,this.router=i,this.activatedRoute=a,this.utilsService=F,this.toastService=G,this.loaderService=x,this.titleService=R,this.institutionService=B,this.submitted=!1,this.color="#000000"}ngOnInit(){const e=this.activatedRoute.snapshot.params.id;this.loaderService.loadingOn(),e?this.tagService.getTagById(e).subscribe(r=>{this.tag=r.data,this.titleService.setTitle(this.tag.title+" | "+this.institutionService.institution.getValue().name),this.color=this.tag.color,this.initializeForm()}):this.initializeForm()}initializeForm(){this.form=this.formBuilder.group({id:[this.tag?.id||""],title:[this.tag?.title||"",[n.k0.required]],color:[this.tag?.color||"",[n.k0.required]],createdBy:[this.tag?.createdBy||localStorage.getItem("lms-user-id")],institutionId:[localStorage.getItem("institutionId")]}),this.loaderService.loadingOff()}upsertTag(){this.submitted=!0,this.form.patchValue({color:this.color}),this.form.valid?this.tagService.upsertTag(this.form.value).subscribe(e=>{this.toastService.success(e.message),this.router.navigate(["../"],{relativeTo:this.activatedRoute})},e=>{this.toastService.error(e.error.message)}):this.toastService.error("Enter valid details")}static{this.\u0275fac=function(r){return new(r||s)(t.rXU(n.ok),t.rXU(f.w),t.rXU(l.Ix),t.rXU(l.nX),t.rXU(h.T),t.rXU(T.f),t.rXU(C.Z),t.rXU(S.hE),t.rXU(U.a))}}static{this.\u0275cmp=t.VBU({type:s,selectors:[["ems-frontend-upsert-tag"]],standalone:!0,features:[t.aNF],decls:2,vars:1,consts:[[1,"upsert-tag"],[4,"ngIf"],[1,"card","mb-4"],[1,"title"],[1,"pi","pi-angle-left","go-back",3,"click"],[3,"formGroup"],[1,"grid"],[1,"md:col-12"],[1,"required"],["type","text","pInputText","","formControlName","title","placeholder","enter title"],[3,"control",4,"ngIf"],[1,"md:col-12","mb-4"],[3,"ngModelChange","ngModel","ngModelOptions","inline"],[3,"onClick","label"],["styleClass","btn-cancel",3,"onClick","label"],[3,"control"]],template:function(r,i){1&r&&(t.j41(0,"div",0),t.DNE(1,j,19,9,"ng-container",1),t.k0s()),2&r&&(t.R7$(),t.Y8G("ngIf",i.form))},dependencies:[m.MD,m.bT,d.u,d.S,g.m,g.c,v.K,p.tm,p.$n,l.iI,n.X1,n.qT,n.me,n.BC,n.cb,n.j4,n.JD,n.YN,n.vS,u.YG,u.sk],encapsulation:2})}}return s})()}]}}]);
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.