1"use strict";(self.webpackChunkmyapp=self.webpackChunkmyapp||[]).push([[5222],{5222:(st,E,a)=>{a.r(E),a.d(E,{CoreBackupPolicyComponent:()=>et});var C=a(98231),t=a(23135),u=a(90695),m=a(44025),g=a(86570),F=a(62794),B=a(98259),f=a(51996),c=a(15385),x=a(8179),k=a(62252),T=a(49008),p=a(52317),S=a(99112),O=a(77257),d=a(15799),_=a(28113),M=a(44267),y=a(27720),b=a(15941),P=a(52702),D=a(2765);const A=(i,r)=>r.name;function G(i,r){1&i&&(t.j41(0,"span",6),t.nrm(1,"i",7),t.k0s())}function N(i,r){1&i&&t.EFF(0," Vui l\xf2ng nh\u1eadp t\xean ch\xednh s\xe1ch ")}function V(i,r){1&i&&t.EFF(0," T\xean ch\xednh s\xe1ch kh\xf4ng \u0111\u01b0\u1ee3c v\u01b0\u1ee3t qu\xe1 255 k\xfd t\u1ef1 ")}function w(i,r){if(1&i&&t.EFF(0),2&i){let e;const s=t.XpG(3);t.SpI(" ",null==(e=s.form.get("policyName"))?null:e.getError("serverError")," ")}}function R(i,r){if(1&i&&t.DNE(0,N,1,0)(1,V,1,0)(2,w,1,1),2&i){let e;const s=t.XpG(2);t.vxM(null!=(e=s.form.get("policyName"))&&e.hasError("required")||null!=(e=s.form.get("policyName"))&&e.hasError("whitespaceOnly")?0:null!=(e=s.form.get("policyName"))&&e.hasError("maxlength")?1:null!=(e=s.form.get("policyName"))&&e.hasError("serverError")?2:-1)}}function I(i,r){1&i&&t.EFF(0," M\xf4 t\u1ea3 kh\xf4ng \u0111\u01b0\u1ee3c v\u01b0\u1ee3t qu\xe1 1000 k\xfd t\u1ef1 ")}function j(i,r){if(1&i&&t.DNE(0,I,1,0),2&i){let e;const s=t.XpG(2);t.vxM(null!=(e=s.form.get("description"))&&e.hasError("maxlength")?0:-1)}}function L(i,r){if(1&i&&t.nrm(0,"vts-option",18),2&i){const e=r.$implicit;t.Y8G("vtsValue",e.name)("vtsLabel",e.label)}}function $(i,r){if(1&i&&t.nrm(0,"vts-option",18),2&i){const e=r.$implicit;t.Y8G("vtsValue",e.name)("vtsLabel",e.label)}}function U(i,r){if(1&i){const e=t.RV6();t.qex(0),t.j41(1,"form",8)(2,"vts-form-item")(3,"vts-form-label",9),t.EFF(4,"T\xean ch\xednh s\xe1ch"),t.k0s(),t.j41(5,"vts-form-control",10)(6,"input",11),t.bIt("input",function(){let n;t.eBV(e);const o=t.XpG();return t.Njj(null==(n=o.form.get("policyName"))?null:n.markAsDirty())}),t.k0s()()(),t.DNE(7,R,3,1,"ng-template",null,2,t.C5r),t.j41(9,"vts-form-item")(10,"vts-form-label"),t.EFF(11,"M\xf4 t\u1ea3"),t.k0s(),t.j41(12,"vts-form-control",12),t.nrm(13,"textarea",13),t.k0s(),t.DNE(14,j,1,1,"ng-template",null,3,t.C5r),t.k0s(),t.j41(16,"div",14)(17,"div",15)(18,"vts-form-item")(19,"vts-form-label",9),t.EFF(20,"T\u1ea7n su\u1ea5t sao l\u01b0u"),t.k0s(),t.j41(21,"vts-form-control",16)(22,"vts-select",17),t.Z7z(23,L,1,2,"vts-option",18,A),t.k0s()()()(),t.j41(25,"div",15)(26,"vts-form-item")(27,"vts-form-label",9),t.EFF(28,"Nh\xf3m d\u1eef li\u1ec7u"),t.k0s(),t.j41(29,"vts-form-control",19)(30,"vts-select",20),t.Z7z(31,$,1,2,"vts-option",18,A),t.k0s()()()()(),t.j41(33,"vts-form-item")(34,"vts-form-label"),t.EFF(35,"K\xedch ho\u1ea1t"),t.k0s(),t.j41(36,"vts-form-control")(37,"div",21),t.nrm(38,"vts-switch",22),t.j41(39,"span",23),t.EFF(40),t.k0s()()()()(),t.bVm()}if(2&i){let e;const s=t.sdS(8),n=t.sdS(15),o=t.XpG();t.R7$(),t.Y8G("formGroup",o.form),t.R7$(4),t.Y8G("vtsValidateStatus",o.form.controls.policyName)("vtsErrorTip",s),t.R7$(7),t.Y8G("vtsErrorTip",n),t.R7$(4),t.Y8G("vtsGutter",16),t.R7$(),t.Y8G("vtsSpan",12),t.R7$(5),t.Y8G("vtsAllowClear",!0),t.R7$(),t.Dyx(o.frequencyOptions()),t.R7$(2),t.Y8G("vtsSpan",12),t.R7$(5),t.Y8G("vtsAllowClear",!0),t.R7$(),t.Dyx(o.dataGroupOptions()),t.R7$(9),t.SpI(" ",null!=(e=o.form.get("status"))&&e.value?"B\u1eadt":"T\u1eaft"," ")}}function X(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",25),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.resetFrequencyToDefault())}),t.nrm(1,"i",29),t.EFF(2," \u0110\u1eb7t l\u1ea1i m\u1eb7c \u0111\u1ecbnh "),t.k0s()}}function q(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",30),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.handleSave())}),t.nrm(1,"i",31),t.EFF(2," L\u01b0u th\xf4ng tin "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("vtsLoading",e.isLoading())}}function Q(i,r){if(1&i){const e=t.RV6();t.j41(0,"div",24)(1,"button",25),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.handleCancel())}),t.nrm(2,"i",26),t.EFF(3," Quay l\u1ea1i "),t.k0s(),t.DNE(4,X,3,0,"button",27)(5,q,3,1,"button",28),t.k0s()}if(2&i){const e=t.XpG();t.R7$(4),t.vxM(e.isEditMode()&&e.canUpdate()?4:-1),t.R7$(),t.vxM(e.canUpdate()?5:-1)}}const Y=f.d7.DAYS_7;let W=(()=>{class i{constructor(){this.fb=(0,t.WQX)(u.ok),this.elRef=(0,t.WQX)(t.aKT),this.isVisible=t.geq.required(),this.isEditMode=(0,t.hFB)(!1),this.data=(0,t.hFB)(null),this.isLoading=(0,t.hFB)(!1),this.errorMessage=(0,t.hFB)(null),this.dataGroupOptions=(0,t.hFB)([]),this.frequencyOptions=(0,t.hFB)([]),this.canUpdate=(0,t.hFB)(!1),this.onCancel=(0,t.CGW)(),this.onSave=(0,t.CGW)(),this.destroy$=new k.B,this.NAME_MAX=255,this.DESC_MAX=1e3,this.VALIDATOR_NO_WHITESPACE=e=>{if(!e.value)return null;const s="string"==typeof e.value?e.value.trim():e.value;return"string"==typeof s&&0===s.length?{whitespaceOnly:!0}:null},this.VALIDATOR_MIN_ITEMS=e=>{const s=e.value;return Array.isArray(s)&&0!==s.length?null:{required:!0}},this.form=this.fb.group({policyName:["",[u.k0.required,u.k0.maxLength(this.NAME_MAX),this.VALIDATOR_NO_WHITESPACE]],description:["",[u.k0.maxLength(this.DESC_MAX)]],frequency:[null,[u.k0.required]],dataGroups:[[],[this.VALIDATOR_MIN_ITEMS]],status:[!0]}),(0,t.QZP)(()=>{const e=this.data();e?this.form.patchValue({policyName:e.policyName,description:e.description??"",frequency:e.frequency,dataGroups:[...e.dataGroups??[]],status:e.status}):this.form.reset({policyName:"",description:"",frequency:null,dataGroups:[],status:!0})}),(0,t.QZP)(()=>{const e=this.errorMessage();if(!e)return;const s=this.form.get("policyName");s?.setErrors({serverError:e}),s?.markAsDirty(),s?.markAsTouched(),setTimeout(()=>{this.elRef.nativeElement.querySelector('input[formControlName="policyName"]')?.focus()},0)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}handleCancel(){this.onCancel.emit()}resetFrequencyToDefault(){this.canUpdate()&&this.form.get("frequency")?.setValue(Y)}handleSave(){if(!this.canUpdate())return;const e=this.form.get("policyName");e?.value&&"string"==typeof e.value&&e.setValue(e.value.trim(),{emitEvent:!1});const s=this.form.get("description");if(s?.value&&"string"==typeof s.value&&s.setValue(s.value.trim(),{emitEvent:!1}
1),this.form.invalid)return void Object.values(this.form.controls).forEach(l=>{l.invalid&&(l.markAsDirty(),l.markAsTouched(),l.updateValueAndValidity({onlySelf:!0}))});const n=this.form.value;this.onSave.emit({policyName:n.policyName,description:n.description||null,frequency:n.frequency,dataGroups:n.dataGroups,status:n.status})}static{this.\u0275fac=function(s){return new(s||i)}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["lib-backup-policy-modal"]],inputs:{isVisible:[1,"isVisible"],isEditMode:[1,"isEditMode"],data:[1,"data"],isLoading:[1,"isLoading"],errorMessage:[1,"errorMessage"],dataGroupOptions:[1,"dataGroupOptions"],frequencyOptions:[1,"frequencyOptions"],canUpdate:[1,"canUpdate"]},outputs:{isVisible:"isVisibleChange",onCancel:"onCancel",onSave:"onSave"},decls:6,vars:6,consts:[["closeIconTpl",""],["modalFooter",""],["nameErrorTip",""],["descErrorTip",""],["vtsClassName","standard-vts-modal",3,"vtsVisibleChange","vtsOnCancel","vtsVisible","vtsTitle","vtsFooter","vtsWidth","vtsCloseIcon","vtsAutofocus"],[4,"vtsModalContent"],["vts-tooltip","","vtsTooltipTitle","\u0110\xf3ng",1,"cursor-pointer"],["vts-icon","","vtsType","Close:custom"],["vts-form","","vtsLayout","vertical",1,"space-y-form",3,"formGroup"],["vtsRequired",""],[3,"vtsValidateStatus","vtsErrorTip"],["vts-input","","formControlName","policyName","placeholder","Nh\u1eadp t\xean",3,"input"],[3,"vtsErrorTip"],["vts-input","","formControlName","description","rows","4","placeholder","Nh\u1eadp n\u1ed9i dung"],["vts-row","",3,"vtsGutter"],["vts-col","",3,"vtsSpan"],["vtsErrorTip","Vui l\xf2ng ch\u1ecdn t\u1ea7n su\u1ea5t"],["formControlName","frequency","vtsPlaceHolder","Ch\u1ecdn","vtsSize","lg",3,"vtsAllowClear"],[3,"vtsValue","vtsLabel"],["vtsErrorTip","Vui l\xf2ng ch\u1ecdn \xedt nh\u1ea5t 1 nh\xf3m d\u1eef li\u1ec7u"],["formControlName","dataGroups","vtsMode","multiple","vtsPlaceHolder","Ch\u1ecdn","vtsSize","lg",3,"vtsAllowClear"],[1,"switch-row"],["formControlName","status"],[1,"switch-label"],[1,"backup-policy-modal__footer-actions"],["vts-button","","vtsType","default",3,"click"],["vts-icon","","vtsType","ArrowBack:custom"],["vts-button","","vtsType","default"],["vts-button","","vtsType","primary",3,"vtsLoading"],["vts-icon","","vtsType","Refresh:vts"],["vts-button","","vtsType","primary",3,"click","vtsLoading"],["vts-icon","","vtsType","PaperTick:custom"]],template:function(s,n){if(1&s){const o=t.RV6();t.j41(0,"vts-modal",4),t.mxI("vtsVisibleChange",function(h){return t.eBV(o),t.DH7(n.isVisible,h)||(n.isVisible=h),t.Njj(h)}),t.bIt("vtsOnCancel",function(){return t.eBV(o),t.Njj(n.handleCancel())}),t.DNE(1,G,2,0,"ng-template",null,0,t.C5r)(3,U,41,10,"ng-container",5)(4,Q,6,2,"ng-template",null,1,t.C5r),t.k0s()}if(2&s){const o=t.sdS(2),l=t.sdS(5);t.R50("vtsVisible",n.isVisible),t.Y8G("vtsTitle",n.isEditMode()?"Ch\u1ec9nh s\u1eeda":"Th\xeam m\u1edbi ch\xednh s\xe1ch sao l\u01b0u d\u1ef1 ph\xf2ng")("vtsFooter",l)("vtsWidth",760)("vtsCloseIcon",o)("vtsAutofocus",null)}},dependencies:[C.MD,u.YN,u.qT,u.me,u.BC,u.cb,u.X1,u.j4,u.JD,O.u,m.G,m.R$,D.T,d.SX,_.tH,_.BE,d.dF,d.Qp,d.rA,d.Yc,_.mi,g.dA,g.qb,M.iO,M.fZ,y.RU,y.EV,y.Xc,b.u,b.mw,b.B1,P.u,P.n],styles:["[_nghost-%COMP%]{display:block}.switch-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.switch-label[_ngcontent-%COMP%]{color:#374151} .backup-policy-modal__footer-actions{display:flex;justify-content:flex-end;align-items:center;gap:12px;width:100%} .backup-policy-modal__footer-actions button+button{margin-inline-start:0!important}"]})}}return i})();const z=["frequencyTpl"],K=["dataGroupsTpl"],H=()=>({enable:!0});function Z(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",11),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.openAddModal())}),t.nrm(1,"i",12),t.EFF(2," Th\xeam m\u1edbi "),t.k0s()}}function J(i,r){if(1&i&&(t.j41(0,"td"),t.EFF(1),t.k0s()),2&i){const e=r.$implicit,s=t.XpG();t.R7$(),t.SpI(" ",s.FREQUENCY_LABELS[e.frequency]||(e.frequencyDays?e.frequencyDays+" ng\xe0y":e.frequency)," ")}}function tt(i,r){if(1&i&&(t.j41(0,"td")(1,"span",13),t.EFF(2),t.k0s()()),2&i){let e;const s=r.$implicit;t.R7$(2),t.SpI(" ",null!==(e=null!==(e=s.dataGroupCount)&&void 0!==e?e:null==s.dataGroups?null:s.dataGroups.length)&&void 0!==e?e:0," nh\xf3m ")}}let et=(()=>{class i{constructor(){this.backupService=(0,t.WQX)(f.$N),this.toastService=(0,t.WQX)(F.Mo),this.dialogService=(0,t.WQX)(x.o3),this.breadcrumbService=(0,t.WQX)(c.BZs),this.checkPermissionService=(0,t.WQX)(c.X4S),this.showCreate=!1,this.showUpdate=!1,this.showDelete=!1,this.destroy$=new k.B,this.data=(0,t.vPA)([]),this.loading=(0,t.vPA)(!1),this.dataGroupOptions=(0,t.vPA)([]),this.frequencyOptions=(0,t.vPA)([]),this.selectedTabIndex=0,this.DEFAULT_SORT="createdDate,desc",this.sort=this.DEFAULT_SORT,this.currentState={},this.modalVisible=(0,t.vPA)(!1),this.modalLoading=(0,t.vPA)(!1),this.isEditMode=(0,t.vPA)(!1),this.selectedItem=(0,t.vPA)(null),this.modalErrorMessage=(0,t.vPA)(null),this.frequencyTpl=(0,t.ebz)("frequencyTpl"),this.dataGroupsTpl=(0,t.ebz)("dataGroupsTpl"),this.FREQUENCY_LABELS=f._g,this.DATA_GROUP_LABELS=f.SH,this.pagingParams={searchKey:"",pageIndex:1,pageSize:10,total:0,searchBoxConfig:{placeholder:"--T\xecm ki\u1ebfm theo t\xean ch\xednh s\xe1ch--"},onChangePagingParams:(e,s)=>{"search"===s&&(this.pagingParams.searchKey=e??"",this.pagingParams.pageIndex=1),"pageIndex"===s&&(this.pagingParams.pageIndex=e),"pageSize"===s&&(this.pagingParams.pageSize=e),this.loadData()}},this.columnConfig=(0,t.EWP)(()=>({cols:[{title:"T\xean ch\xednh s\xe1ch",useField:"policyName",width:"320px",minWidth:240},{title:"T\u1ea7n su\u1ea5t sao l\u01b0u",useField:"frequency",width:"160px",useTemplate:this.frequencyTpl()},{title:"Nh\xf3m d\u1eef li\u1ec7u",useField:"dataGroups",width:"140px",useTemplate:this.dataGroupsTpl()},{title:"Ng\xe0y t\u1ea1o",useField:"createdDate",width:"170px",isDate:!0,alignContent:"center",alignTitle:"center"}]})),this.statusOptions={statusKey:"status",useSwitchStatus:!0,actionKey:c.fb6.changeStatus,trueSwitchValue:1,disableSwitch:!0,width:"180px",stages:[{value:!0,text:"\u0110ang ho\u1ea1t \u0111\u1ed9ng",preset:"success"},{value:!1,text:"Ng\u1eebng ho\u1ea1t \u0111\u1ed9ng",preset:"default"}]},this.tabGroupConfig={tabProperty:"status",tabValueConfig:[{tabTitle:"T\u1ea5t c\u1ea3",tabValue:"all",total:0,conditionParams:{}},{tabTitle:"\u0110ang ho\u1ea1t \u0111\u1ed9ng",tabValue:"active",total:0,conditionParams:{status:!0}},{tabTitle:"Ng\u1eebng ho\u1ea1t \u0111\u1ed9ng",tabValue:"inactive",total:0,conditionParams:{status:!1}}],hasDeleteSelected:!0,onChangeTab:e=>{this.pagingParams.pageIndex=1,this.onChangeTabFilter(e)}},this.baseActionOptions=[{icon:"edit:figma",eventName:c.fb6.update,type:"icon",text:"S\u1eeda"},{icon:"DeleteUser:custom",eventName:c.fb6.delete,type:"icon",text:"X\xf3a"}],this.actionOptions={actions:[],onClick:(e,s)=>this.handleAction(e,s),fixedRight:!0}}ngOnInit(){this.checkActionPermission(),this.breadcrumbService.setBreadcrumbs([{label:"Trang ch\u1ee7",url:"/dashboard"},{label:"Qu\u1ea3n l\xfd c\u1ea5u h\xecnh chung",disabled:!0},{label:"Ch\xednh s\xe1ch sao l\u01b0u d\u1ef1 ph\xf2ng",url:"/backup-policy"}]),this.loadDropdowns(),this.loadData()}checkActionPermission(){this.checkPermissionService.checkPermissionForActionByMethod(["POST","PATCH","DELETE"],["/api/admin/backup-policies","/api/admin/backup-policies/{id}","/api/admin/backup-policies/{id}"]).subscribe({next:n=>{const o=n.data??n;this.showCreate=!0===o[0],this.showUpdate=!0===o[1],this.showDelete=!0===o[2],this.syncActionOptionsWithPermission()},error:()=>{this.showCreate=!1,this.showUpdate=!1,this.showDelete=!1,this.syncActionOptionsWithPermission()}})}syncActionOptionsWithPermission(){this.statusOptions={...this.statusOptions,disableSwitch:!this.showUpdate},this.actionOptions={...this.actionOptions,actions:this.baseActionOptions.filter(e=>e.eventName===c.fb6.update?this.showUpdate:e.eventName!==c.fb6.delete||this.showDelete)}}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadDropdowns(){(0,T.p)({dataGroups:this.backupService.listDataGroups(),frequencies:this.backupService.listFrequencies()}).pipe((0,p.Q)(this.destroy$)).subscribe({next:({dataGroups:e,frequencies:s})=>{this.dataGroupOptions.set(e??[]),this.frequencyOptions.set(s??[])},error:()=>{this.dataGroupOptions.set([]),this.frequencyOptions.set([])}})}onChangeTabFilter(e){this.selectedTabIndex=e,this.currentState=this.tabGroupConfig.tabValueConfig[e].conditionParams,this.loadData()}loadData(){this.loading.set(!0);const s={page:0,size:1};(0,T.p)({main:this.backupService.list({page:this.pagingParams.pageIndex-1,size:this.pagingParams.pageSize,keyword:this.pagingParams.searchKey,sort:this.sort,status:this.currentState?.status??null}),all:this.backupService.list({...s}),active:this.backupService.list({...s,status:!0}),inactive:this.backupService.list({...s,status:!1})}).pipe((0,p.Q)(this.destroy$),(0,S.j)(()=>this.loading.set(!1))).subscribe({next:({main:n,all:o,active:l,inactive:h})=>{const v=n.body;
1this.data.set(v?.backupPolicies??[]),this.pagingParams.total=v?.pagination?.totalElements??0,this.tabGroupConfig.tabValueConfig[0].total=o.body?.pagination?.totalElements??0,this.tabGroupConfig.tabValueConfig[1].total=l.body?.pagination?.totalElements??0,this.tabGroupConfig.tabValueConfig[2].total=h.body?.pagination?.totalElements??0},error:()=>{this.data.set([]),this.pagingParams.total=0,this.toastService.error("","L\u1ed7i t\u1ea3i danh s\xe1ch ch\xednh s\xe1ch sao l\u01b0u")}})}reloadTable(){this.pagingParams.pageIndex=1,this.sort=this.DEFAULT_SORT,this.currentState=this.tabGroupConfig.tabValueConfig[this.selectedTabIndex].conditionParams,this.loadData()}handleAction(e,s){if("deleteList"===e)return void this.batchDelete(Array.from(s));const n=s;e===c.fb6.update?this.openEditModal(n):e===c.fb6.changeStatus?this.toggleStatus(n):e===c.fb6.delete&&this.confirmDelete(n)}openAddModal(){this.showCreate?(this.isEditMode.set(!1),this.selectedItem.set(null),this.modalErrorMessage.set(null),this.modalVisible.set(!0)):this.toastService.error("","B\u1ea1n kh\xf4ng c\xf3 quy\u1ec1n th\xeam m\u1edbi ch\xednh s\xe1ch sao l\u01b0u")}openEditModal(e){this.showUpdate?(this.isEditMode.set(!0),this.selectedItem.set(e),this.modalErrorMessage.set(null),this.modalVisible.set(!0)):this.toastService.error("","B\u1ea1n kh\xf4ng c\xf3 quy\u1ec1n ch\u1ec9nh s\u1eeda ch\xednh s\xe1ch sao l\u01b0u")}handleModalCancel(){this.modalErrorMessage.set(null),this.modalVisible.set(!1)}handleModalSave(e){if(!(this.isEditMode()?this.showUpdate:this.showCreate))return void this.toastService.error("","B\u1ea1n kh\xf4ng c\xf3 quy\u1ec1n l\u01b0u ch\xednh s\xe1ch sao l\u01b0u");this.modalLoading.set(!0);const n=this.selectedItem();(this.isEditMode()&&n?this.backupService.update(n.id,e):this.backupService.create(e)).pipe((0,p.Q)(this.destroy$),(0,S.j)(()=>this.modalLoading.set(!1))).subscribe({next:()=>{this.toastService.success("",this.isEditMode()?"C\u1eadp nh\u1eadt th\xe0nh c\xf4ng":"Th\xeam m\u1edbi th\xe0nh c\xf4ng"),this.modalErrorMessage.set(null),this.modalVisible.set(!1),this.loadData()},error:l=>{const h=l?.error?.errorKey;"backuppolicynameexists"===h||(l?.error?.detail||"").toLowerCase().includes("exists")?(this.modalErrorMessage.set("T\xean ch\xednh s\xe1ch \u0111\xe3 t\u1ed3n t\u1ea1i. Vui l\xf2ng nh\u1eadp t\xean kh\xe1c"),this.toastService.error("","T\xean ch\xednh s\xe1ch \u0111\xe3 t\u1ed3n t\u1ea1i")):(this.modalErrorMessage.set(null),this.toastService.error("",this.isEditMode()?"C\u1eadp nh\u1eadt th\u1ea5t b\u1ea1i":"Th\xeam m\u1edbi th\u1ea5t b\u1ea1i"))}})}toggleStatus(e){if(!this.showUpdate)return void this.toastService.error("","B\u1ea1n kh\xf4ng c\xf3 quy\u1ec1n thay \u0111\u1ed5i tr\u1ea1ng th\xe1i ch\xednh s\xe1ch sao l\u01b0u");const s=!!e.status;this.dialogService.confirmMessage(`\u0110\u1ed3ng ch\xed vui l\xf2ng x\xe1c nh\u1eadn ch\u1eafc ch\u1eafn mu\u1ed1n ${s?"kh\xf3a":"m\u1edf kh\xf3a"} ch\xednh s\xe1ch <strong>${c.$Db.escapeHtml(e.policyName||"")}</strong>`,void 0,void 0,{},s?"X\xe1c nh\u1eadn kh\xf3a ch\xednh s\xe1ch":"X\xe1c nh\u1eadn m\u1edf kh\xf3a ch\xednh s\xe1ch",{text:s?"Kh\xf3a":"M\u1edf kh\xf3a",icon:s?"lock:figma":"unlock:figma"},{text:"Quay l\u1ea1i",icon:"ArrowBack:custom"}).afterClose.subscribe(l=>{l===c.h87.RESULT_CLOSE_DIALOG.CONFIRM&&this.backupService.update(e.id,{status:!e.status}).pipe((0,p.Q)(this.destroy$)).subscribe({next:()=>{this.toastService.success("",s?"Kh\xf3a ch\xednh s\xe1ch th\xe0nh c\xf4ng":"M\u1edf kh\xf3a ch\xednh s\xe1ch th\xe0nh c\xf4ng"),this.loadData()},error:()=>this.toastService.error("",s?"Kh\xf3a ch\xednh s\xe1ch th\u1ea5t b\u1ea1i":"M\u1edf kh\xf3a ch\xednh s\xe1ch th\u1ea5t b\u1ea1i")})})}confirmDelete(e){this.showDelete?this.dialogService.confirmMessage(`B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n x\xf3a ch\xednh s\xe1ch "<strong>${c.$Db.escapeHtml(e.policyName)}</strong>"?`,void 0,void 0,{},"X\xe1c nh\u1eadn x\xf3a",{text:"X\xf3a",icon:"DeleteUser:custom"},{text:"Quay l\u1ea1i",icon:"ArrowBack:custom"}).afterClose.subscribe(n=>{n===c.h87.RESULT_CLOSE_DIALOG.CONFIRM&&this.backupService.delete(e.id).pipe((0,p.Q)(this.destroy$)).subscribe({next:()=>{this.toastService.success("","X\xf3a th\xe0nh c\xf4ng"),this.loadData()},error:o=>{const l=o?.status,h=o?.error?.errorCode||o?.error?.code;404===l||"ENTITY_NOT_FOUND"===h||"ENTITY_NOT_EXIST"===h?(this.toastService.error("","B\u1ea3n ghi \u0111\xe3 b\u1ecb x\xf3a"),this.loadData()):this.toastService.error("","L\u1ed7i x\xf3a ch\xednh s\xe1ch")}})}):this.toastService.error("","B\u1ea1n kh\xf4ng c\xf3 quy\u1ec1n x\xf3a ch\xednh s\xe1ch sao l\u01b0u")}batchDelete(e){this.showDelete?e&&0!==e.length&&this.dialogService.confirmMessage(`B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n x\xf3a ${e.length} ch\xednh s\xe1ch \u0111\xe3 ch\u1ecdn?`,void 0,void 0,{},"X\xe1c nh\u1eadn x\xf3a",{text:"Ti\u1ebfp t\u1ee5c x\xf3a",icon:"DeleteUser:custom"},{text:"Quay l\u1ea1i",icon:"ArrowBack:custom"}).afterClose.subscribe(n=>{n===c.h87.RESULT_CLOSE_DIALOG.CONFIRM&&this.backupService.batchDelete(e).pipe((0,p.Q)(this.destroy$)).subscribe({next:()=>{this.toastService.success("",`\u0110\xe3 x\xf3a ${e.length} ch\xednh s\xe1ch`),this.loadData()},error:()=>this.toastService.error("","L\u1ed7i x\xf3a ch\xednh s\xe1ch")})}):this.toastService.error("","B\u1ea1n kh\xf4ng c\xf3 quy\u1ec1n x\xf3a ch\xednh s\xe1ch sao l\u01b0u")}static{this.\u0275fac=function(s){return new(s||i)}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["lib-core-backup-policy"]],viewQuery:function(s,n){1&s&&(t.wEZ(n.frequencyTpl,z,5),t.wEZ(n.dataGroupsTpl,K,5)),2&s&&t.NyB(2)},decls:14,vars:23,consts:[["frequencyTpl",""],["dataGroupsTpl",""],[1,"backup-policy-container"],[1,"header-wrapper"],[1,"backup-policy-header"],[1,"backup-policy-header__text"],[1,"backup-policy-header__title"],[1,"action-buttons"],["vts-button","","vtsType","primary"],[3,"onReloadTable","loading","data","columns","tabGroup","actionOptions","statusOptions","pagingParams","vtsCreatable","vtsShowCheckbox","vtsSh
1owTableConfig","vtsSearchable","vtsEntityName","autoResize"],[3,"onCancel","onSave","isVisible","isEditMode","data","isLoading","errorMessage","dataGroupOptions","frequencyOptions","canUpdate"],["vts-button","","vtsType","primary",3,"click"],["vts-icon","","vtsType","AddFolder:custom"],[1,"data-group-count"]],template:function(s,n){if(1&s){const o=t.RV6();t.j41(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"h2",6),t.EFF(5,"Ch\xednh s\xe1ch sao l\u01b0u d\u1ef1 ph\xf2ng"),t.k0s()()(),t.j41(6,"div",7),t.DNE(7,Z,3,0,"button",8),t.k0s()(),t.j41(8,"vts-custom-pro-table",9),t.bIt("onReloadTable",function(){return t.eBV(o),t.Njj(n.reloadTable())}),t.k0s(),t.DNE(9,J,2,1,"ng-template",null,0,t.C5r)(11,tt,3,1,"ng-template",null,1,t.C5r),t.j41(13,"lib-backup-policy-modal",10),t.bIt("onCancel",function(){return t.eBV(o),t.Njj(n.handleModalCancel())})("onSave",function(h){return t.eBV(o),t.Njj(n.handleModalSave(h))}),t.k0s()()}2&s&&(t.R7$(7),t.vxM(n.showCreate?7:-1),t.R7$(),t.Y8G("loading",n.loading())("data",n.data())("columns",n.columnConfig())("tabGroup",n.tabGroupConfig)("actionOptions",n.actionOptions)("statusOptions",n.statusOptions)("pagingParams",n.pagingParams)("vtsCreatable",!1)("vtsShowCheckbox",!0)("vtsShowTableConfig",!1)("vtsSearchable",!0)("vtsEntityName","ch\xednh s\xe1ch sao l\u01b0u")("autoResize",t.lJ4(22,H)),t.R7$(5),t.Y8G("isVisible",n.modalVisible())("isEditMode",n.isEditMode())("data",n.selectedItem())("isLoading",n.modalLoading())("errorMessage",n.modalErrorMessage())("dataGroupOptions",n.dataGroupOptions())("frequencyOptions",n.frequencyOptions())("canUpdate",n.isEditMode()?n.showUpdate:n.showCreate))},dependencies:[C.MD,u.YN,m.G,m.R$,D.T,g.dA,g.qb,B.IY,W],styles:[".backup-policy-container[_ngcontent-%COMP%]{background:transparent}.header-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.backup-policy-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px}.backup-policy-header__icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:40px;height:40px;background-color:var(--secondary-color-1);border-radius:8px;color:var(--primary-color)}.backup-policy-header__icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:24px}.backup-policy-header__text[_ngcontent-%COMP%]{display:flex;flex-direction:column}.backup-policy-header__title[_ngcontent-%COMP%]{margin:0;font-size:20px;font-weight:600;color:#001433;line-height:1.2}.backup-policy-header__subtitle[_ngcontent-%COMP%]{margin:4px 0 0;font-size:14px;color:#5f6368}.action-buttons[_ngcontent-%COMP%]{display:flex;gap:16px}.data-group-count[_ngcontent-%COMP%]{color:#dc2626;font-weight:500}"]})}}return i})()}}]);
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.