import{s as f}from"./icons.e9d866c3.js";import{d as c,r as i,b as u,c as v,e as b,z as p,U as y,N as _,G as m,a as g,q as h}from"./registerWidgets.787b786f.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aeb85430-d69f-4f0b-bc95-ca8b8db176d3",e._sentryDebugIdIdentifier="sentry-dbid-aeb85430-d69f-4f0b-bc95-ca8b8db176d3")}catch{}})();const w=c({__name:"SaveButton",props:{model:null},setup(e){const n=e,t=i(!1);async function s(){t.value=!0;try{await n.model.save()}finally{t.value=!1}}return addEventListener("keydown",a=>{(a.metaKey||a.ctrlKey)&&a.key==="s"&&(a.preventDefault(),s())}),addEventListener("beforeunload",a=>{n.model.hasChanges()&&(a.preventDefault(),a.returnValue="")}),(a,o)=>{var d,l;const r=g("icon");return u(),v("button",{class:m(["save-button",{changes:(d=e.model)==null?void 0:d.hasChanges()}]),onClick:o[0]||(o[0]=S=>s())},[b(r,{class:"icon",path:p(f),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),y(" "+_(t.value?"Saving ...":(l=e.model)!=null&&l.hasChanges()?"Save":"Saved"),1)],2)}}});const k=h(w,[["__scopeId","data-v-15752ff4"]]);export{k as S};
//# sourceMappingURL=SaveButton.6b400f27.js.map
