import{j as c}from"./icons.2362754f.js";import{d as f,r as i,b as u,c as v,e as p,z as y,S as _,N as b,G as m,a as g,q as h}from"./registerWidgets.2bf05ebf.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]="8a0abf73-012b-40aa-8dcf-04e8b41949ac",e._sentryDebugIdIdentifier="sentry-dbid-8a0abf73-012b-40aa-8dcf-04e8b41949ac")}catch{}})();const S=f({__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 l,d;const r=g("icon");return u(),v("button",{class:m(["save-button",{changes:(l=e.model)==null?void 0:l.hasChanges()}]),onClick:o[0]||(o[0]=w=>s())},[p(r,{class:"icon",path:y(c),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),_(" "+b(t.value?"Saving ...":(d=e.model)!=null&&d.hasChanges()?"Save":"Saved"),1)],2)}}});const k=h(S,[["__scopeId","data-v-42786fd0"]]);export{k as S};
//# sourceMappingURL=SaveButton.c69ab798.js.map
