import{d as l,r as i,b as u,c as f,w as c,b0 as b,ew as y,u as v,cb as p}from"./registerWidgets.1e9167ab.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="d5e060e3-595a-4bd3-9c10-6ba18582885c",a._sentryDebugIdIdentifier="sentry-dbid-d5e060e3-595a-4bd3-9c10-6ba18582885c")}catch{}})();const w=l({__name:"SaveButton",props:{model:{}},setup(a){const n=a,s=i(!1);async function t(){s.value=!0;try{await n.model.save()}finally{s.value=!1}}return addEventListener("keydown",e=>{(e.metaKey||e.ctrlKey)&&e.key==="s"&&(e.preventDefault(),t())}),addEventListener("beforeunload",e=>{n.model.hasChanges()&&(e.preventDefault(),e.returnValue="")}),(e,d)=>{var o,r;return u(),f(v(p),{class:y(["save-button",{changes:(o=e.model)==null?void 0:o.hasChanges()}]),loading:s.value,disabled:!((r=e.model)!=null&&r.hasChanges()),onClick:d[0]||(d[0]=g=>t())},{default:c(()=>[b(" Save ")]),_:1},8,["class","loading","disabled"])}}});export{w as _};
//# sourceMappingURL=SaveButton.vue_vue_type_script_setup_true_lang.77a4e1fa.js.map
