import{a as Ce,b as _}from"./chunk-CSJOXAZG.js";import{a as Se}from"./chunk-PM4HBEKE.js";import{a as fe}from"./chunk-CCXXK3LT.js";import{a as ve}from"./chunk-MW5UHD7Q.js";import{a as de}from"./chunk-QYJGZ7EQ.js";import{b as ge}from"./chunk-JPFZ7G4S.js";import{b as S,c as D,d as w,e as E,f as F}from"./chunk-7SSPIKUV.js";import{a as me}from"./chunk-H4374F74.js";import{t as A}from"./chunk-TL6VKVO7.js";import"./chunk-BTNSHOI7.js";import"./chunk-JAY45DEO.js";import"./chunk-LINAD4CC.js";import"./chunk-TPHZRJVN.js";import{a as ce,b as x,f as pe}from"./chunk-L2U5MHO4.js";import{Aa as M,B as ne,D as ae,Ja as oe,Ka as N,La as se,Ma as le,Va as ue,q as Q,r as Z,u as ee,ua as re,w as te,z as ie}from"./chunk-6PWFR42O.js";import"./chunk-QVBHH5C3.js";import{b as K}from"./chunk-IGFM5CCE.js";import"./chunk-FWAWZDGH.js";import"./chunk-WUNNKW5D.js";import"./chunk-IFY4UZPR.js";import"./chunk-IXRBBB6V.js";import"./chunk-PLVHWZTL.js";import"./chunk-PDYJ5OYY.js";import"./chunk-M6NTKB7A.js";import"./chunk-YMOV4UGM.js";import{a as he}from"./chunk-2OOUIVXH.js";import{fa as Y,la as q,ua as y}from"./chunk-TDUJNOEU.js";import{Db as C,Ec as P,Hb as I,Ib as R,Jc as u,Kc as d,Mc as $,Wc as J,Yb as U,Zb as W,Zc as X,_b as H,dc as m,ec as o,fc as s,fd as a,gc as v,gd as r,hd as T,kd as V,lb as i,ma as O,nc as z,tc as G,ua as k,va as B,vc as b,wb as f,zd as L}from"./chunk-I3FGJX2C.js";import"./chunk-AKP2VPKK.js";import"./chunk-ML3VIXIY.js";import"./chunk-INB5GR2I.js";import"./chunk-B7YGBANW.js";var xe=(()=>{let e=class e extends Se{get statusType(){let t=E(this.localizationService.getSync.bind(this.localizationService));return[{id:S.Created,name:t[S.Created]},{id:S.Active,name:t[S.Active]},{id:S.Expired,name:t[S.Expired]},{id:S.Revoked,name:t[S.Revoked]},{id:S.Canceled,name:t[S.Canceled]}]}get subjectType(){let t=w(this.localizationService.getSync.bind(this.localizationService));return[{id:D.Store,name:t[D.Store]},{id:D.Cashbox,name:t[D.Cashbox]}]}get licenses(){let t=new Map;return this.data.licenses.forEach(l=>{t.set(l.client.id,l.client.name)}),Array.from(t.entries()).map(([l,c])=>({id:l,name:c}))}constructor(t,l,c,h,g){super(l,c,h,g),this.serviceCenterLicensesService=t,this.fb=l,this.data=c,this.drawerRef=h,this.cdr=g}buildForm(){return this.fb.group({statuses:this.fb.control([]),subjectType:this.fb.control(null),clients:this.fb.control([])})}patchValue(){return{statuses:this.data.filters.statuses??[],subjectType:this.data.filters.subjectType??null,clients:this.data.filters.clients??[]}}};e.\u0275fac=function(l){return new(l||e)(f(_),f(ne),f(N),f(oe),f(L))},e.\u0275cmp=C({type:e,selectors:[["tis-license-filters"]],features:[J([Ce,_]),I],decls:10,vars:27,consts:[[3,"formGroup"],["formControlName","clients","token","clients",3,"options","enableSearch","multiple","highlightSelectedItems","label","placeholder"],["formControlName","statuses","token","statuses",3,"options","multiple","highlightSelectedItems","label","placeholder"],["formControlName","subjectType","token","subjectType",3,"options","label","placeholder"]],template:function(l,c){l&1&&(o(0,"form",0),v(1,"wk-dropdown",1),a(2,"translate"),a(3,"translate"),v(4,"wk-dropdown",2),a(5,"translate"),a(6,"translate"),v(7,"wk-dropdown",3),a(8,"translate"),a(9,"translate"),s()),l&2&&(m("formGroup",c.filtersForm),i(),m("options",c.licenses)("enableSearch",!0)("multiple",!0)("highlightSelectedItems",!1)("label",r(2,15,"\u041A\u043E\u043C\u043F\u0430\u043D\u0438\u044F"))("placeholder",r(3,17,"\u0412\u0441\u0435")),i(3),m("options",c.statusType)("multiple",!0)("highlightSelectedItems",!1)("label",r(5,19,"\u0421\u0442\u0430\u0442\u0443\u0441"))("placeholder",r(6,21,"\u0412\u0441\u0435")),i(3),m("options",c.subjectType)("label",r(8,23,"\u041E\u0431\u044A\u0435\u043A\u0442 \u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0438"))("placeholder",r(9,25,"\u0412\u0441\u0435")))},dependencies:[y,ae,ee,Q,Z,te,ie,le,x],styles:[`[_nghost-%COMP%]{display:block;width:100%}
/*# sourceMappingURL=license-filters.component-MUEBID7O.css.map */`],changeDetection:0});let n=e;return n})();function ke(n,e){if(n&1&&(o(0,"div",0)(1,"div",1),u(2),a(3,"translate"),s(),o(4,"div",2),u(5),s(),o(6,"div",1),u(7),a(8,"translate"),s(),o(9,"div",2),u(10),s(),v(11,"wk-divider",3),a(12,"translate"),o(13,"div",1),u(14),s(),o(15,"div",2),u(16),s(),v(17,"wk-divider",3),a(18,"translate"),o(19,"div",1),u(20),a(21,"translate"),s(),o(22,"div",2),u(23),s(),o(24,"div",1),u(25),a(26,"translate"),s(),v(27,"wk-badge",4),o(28,"div",1),u(29),a(30,"translate"),s(),o(31,"div",2),u(32),a(33,"date"),s(),o(34,"div",1),u(35),a(36,"translate"),s(),o(37,"div",2),u(38),a(39,"date"),s(),o(40,"div",1),u(41),a(42,"translate"),s(),o(43,"div",2),u(44),a(45,"date"),s(),v(46,"wk-divider",3),a(47,"translate"),o(48,"div",1),u(49),a(50,"translate"),s(),o(51,"div",2),u(52),a(53,"priceFormat"),s(),o(54,"div",1),u(55),a(56,"translate"),s(),o(57,"div",2),u(58),a(59,"priceFormat"),s()()),n&2){let p=e,t=b();i(2),d(r(3,25,"\u041A\u043E\u043C\u043F\u0430\u043D\u0438\u044F")),i(3),d(p.client.name),i(2),d(r(8,27,"\u0418\u0418\u041D/\u0411\u0418\u041D")),i(3),d(p.clientXin),i(),m("text",r(12,29,"\u041E\u0431\u044A\u0435\u043A\u0442 \u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0438")),i(3),d(t.subjectNames[p.subjectType]),i(2),d(p.subjectName),i(),m("text",r(18,31,"\u041B\u0438\u0446\u0435\u043D\u0437\u0438\u044F")),i(3),d(r(21,33,"\u0422\u0438\u043F \u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0438")),i(3),d(p.type.name),i(2),d(r(26,35,"\u0421\u0442\u0430\u0442\u0443\u0441")),i(2),m("text",t.statusName[p.status])("variant",t.statusBadge[p.status])("stylingMode","outlined"),i(2),d(r(30,37,"\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F")),i(3),d(T(33,39,p.creationDate,"dd.MM.yyyy HH:mm")),i(3),d(r(36,42,"\u0414\u0430\u0442\u0430 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438")),i(3),d(p.activationDate?T(39,44,p.activationDate,"dd.MM.yyyy HH:mm"):"-"),i(3),d(r(42,47,"\u0414\u0430\u0442\u0430 \u0438\u0441\u0442\u0435\u0447\u0435\u043D\u0438\u044F")),i(3),d(p.expirationDate?T(45,49,p.expirationDate,"dd.MM.yyyy HH:mm"):"-"),i(2),m("text",r(47,52,"\u0426\u0435\u043D\u0430")),i(3),d(r(50,54,"\u0426\u0435\u043D\u0430 \u0434\u043B\u044F \u0426\u0422\u041E")),i(3),d(r(53,56,p.serviceCenterPrice)+" \u20B8"),i(3),d(r(56,58,"\u0426\u0435\u043D\u0430 \u0434\u043B\u044F \u043A\u043B\u0438\u0435\u043D\u0442\u0430")),i(3),d(r(59,60,p.clientPrice)+" \u20B8")}}function Be(n,e){n&1&&(o(0,"div",0),v(1,"wk-skeleton",5)(2,"wk-skeleton",6)(3,"wk-skeleton",5)(4,"wk-skeleton",6)(5,"wk-divider",7),a(6,"translate"),v(7,"wk-skeleton",5)(8,"wk-skeleton",6)(9,"wk-divider",3),a(10,"translate"),v(11,"wk-skeleton",5)(12,"wk-skeleton",6)(13,"wk-skeleton",5)(14,"wk-skeleton",6)(15,"wk-skeleton",5)(16,"wk-skeleton",6)(17,"wk-skeleton",5)(18,"wk-skeleton",6)(19,"wk-divider",3),a(20,"translate"),v(21,"wk-skeleton",5)(22,"wk-skeleton",6)(23,"wk-skeleton",5)(24,"wk-skeleton",6),s()),n&2&&(i(5),m("text",r(6,3,"\u041E\u0431\u044A\u0435\u043A\u0442 \u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0438")),i(4),m("text",r(10,5,"\u041B\u0438\u0446\u0435\u043D\u0437\u0438\u044F")),i(10),m("text",r(20,7,"\u0426\u0435\u043D\u0430")))}var we=(()=>{let e=class e{get subjectNames(){return w(this._translateService.instant.bind(this._translateService))}get statusBadge(){return F}get statusName(){return E(this._translateService.instant.bind(this._translateService))}constructor(t){this.data$$=t,this._translateService=O(ce)}};e.\u0275fac=function(l){return new(l||e)(f(N))},e.\u0275cmp=C({type:e,selectors:[["tis-license-view"]],decls:3,vars:3,consts:[[1,"info-wrapper"],[1,"label"],[1,"info"],["margin","none",3,"text"],[1,"info",3,"text","variant","stylingMode"],["width","180px","height","20px",1,"label"],["width","180px","height","20px",1,"info"],[3,"text"]],template:function(l,c){if(l&1&&(U(0,ke,60,62,"div",0),a(1,"async"),W(2,Be,25,9,"div",0)),l&2){let h;H((h=r(1,1,c.data$$))?0:2,h)}},dependencies:[y,ue,re,M,Y,q,he,x],styles:[`.info-wrapper[_ngcontent-%COMP%]{display:grid;width:fit-content;align-items:center;grid-template-columns:repeat(2,minmax(180px,min-content));gap:var(--space-vertical-snudge)}.label[_ngcontent-%COMP%]{grid-column:1/2;color:var(--color-font-secondary)}.info[_ngcontent-%COMP%]{grid-column:2/4;font:var(--font-body-1-strong)}wk-divider[_ngcontent-%COMP%]{grid-column:1/-1;margin-top:var(--space-vertical-xl);margin-bottom:var(--space-vertical-xxs)}
/*# sourceMappingURL=license-view.component-WC5W3TF2.css.map */`],changeDetection:0});let n=e;return n})();var Ee=n=>[{caption:n("\u041A\u043E\u043C\u043F\u0430\u043D\u0438\u044F"),dataField:"client",calculateCellValue:e=>e.client.name,minWidth:200,width:"30%"},{caption:n("\u041E\u0431\u044A\u0435\u043A\u0442 \u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0438"),dataField:"subjectType",isCustom:!0,minWidth:300,width:"25%"},{caption:n("\u041B\u0438\u0446\u0435\u043D\u0437\u0438\u044F"),dataField:"type",calculateCellValue:e=>e.type.name,minWidth:200,width:"20%"},{caption:n("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F"),dataField:"CreationDate",sortOrder:"desc",allowSorting:!0,calculateCellValue:e=>A(new Date(e.creationDate),"dd.MM.yyyy HH:mm"),minWidth:150,width:"15%"},{caption:n("\u0414\u0430\u0442\u0430 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438"),dataField:"ActivationDate",sortOrder:"desc",allowSorting:!0,calculateCellValue:e=>e.activationDate?A(new Date(e.activationDate),"dd.MM.yyyy HH:mm"):"-",minWidth:150,width:"15%"},{caption:n("\u0414\u0430\u0442\u0430 \u0438\u0441\u0442\u0435\u0447\u0435\u043D\u0438\u044F"),calculateCellValue:e=>e.expirationDate?A(new Date(e.expirationDate),"dd.MM.yyyy"):"-",minWidth:150,dataField:"ExpirationDate",width:"15%",allowSorting:!0,sortOrder:"desc"},{caption:n("\u0421\u0442\u0430\u0442\u0443\u0441"),isCustom:!0,minWidth:100,dataField:"status",width:"15%"}];var Ie=(n,e)=>({status:n,subjectType:e});function Te(n,e){if(n&1&&(o(0,"div",5),v(1,"wk-badge",6),s()),n&2){let p=e.$implicit,t=b();i(),m("text",t.statusName[p.status])("variant",t.statusBadge[p.status])("stylingMode","outlined")}}function Le(n,e){if(n&1&&(o(0,"span"),u(1),s()),n&2){let p=e.$implicit,t=b();i(),$("",t.subjectNames[p.subjectType]," (",p.subjectName,")")}}var _e=(()=>{let e=class e extends fe{get statusBadge(){return F}get statusName(){return E(this.translate)}get subjectNames(){return w(this.translate)}get criteria(){return{filter:this.filters,search:{clientName:this.searchValue,clientXin:this.searchValue,clientOwnerPhone:this.searchValue,serviceCenterName:this.searchValue,serviceCenterXin:this.searchValue}}}get filterData(){return{filters:this.filters,licenses:this.licenses}}constructor(t,l,c,h){super(c,h),this._serviceCenterLicensesService=t,this._licenseService=l,this.icons=pe,this.columns=Ee(this.translate),this.filterComponent=xe,this.acquiring=[],this.licenses=[],this.menuItems=[{text:this.localizationService.getSync("\u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C"),action:g=>this.viewLicense(g)}]}ngOnInit(){super.ngOnInit(),this.getLicenses()}getLoadMethod(t){return this._serviceCenterLicensesService.getAll(t)}viewLicense(t){this.drawerService.open(we,{data:this._licenseService.getById(t.id),header:this.localizationService.getSync("\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0438")})}getLicenses(){this._serviceCenterLicensesService.getAll({criteria:null,take:100,skip:0,isAscending:!0,orderBy:"id"}).pipe(K(this)).subscribe(t=>{this.licenses=t.data})}};e.\u0275fac=function(l){return new(l||e)(f(_),f(ge),f(L),f(se))},e.\u0275cmp=C({type:e,selectors:[["tis-license-list"]],features:[I],decls:10,vars:22,consts:[["table",""],["status",""],["subjectType",""],[1,"header",3,"showBackButton","title"],[3,"clickedFilters","rowDblClicked","changedSearch","allowColumnResizing","data","columns","menuItems","enableContextMenu","enablePagination","hoverable","pageNavigation","enableToolbar","activeFilters","enableSpinner","customTemplates","searchPlaceholder"],[1,"status-badge"],[3,"text","variant","stylingMode"]],template:function(l,c){if(l&1){let h=z();v(0,"tis-subheader",3),a(1,"translate"),o(2,"tis-main-layout")(3,"tis-table",4,0),a(5,"translate"),G("clickedFilters",function(){return k(h),B(c.openFilters())})("rowDblClicked",function(j){return k(h),B(c.viewLicense(j))})("changedSearch",function(j){return k(h),B(c.changedSearch(j))}),s()(),R(6,Te,2,3,"ng-template",null,1,V)(8,Le,2,2,"ng-template",null,2,V)}if(l&2){let h=P(7),g=P(9);m("showBackButton",!1)("title",r(1,15,"\u041B\u0438\u0446\u0435\u043D\u0437\u0438\u0438")),i(3),m("allowColumnResizing",!0)("data",c.dataSource)("columns",c.columns)("menuItems",c.menuItems)("enableContextMenu",!0)("enablePagination",!0)("hoverable",!0)("pageNavigation",!0)("enableToolbar",!0)("activeFilters",!!c.filters)("enableSpinner",!0)("customTemplates",X(19,Ie,h,g))("searchPlaceholder",r(5,17,"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0418\u0418\u041D, \u043A\u043E\u043C\u043F\u0430\u043D\u0438\u0438, \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430"))}},dependencies:[y,ve,de,me,M,x],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=license-list.component-O6UUNPF5.css.map */`],changeDetection:0});let n=e;return n})();var St=[{path:"",component:_e,pathMatch:"full"},{path:"**",redirectTo:""}];export{St as routes};
//# sourceMappingURL=licenses.routes-4BPJNJYC.js.map
