1"use strict";(self.webpackChunkexate_portal=self.webpackChunkexate_portal||[]).push([[3313],{90588:($,f,i)=>{function l({minLength:u=3,areSpecialCharactersAllowed:n=!0,isFirstCharacterCanBeNumeric:d=!1,checkSpecialCharacter:g=!0,areAlphaNumricAllowed:c=!1}){return{minLength:u,areSpecialCharactersAllowed:n,isFirstCharacterCanBeNumeric:d,checkSpecialCharacter:g,areAlphaNumricAllowed:c}}function v(u,n="Input",d=l({})){if(!u.value)return null;const g=u.value,c=g.trim(),x=d.minLength,D=`${n} must be at least ${d.minLength} characters`,b=new RegExp(/^[a-zA-Z]*$/),C=new RegExp(/^(?!\d+$)[a-zA-Z0-9 ]+$/),U=`${n} must be characters and number`,y=d.areSpecialCharactersAllowed?new RegExp(/^[a-zA-Z0-9 ._-]*$/):new RegExp(/^[a-zA-Z0-9]*$/),t=d.areSpecialCharactersAllowed?"Special characters are not allowed except space dot hyphen & underscore":"Special characters are not allowed";if(c.length>0){if(c.length<x)return{message:D};if(!d.isFirstCharacterCanBeNumeric&&!1===b.test(c.charAt(0)))return{message:"First character must be alphabet"};if(d.areAlphaNumricAllowed&&!1===C.test(c))return{message:U};if(d.checkSpecialCharacter&&!1===y.test(c))return{message:t}}else if(0===c.length&&g.length>0)return{message:`${n} is required`};return null}i.d(f,{W:()=>v,g:()=>l})},13313:($,f,i)=>{i.r(f),i.d(f,{DataUsageModule:()=>w});var l=i(48425),v=i(60177),u=i(89461),n=i(89417),d=i(20923),g=i(5100),c=i(51188),x=i(7673),D=i(88592),b=i(23294),M=i(25558),C=i(48686),U=i(81665),y=i(75564),t=i(93953),E=i(50779),T=i(54124),R=i(81594),N=i(90588),I=i(88141),F=i(85176),S=i(34006);function j(a,m){if(1&a){const e=t.RV6();t.j41(0,"exate-button",12),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.saveDataUsage())}),t.k0s()}if(2&a){const e=t.XpG();t.Y8G("disabled",e.datausageForm.invalid)}}let X=(()=>{class a{get id(){return this.datausageForm.get("id")}get name(){return this.datausageForm.get("name")}get description(){return this.datausageForm.get("description")}get isConsentRequired(){return this.datausageForm.get("isConsentRequired")}constructor(e,s,o,r,h){this.modalRef=e,this.fb=s,this.query=o,this.service=r,this.matDialog=h,this.datausageForm=this.fb.nonNullable.group({id:[0],name:["",[n.k0.required,p=>(0,N.W)(p,"Data Usage Name"),p=>this.validateNameIsUnique(p)]],description:[""],isConsentRequired:[!1]})}ngOnInit(){this.action="Add",this.item&&(this.action="Edit",this.id.setValue(this.item.DataUsageId),this.name.setValue(this.item.DataUsageName),this.description.setValue(this.item.DataUsageDescription),this.isConsentRequired.setValue(this.item.IsConsentRequired))}validateNameIsUnique(e){return null!=e.parent&&this.query.getDataUsageNameExists(e.parent.value.id,e.value)?{message:"Data Usage Name already exists. Must be unique"}:null}saveDataUsage(){const e=(0,F.m)({DataUsageId:parseInt(this.id.value),DataUsageName:this.name.value,DataUsageDescription:this.description.value,IsConsentRequired:this.isConsentRequired.value});this.datausageForm.valid&&this.service.upsertDataUsage(e).pipe((0,I.M)(s=>this.matDialog.closeAll())).subscribe()}closeModal(){this.matDialog.closeAll()}static#t=this.\u0275fac=function(s){return new(s||a)(t.rXU(E.Y$),t.rXU(n.ok),t.rXU(U.O),t.rXU(C.V),t.rXU(S.bZ))};static#e=this.\u0275cmp=t.VBU({type:a,selectors:[["app-data-usage-edit-modal"]],inputs:{item:"item"},decls:17,vars:2,consts:[["role","form",3,"formGroup"],[1,"modal-body"],[1,"form-group"],["for","dataUsageName"],["label","Data Usage Name","formControlName","name","id","dataUsageName","appTrim",""],["for","description"],["type","textarea","rows","2","id","description","formControlName","description","appTrim",""],["for","isConsentRequired"],["formControlName","isConsentRequired","id","isConsentRequired"],[1,"modal-delete-footer"],["size","small","color","primary","name","Submit",3,"disabled"],["size","small","color","warn","name","Cancel",3,"click"],["size","small","color","primary","name","Submit",3,"click","disabled"]],template:function(s,o){1&s&&(t.j41(0,"form",0)(1,"div",1)(2,"div",2)(3,"label",3),t.EFF(4,"Data Usage Name: "),t.k0s(),t.nrm(5,"exate-input",4),t.k0s(),t.j41(6,"div",2)(7,"label",5),t.EFF(8,"Description: "),t.k0s(),t.nrm(9,"exate-input",6),t.k0s(),t.j41(10,"div",2)(11,"label",7),t.EFF(12,"Is Consent Required: \xa0\xa0"),t.k0s(),t.nrm(13,"exate-switch",8),t.k0s()(),t.j41(14,"div",9),t.DNE(15,j,1,1,"exate-button",10),t.j41(16,"exate-button",11),t.bIt("click",function(){return o.closeModal()}),t.k0s()()()),2&s&&(t.Y8G("formGroup",o.datausageForm),t.R7$(15),t.vxM(o.datausageForm.dirty?15:-1))},dependencies:[n.qT,n.BC,n.cb,n.j4,n.JD,l.tf,l.Bz,l.vE],styles:[".modal-body[_ngcontent-%COMP%]{padding:0 25px;background:var(--modal-bg)!important;color:rgb(var(--text-color))!important} .mat-mdc-dialog-container .mat-mdc-dialog-content{font-size:13px!important;overflow:hidden!important} .mat-mdc-dialog-contentm{color:rgb(var(--text-color))!important} .modal-close{color:rgb(var(--text-color))!important} .mdc-button.btn-small{text-transform:none!important;margin-right:10px} .mat-mdc-dialog-container .mat-mdc-dialog-title{color:rgb(var(--text-color))}"]})}return a})();const G=["dataUsageEditModal"],L=(a,m)=>m.DataUsageId,A=a=>({canEdit:a});function V(a,m){if(1&a){const e=t.RV6();t.j41(0,"span",3)(1,"exate-button",7),t.nI1(2,"async"),t.nI1(3,"async"),t.bIt("click",function(){t.eBV(e);const o=t.XpG(2);return t.Njj(o.openDataUsageEditModal(null))}),t.k0s()()}if(2&a){const e=t.XpG(2);t.R7$(),t.Y8G("disabled",!1===t.bMT(2,2,e.canEdit$))("color","light"===t.bMT(3,4,e.theme$)?"primary":"")}}function z(a,m){1&a&&t.nrm(0,"exate-loader",6),2&a&&t.Y8G("showLoadingText",!0)("diameterSize",28)}function B(a,m){if(1&a){const e=t.RV6();t.j41(0,"div",8)(1,"app-card",9),t.bIt("clicked",function(){const o=t.eBV(e).$implicit,r=t.XpG
1(2),h=t.XpG();return t.Njj(r.canEdit?h.openDataUsageEditModal(o):"")}),t.k0s()()}if(2&a){const e=m.$implicit;t.R7$(),t.Y8G("title",e.DataUsageName)("footerRight",e.DataUsageId)}}function O(a,m){1&a&&(t.j41(0,"div"),t.Z7z(1,B,2,2,"div",8,L),t.k0s()),2&a&&(t.R7$(),t.Dyx(m))}function _(a,m){if(1&a&&t.nrm(0,"app-data-usage-edit-modal",10),2&a){const e=t.XpG(2);t.Y8G("item",e.item)}}function k(a,m){if(1&a&&(t.j41(0,"div",1)(1,"div",2)(2,"div")(3,"h2"),t.EFF(4,"Data Usage"),t.k0s(),t.DNE(5,V,4,6,"span",3),t.k0s(),t.j41(6,"form",4),t.nrm(7,"exate-input",5),t.k0s()(),t.DNE(8,z,1,2,"exate-loader",6),t.nI1(9,"async"),t.DNE(10,O,3,0,"div"),t.nI1(11,"async"),t.k0s(),t.DNE(12,_,1,1,"ng-template",null,0,t.C5r)),2&a){let e;const s=t.XpG();t.R7$(5),t.vxM(m.canEdit?5:-1),t.R7$(2),t.Y8G("formControl",s.search),t.R7$(),t.vxM(t.bMT(9,4,s.isLoading$)?8:-1),t.R7$(2),t.vxM((e=t.bMT(11,6,s.dataUsages$))?10:-1,e)}}const Y=[{path:"",component:(()=>{class a{constructor(e,s,o,r,h,p,W){this.datausageService=e,this.datausageQuery=s,this.datausageStore=o,this.sessionQuery=r,this.modalService=h,this.exateModalService=p,this.uiThemeService=W,this.subscriptions=[],this.search=new n.MJ(""),this.theme$=this.uiThemeService.currentTheme}ngOnInit(){this.isLoading$=this.datausageQuery.selectLoading(),this.searchTerm$=this.datausageQuery.selectSearchTerm(),this.subscriptions.push(this.searchTerm$.subscribe(s=>this.search.setValue(s))),this.dataUsages$=this.doSearch(this.searchTerm$),this.subscriptions.push(this.datausageService.get().subscribe()),this.canEdit$=(0,x.of)(!0);const e=this.search.valueChanges.subscribe(s=>{this.datausageStore.setSearchTerm(s??"")});this.subscriptions.push(e)}doSearch(e){return e.pipe((0,b.F)(),(0,M.n)(s=>s?this.datausageQuery.selectByDataUsageName(s):this.datausageQuery.selectAll()))}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}openDataUsageEditModal(e){this.item=e,this.exateModalService.openDialog({title:(this.item?"Edit":"Add")+" Data Usage",size:"450px",template:this.dataUsageEditModal})}static#t=this.\u0275fac=function(s){return new(s||a)(t.rXU(C.V),t.rXU(U.O),t.rXU(y.B),t.rXU(D.X),t.rXU(E.I8),t.rXU(l.Mh),t.rXU(T.j))};static#e=this.\u0275cmp=t.VBU({type:a,selectors:[["app-data-usage-list"]],viewQuery:function(s,o){if(1&s&&t.GBs(G,5),2&s){let r;t.mGM(r=t.lsd())&&(o.dataUsageEditModal=r.first)}},decls:2,vars:5,consts:[["dataUsageEditModal",""],[1,"row"],[1,"cardtitle"],[1,"icon-btn"],["id","search-form","role","search",1,"navbar-form","pull-right","r-search"],["variant","icon","icon","search","placeholder","Search",3,"formControl"],["color","default",3,"showLoadingText","diameterSize"],["variant","icon","icon","add",1,"icon-bg",3,"click","disabled","color"],[1,"col-md-3","col-xs-6","col-sm-4","col-lg-2"],["footerLeft"," ",3,"clicked","title","footerRight"],[3,"item"]],template:function(s,o){if(1&s&&(t.DNE(0,k,14,8),t.nI1(1,"async")),2&s){let r;t.vxM((r=t.eq3(3,A,t.bMT(1,1,o.canEdit$)))?0:-1,r)}},dependencies:[n.qT,n.BC,n.cb,n.l_,n.cV,R.i,l.tf,l.Bz,l.C1,X,v.Jj],styles:[".rbox-text[_ngcontent-%COMP%]{padding:50px 20px}.rbox-text[_ngcontent-%COMP%]:after{content:none}.col-md-2[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.navbar-form[_ngcontent-%COMP%]{padding:0 0 0 22px}input[_ngcontent-%COMP%]{vertical-align:top!important}@media (min-width: 1600px){.col-md-3[_ngcontent-%COMP%]{width:20%}} .icon-btn .icon-bg .mdc-icon-button.mat-mdc-icon-button{background-color:var(--basic-button-outside-card-bg)}"]})}return a})(),data:{breadcrumb:"Data Usage",baseUrl:"data-usage"}}];let Q=(()=>{class a{static#t=this.\u0275fac=function(s){return new(s||a)};static#e=this.\u0275mod=t.$C({type:a});static#a=this.\u0275inj=t.G2t({imports:[c.iI.forChild(Y),c.iI]})}return a})();var P=i(64917),Z=i(83967),J=i(14331);let w=(()=>{class a{static#t=this.\u0275fac=function(s){return new(s||a)};static#e=this.\u0275mod=t.$C({type:a});static#a=this.\u0275inj=t.G2t({imports:[v.MD,Q,u.h,n.X1,n.YN,d.t,g.H,P.Y,Z.D,J.h,E.Q_,l.JA]})}return a})()}}]);
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.