import{a as H}from"./chunk-ELNHEHXE.js";import{a as z}from"./chunk-TUAL6EZO.js";import{a as $}from"./chunk-NLXRVFDY.js";import{a as W}from"./chunk-P7KQ7LX4.js";import"./chunk-SMMIHGJB.js";import{a as O}from"./chunk-EJEVRE4J.js";import"./chunk-SMAIR2YP.js";import"./chunk-JAY45DEO.js";import"./chunk-LINAD4CC.js";import"./chunk-ZBAZR7FK.js";import"./chunk-Y5ITWXM5.js";import{Ka as V,ya as R}from"./chunk-NNMVEAHQ.js";import{a as P,b as C}from"./chunk-KXDO3JYP.js";import"./chunk-LUCOJAXQ.js";import"./chunk-HQUUBXQJ.js";import"./chunk-RTKDH4JU.js";import"./chunk-IFY4UZPR.js";import"./chunk-UU4K5RCK.js";import"./chunk-JBWPPKX4.js";import{a as N}from"./chunk-7N232KV6.js";import"./chunk-PDYJ5OYY.js";import{i as j}from"./chunk-NDLDFKR2.js";import{$c as A,Cb as B,Dc as E,Fc as I,Gb as D,Hb as x,K as s,Tc as M,ad as T,bc as c,cc as f,dc as b,ec as g,ed as v,fa as a,ka as u,kb as d,lc as F,nc as U,sd as L,ta as S,ua as w,vb as l,yc as _}from"./chunk-PVUKHE45.js";import"./chunk-AKP2VPKK.js";import"./chunk-GVXHDKBW.js";import{d as y,n as Y}from"./chunk-VD6R3735.js";import"./chunk-MZPAXKJS.js";var p=(()=>{let e=class e{constructor(t){this._http=t}getAll(t){return this._http.post("/api/admin/users/all",t,{headers:N})}block(t){return this._http.put(`/api/admin/users/${t}/block`,null)}unblock(t){return this._http.put(`/api/admin/users/${t}/unblock`,null)}};e.\u0275fac=function(n){return new(n||e)(u(j))},e.\u0275prov=a({token:e,factory:e.\u0275fac});let i=e;return i})();var m=(()=>{let e=class e{constructor(t){this._userServiceApi=t}getAll(t){return this._userServiceApi.getAll(t).pipe(s(1))}block(t){return this._userServiceApi.block(t).pipe(s(1))}unblock(t){return this._userServiceApi.unblock(t).pipe(s(1))}};e.\u0275fac=function(n){return new(n||e)(u(p))},e.\u0275prov=a({token:e,factory:e.\u0275fac});let i=e;return i})();Y();var K=[{caption:"\u0410\u0439\u0434\u0438",dataField:"id",width:"320px",minWidth:320},{caption:"\u0418\u043C\u044F",dataField:"fullName",showDashIfEmpty:!0,width:"25%",minWidth:130},{caption:"\u041D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430",dataField:"login",width:"20%",minWidth:130,isCustom:!0},{caption:"\u041A\u043E\u043C\u043F\u0430\u043D\u0438\u044F",dataField:"companyNames",width:"25%",minWidth:130,showDashIfEmpty:!0},{caption:"\u0421\u0442\u0430\u0442\u0443\u0441",dataField:"isBlocked",isCustom:!0,width:"80px",minWidth:100}];var X=(i,e)=>({login:i,isBlocked:e});function Z(i,e){if(i&1&&(E(0),A(1,"phoneFormat")),i&2){let r=e.$implicit;I(" ",T(1,1,r.login),`
`)}}function ee(i,e){if(i&1&&(f(0,"div",5),g(1,"wk-badge",6),b()),i&2){let r=e.$implicit;d(),c("text",r.isBlocked?"\u0417\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u043D":"\u0410\u043A\u0442\u0438\u0432\u0435\u043D")("variant",r.isBlocked?"error":"success")("stylingMode","outlined")}}var o,h=(o=class extends z{get criteria(){return{search:{id:this.searchValue,name:this.searchValue,login:this.searchValue,company:this.searchValue},filter:null}}constructor(e,r,t){super(r,t),this._userService=e,this.columns=K,this.menuItems=[{text:"\u0417\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C",action:n=>this._blockUser(n.id),visible:n=>!n.isBlocked},{text:"\u0420\u0430\u0437\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C",action:n=>this._unBlockUser(n.id),visible:n=>n.isBlocked}]}getLoadMethod(e){return this._userService.getAll(e)}_blockUser(e){this._userService.block(e).pipe(C(this)).subscribe(()=>{this.table?.refresh()})}_unBlockUser(e){this._userService.unblock(e).pipe(C(this)).subscribe(()=>{this.table?.refresh()})}},o.\u0275fac=function(r){return new(r||o)(l(m),l(L),l(V))},o.\u0275cmp=B({type:o,selectors:[["tis-user-list"]],features:[D],decls:8,vars:16,consts:[["table",""],["phone",""],["isBlockedTmpl",""],["title","\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0438",1,"header",3,"showBackButton"],["searchPlaceholder","\u041F\u043E\u0438\u0441\u043A \u043F\u043E ID, \u0438\u043C\u0435\u043D\u0438, \u043D\u043E\u043C\u0435\u0440\u0443 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 \u0438 \u043A\u043E\u043C\u043F\u0430\u043D\u0438\u0438",3,"changedSearch","allowColumnResizing","data","columns","menuItems","enableContextMenu","enablePagination","hoverable","pageNavigation","enableToolbar","enableFilters","enableSpinner","customTemplates"],[1,"status-badge"],[3,"text","variant","stylingMode"]],template:function(r,t){if(r&1){let n=F();g(0,"tis-subheader",3),f(1,"tis-main-layout")(2,"tis-table",4,0),U("changedSearch",function(Q){return S(n),w(t.changedSearch(Q))}),b()(),x(4,Z,2,3,"ng-template",null,1,v)(6,ee,2,3,"ng-template",null,2,v)}if(r&2){let n=_(5),k=_(7);c("showBackButton",!1),d(2),c("allowColumnResizing",!0)("data",t.dataSource)("columns",t.columns)("menuItems",t.menuItems)("enableContextMenu",!0)("enablePagination",!0)("hoverable",!0)("pageNavigation",!0)("enableToolbar",!0)("enableFilters",!1)("enableSpinner",!0)("customTemplates",M(13,X,n,k))}},dependencies:[$,W,O,R,H],styles:[`[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:100%}.header[_ngcontent-%COMP%]{top:0;position:sticky;z-index:10}.status-badge[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;justify-content:center}
/*# sourceMappingURL=user-list.component-WYTKQDBD.css.map */`],changeDetection:0}),o);h=y([P()],h);var ve=[{path:"",component:h,pathMatch:"full",providers:[p,m]},{path:"**",redirectTo:""}];export{ve as routes};
//# sourceMappingURL=users.routes-BCNSHYL7.js.map
