import{a as R}from"./chunk-MANB3PJC.js";import{f as P}from"./chunk-A4FSGNM7.js";import{Bd as f,E as s,md as p,s as i,tc as l,u as S}from"./chunk-CBXQYRPM.js";import{Ec as c,Rc as _,ca as a,da as m,fa as o,la as I}from"./chunk-LVXYIJUI.js";var L=(()=>{class t{constructor(r){this.lpsService=r}print(r,e){let n=new c;return n=n.append("async",!0),this.lpsService.post(this.getLPSApiEndpoint(e),r,n)}printLabel(r){let e=new c;return e=e.append("async",!0),this.lpsService.post(i.PRINT_LABEL,{printQueueID:r,sysUser:l.getSystemUser().userName},e)}getLPSApiEndpoint(r){switch(r){case s.DELIVERY_NOTE:return i.PRINT_DELIVERY_NOTE;case s.PARKED_NOTE:return i.PRINT_PARKED_NOTE;case s.CONSIGNMENT_NOTE:return i.PRINT_CONSIGNMENT_NOTE;case s.CONTAINER_STICKER:return i.PRINT_CONTAINER_STICKER;case s.UNIQUE_BUNDLE_STICKER:return i.PRINT_UNIQUE_BUNDLE_STICKER;case s.CORRECTION_NOTE:return i.PRINT_CORRECTION_NOTE;case s.BUFFER_CONTAINER_CONTENT:return i.PRINT_BUFFER_CONTAINER_CONTENT;case s.PACKING_NOTE:return i.PRINT_PACKING_NOTE;case s.BILL_OF_LADING:return i.PRINT_BILL_OF_LADING;case s.SOIL_RECEPTION_TICKET:return i.PRINT_SOIL_RECEPTION_TICKET;case s.TEST_REPORT_FOR_LPS:return i.PRINT_TEST_REPORT_FOR_LPS;case s.CLEAN_RETURN_TICKET:return i.PRINT_CLEAN_RETURN_TICKET;case s.CONTAINER_LABEL:return i.PRINT_CONTAINER_LABEL;default:return""}}static{this.\u0275fac=function(e){return new(e||t)(o(R))}}static{this.\u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var N=(()=>{class t{constructor(r){this.printService=r}print(r,e){return this.printService.print(r,e)}printLabel(r){return this.printService.printLabel(r)}static{this.\u0275fac=function(e){return new(e||t)(o(L))}}static{this.\u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var T=(()=>{class t{constructor(r,e,n,u){this.printLPSFacade=r,this.toastMessageService=e,this.loggingService=n,this.translateService=u}handleLabelPrinterCall(r){this.printLPSFacade.printLabel(r).subscribe({next:e=>{e.errorCode===S.OK?this.toastMessageService.showToastPanel(p.getSuccessDefaultConfig().withMessage(this.translateService.instant("MSG_LABEL_PRINTED"))):this.handlePrintErrorMessage(this.translateService.instant("MSG_ERROR_PRINTING_LABEL",{error:`${e.errorCode}: ${e.detailMessage}`}))},error:e=>{this.handlePrintErrorMessage(this.translateService.instant("MSG_ERROR_PRINTING_LABEL",{error:e.message}))}})}handlePrintErrorMessage(r){this.loggingService.error(r),this.toastMessageService.showToastPanel(p.getErrorDefaultConfig().withMessage(r))}static{this.\u0275fac=function(e){return new(e||t)(o(N),o(f),o(P),o(_))}}static{this.\u0275prov=a({token:t,factory:t.\u0275fac})}}return t})();var O=(()=>{class t{static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275mod=I({type:t})}static{this.\u0275inj=m({providers:[T]})}}return t})();export{N as a,T as b,O as c};
