1import{a as p}from"./chunk-KDI3GPIC.js";import{a as b}from"./chunk-GWD2IUT7.js";import{b as k,e as f}from"./chunk-AUF7EZQC.js";import{a as i}from"./chunk-HQ4I43KI.js";import{la as A,qa as C,s as u}from"./chunk-VS7X6DYN.js";import{a as S,b as d,f as y}from"./chunk-TSRGIXR5.js";var l=y(b());var $=(()=>{let o=class o{constructor(){this.catalogSearchApiClient=C(k)}addEvent(s,e,t,a){switch(s){case i.Resume:return a?this.catalogSearchApiClient.catalogItemEvents_AddAuthorizedResumeEvent(a,t,e):this.catalogSearchApiClient.catalogItemEvents_AddResumeEvent(t,e);case i.Vacancy:return a?this.catalogSearchApiClient.catalogItemEvents_AddAuthorizedVacancyEvent(a,t,e):this.catalogSearchApiClient.catalogItemEvents_AddVacancyEvent(t,e);default:throw new Error("Catalog type must be defined.")}}getStats(s,e,t,a=14){return this.getStatsApiRequest(e,s,t,a).pipe(u(c=>this.calcStats(c,a)))}getPairBuckets(s,e,t,a){return this.getStatsApiRequest(e,s,t,a).pipe(u(c=>this.calcPairBuckets(c,a)))}getWorkerPairBuckets(s,e,t){let a=p.getCurrentTimeZoneOffsetInMinutes();return this.catalogSearchApiClient.catalogItemStats_GetWorkerStats(s,e,a,t).pipe(u(c=>this.calcPairBuckets(c,t)))}getLastViewDate(s,e,t){let a;switch(e){case i.Resume:a=f.Resume;break;case i.Vacancy:a=f.Vacancy;break;default:throw new Error("Catalog type must be defined.")}return this.catalogSearchApiClient.catalogItemViews_GetLastCatalogView(s,t,a)}calcStats(s,e){let t=new Array(e);for(let c=0;c<t.length;c++){let n=(0,l.default)().subtract(e-c-1,"days"),m=s.buckets.find(g=>(0,l.default)(g.date).isSame(n,"day"));t[c]=m?.count||0}let a=t.slice(e-7).reduce((c,n)=>c+n,0),r=Math.max(...t);for(let c=0;c<t.length;c++)t[c]=t[c]/r*100;return{buckets:t,total:s.totalCount,lastWeekIncrease:a}}calcPairBuckets(s,e){let t=new Array(e);for(let c=0;c<t.length;c++){let n=(0,l.default)().startOf("day").subtract(c,"days"),m={count:0,date:n.toDate()};t[e-c-1]=s.buckets.find(g=>(0,l.default)(g.date).isSame(n,"day"))||m}let a=t.slice(e/2,e),r=t.slice(0,e/2).map((c,n)=>d(S({},c),{date:a[n].date}));return{current:a,previous:r}}getStatsApiRequest(s,e,t,a){let r=p.getCurrentTimeZoneOffsetInMinutes();switch(e){case i.Resume:return this.catalogSearchApiClient.catalogItemStats_GetResumeStats(s,t,r,a);case i.Vacancy:return this.catalogSearchApiClient.catalogItemStats_GetVacancyStats(s,t,r,a);default:throw new Error("Catalog type must be defined.")}}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let h=o;return h})();export{$ as a};
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.