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