1import{a as $t,b as Gt}from"./chunk-OFH2WIJO.js";import{a as Yt,b as Kt}from"./chunk-CMCU6XFH.js";import{a as Y,b as K,c as Xt}from"./chunk-MLIOEYSJ.js";import{c as st,d as Et}from"./chunk-CNCCU4LT.js";import{a as le}from"./chunk-5YL7SUI7.js";import{i as qt}from"./chunk-TMML4CLY.js";import{b as Rt,f as Nt,h as lt,m as Ft,n as jt}from"./chunk-YO4EDRJ7.js";import"./chunk-5KUSON4V.js";import{b as Ht}from"./chunk-7G6VV26I.js";import{b as Ut}from"./chunk-GIOONPFU.js";import"./chunk-MIK4VLE4.js";import{$ as f,$a as u,C as T,Da as Z,Ea as j,Fc as ot,Gb as l,Hb as g,Ib as k,Ic as z,J as ht,Kb as nt,La as y,Na as S,Oa as U,Ob as it,Pa as H,Pc as F,Qa as q,Ra as m,Sa as a,Sc as at,Ta as o,Ua as b,Ub as A,V as X,W as Q,Ya as D,Yb as vt,Z as P,_ as h,_a as C,_c as It,a as G,db as Mt,eb as Pt,ec as wt,ed as rt,f as se,fb as Ot,fd as W,gb as tt,gd as Lt,hd as V,ib as I,id as Tt,jd as Dt,k as dt,kb as ut,lb as s,lc as yt,mb as p,na as ct,nb as O,oc as St,od as kt,pa as ft,pb as bt,pd as Bt,qb as x,qd as Wt,ra as n,rb as v,rc as pt,rd as Vt,sb as w,sd as At,tb as N,u as Ct,ub as gt,ud as zt,v as B,xb as xt,ya as
1L,yb as et,za as J}from"./chunk-UPWIJIG3.js";var ie=se(le());var Qt=(()=>{class i{constructor(){this.http=P(wt),this.configService=P(Dt)}getLeadList(t){return this.http.get(`${this.configService.config.prov}/leads`,{params:t})}getLeadById(t){return this.http.get(`${this.configService.config.prov}/leads/${t}`)}updateLeadState(t,r){return this.http.put(`${this.configService.config.prov}/leads/${t}/state`,r)}updateLeadComment(t,r){return this.http.put(`${this.configService.config.prov}/leads/${t}/userComment`,r)}getLeadsFilters(t){return this.http.get(`${this.configService.config.prov}/leads/filters`,{params:t})}createReport(t){return this.http.post(`${this.configService.config.prov}/reports`,t)}getReportList(t){return this.http.get(`${this.configService.config.prov}/leads`,{params:t})}downloadReportFile(t){return this.http.get(`${this.configService.config.prov}/reports/${t}`,{responseType:"text"})}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var E=(()=>{class i{constructor(){this.translate=P(rt),this.errorHandlerService=P(zt),this.leadsApiService=P(Qt),this.openLeadInfoSidebar=new dt(null),this.updateLeadInfo=new dt(null)}getLeadList(t){return this.leadsApiService.getLeadList(t).pipe(B(r=>r.data),T(this.errorHandlerService.handleError))}getLeadById(t){return this.leadsApiService.getLeadById(t).pipe(B(r=>(r.success||this.errorHandlerService.handleError(r),r.data)),T(this.errorHandlerService.handleError))}updateLeadState(t,r){return this.leadsApiService.updateLeadState(t,r).pipe(B(e=>e.success),T(this.errorHandlerService.handleError))}updateLeadComment(t,r){return this.leadsApiService.updateLeadComment(t,r).pipe(B(e=>e.success),T(this.errorHandlerService.handleError))}getLeadsFilters(t){return this.leadsApiService.getLeadsFilters(t).pipe(B(r=>r.data),T(this.errorHandlerService.handleError))}createReport(t){return this.leadsApiService.createReport(t).pipe(B(r=>r.success?"":r.message),T(this.errorHandlerService.handleError))}getReportList(t){return this.leadsApiService.getReportList(t).pipe(B(r=>r.data),T(this.errorHandlerService.handleError))}downloadReportFile(t){return this.leadsApiService.downloadReportFile(t).pipe(T(this.errorHandlerService.handleError))}
1getStates(){return[{id:K.NEW,name:this.translate.instant("leads.page.card.status.new")},{id:K.INWORK,name:this.translate.instant("leads.page.card.status.onWork")},{id:K.INVALID,name:this.translate.instant("leads.page.card.status.bad")},{id:K.SUCCESS,name:this.translate.instant("leads.page.card.status.success")}]}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function ce(i,M){i&1&&b(0,"app-preloader")}function ge(i,M){i&1&&(s(0),l(1,"translate")),i&2&&O(" ",g(1,1,"leads.page.table.export_error.description")," ")}function pe(i,M){i&1&&(s(0),l(1,"translate")),i&2&&O(" ",g(1,1,"leads.page.table.export_error.max_reports")," ")}function _e(i,M){if(i&1&&(a(0,"h4",5),s(1),l(2,"translate"),o(),a(3,"p"),y(4,ge,2,3),Z(5,pe,2,3,"ng-template",null,0,nt),o()),i&2){let t=tt(6);n(),p(g(2,2,"leads.page.table.export_error.title")),n(3),S(t?-1:4)}}function me(i,M){if(i&1){let t=D();a(0,"h4",5),s(1),l(2,"translate"),o(),a(3,"p"),s(4),l(5,"translate"),o(),a(6,"p",6)(7,"strong"),s(8),o()(),a(9,"p",7),s(10),l(11,"translate"),o(),a(12,"button",8),C("click",function(){h(t);let e=u(2);return f(e.closeModal())}),a(13,"div"),s(14),l(15,"translate"),o()()}if(i&2){let t=u(2);n(),p(g(2,5,"leads.page.table.export_preparing.title")),n(3),p(g(5,7,"leads.page.table.export_preparing.description1")),n(4),p(t.userEmail),n(2),p(g(11,9,"leads.page.table.export_preparing.description2")),n(4),p(g(15,11,"leads.page.table.export_preparing.button"))}}function Ce(i,M){if(i&1&&y(0,_e,7,4)(1,me,16,13),i&2){let t=u();S(t.error?0:1)}}var Jt=(()=>{class i{constructor(){this.activeModal=P(kt),this.leadsService=P(E),this.leadsRequestParams={},this.userEmail="",this.loading=!0,this.error=!1,this.errorMaxReportsCountExceeded=!1}ngOnInit(){let t={fields:Object.values(Xt),filters:G(G(G({},this.leadsRequestParams),this.leadsRequestParams.siteId&&{siteId:this.leadsRequestParams.siteId.split(",")}),this.leadsRequestParams.widgetName&&{widgetName:this.leadsRequestParams.widgetName.split(",")})};this.createReportSub=this.leadsService.createReport(t).pipe(ht(()=>this.loading=!1)).subscribe(r=>{this.error=r!=="",this.errorMaxReportsCountExceeded=r.includes("MAX_REPORTS_COUNT_EXCEEDED")},()=>this.error=!0)}closeModal(){this.activeModal.close()}ngOnDestroy(){this.createReportSub&&this.createReportSub.unsubscribe()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-leads-export"]],inputs:{leadsRequestParams:"leadsRequestParams",userEmail:"userEmail"},standalone:!1,decls:6,vars:1,consts:[["errorMaxReportsCountExceeded",""],[1,"modal-body"],[1,"close","btn",3,"click"],["inlineSVG","/assets/images/core/cross.svg"],[1,"export-container"],[1,"modal-title"],[1,"m-0"],[1,"description-small"],[1,"btn","button-export",3,"click"]],template:function(r,e){r&1&&(a(0,"div",1)(1,"button",2),C("click",function(){return e.closeModal()}),b(2,"span",3),o(),a(3,"div",4),y(4,ce,1,0,"app-preloader")(5,Ce,2,1),o()()),r&2&&(n(4),S(e.loading?4:5))},dependencies:[lt,V,W],styles:[".close[_ngcontent-%COMP%]{margin-left:-20px}.export-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:0 1rem 2rem}.export-container[_ngcontent-%COMP%] app-preloader[_ngcontent-%COMP%]{padding:5rem 0 4rem}.export-container[_ngcontent-%COMP%] h4[_ngcontent-%COMP%], .export-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#16181d;text-align:center}.export-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:1rem;margin-top:2rem;margin-bottom:0}.export-container[_ngcontent-%COMP%] p.description-small[_ngcontent-%COMP%]{font-size:.9rem;margin-bottom:2rem}.export-container[_ngcontent-%COMP%] .button-export[_ngcontent-%COMP%]{line-height:2;font-size:1.2rem;font-weight:600;color:#fff}"]})}}return i})();var he=i=>({"sidebar-open":i}),fe=()=>["-serverDate"];function Me(i,M){i&1&&(a(0,"span"),b(1,"i",36),o())}function Pe(i,M){if(i&1&&(a(0,"div",20)(1,"label",37),s(2),l(3,"translate"),o(),a(4,"div",38),s(5),o()()),i&2){let t=u();n(2),p(g(3,2,"leads.page.card.status.name")),n(3),p(t.leadInfo.firstName)}}function Oe(i,M){if(i&1&&(a(0,"div",21)(1,"label",37),s(2),l(3,"translate"),o(),a(4,"div",38)(5,"a",39),s(6),o()()()),i&2){let t=u();n(2),p(g(3,4,"leads.page.card.status.email")),n(3),m("href",gt("mailto:",t.leadInfo.emails[0]),ct),n(),p(t.leadInfo.emails[0])}}function ue(i,M){if(i&1&&(a(0,"div",21)(1,"label",37),s(2),l(3,"translate"),o(),a(4,"div",38)(5,"a",39),s(6),o()()()),i&2){let t=u();n(2),p(g(3,4,"leads.page.card.status.phone")),n(3),m("href",gt("tel:",t.leadInfo.phones[
10]),ct),n(),p(t.leadInfo.phones[0])}}function be(i,M){if(i&1&&(a(0,"div",20)(1,"label",37),s(2),o(),a(3,"div",38),s(4),o()()),i&2){let t=M.$implicit;n(2),p(t.name),n(2),p(t.value)}}function xe(i,M){if(i&1&&(a(0,"div",22)(1,"label",37),s(2),l(3,"translate"),o(),a(4,"div",38),s(5),o()()),i&2){let t=u();n(2),p(g(3,2,"leads.page.card.status.message")),n(3),p(t.leadInfo.comment)}}function ve(i,M){i&1&&(b(0,"i",45),l(1,"translate")),i&2&&m("title",N(g(1,2,"leads.page.card.source.linkDesc")))}function we(i,M){if(i&1&&(a(0,"div",35)(1,"div",40),b(2,"i",41),o(),a(3,"div",42)(4,"div",43)(5,"span",44),y(6,ve,2,4,"i",45),a(7,"small"),s(8),l(9,"date"),o()(),a(10,"h2"),s(11),o(),a(12,"p",46),s(13),o()()()()),i&2){let t=M.$implicit,r=M.$index;n(6),S(r===0?6:-1),n(2),p(k(9,4,t.serverDate,"dd.MM.y, HH:mm")),n(3),p(t.title),n(2),p(t.url)}}var ee=(()=>{class i{constructor(){this.leadsService=P(E),this.leadInfo=null,this.isUserCommentUpdated=!1,this.isOpen=!1,this.closeSidebar=new j}ngOnInit(){this.openLeadInfoSidebarSub=this.leadsService.openLeadInfoSidebar.subscribe(t=>{this.isOpen&&this.index===t.index||(this.leadInfo=t.data,this.status=t.data.state,this.index=t.index,this.isOpen=!0,setTimeout(()=>{let r=$(".vertical-timeline-block")[$(".vertical-timeline-block").length-1].offsetHeight;$(".v-timeline2").css("--timelineTop",`-${r}px`)},0))})}closeLeadInfo(){this.isOpen&&(this.isOpen=!1,this.closeSidebar.emit())}updateState(t){this.leadsService.updateLeadState(this.leadInfo.id,{state:t}).subscribe(()=>{this.leadsService.updateLeadInfo.next({index:this.index,state:t})})}updateComment(){this.leadsService.updateLeadComment(this.leadInfo.id,{comment:this.leadInfo.userComment}).subscribe(t=>{t&&(this.isUserCommentUpdated=!0,setTimeout(()=>{this.isUserCommentUpdated=!1},1e3))})}ngOnDestroy(){this.openLeadInfoSidebarSub&&this.openLeadInfoSidebarSub.unsubscribe()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-lead-info"]],outputs:{closeSidebar:"closeSidebar"},standalone:!1,decls:81,vars:69,consts:[["id","right-sidebar",1,"lead-info-sidebar","animate__animated","animate__fadeInRight",3,"clickOutside","ngClass"],[1,"sidebar-title"],[1,"lead-info-sidebar__close","btn",3,"click"],["inlineSVG","/assets/images/core/cross.svg"],["id","crm-details-title"],[1,"sidebar-body"],["id","detailsContent",1,"lead-info-card-wrapper"],["id","detailsInfo"],[1,"lead-info-card__status"],[1,"btn-group","btn-group-toggle","btn-group__status-selector"],[1,"btn","btn-default","btn-status-new"],["type","radio","name","radioLeadInfo",3,"ngModelChange","ngModel","value"],[1,"btn","btn-default","btn-status-inwork"],[1,"btn","btn-default","btn-status-invalid"],[1,"btn","btn-default","btn-status-success"],[1,"lead-info-card__data","lead-info-card__data-notes"],["for","detailsInfoComment"],["id","detailsInfoComment","rows","3","type","text",1,"form-control",3,"blur","ngModelChange","ngModel"],[1,"stats-title","mt-3"],[1,"colored-dark-blue"],[1,"lead-info-card__data","lead-info-card__data-colored"],[1,"lead-info-card__data"],[1,"lead-info-card__data","lead-info-card__data-colored","lead-info-card__data-commented"],[1,"lead-info-card__external"],[1,"lead-info-card__external-item","lead-info-card__external-item-marg"],[1,"panel-body"],[1,"stats-title"],[1,"lead-info-card__external-item__value"],[1,"ppanel-pages"],[1,"pull-right"],[1,"fa","fa-street-view","fa-3x",2,"color","#3498db"],[1,"lead-info-card__external-item"],[1,"fa","fa-eye","fa-3x",2,"color","#9b59b6"],[1,"lead-info-card__history-wrapper"],[1,"lead-info-card__history","v-timeline2","vertical-container"],[1,"vertical-timeline-block"],[1,"fa","fa-check"],[1,"label"],[1,"value"],[3,"href"],[1,"vertical-timeline-icon"],[1,"fa","fa-eye"],[1,"vertical-timeline-content","no-corner-timeline"],[1,"vertical-timeline-content__padding"],[1,"vertical-date","pull-right"],["data-placement","top","data-toggle","tooltip",1,"fa","fa-flag-checkered",3,"title"],[1,"action-url"]],template:function(r,e){r&1&&(a(0,"div",0),C("clickOutside",function(){return e.closeLeadInfo()}),a(1,"div",1)(2,"button",2),C("click",function(){return e.closeLeadInfo()}),b(3,"span",3),o(),a(4,"h5",4),s(5),l(6,"translate"),l(7,"date"),o()(),a(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"label"),s(13),l(14,"translate"),o(),a(15,"div",9)(16,"label",10)(17,"input",11),w("ngModelChange",function(d){return v(e.status,d)||(e.status=d),d}),C("ngModelChange",function(d){return e.updateState(d)}),o(),s(18),l(19,"translate"),o(),a(20,"label",12)(21,"input",11),w("ngModelChange",function(d){return v(e.status,d)||(e.status=d),d}),C("ngModelChange",function(d){return e.updateState(d)}),o(),s(22),l(23,"translate"),o(),a(24,"label",13)(25,"input",11),w("ngModelChange",function(d){return v(e.status,d)||(e.status=d),d}),C("ngModelChange",function(d){return e.updateState(d)}
1),o(),s(26),l(27,"translate"),o(),a(28,"label",14)(29,"input",11),C("ngModelChange",function(d){return e.updateState(d)}),w("ngModelChange",function(d){return v(e.status,d)||(e.status=d),d}),o(),s(30),l(31,"translate"),o()()(),a(32,"div",15)(33,"label",16),s(34),l(35,"translate"),y(36,Me,2,0,"span"),o(),a(37,"textarea",17),C("blur",function(){return e.updateComment()}),w("ngModelChange",function(d){return v(e.leadInfo.userComment,d)||(e.leadInfo.userComment=d),d}),o()(),a(38,"div",18)(39,"h4",19),s(40),l(41,"translate"),o()(),y(42,Pe,6,4,"div",20),y(43,Oe,7,6,"div",21),y(44,ue,7,6,"div",21),H(45,be,5,2,"div",20,U),y(47,xe,6,4,"div",22),o(),a(48,"div",23)(49,"div",24)(50,"div",25)(51,"div",26)(52,"h4",19),s(53),l(54,"translate"),o()(),a(55,"div",27)(56,"h1")(57,"span",28),s(58),o()(),a(59,"div",29),b(60,"i",30),o()()()(),a(61,"div",31)(62,"div",25)(63,"div",26)(64,"h4",19),s(65),l(66,"translate"),o()(),a(67,"div",27)(68,"h1")(69,"span",28),s(70),o()(),a(71,"div",29),b(72,"i",32),o()()()()(),a(73,"div",33)(74,"label",19),s(75),l(76,"translate"),o(),a(77,"div",34),H(78,we,14,7,"div",35,U),l(80,"orderBy"),o()()()()()),r&2&&(m("ngClass",et(66,he,e.isOpen)),n(5),bt(" ",e.leadInfo.title," ",g(6,38,"global.from")," ",k(7,40,e.leadInfo.createDate,"dd.MM.y, HH:mm")," "),n(8),p(g(14,43,"leads.page.table.th4")),n(3),I("active",e.status==="NEW"),n(),x("ngModel",e.status),m("value","NEW"),n(),O(" ",g(19,45,"leads.page.card.status.new")," "),n(2),I("active",e.status==="INWORK"),n(),x("ngModel",e.status),m("value","INWORK"),n(),O(" ",g(23,47,"leads.page.card.status.onWork")," "),n(2),I("active",e.status==="INVALID"),n(),x("ngModel",e.status),m("value","INVALID"),n(),O(" ",g(27,49,"leads.page.card.status.bad")," "),n(2),I("active",e.status==="SUCCESS"),n(),x("ngModel",e.status),m("value","SUCCESS"),n(),O(" ",g(31,51,"leads.page.card.status.success")," "),n(4),O("",g(35,53,"leads.page.card.status.notes")," "),n(2),S(e.isUserCommentUpdated?36:-1),n(),x("ngModel",e.leadInfo.userComment),n(3),p(g(41,55,"leads.page.card.details")),n(2),S(e.leadInfo.firstName?42:-1),n(),S(e.leadInfo.emails.length?43:-1),n(),S(e.leadInfo.phones.length?44:-1),n(),q(e.leadInfo.fieldsValues),n(2),S(e.leadInfo.comment?47:-1),n(6),p(g(54,57,"leads.page.card.visitNumber")),n(5),p(e.leadInfo.visitNo),n(7),p(g(66,59,"leads.page.card.sawPages")),n(5),p(e.leadInfo.history.length),n(5),p(g(76,61,"leads.page.card.visitHistory.title")),n(3),q(k(80,63,e.leadInfo.history,xt(68,fe))))},dependencies:[it,ot,at,z,F,$t,V,A,W,Nt],styles:['#right-sidebar[_ngcontent-%COMP%]{background-color:#fff;border-left:1px solid #e4e5e7;border-top-left-radius:10px;border-bottom-left-radius:10px;position:fixed;top:0;width:100%;max-width:500px;z-index:1040;bottom:0;right:0;display:none;overflow:hidden;box-shadow:0 4px 12px #0000001f}#right-sidebar.animate__animated[_ngcontent-%COMP%]{animation-duration:.35s}#right-sidebar.sidebar-open[_ngcontent-%COMP%]{display:block}#right-sidebar[_ngcontent-%COMP%] .sidebar-title[_ngcontent-%COMP%]{height:70px;display:flex;align-items:center;justify-content:flex-start;border-bottom:1px solid #D4D7DD;padding:13px 23px 13px 18px;text-align:center;vertical-align:middle;font-size:.8rem;gap:18px;position:relative;z-index:1}#right-sidebar[_ngcontent-%COMP%] .sidebar-title[_ngcontent-%COMP%] button.lead-info-sidebar__close[_ngcontent-%COMP%]{padding:10px;display:flex;align-items:center;justify-content:center}#right-sidebar[_ngcontent-%COMP%] .sidebar-title[_ngcontent-%COMP%] button.lead-info-sidebar__close[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:flex;width:14px;height:14px;position:relative;color:#7e889a}#right-sidebar[_ngcontent-%COMP%] .sidebar-title[_ngcontent-%COMP%] button.lead-info-sidebar__close[_ngcontent-%COMP%] span[_ngcontent-%COMP%] svg{width:100%;height:100%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#right-sidebar[_ngcontent-%COMP%] .sidebar-title[_ngcontent-%COMP%] button.lead-info-sidebar__close[_ngcontent-%COMP%]:hover{background-color:#f4f4f6}#right-sidebar[_ngcontent-%COMP%] .sidebar-title[_ngcontent-%COMP%] #crm-details-title[_ngcontent-%COMP%]{margin:0;font-style:normal;font-weight:400;font-size:1rem;line-height:1.2rem;color:#16181d}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%]{width:100%;height:calc(100vh - 56px);margin:0;padding:23px;overflow-x:hidden;overflow-y:auto}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%]{background-color:#fff}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__status[_ngcontent-%COMP%], #right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__data[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:10px;margin-bottom:20px;margin-top:0}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__status[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:not(.label), #right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__data[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:not(.label){font-style:normal;font-weight:500;font-size:1rem;line-height:1.2rem;color:#16181d;margin:0}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__status[_ngcontent-%COMP%] .btn-group__status-selector[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;justify-content:center;flex-wrap:wrap}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__status[_ngcontent-%COMP%] .btn-group__status-selector[_ngcontent-%COMP%] label.btn[_ngcontent-%COMP%]{width:auto;padding:10px;font-style:normal;font-weight:500;font-size:.9rem;line-height:1rem;box-shadow:none;border-color:#d4d7dd;color:#7e889a}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__status[_ngcontent-%COMP%] .btn-group__status-selector[_ngcontent-%COMP%] label.btn[_ngcontent-%COMP%]:first-child{border-radius:4px 0 0 4px}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__status[_ngcontent-%COMP%] .btn-group__status-selector[_ngcontent-%COMP%] label.btn[_ngcontent-%COMP%]:last-child{border-radius:0 4px 4px 0}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__status[_ngcontent-%COMP%] .btn-group__status-selector[_ngcontent-%COMP%] label.btn.active[_ngcontent-%COMP%]{color:#fff}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__status[_ngcontent-%COMP%] .btn-group__status-selector[_ngcontent-%COMP%] label.btn.btn-status-new.active[_ngcontent-%COMP%]{border-color:#9e58ae;background-color:#9e58ae}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__status[_ngcontent-%COMP%] .btn-group__status-selector[_ngcontent-%COMP%] label.btn.btn-status-inwork.active[_ngcontent-%COMP%]{border-color:#4898a8;background-color:#4898a8}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__status[_ngcontent-%COMP%] .btn-group__status-selector[_ngcontent-%COMP%] label.btn.btn-status-invalid.active[_ngcontent-%COMP%]{border-color:#e25336;background-color:#e25336}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__status[_ngcontent-%COMP%] .btn-group__status-selector[_ngcontent-%COMP%] label.btn.btn-status-success.active[_ngcontent-%COMP%]{border-color:#59a44a;background-color:#59a44a}@media (max-width: 483px){#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__status[_ngcontent-%COMP%] .btn-group__status-selector[_ngcontent-%COMP%] label.btn[_ngcontent-%COMP%]{margin-top:5px}}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__data[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{font-style:normal;font-weight:400;font-size:1rem;line-height:1.2rem;color:#7e889a;padding:14px;border-radius:4px}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__data[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-style:normal;font-weight:400;font-size:1rem;line-height:1.2rem;color:#7e889a}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__data[_ngcontent-%COMP%] .value[_ngcontent-%COMP%], #right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] .lead-info-card__data[_ngcontent-%COMP%] .value[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{font-style:normal;font-weight:600;font-size:1rem;line-height:1.2rem;color:#16181d}#right-sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%] #detailsInfo[_ngcontent-%COMP%] h4[_ng
1content-%COMP%]{text-transform:capitalize;font-style:normal;font-weight:500;font-size:1.2rem;line-height:1.6rem;color:#16181d;margin:0 0 25px}.colored-dark-blue[_ngcontent-%COMP%]{color:#34495e}.lead-info-card[_ngcontent-%COMP%]{padding-left:15px;padding-right:15px}.lead-info-card__data[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:400;margin-bottom:0}.lead-info-card__data[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{font-weight:700;font-size:.95rem;width:100%;word-wrap:break-word}.lead-info-card__data-colored[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:#34495e}.lead-info-card__data[_ngcontent-%COMP%]{margin-top:10px}.lead-info-card__data-commented[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{font-weight:400;font-size:.8rem}.lead-info-card__data-notes[_ngcontent-%COMP%]{margin-top:15px}.lead-info-card__data-notes[_ngcontent-%COMP%] label[_ngcontent-%COMP%] span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#62cb31}.lead-info-card__data-notes[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{font-size:.8rem;font-weight:700}.lead-info-card__data-notes[_ngcontent-%COMP%] textarea.on-focused[_ngcontent-%COMP%]{border-color:#4898a8}.lead-info-card__external[_ngcontent-%COMP%]{display:flex;padding:5px 0 25px}.lead-info-card__external-item[_ngcontent-%COMP%]{flex-basis:100%;background-color:#f4f4f6;border-radius:5px;height:117px}.lead-info-card__external-item.lead-info-card__external-item-marg[_ngcontent-%COMP%]{margin-right:15px}.lead-info-card__external-item[_ngcontent-%COMP%] .stats-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{text-transform:capitalize;margin:0;font-style:normal;font-weight:500;font-size:.9rem;line-height:1rem;color:#505662}.lead-info-card__external-item[_ngcontent-%COMP%] .panel-body[_ngcontent-%COMP%]{padding:15px;height:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between}.lead-info-card__external-item__value[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;justify-content:space-between;color:#35495e}.lead-info-card__history[_ngcontent-%COMP%]{margin:0;padding:15px 0}.lead-info-card__history[_ngcontent-%COMP%] .vertical-timeline-content[_ngcontent-%COMP%] .vertical-date[_ngcontent-%COMP%]{padding-left:5px}.lead-info-card__history[_ngcontent-%COMP%] .vertical-timeline-content[_ngcontent-%COMP%] .vertical-date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:4px;color:#62cb31}.lead-info-card__history[_ngcontent-%COMP%] .vertical-timeline-content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:.9rem;color:#34495e}.lead-info-card__history.v-timeline2[_ngcontent-%COMP%]:before{left:18px}.lead-info-card__history-wrapper[_ngcontent-%COMP%]{padding:0 15px;margin-top:-5px}.lead-info-card__history-wrapper[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{text-transform:uppercase;font-size:.75rem;font-weight:600;margin-bottom:0}.vertical-container[_ngcontent-%COMP%]{width:100%;margin:0 auto}.vertical-container[_ngcontent-%COMP%]:after{content:"";display:table;clear:both}.v-timeline2[_ngcontent-%COMP%]{position:relative;padding:0;margin-top:2em;margin-bottom:2em;overflow:hidden;--timelineTop: -80px}.v-timeline2[_ngcontent-%COMP%]:before{content:"";position:absolute;top:var(--timelineTop);left:28px;height:100%;width:4px;background:#e3e8f0}.vertical-timeline-content[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{float:right}.no-corner-timeline.vertical-timeline-content[_ngcontent-%COMP%]:after{border-color:transparent #ccc transparent transparent!important}.vertical-timeline-content__padding[_ngcontent-%COMP%]{padding:10px;background-color:#f7f9fa}.vertical-timeline-block[_ngcontent-%COMP%]{position:relative;margin:2em 0}.vertical-timeline-block[_ngcontent-%COMP%]:after{content:"";display:table;clear:both}.vertical-timeline-block[_ngcontent-%COMP%]:first-child{margin-top:0}.vertical-timeline-block[_ngcontent-%COMP%]:last-child{margin-bottom:0}.vertical-timeline-icon[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:40px;height:40px;border-radius:50%;font-size:.9rem;border:1px solid #e4e5e7;text-align:center;background:#fff}.vertical-timeline-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block;width:24px;height:24px;position:relative;
1left:50%;top:50%;margin-left:-12px;margin-top:-9px}.vertical-timeline-content[_ngcontent-%COMP%]{position:relative;margin-left:60px;background:#fff;border-radius:.25em;border:1px solid #e4e5e7}.vertical-timeline-content[_ngcontent-%COMP%]:after{content:"";display:table;clear:both}.vertical-timeline-content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-weight:400;margin-top:4px}.vertical-timeline-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:1em 0 0;line-height:1.6}.vertical-timeline-content[_ngcontent-%COMP%] .vertical-date[_ngcontent-%COMP%]{font-weight:500;text-align:right;font-size:.8rem}.vertical-date[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#62cb31;font-weight:400}.vertical-timeline-block[_ngcontent-%COMP%] .vertical-date[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#6a6c6f}.vertical-timeline-content[_ngcontent-%COMP%]:after, .vertical-timeline-content[_ngcontent-%COMP%]:before{right:100%;top:20px;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.vertical-timeline-content[_ngcontent-%COMP%]:after{border-color:transparent;border-right-color:#fff;border-width:10px;margin-top:-10px}.vertical-timeline-content[_ngcontent-%COMP%]:before{border-color:transparent;border-right-color:#e4e5e7;border-width:11px;margin-top:-11px}p.action-url[_ngcontent-%COMP%]{word-wrap:break-word;max-width:800px;color:#4898a8}@media only screen and (min-width: 768px){.vertical-timeline-content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:1rem}.vertical-timeline-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:.8rem}}.btn[_ngcontent-%COMP%]{border-radius:3px;font-size:.8rem;white-space:nowrap}.btn[_ngcontent-%COMP%]:hover, .btn[_ngcontent-%COMP%]:focus, .btn.focus[_ngcontent-%COMP%]{text-decoration:none;box-shadow:none}.btn[_ngcontent-%COMP%]:active:not(:disabled), .btn.active[_ngcontent-%COMP%]:not(:disabled){background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px #00000020}.stats-title[_ngcontent-%COMP%]{width:100%}.stats-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{text-transform:uppercase;font-size:.75rem;font-weight:600}']})}}return i})();var Ie=i=>({"active-row":i});function Le(i,M){if(i&1){let t=D();a(0,"tr",14),C("click",function(){let e=h(t),c=e.$implicit,d=e.$index,_=u();return f(_.openLeadInfo(c,d))}),a(1,"td",1)(2,"span",15),s(3),o()(),a(4,"td",16),l(5,"translate"),a(6,"span"),s(7),o()(),a(8,"td",3)(9,"span",15),s(10),o()(),a(11,"td",17),l(12,"translate"),a(13,"span"),s(14),o()(),a(15,"td",18),l(16,"translate"),s(17),l(18,"date"),o()()}if(i&2){let t=M.$implicit,r=M.$index,e=u();m("id",t.id)("ngClass",et(26,Ie,e.currentOpenedRow===r)),n(2),m("title",t.widgetName),n(),p(t.widgetName),n(),m("title",N(g(5,17,"leads.page.table.tooltip"))),n(3),p(t.siteName),n(2),m("title",t.pageUrl),n(),p(t.pageUrl),n(),m("title",N(g(12,19,"leads.page.table.tooltip"))),n(2),ut(t.state),n(),p(t.status),n(),m("title",N(g(16,21,"leads.page.table.tooltip"))),n(2),p(k(18,23,t.date,"dd.MM.y, HH:mm"))}}function Ee(i,M){if(i&1){let t=D();a(0,"app-lead-info",19),C("closeSidebar",function(){h(t);let e=u();return f(e.currentOpenedRow=null)}),o()}}var ne=(()=>{class i{constructor(){this.leadsService=P(E),this.leads=[],this.limitOptions=[],this.searchParams={},this.sortingDesc=!0,this.changeSortingDesc=new j,this.updateLeads=new j,this.currentOpenedRow=null}ngOnInit(){}ngAfterViewChecked(){this.leads.forEach(t=>{$("#"+t.id+" .widget-name span")&&$("#"+t.id+" .widget-name span")[0]&&($("#"+t.id+" .widget-name span")[0].scrollWidth>$("#"+t.id+" .widget-name span").innerWidth()+.4?$("#"+t.id+" .widget-name span")?.tooltip({trigger:"hover"}):$("#"+t.id+" .widget-name span")?.tooltip("hide")),$("#"+t.id+" .site-url span")&&$("#"+t.id+" .site-url span")[0]&&($("#"+t.id+" .site-url span")[0].scrollWidth>$("#"+t.id+" .site-url span").innerWidth()+.4?$("#"+t.id+" .site-url span")?.tooltip({trigger:"hover"}):$("#"+t.id+" .site-url span")?.tooltip("hide"))})}changeDateSorting(){this.changeSortingDesc.emit(),this.updateLeads.emit(!0)}openLeadInfo(t,r){this.leadsService.getLeadById(t.id).subscribe(e=>{e&&(this.currentOpenedRow=r,this.leadsService.openLeadInfoSidebar.next({data:e,index:r}))})}
1prevList(){this.searchParams.offset!==0&&(this.searchParams.offset-=this.searchParams.limit.value,this.updateLeads.emit(!0))}nextList(){this.leads.length<this.searchParams.limit.value||(this.searchParams.offset=this.searchParams.offset+this.searchParams.limit.value,this.updateLeads.emit(!0))}selectLimit(){this.updateLeads.emit(!1)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-leads-list"]],inputs:{leads:"leads",limitOptions:"limitOptions",searchParams:"searchParams",sortingDesc:"sortingDesc"},outputs:{changeSortingDesc:"changeSortingDesc",updateLeads:"updateLeads"},standalone:!1,decls:34,vars:25,consts:[[1,"crm-table"],[1,"widget-name"],[1,"site"],[1,"site-url"],[1,"status"],[1,"date",3,"click"],[1,"fas","float-right","pt-1",3,"ngClass"],[3,"id","ngClass"],[1,"crm-footer"],[1,"on-page"],["bindLabel","value","id","limitSelector",3,"change","ngModelChange","ngModel","clearable","items"],[1,"btn-group"],[1,"btn","btn-default",3,"click","disabled"],["inlineSVG","./assets/images/core/caret-down.svg"],[3,"click","id","ngClass"],[1,"cut",3,"title"],["data-placement","top","data-toggle","tooltip",1,"site",3,"title"],["data-placement","top","data-toggle","tooltip",1,"status",3,"title"],["data-placement","top","data-toggle","tooltip",1,"date",3,"title"],[3,"closeSidebar"]],template:function(r,e){r&1&&(a(0,"div",0)(1,"table")(2,"thead")(3,"th",1),s(4),l(5,"translate"),o(),a(6,"th",2),s(7),l(8,"translate"),o(),a(9,"th",3),s(10),l(11,"translate"),o(),a(12,"th",4),s(13),l(14,"translate"),o(),a(15,"th",5),C("click",function(){return e.changeDateSorting()}),s(16),l(17,"translate"),b(18,"i",6),o()(),a(19,"tbody"),H(20,Le,19,28,"tr",7,U),o()()(),a(22,"div",8)(23,"div",9)(24,"label"),s(25),l(26,"translate"),o(),a(27,"ng-select",10),C("change",function(){return e.selectLimit()}),w("ngModelChange",function(d){return v(e.searchParams.limit,d)||(e.searchParams.limit=d),d}),o()(),a(28,"div",11)(29,"button",12),C("click",function(){return e.prevList()}),b(30,"span",13),o(),a(31,"button",12),C("click",function(){return e.nextList()}),b(32,"span",13),o()()(),y(33,Ee,1,0,"app-lead-info")),r&2&&(n(4),p(g(5,13,"leads.page.table.th1")),n(3),p(g(8,15,"leads.page.table.th2")),n(3),p(g(11,17,"leads.page.table.th3")),n(3),p(g(14,19,"leads.page.table.th4")),n(3),O(" ",g(17,21,"leads.page.table.th5")," "),n(2),m("ngClass",e.sortingDesc?"fa-sort-amount-down":"fa-sort-amount-up"),n(2),q(e.leads),n(5),p(g(26,23,"sitelist.table.onPage")),n(2),x("ngModel",e.searchParams.limit),m("clearable",!1)("items",e.limitOptions),n(2),m("disabled",e.searchParams.offset===0),n(2),m("disabled",e.leads.length<e.searchParams.limit.value),n(2),S(e.currentOpenedRow!==null?33:-1))},dependencies:[it,z,F,st,V,ee,A,W],styles:[".crm-table[_ngcontent-%COMP%]{display:block;width:100%;border:1px solid #D4D7DD;border-radius:5px;overflow:auto}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{table-layout:fixed;width:100%;height:100%;position:relative}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{width:100%;display:flex;position:sticky;z-index:1;top:0;background-color:#fff}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]:not(:last-of-type){border-right:1px solid #D4D7DD}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:1px solid #D4D7DD}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{width:100%;display:flex;min-width:auto;height:inherit}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:not(:first-child) td[_ngcontent-%COMP%]{border-top:1px solid #D4D7DD}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{height:inherit;display:flex;align-items:center;justify-content:flex-start;padding:19px 14px;font-style:normal;font-weight:500;font-size:.9rem;line-height:1.2rem;text-align:left;color:#16181d;word-break:break-all}@media (max-width: 1919px){.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:9px 10px;font-size:.8rem;line-height:1rem}}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td.widget-name[_ng
1content-%COMP%]{font-size:.9rem;line-height:1.2rem;font-weight:700}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td.widget-name[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-letter{text-transform:uppercase}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{cursor:pointer}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover td[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr.active-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{background-color:#f4f4f6}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{height:100%;padding:19px 14px;font-style:normal;font-weight:500;font-size:1rem;line-height:1.2rem;text-align:left;background-color:#fff}@media (max-width: 1919px){.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:10px 7px;font-size:.8rem;line-height:1rem}}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:not(:last-of-type), .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:not(:last-of-type), .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:not(:last-of-type), .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:not(:last-of-type){border-right:1px solid #D4D7DD}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] .cut[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .cut[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th[_ngcontent-%COMP%] .cut[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .cut[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.widget-name[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.widget-name[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.widget-name[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.widget-name[_ngcontent-%COMP%]{width:38%;min-width:320px;white-space:nowrap}@media (max-width: 1919px){.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.widget-name[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.widget-name[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.widget-name[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.widget-name[_ngcontent-%COMP%]{min-width:255px}}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.site[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.site[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.site[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.site[_ngcontent-%COMP%]{width:17%;min-width:300px}@media (max-width: 1919px){.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.site[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.site[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.site[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.site[_ngcontent-%COMP%]{min-width:200
1px}}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.site-url[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.site-url[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.site-url[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.site-url[_ngcontent-%COMP%]{width:25%;min-width:430px;white-space:nowrap}@media (max-width: 1919px){.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.site-url[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.site-url[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.site-url[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.site-url[_ngcontent-%COMP%]{min-width:300px}}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.status[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.status[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.status[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.status[_ngcontent-%COMP%]{width:10%;min-width:120px}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.status[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.status[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.status[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{padding:4px 8px;border-radius:4px;font-style:normal;font-weight:400;font-size:.8rem;line-height:1.2rem;color:#fff}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.status[_ngcontent-%COMP%] span.NEW[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.status[_ngcontent-%COMP%] span.NEW[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.status[_ngcontent-%COMP%] span.NEW[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.status[_ngcontent-%COMP%] span.NEW[_ngcontent-%COMP%]{background-color:#9e58ae}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.status[_ngcontent-%COMP%] span.INWORK[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.status[_ngcontent-%COMP%] span.INWORK[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.status[_ngcontent-%COMP%] span.INWORK[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.status[_ngcontent-%COMP%] span.INWORK[_ngcontent-%COMP%]{background-color:#4898a8}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.status[_ngcontent-%COMP%] span.INVALID[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.status[_ngcontent-%COMP%] span.INVALID[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.status[_ngcontent-%COMP%] span.INVALID[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.status[_ngcontent-%COMP%] span.INVALID[_ngcontent-%COMP%]{background-color:#e25336}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.status[_ngcontent-%COMP%] span.SUCCESS[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.status[_ngcontent-%COMP%] span.SUCCESS[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.status[_ngcontent-%COMP%] span.SUCCESS[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.status[_ngcontent-%COMP%] span.SUCCESS[_ngcontent-%COMP%]{background-color:#59a44a}.crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.date[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] td.date[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th.date[_ngcontent-%COMP%], .crm-table[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.date[_ngcontent-%COMP%]{width:10%;min-width:150px}.crm-footer[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;justify-content:flex-end;margin-top:30px;gap:40px;flex-wrap:nowrap}.crm-footer[_ngcontent-%COMP%] .on-page[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:15px}.crm-footer[_ngcontent-%COMP%] .on-page[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{margin:0;font-style:normal;font-weight:400;font-size:1rem;line-height:1.2rem;color:#16181d}.crm-footer[_ngcontent-%COMP%] .on-page[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%]{border-color:#d4d7dd}.crm-footer[_ngcontent-%COMP%] .on-page[_ngcontent-%COMP%] .ng-select.ng-select-opened[_ngcontent-%COMP%] .ng-select-container .ng-arrow-wrapper{background-image:url(/assets/images/core/caret-up.svg)}.crm-footer[_ngcontent-%COMP%] .on-page[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container{padding:7px 10px}.crm-footer[_ngcontent-%COMP%] .on-page[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-value-container{padding:0 10px 0 0}.crm-footer[_ngcontent-%COMP%] .on-page[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-input{display:none}.crm-footer[_ngcontent-%COMP%] .on-page[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-arrow-wrapper{width:.8rem;height:.8rem;display:flex;align-items:center;justify-content:center;background-image:url(/assets/images/core/caret-down.svg);background-position:center;background-repeat:no-repeat}.crm-footer[_ngcontent-%COMP%] .on-page[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-arrow-wrapper .ng-arrow{display:none}.crm-footer[_ngcontent-%COMP%] .btn-group[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{height:36px;display:flex;align-items:center;justify-content:center;padding:4px 16px;color:#16181d;border-color:#d4d7dd}.crm-footer[_ngcontent-%COMP%] .btn-group[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:flex;width:28px;height:28px;position:relative}.crm-footer[_ngcontent-%COMP%] .btn-group[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%] svg{width:100%;height:100%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.crm-footer[_ngcontent-%COMP%] .btn-group[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:first-child span[_ngcontent-%COMP%]{transform:rotate(90deg)}.crm-footer[_ngcontent-%COMP%] .btn-group[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:last-child span[_ngcontent-%COMP%]{transform:rotate(-90deg)}.crm-footer[_ngcontent-%COMP%] .btn-group[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background-color:#f4f4f6}"]})}}return i})();var De=["p"];function ke(i,M){if(i&1){let t=D();a(0,"div",22)(1,"div",23)(2,"div",24)(3,"label",25),s(4),l(5,"translate"),o(),a(6,"div",26)(7,"ngbd-datepicker-i18n",27),w("ngModelChange",function(e){h(t);let c=u();return v(c.periodStart,e)||(c.periodStart=e),f(e)}),o()()(),a(8,"div",28)(9,"label",25),s(10),l(11,"translate"),o(),a(12,"div",29)(13,"ngbd-datepicker-i18n",27),w("ngModelChange",function(e){h(t);let c=u();return v(c.periodEnd,e)||(c.periodEnd=e),f(e)}),o()()()(),a(14,"div",30)(15,"button",31),C("click",function(){h(t);let e=u();return f(e.periodApply())}),s(16),l(17,"translate"),o()()()}if(i&2){let t=u();n(4),O("",g(5,5,"global.period.dateStart"),":"),n(3),x("ngModel",t.periodStart),n(3),O("",g(11,7,"global.period.dateEnd"),":"),n(3),x("ngModel",t.periodEnd),n(3),O(" ",g(17,9,"global.period.start")," ")}}function Be(i,M){if(i&1){let t=D();a(0,"app-leads-list",34),C("changeSortingDesc",function(){h(t);let e=u(2);return f(e.changeSortingDesc())})("updateLeads",function(e){h(t);let c=u(2);return f(c.timeoutFiltering(e,!1))}),o()}if(i&2){let t=u(2);m("leads",t.leads)("limitOptions",t.limitOptions)("searchParams",t.searchParams)("sortingDesc",t.sortingDesc)}}function We(i,M){i&1&&(a(0,"h2"),s(1),l(2,"translate"),o()),i&2&&(n(),p(g(2,1,"leads.page.table.noData")))}function Ve(i,M){i&1&&b(0,"app-preloader",33),i&2&&m("absolute",!0)}
1function Re(i,M){if(i&1&&(y(0,Be,1,4,"app-leads-list",32)(1,We,3,3,"h2"),y(2,Ve,1,1,"app-preloader",33)),i&2){let t=u();S(t.leads.length?0:1),n(2),S(t.isLaddaLoading||t.isPreloading?2:-1)}}function Ne(i,M){i&1&&b(0,"app-preloader")}var oe=(()=>{class i{constructor(){this.translate=P(rt),this.modalService=P(Bt),this.coreSitesService=P(At),this.coreUserService=P(Ut),this.sitesService=P(qt),this.userService=P(Ht),this.leadsService=P(E),this.periodType="WEEK",this.allSites=[],this.allWidgets=[],this.states=[],this.sitesIds=[],this.widgetsIds=[],this.statesIds=[],this.leads=[],this.limitOptions=[{value:10},{value:25},{value:50},{value:100}],this.searchParams={offset:0,limit:this.limitOptions[1]},this.leadsRequestParams={},this.isLoading=!0,this.isLaddaLoading=!1,this.isPreloading=!1,this.sortingDesc=!0,this.ALL_SITE_ID="0000000000000000",this.ONE_DAY=864e5}ngOnInit(){this.changePeriod(this.periodType),this.initStats(),this.innerWidth=window.innerWidth,this.translate.get("leads.page.filter.states.all").subscribe(t=>{this.states=[{id:this.ALL_SITE_ID,name:t}],this.sitesIds=[this.ALL_SITE_ID],this.widgetsIds=[this.ALL_SITE_ID],this.statesIds=[this.ALL_SITE_ID],this.states=this.states.concat(this.leadsService.getStates())}),this.translate.get("leads.page.table.extra.default").subscribe(t=>{this.defaultName=t}),this.translate.get("leads.page.table.extra.widget").subscribe(t=>{this.defaultExtraName=t}),this.updateLeadInfo=this.leadsService.updateLeadInfo.subscribe(t=>{t&&(this.leads[t.index].state=t.state,this.leads[t.index].status=this.setStatusByState(t.state))})}onResize(t){this.innerWidth=t.target.innerWidth}changePeriod(t){t===Y.TODAY?(this.periodStart=new Date,this.periodStart.setHours(0,0,0,0),this.periodEnd=new Date(this.getToday().getTime())):t===Y.YESTERDAY?(this.periodEnd=new Date(this.getToday().getTime()-this.ONE_DAY),this.periodStart=new Date(this.getToday().getTime()-this.ONE_DAY)):t===Y.WEEK?(this.periodStart=new Date(this.getToday().getTime()-7*this.ONE_DAY),this.periodEnd=new Date(this.getToday().getTime())):t===Y.MONTH&&(this.periodStart=new Date(this.getToday().getTime()-30*this.ONE_DAY),this.periodEnd=new Date(this.getToday().getTime())),this.timeoutFiltering(!1,!0)}periodApply(){this.isPreloading=!0,this.periodType="USER",this.popover.close(),this.changePeriod("USER")}checkFilters(t,r){t.id===this.ALL_SITE_ID?r==="sites"?this.sitesIds=[this.ALL_SITE_ID]:r==="widgets"?this.widgetsIds=[this.ALL_SITE_ID]:r==="states"&&(this.statesIds=[this.ALL_SITE_ID]):r==="sites"?this.sitesIds=this.sitesIds.filter(e=>e!==this.ALL_SITE_ID):r==="widgets"?this.widgetsIds=this.widgetsIds.filter(e=>e!==this.ALL_SITE_ID):r==="states"&&(this.statesIds=this.statesIds.filter(e=>e!==this.ALL_SITE_ID))}removeSelection(t){t==="sites"&&!this.sitesIds.length?this.sitesIds=[this.ALL_SITE_ID]:t==="widgets"&&!this.widgetsIds.length?this.widgetsIds=[this.ALL_SITE_ID]:t==="states"&&!this.statesIds.length&&(this.statesIds=[this.ALL_SITE_ID])}timeoutFiltering(t,r){this.isLoading=!0,clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(()=>{t||(this.searchParams.offset=0),r&&this.getFilters(),this.getLeads()},50)}changeSortingDesc(){this.sortingDesc=!this.sortingDesc}startExport(){let t=this.modalService.open(Jt,{windowClass:"animate__animated animate__slideInDown animate__faster"});t.componentInstance.leadsRequestParams=this.leadsRequestParams,t.componentInstance.userEmail=this.coreUserService.user.email}initStats(){this.coreUserService.user?this.getSites():this.meInfoSub=this.userService.getMeInfo().subscribe(()=>{this.getSites()})}getSites(){this.translate.get("leads.page.filter.sites").subscribe(t=>{this.allSites=[{id:this.ALL_SITE_ID,name:t}],this.sitesIds=[this.ALL_SITE_ID],this.sitesService.getSites().subscribe(r=>{this.coreSitesService.sites=r})})}getFilters(){let t={dateFrom:this.getUNIXTime(this.periodStart),dateTo:this.getUNIXTime(this.getTomorrowCopyDate(this.periodEnd))};this.translate.get("leads.page.filter.widgets.all").subscribe(r=>{this.allSites=[{id:this.ALL_SITE_ID,name:this.translate.instant("leads.page.filter.sites")}],this.allWidgets=[{id:this.ALL_SITE_ID,name:r}],this.leadsService.getLeadsFilters(t).subscribe(e=>{e&&(this.allSites=this.allSites.concat(e),e.forEach(c=>
1c.widgets.forEach(d=>this.allWidgets.push({id:d.name,name:d.name}))),this.sitesIds.length&&this.sitesIds[0]!==this.ALL_SITE_ID?(this.allWidgets=this.allWidgets.slice(0,1),this.sitesIds.forEach(c=>{this.allSites.filter(_=>_.id===c)[0].widgets.forEach(_=>this.allWidgets.push({id:_.name,name:_.name}))})):(this.allWidgets=this.allWidgets.slice(0,1),this.allSites.slice(1).forEach(c=>c.widgets.forEach(d=>this.allWidgets.push({id:d.name,name:d.name})))))})})}getToday(){return new Date(new Date().setHours(0,0,0,0))}getLeads(){let t={orders:this.sortingDesc?"-date":"date",limit:this.searchParams.limit.value,offset:this.searchParams.offset,dateFrom:this.getUNIXTime(this.periodStart),dateTo:this.getUNIXTime(this.getTomorrowCopyDate(this.periodEnd))};this.sitesIds.length&&this.sitesIds[0]!==this.ALL_SITE_ID&&(t.siteId=this.sitesIds.join(",")),this.statesIds.length&&this.statesIds[0]!==this.ALL_SITE_ID&&(t.state=this.statesIds.join(",")),this.widgetsIds.length&&this.widgetsIds[0]!==this.ALL_SITE_ID&&(t.widgetName=this.widgetsIds.join(",")),this.leadsRequestParams=t,this.leadsService.getLeadList(t).pipe(Ct(3e3)).subscribe(r=>{this.leads=r.map(e=>(e.status=this.setStatusByState(e.state),e.widgetName=this.setExtraName(e.widgetName),e)),this.isLoading=!1,this.isLaddaLoading=!1,this.isPreloading=!1,setTimeout(()=>{$('[data-toggle="tooltip"]')?.tooltip({trigger:"hover"})})})}setStatusByState(t){if(t==="NEW")return this.translate.instant("leads.page.card.status.new");if(t==="INWORK")return this.translate.instant("leads.page.card.status.onWork");if(t==="INVALID")return this.translate.instant("leads.page.card.status.bad");if(t==="SUCCESS")return this.translate.instant("leads.page.card.status.success")}setExtraName(t){return t?t===this.defaultName?t+" "+this.defaultExtraName:t:this.defaultName+" "+this.defaultExtraName}getTomorrowCopyDate(t){let r=new Date(t.getTime());return r.setDate(r.getDate()+1),r}getUNIXTime(t){return(0,ie.default)(t).unix()*1e3}ngOnDestroy(){this.meInfoSub&&this.meInfoSub.unsubscribe(),this.updateLeadInfo&&this.updateLeadInfo.unsubscribe()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-leads"]],viewQuery:function(r,e){if(r&1&&Mt(De,5),r&2){let c;Pt(c=Ot())&&(e.popover=c.first)}},hostBindings:function(r,e){r&1&&C("resize",function(d){return e.onResize(d)},ft)},standalone:!1,decls:86,vars:94,consts:[["popContent",""],["p","ngbPopover"],[1,"page-title"],[1,"title-main"],[1,"filters"],[1,"filter"],["bindLabel","name","bindValue","id","id","siteSelector","multiple","true",3,"add","change","ngModelChange","ngModel","items","placeholder"],[1,"btn-group","btn-group-toggle","btn-group__period-selector"],[1,"btn","btn-default"],["type","radio","name","radioLeads",3,"ngModelChange","ngModel","value"],["container","body","id","periods-custom","type","button",1,"btn","btn-default",3,"autoClose","ngbPopover","placement"],[1,"request-period-name"],["bindLabel","name","bindValue","id","id","widgetsSelector","multiple","true",3,"add","change","ngModelChange","ngModel","items","placeholder"],["bindLabel","name","bindValue","id","id","statesSelector","multiple","true",3,"add","change","ngModelChange","ngModel","items","placeholder"],[1,"crm-header"],[1,"d-flex"],[1,"btn","button-export",3,"click"],["aria-hidden","true",1,"fa","fa-file-excel-o"],[1,"btn","button-update","ml-2",3,"click","ladda"],["inlineSVG","/assets/images/crm/refresh-icon.svg",1,"mr-2"],[1,"ml-1"],[1,"leads-list-container"],["id","custom-period-container-template"],[1,"d-flex","flex-column"],[1,"text-left"],[1,"control-label","m-0"],["id","req-period-start"],[3,"ngModelChange","ngModel"],[1,"text-left","mt-3"],["id","req-period-end"],[1,"text-right","mt-3"],["id","periodApply","type","button",1,"btn","w-xs","btn-success",3,"click"],[3,"leads","limitOptions","searchParams","sortingDesc"],[1,"preloader-shade",3,"absolute"],[3,"changeSortingDesc","updateLeads","leads","limitOptions","searchParams","sortingDesc"]],template:function(r,e){if(r&1){let c=D();a(0,"div",2)(1,"h1",3),s(2),l(3,"translate"),o()(),a(4,"h2"),s(5),l(6,"translate"),o(),a(7,"app-card")(8,"div",4)(9,"div",5)(10,"h5"),s(11),l(12,"translate"),o(),a(13,"ng-select",6),l(14,"translate"),C("add",function(_){return h(c),f(e.checkFilters(_,"sites"))})("change",function(){return h(c),e.removeSelection("sites"),e.timeoutFiltering(!1,!1),f(e.isPreloading=!0)}),w("ngModelChange",function(_){return h(c),v(e.sitesIds,_)||(e.sitesIds=_),f(_)}),o()(),a(15,"div",5)(16,"h5"),s(17),l(18,"translate"),o(),a(19,"div",7)(20,"label",8)(21,"input",9),w("ngModelChange",function(_){return h(c),v(e.periodType,_)||(e.periodType=_),f(_)}
1),C("ngModelChange",function(_){return h(c),e.changePeriod(_),f(e.isPreloading=!0)}),o(),s(22),l(23,"translate"),o(),a(24,"label",8)(25,"input",9),w("ngModelChange",function(_){return h(c),v(e.periodType,_)||(e.periodType=_),f(_)}),C("ngModelChange",function(_){return h(c),e.changePeriod(_),f(e.isPreloading=!0)}),o(),s(26),l(27,"translate"),o(),a(28,"label",8)(29,"input",9),w("ngModelChange",function(_){return h(c),v(e.periodType,_)||(e.periodType=_),f(_)}),C("ngModelChange",function(_){return h(c),e.changePeriod(_),f(e.isPreloading=!0)}),o(),s(30),l(31,"translate"),o(),a(32,"label",8)(33,"input",9),w("ngModelChange",function(_){return h(c),v(e.periodType,_)||(e.periodType=_),f(_)}),C("ngModelChange",function(_){return h(c),e.changePeriod(_),f(e.isPreloading=!0)}),o(),s(34),l(35,"translate"),o(),Z(36,ke,18,11,"ng-template",null,0,nt),a(38,"button",10,1),s(40),l(41,"translate"),o()(),a(42,"p",11)(43,"span"),s(44),l(45,"translate"),o(),a(46,"span"),s(47),l(48,"date"),o(),a(49,"span"),s(50),l(51,"translate"),o(),a(52,"span"),s(53),l(54,"date"),o()()(),a(55,"div",5)(56,"h5"),s(57),l(58,"translate"),o(),a(59,"ng-select",12),l(60,"translate"),C("add",function(_){return h(c),f(e.checkFilters(_,"widgets"))})("change",function(){return h(c),e.removeSelection("widgets"),e.timeoutFiltering(!1,!1),f(e.isPreloading=!0)}),w("ngModelChange",function(_){return h(c),v(e.widgetsIds,_)||(e.widgetsIds=_),f(_)}),o()(),a(61,"div",5)(62,"h5"),s(63),l(64,"translate"),o(),a(65,"ng-select",13),l(66,"translate"),C("add",function(_){return h(c),f(e.checkFilters(_,"states"))})("change",function(){return h(c),e.removeSelection("states"),e.timeoutFiltering(!1,!1),f(e.isPreloading=!0)}),w("ngModelChange",function(_){return h(c),v(e.statesIds,_)||(e.statesIds=_),f(_)}),o()()()(),a(67,"section")(68,"div",14)(69,"h2"),s(70),l(71,"translate"),o(),a(72,"div",15)(73,"button",16),C("click",function(){return h(c),f(e.startExport())}),b(74,"i",17),a(75,"div"),s(76),l(77,"translate"),o()(),a(78,"button",18),C("click",function(){return h(c),e.timeoutFiltering(!1,!1),f(e.isLaddaLoading=!0)}),b(79,"span",19),a(80,"div",20),s(81),l(82,"translate"),o()()()(),a(83,"app-card",21),y(84,Re,3,2)(85,Ne,1,0,"app-preloader"),o()()}if(r&2){let c=tt(37);n(2),p(g(3,50,"sidebar.leads")),n(3),p(g(6,52,"leads.page.filter.title")),n(6),p(g(12,54,"sidebar.sites")),n(2),x("ngModel",e.sitesIds),m("items",e.allSites)("placeholder",g(14,56,"widgetsList.add.chooseSite")),n(4),p(g(18,58,"leads.page.filter.period")),n(3),I("active",e.periodType==="TODAY"),n(),x("ngModel",e.periodType),m("value","TODAY"),n(),O(" ",g(23,60,"reports.emails.period.today")," "),n(2),I("active",e.periodType==="YESTERDAY"),n(),x("ngModel",e.periodType),m("value","YESTERDAY"),n(),O(" ",g(27,62,"reports.emails.period.yesterday")," "),n(2),I("active",e.periodType==="WEEK"),n(),x("ngModel",e.periodType),m("value","WEEK"),n(),O(" ",g(31,64,"reports.emails.period.week")," "),n(2),I("active",e.periodType==="MONTH"),n(),x("ngModel",e.periodType),m("value","MONTH"),n(),O(" ",g(35,66,"reports.emails.period.month")," "),n(4),I("active",e.periodType==="USER"),m("autoClose","outside")("ngbPopover",c)("placement",e.innerWidth<850?"bottom":"left"),n(2),O(" ",g(41,68,"reports.emails.period.user")," "),n(4),p(g(45,70,"reports.emails.filter.from")),n(3),O("\xA0",k(48,72,e.periodStart,"d.MM.yyyy")),n(3),O("\xA0",g(51,75,"reports.emails.filter.to")),n(3),O("\xA0",k(54,77,e.periodEnd,"d.MM.yyyy")),n(4),p(g(58,80,"sidebar.widgets")),n(2),x("ngModel",e.widgetsIds),m("items",e.allWidgets)("placeholder",g(60,82,"leads.page.filter.widgets.placeholder")),n(4),p(g(64,84,"leads.page.filter.states.title")),n(2),x("ngModel",e.statesIds),m("items",e.states)("placeholder",g(66,86,"leads.page.filter.states.placeholder")),n(5),p(g(71,88,"sidebar.leads")),n(6),p(g(77,90,"leads.page.table.export")),n(2),m("ladda",e.isLaddaLoading),n(3),p(g(82,92,"leads.page.table.refresh")),n(3),S(!e.isLoading||e.isLaddaLoading||e.isPreloading&&e.leads.length?84:85)}},dependencies:[ot,at,z,F,Wt,st,Rt,lt,Ft,V,Yt,ne,A,W],styles:[".page-title[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:20px}.title-button[_ngcontent-%COMP%]{padding:20px 24px;border-radius:10px;display:flex;align-items:center;justify-content:space-between}.title-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-style:normal;font-weight:500;font-size:1.3rem;line-height:1.7rem}.title-button[_ngcontent-%COMP%] span.icon[_ngcontent-%COMP%]{width:26px;height:26px;margin-right:18px;position:relative}.title-button[_ngcontent-%COMP%] span.icon[_ngcontent-%COMP%] svg{width:100%;height:100%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}@media (max-width: 1919px){.title-button[_ngcontent-%COMP%]{padding:14px 18px}}@media (max-width: 1199px){.title-button[_ngcontent-%COMP%]{padding:16px 20px}.title-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:1.1rem;line-height:1.5rem}}@media (max-width: 991px){.title-button[_ngcontent-%COMP%]{padding:12px 16px}.title-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.9rem;line-height:1.2rem}.title-button[_ngcontent-%COMP%] span.icon[_ngcontent-%COMP%]{width:22px;height:22px}}@media (max-width: 767px){.title-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{line-height:1rem}.title-button[_ngcontent-%COMP%] span.icon[_ngcontent-%COMP%]{width:18px;height:18px;margin-right:10px}}[_nghost-%COMP%] .page-title[_ngcontent-%COMP%]{margin-bottom:35px}[_nghost-%COMP%] h2[_ngcontent-%COMP%]{margin-bottom:25px;font-style:normal;font-weight:400;font-size:1.3rem;line-height:1.7rem;color:#16181d}[_nghost-%COMP%] .filters[_ngcontent-%COMP%]{width:100%;display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:10px}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap;gap:10px;flex-basis:48%}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{font-style:normal;font-weight:600;font-size:1rem;line-height:1.2rem;margin:0;color:#16181d}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container{align-items:center;border-radius:4px;border:1px solid #D4D7DD;padding:4px}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-value-container, [_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-clear-wrapper, [_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-arrow-wrapper{padding:0}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-value-container{display:inline-flex;align-items:center;justify-content:flex-start;gap:5px}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-value-container .ng-placeholder, [_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-value-container .ng-input{padding:3px 5px;font-style:normal;font-weight:400;font-size:1rem;line-height:1.2rem;color:#7e889a}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-value-container .ng-value{display:flex;align-items:center;justify-content:flex-start;border:1px solid #D4D7DD;border-radius:4px;background-color:#fff;margin:0}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-value-container .ng-value span{dis
1play:flex;height:100%;padding:7px;border:none;font-style:normal;font-weight:400;font-size:1rem;line-height:1.2rem;color:#7e889a}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-value-container .ng-value .ng-value-icon{font-size:1.2rem;line-height:1.2rem;padding-left:10px;padding-right:4px}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-value-container .ng-value .ng-value-icon:hover{background-color:#f4f4f6}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .ng-select[_ngcontent-%COMP%] .ng-select-container .ng-value-container .ng-value .ng-value-label{padding-left:4px;padding-right:10px}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .btn-group__period-selector[_ngcontent-%COMP%]{width:100%;flex-wrap:wrap}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .btn-group__period-selector[_ngcontent-%COMP%] label[_ngcontent-%COMP%], [_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .btn-group__period-selector[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{height:45px;padding:13px;font-style:normal;font-weight:600!important;font-size:1rem!important;line-height:1rem!important;color:#16181d}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .btn-group__period-selector[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:first-child, [_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .btn-group__period-selector[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:first-child{border-radius:4px 0 0 4px}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .btn-group__period-selector[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:last-child, [_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .btn-group__period-selector[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:last-child{border-radius:0 4px 4px 0}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .btn-group__period-selector[_ngcontent-%COMP%] label.btn.active[_ngcontent-%COMP%]:not(:disabled), [_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .btn-group__period-selector[_ngcontent-%COMP%] button.btn.active[_ngcontent-%COMP%]:not(:disabled){background:#4898a81a;border:1px solid #4898A8;color:#4898a8;box-shadow:none;z-index:2}[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%;margin:0;display:flex;align-items:center;justify-content:flex-end;font-style:normal;font-weight:400;font-size:.75rem;line-height:.9rem;color:#7e889a}@media (max-width: 1919px){[_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .btn-group__period-selector[_ngcontent-%COMP%] label[_ngcontent-%COMP%], [_nghost-%COMP%] .filters[_ngcontent-%COMP%] .filter[_ngcontent-%COMP%] .btn-group__period-selector[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-bottom:5px}}@media (max-width: 1199px){[_nghost-%COMP%] .filters[_ngcontent-%COMP%]{flex-direction:column}}[_nghost-%COMP%] section[_ngcontent-%COMP%]{margin-top:35px}[_nghost-%COMP%] section[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]:last-child{margin:0}[_nghost-%COMP%] section[_ngcontent-%COMP%] .crm-header[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;justify-content:space-between;margin-bottom:15px}[_nghost-%COMP%] section[_ngcontent-%COMP%] .crm-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}[_nghost-%COMP%] section[_ngcontent-%COMP%] .crm-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:15px;padding:10px 15px;border-radius:4px;font-style:normal;font-weight:500;font-size:1rem;line-height:1.2rem;color:#fff}[_nghost-%COMP%] section[_ngcontent-%COMP%] .crm-header[_ngcontent-%COMP%] button.button-update[_ngcontent-%COMP%]{background-color:#4898a8}[_nghost-%COMP%] section[_ngcontent-%COMP%] .crm-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:flex;width:24px;height:24px;position:relative}[_nghost-%COMP%] section[_ngcontent-%COMP%] .crm-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%] svg{width:100%;height:100%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}[_nghost-%COMP%] section[_ngcontent-%COMP%] .crm-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background-color:#397884;border-color:#397884}.crm-notification-block[_ngcontent-%COMP%]{margin-top:20px;
1display:flex;align-items:center;border:1px solid #4894c5;background-color:#eff8fb;padding:10px 7px}.crm-notification-icon[_ngcontent-%COMP%]{min-width:36px;height:36px;background-image:url(/assets/images/crm/notification.png);background-repeat:no-repeat;background-position:center center;background-size:36px;margin-right:10px}.crm-notification-text[_ngcontent-%COMP%]{font-size:.8rem;flex:1;margin-right:10px;color:#6a6c6f}.ladda-label[_ngcontent-%COMP%]{display:flex}.preloader-shade[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:9;background-color:#f8f8f8;opacity:.3} .leads-list-container .preloader-shade .widget-page-preloader-all-inner{top:35px!important}"]})}}return i})();var ae=(()=>{class i{constructor(){this.route=P(yt),this.router=P(St),this.leadsService=P(E),this.reportId=this.route.snapshot.params.id}ngOnInit(){this.leadsService.downloadReportFile(this.reportId).subscribe(t=>{if(t){let r=new Blob([t],{type:"text/csv;charset=UTF-8"}),e=document.createElement("a");e.style.display="none",e.href=window.URL.createObjectURL(r),e.download=`report_leads_${this.reportId}.csv`,document.body.appendChild(e),e.click(),this.router.navigate(["/leads"])}})}ngOnDestroy(){this.downloadReportFileSub&&this.downloadReportFileSub.unsubscribe()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-leads-report"]],standalone:!1,decls:0,vars:0,template:function(r,e){},encapsulation:2})}}return i})();var Ae=[{path:"",component:oe,title:"sidebar.leads"},{path:"report/:id",component:ae,title:"sidebar.leads"}],re=(()=>{class i{static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275mod=J({type:i})}static{this.\u0275inj=Q({imports:[pt.forChild(Ae),pt]})}}return i})();var Mi=(()=>{class i{static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275mod=J({type:i})}static{this.\u0275inj=Q({imports:[vt,It,Lt,Vt,Et,Gt,jt,re,Tt,Kt.forRoot({style:"zoom-in"})]})}}return i})();export{Mi as LeadsModule};
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.