1import{b as N,e as R}from"./chunk-KEKOWM7X.js";import"./chunk-JCOTUPE5.js";import{B as M,Bc as C,Ib as j,Ja as b,Jc as f,P as y,Pc as L,Qc as h,ec as I,gc as w,jb as P,ub as S,xb as O}from"./chunk-TXT3R3MF.js";import{Ea as s,Fa as c,Ha as D,Ia as n,Ja as E,S as v,a as g,aa as m,gc as d,jb as F,q as u,qa as l,x as p}from"./chunk-PWAHSUDZ.js";import"./chunk-2BAXZMGZ.js";var T=new D("PDFInvoicesListInvoices"),a=class{},x=(()=>{class i{constructor(e){this.adapter=e}getInvoicesForOrder(e,t,r){return this.adapter.getInvoicesForOrder(e,t,r)}getInvoicePDF(e,t,r,o){return this.adapter.getInvoicePDF(e,t,r,o)}static{this.\u0275fac=function(t){return new(t||i)(n(a))}}static{this.\u0275prov=s({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),G=(()=>{class i extends h{constructor(){super(...arguments),this.responseStatus=L.BAD_REQUEST}hasMatch(e){return super.hasMatch(e)&&this.getErrors(e)?.length>0}handleError(e,t){this.handleInvoicesListError(e,t),this.handlePDFDownloadError(e,t)}handleInvoicesListError(e,t){this.getErrors(t).filter(r=>this.isInvoicesListNotFoundError(r)).forEach(()=>{this.globalMessageService.add({key:"pdfInvoices.invoicesLoadingError"},f.MSG_TYPE_ERROR)})}handlePDFDownloadError(e,t){this.getErrors(t).filter(r=>this.isDownloadInvoiceError(r)).forEach(()=>{this.globalMessageService.add({key:"pdfInvoices.downloadPDFError"},f.MSG_TYPE_ERROR)})}isInvoicesListNotFoundError(e){return e?.type==="UnknownIdentifierError"&&e?.message!=null&&e?.message.includes("Order")}isDownloadInvoiceError(e){return e?.type==="UnknownIdentifierError"&&e?.message!=null&&e?.message.includes("Invoice")}getErrors(e){return(e.error?.errors??[]).filter(t=>this.isInvoicesListNotFoundError(t)||this.isDownloadInvoiceError(t))}getPriority(){return O.NORMAL}static{this.\u0275fac=(()=>{let e;return function(r){return(e||(e=F(i)))(r||i)}})()}static{this.\u0275prov=s({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),U=(()=>{class i{constructor(e,t,r){this.routingService=e,this.userIdService=t,this.pdfInvoicesConnector=r,this.subscriptions=new g,this.subscriptions.add(this.userIdService.takeUserId().subscribe(o=>this.userId=o)),this.subscriptions.add(this.getOrderId().subscribe(o=>this.orderId=o))}getInvoicesForOrder(e,t,r){return this.pdfInvoicesConnector.getInvoicesForOrder(t||this.userId,r||this.orderId,e).pipe(l(1))}getInvoicePDF(e,t,r,o){return this.pdfInvoicesConnector.getInvoicePDF(r||this.userId,o||this.orderId,e,t).pipe(l(1))}getOrderId(){return this.routingService.getRouterState().pipe(p(e=>e.state.params),m(),p(e=>e.orderCode))}ngOnDestroy(){this.subscriptions.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)(n(C),n(w),n(x))}}static{this.\u0275prov=s({token:i,factory:i.\u0275fac})}}return i})(),H=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=d({type:i})}static{this.\u0275inj=c({providers:[U,{provide:N,useExisting:U},{provide:h,useExisting:G,multi:!0},x]})}}return i})();var q=(()=>{class i{constructor(e,t,r){this.http=e,this.occEndpoints=t,this.converter=r,this.logger=E(P)}getInvoicesForOrder(e,t,r){return this.http.get(this.buildInvoiceListUrl(e,t,r)).pipe(v(o=>u(I(o,this.logger))),this.converter.pipeable(T))}getInvoicePDF(e,t,r,o){let A={responseType:"blob"};return this.http.get(this.buildInvoicePDFUrl(e,t,r,o),A).pipe(v(V=>u(I(V,this.logger))))}buildInvoiceListUrl(e,t,r){return this.occEndpoints.buildUrl("pdfInvoicesListInvoices",{urlParams:{userId:e,orderId:t},queryParams:r})}buildInvoicePDFUrl(e,t,r,o){return this.occEndpoints.buildUrl("pdfInvoicesDownloadInvoicePDF",{urlParams:{userId:e,orderId:t,invoiceId:r},queryParams:o?{externalSystemId:o}:void 0})}static{this.\u0275fac=function(t){return new(t||i)(n(y),n(S),n(j))}}static{this.\u0275prov=s({token:i,factory:i.\u0275fac})}}return i})(),B={backend:{occ:{endpoints:{pdfInvoicesListInvoices:"users/${userId}/orders/${orderId}/invoices",pdfInvoicesDownloadInvoicePDF:"users/${userId}/orders/${orderId}/invoices/${invoiceId}/download"}}}},$=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=d({type:i})}static{this.\u0275inj=c({providers:[b(B),{provide:a,useClass:q}],imports:[M]})}}return i})();var le=(()=>
1{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=d({type:i})}static{this.\u0275inj=c({imports:[R,H,$]})}}return i})();export{le as PDFInvoicesModule};
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.