import{A as s,ad as o,lb as i,sb as r,w as a}from"./chunk-ZVAMPSQU.js";var l=(()=>{let e=class e{get unsavedChangesMessage(){return this.translate.instant("services.unsavedChanges.message")}constructor(){this.router=s(r),this.translate=s(o),this.pendingChanges=!1,this.router.events.subscribe(n=>{n instanceof i&&this.clearPendingChanges()}),window.addEventListener("beforeunload",n=>{if(this.pendingChanges)return(n||window.event).returnValue=this.unsavedChangesMessage,this.unsavedChangesMessage})}setPendingChanges(){this.pendingChanges=!0}hasPendingChanges(){return this.pendingChanges}clearPendingChanges(){this.pendingChanges=!1}};e.\u0275fac=function(g){return new(g||e)},e.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();export{l as a};
