import{a as i,b as x,c as s,d as T}from"./chunk-6B6CBPYV.js";import{Da as c,La as y}from"./chunk-5E3JCGAH.js";import{b as p,c as d}from"./chunk-YBNTOQCK.js";import{be as S,g as u,na as m,ta as h,xa as o}from"./chunk-WL5U2YIT.js";import{e as l}from"./chunk-ADEKKGI2.js";var n,g=l(()=>{T();n=class a{toQueryString(){let e=[];return this.errorType!==null&&this.errorType.toString()&&e.push("errorType="+encodeURIComponent(this.errorType.toString())),this.exceptionMessage!==null&&this.exceptionMessage.toString()&&e.push("exceptionMessage="+encodeURIComponent(this.exceptionMessage.toString())),this.exceptionSubMessage!==null&&this.exceptionSubMessage.toString()&&e.push("exceptionSubMessage="+encodeURIComponent(this.exceptionSubMessage.toString())),this.exceptionType!==null&&this.exceptionType.toString()&&e.push("exceptionType="+encodeURIComponent(this.exceptionType.toString())),this.fatal!==null&&this.fatal.toString()&&e.push("fatal="+encodeURIComponent(this.fatal.toString())),this.message!==null&&this.message.toString()&&e.push("message="+encodeURIComponent(this.message.toString())),this.messageDetail!==null&&this.messageDetail.toString()&&e.push("messageDetail="+encodeURIComponent(this.messageDetail.toString())),this.stackTrace!==null&&this.stackTrace.toString()&&e.push("stackTrace="+encodeURIComponent(this.stackTrace.toString())),this.statusText!==null&&this.statusText.toString()&&e.push("statusText="+encodeURIComponent(this.statusText.toString())),e.join("&")}constructor(e=null){this.clone=()=>new a(this),this.errorType=s.manageDefaultValue(e,"errorType",""),this.exceptionMessage=s.manageDefaultValue(e,"exceptionMessage",""),this.exceptionSubMessage=s.manageDefaultValue(e,"exceptionSubMessage",""),this.exceptionType=s.manageDefaultValue(e,"exceptionType",""),this.fatal=s.manageDefaultValue(e,"fatal",!1),this.message=s.manageDefaultValue(e,"message",""),this.messageDetail=s.manageDefaultValue(e,"messageDetail",""),this.stackTrace=s.manageDefaultValue(e,"stackTrace",""),this.statusText=s.manageDefaultValue(e,"statusText","")}}});var V,M=l(()=>{m();x();g();S();d();y();V=(()=>{let e=class e{constructor(t,r){this.translatorService=t,this.messageService=r,this.errorNotifications=new u,this.errors=[]}pushError(t){this.errors.push(t),this.notifyErrors()}pushErrorMessage(t){this.errors.push(new n({messageDetail:`${t}`,fatal:!1})),this.notifyErrors()}pushSaveInfoEntity(t,r){if(t.result===i.Success)return;if(t.result!==i.Error){this.messageService.add({key:"globalToast",severity:"error",summary:this.translatorService.translateEnum(i,t.result),detail:this.translatorService.translate(t.errorMessage)});return}let f=t.result!==i.Error?this.translatorService.translateEnum(i,t.result):"";this.errors.push(new n({message:r,exceptionMessage:this.translatorService.translate(t.errorMessage,t.detailedErrorMessage),exceptionSubMessage:`${f} ${t.detailedErrorMessage?t.detailedErrorMessage:""}`,fatal:!1})),this.notifyErrors()}popError(){return this.errors.shift()}hasErrors(){return this.errors.length>0}getStackedErrorsThenClear(){let t=this.errors;return this.errors=[],t}handleApiResult(t,r){return t.result===i.Success?!0:(this.pushSaveInfoEntity(t,r),!1)}notifyErrors(){this.errorNotifications.next(this.errors)}};e.\u0275fac=function(r){return new(r||e)(o(p),o(c))},e.\u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"});let a=e;return a})()});export{n as a,g as b,V as c,M as d};
