"use strict";(self.webpackChunksphere_web=self.webpackChunksphere_web||[]).push([[7318],{27318:function(t,e,i){i.r(e),i.d(e,{OneSActionModule:function(){return Z}});var a=i(38583),r=i(3679),n=i(88452),s=i(11494),o=i(99692),c=i(83461),d=i(42724),l=i(66176),h=i(91471),u=i(68770),f=i(64916),p=i(85921),g=i(37716),S=i(95906),A=i(98435),b=i(12031),C=i(29366),m=i(83076),w=i(43982);const x=function(){return[25,50,100,500]},y=[{path:"",component:(()=>{class t extends f.V{constructor(){super(...arguments),this.dataSource=new l.$s}ngAfterViewInit(){this.dataSource.paginator=this.paginator,this.dataSource.sort=this.sort,this.dataSource.filter=this.filter,this.dataSource.lazyLoadArgsChange.subscribe(t=>{this.getActionsLazy(t),this.updateCount()})}getActionsLazy(t){this.isLoading=!0,JSON.stringify(t),this._dataService.oneSActionsService.getActionsLazy(t).then(t=>{this.dataSource.loadLazyData(t),this.success("\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b",t)},t=>{this.error("\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439",t)}).finally(()=>{this.isLoading=!1})}updateCount(){this._dataService.oneSActionsService.getActionsCount().then(t=>{this.totalRecords=t})}editAction(t){t&&t.isChecked&&this._dataService.oneSActionsService.closeAction(t.id).then(t=>{this.updateCount(),this.dataSource.refreshLazyLoadData()},t=>{this.error(t)})}}return t.\u0275fac=function(){let e;return function(i){return(e||(e=g.n5z(t)))(i||t)}}(),t.\u0275cmp=g.Xpm({type:t,selectors:[["one-s-actions"]],viewQuery:function(t,e){if(1&t&&(g.Gf(o.NW,5),g.Gf(s.YE,5),g.Gf(p.f,5)),2&t){let t;g.iGM(t=g.CRH())&&(e.paginator=t.first),g.iGM(t=g.CRH())&&(e.sort=t.first),g.iGM(t=g.CRH())&&(e.filter=t.first)}},features:[g.qOj],decls:8,vars:6,consts:[[3,"title"],[3,"refresh","clearFilter"],[3,"pageSizeOptions","length"],[1,"content-s-table"],["s-table","","matSort","","sFilter","","cdkDropList","",1,"table",3,"dataSource"],["width","50px","field","id","headerText","Id"],["width","50vw","field","action","headerText","\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435"],["width","100px","field","isChecked","headerText","\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e",3,"editable","dataChange"]],template:function(t,e){1&t&&(g.TgZ(0,"s-table-header",0),g.TgZ(1,"s-table-toolbar",1),g.NdJ("refresh",function(){return e.dataSource.refreshLazyLoadData()})("clearFilter",function(){return e.filter.clearAllFilters()}),g.qZA(),g._UZ(2,"mat-paginator",2),g.qZA(),g.TgZ(3,"div",3),g.TgZ(4,"table",4),g._UZ(5,"s-number-column",5),g._UZ(6,"s-text-column",6),g.TgZ(7,"s-bool-column",7),g.NdJ("dataChange",function(t){return e.editAction(t)}),g.qZA(),g.qZA(),g.qZA()),2&t&&(g.MGl("title","\u0412\u0441\u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 ",e.totalRecords,""),g.xp6(2),g.Q6J("pageSizeOptions",g.DdM(5,x))("length",e.totalRecords),g.xp6(2),g.Q6J("dataSource",e.dataSource),g.xp6(3),g.Q6J("editable",!0))},directives:[S.I,A.j,o.NW,b.m7,s.YE,p.f,c.Wj,C.E,m.w,w.K],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}center[_ngcontent-%COMP%]{text-align:center;max-height:1rem}.table[_ngcontent-%COMP%]{width:100%}"]}),t})()}];let Z=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=g.oAB({type:t}),t.\u0275inj=g.cJS({imports:[[a.ez,r.u5,n.Bz.forChild(y),s.JX,o.TU,c._t,d.x,l.w_,h.b,u.Y]]}),t})()}}]);