import{a as A}from"./chunk-CFFHWVA5.js";import{a as w,b as a}from"./chunk-C7V3KKPV.js";import{A as j,c as N,f as m,i as F,y as $}from"./chunk-2YE7XEKS.js";import{$d as p,Vd as e,Wd as g,Yd as f,ba as n,ce as S,ie as r,je as u,ka as I,oe as b,pa as P,r as y,w as o}from"./chunk-UNHECMG2.js";var L=p({Id:g,FormOfAddress:e,Nationality:r(e),AddressLine1:r(e),AddressLine2:r(e),BillingAddress:r(e),Birthdate:r(b),CorrespondenceAddress:r(e),DisplayEmail:r(e),Email:u(e),Email2:u(e),FirstName:r(e),Gender:r(S([f("M"),f("F"),f("X")])),HomeTown:r(e),LastName:r(e),FullName:r(e),Location:r(e),MiddleName:r(e),NativeLanguage:r(e),PhoneMobile:r(e),PhonePrivate:r(e),PhoneBusiness:u(e),SocialSecurityNumber:r(e),StayPermit:r(g),StayPermitExpiry:r(b),Zip:r(e)}),E=p({Id:g,FullName:e,DisplayEmail:r(e),Email:u(e)}),M=p({Id:g,FullName:e});function O(s){return h=>h.pipe(n(t=>{let i=Number(t.headers.get("X-Pagination-Offset")),l=Number(t.headers.get("X-Pagination-Total"));return a(s)(t.body).pipe(o(d=>({offset:i,total:l,entries:d})))}))}function c(s,h,t=new m){return t.set("offset",String(s)).set("limit",String(h))}function C(s=new N){return s.set("X-Pagination-Total","on")}var _=(()=>{class s extends A{constructor(){let t=P(F),i=P(j);super(t,i,L,"Persons"),this.personEmailCodec=p($(this.codec.props,["Email","FormOfAddress"]))}getListForIds(t){return this.getList({params:{"filter.Id":`;${t.join(";")}`}})}getSummaries(t){if(t.length===0)return y([]);let i=new m().set("filter.Id",`;${t.join(";")}`).set("fields",["Id","FullName","DisplayEmail","Email"].join(","));return this.http.get(`${this.baseUrl}/`,{params:c(0,0,i)}).pipe(n(a(E)))}getSummariesByEmail(t){if(t.length===0)return y([]);let i=new m().set("filter.Email",`;${t.join(";")}`).set("fields",["Id","FullName","DisplayEmail","Email"].join(","));return this.http.get(`${this.baseUrl}/`,{params:c(0,0,i)}).pipe(n(a(E)))}getMyself(t){return this.http.get(`${this.baseUrl}/me`,t).pipe(n(w(this.codec)))}getByIdWithEmailInfos(t){return this.http.get(`${this.baseUrl}/`,{params:{"filter.Id=":t.toString(),fields:["FormOfAddress","Email"].join(",")}}).pipe(n(a(this.personEmailCodec)),o(i=>i[0]))}getFullNamesById(t){let i=new m().set("filter.Id",`;${t.join(";")}`).set("fields","Id,FullName");return this.http.get(`${this.baseUrl}/`,{params:c(0,0,i)}).pipe(n(a(M)))}update(t,i,l,d){let x={PhonePrivate:i,PhoneMobile:l,Email2:d};return this.http.put(`${this.baseUrl}/${t}`,x).pipe(o(()=>{}))}updateEmail(t,i,l){let d={Email:i};return this.http.put(`${this.baseUrl}/${t}`,d,{context:l}).pipe(o(()=>{}))}static{this.\u0275fac=function(i){return new(i||s)}}static{this.\u0275prov=I({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();export{O as a,c as b,C as c,_ as d};
