import {J,a6 as pi,ef as T,c as tS,U as RN,b3 as w,H as ul,al as Kv,el as d,aa as ye,ab as LN,bd as K,N as Sr,ad as ce}from'./main-WUGO6e7n.js';var a,R,S=J(()=>{pi();T();tS();RN();w();ul();a=(function(e){return e[e.success=200]="success",e[e.badRequest=400]="badRequest",e[e.notFound=404]="notFound",e[e.serverError=500]="serverError",e[e.forbidden=403]="forbidden",e})(a||{}),R=(()=>{class e{constructor(r,i,o){this.dvlConfirmationService=r,this.applicationErrorService=i,this.translatorService=o;}handleError(r,i=null){switch(console.error(r),r.status){case a.serverError:this.handleServerError(r);break;case a.forbidden:this.handleForbiddenError(r.error);break;case a.badRequest:this.handleBadRequest(r.error,this.translatorService.translate("lblError"));break;case a.notFound:this.handleBadRequest(r.error,this.translatorService.translate("lblError"),this.translatorService.translate(i)||"Item not found");break;default:this.handleGenericError(r);}return Kv()}handleBadRequest(r,i=this.translatorService.translate("AnErrorOccured"),o=this.translatorService.translate("AnErrorOccured")){typeof r=="string"&&(r={message:`${r}`});let n=r?.Message||r?.message||o;this.dvlConfirmationService.confirm({intent:"default",actionMode:"ok",title:`${i}`,message:n,width:n?.length>120?"640px":void 0});}handleForbiddenError(r,i=this.translatorService.translate("ShowAccessDenied")){let o=r.translationKey?this.translatorService.translate(r.translationKey):r.Message||r.message;this.dvlConfirmationService.confirm({intent:"default",actionMode:"ok",title:`${i}`,message:o});}handleGenericError(r){this.sendToApplicationError(r.message,r.statusText);}handleServerError(r){r.error&&(r.error.exceptionMessage||r.error.message)?this.sendToApplicationError(r.error.message,r.statusText,r.error.exceptionMessage,r.error.exceptionType,r.error.stackTrace):this.handleGenericError(r);}sendToApplicationError(r,i,o,n,m){this.applicationErrorService.pushError(new d({message:r,statusText:i,exceptionMessage:o,exceptionType:n,stackTrace:m,fatal:!1}));}static{this.\u0275fac=function(i){return new(i||e)(ye(LN),ye(K),ye(Sr))};}static{this.\u0275prov=ce({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();});export{R,S};