import{f as p,c as u,o as b,w as i,e as l,g as m,t as d,h as f}from"./runtime-dom.esm-bundler-CnPoR0UW.chunk.mjs";import{c as w}from"./index-DaEUtA7I.chunk.mjs";import{a as g}from"./index-C1xmmKTZ-Dc_rYBq-.chunk.mjs";import{a as S,l as c}from"./index-BgmsSgl5.chunk.mjs";import{t as h}from"./translation-DoG5ZELJ-DFt3Gk_P.chunk.mjs";import{c as I}from"./index-BoQ4w0RZ.chunk.mjs";import{b as M}from"./createElementId-DhjFt1I9-Cdw8hg_s.chunk.mjs";import{N as k}from"./NcCheckboxRadioSwitch-D0gFwEVl-V4x6qq9f.chunk.mjs";import{N}from"./ContentCopy-Ds2LtgQK.chunk.mjs";import{g as R}from"./index-DqIuD5e7.chunk.mjs";import"./index-sH3U_332.chunk.mjs";import"./index-CClfw3S6.chunk.mjs";import"./logger-D3RVzcfQ-v2acROFG.chunk.mjs";import"./mdi-DEKCY6bD.chunk.mjs";import"./NcNoteCard-CWiO3Dse-DuB9YE1o.chunk.mjs";import"./NcPasswordField-BOLzDHBJ-GBwBvLv5.chunk.mjs";import"./TrashCanOutline-DGTAXxb4.chunk.mjs";const T=R().detectLogLevel().setApp("sharebymail").build(),V={name:"AdminSettings",components:{NcCheckboxRadioSwitch:k,NcSettingsSection:N},setup(){return{t:h}},data(){return{sendPasswordMail:c("sharebymail","sendPasswordMail"),replyToInitiator:c("sharebymail","replyToInitiator")}},watch:{sendPasswordMail(e){this.update("sendpasswordmail",e)},replyToInitiator(e){this.update("replyToInitiator",e)}},methods:{async update(e,a){await I();const s=M("/apps/provisioning_api/api/v1/config/apps/{appId}/{key}",{appId:"sharebymail",key:e}),o=a?"yes":"no";try{const{data:t}=await w.post(s,{value:o});this.handleResponse({status:t.ocs?.meta?.status})}catch(t){this.handleResponse({errorMessage:h("sharebymail","Unable to update share by mail config"),error:t})}},async handleResponse({status:e,errorMessage:a,error:s}){e!=="ok"&&(g(a),T.error(a,{error:s}))}}};function v(e,a,s,o,t,x){const n=p("NcCheckboxRadioSwitch"),y=p("NcSettingsSection");return b(),u(y,{name:o.t("sharebymail","Share by mail"),description:o.t("sharebymail","Allows people to share a personalized link to a file or folder by putting in an email address.")},{default:i(()=>[l(n,{modelValue:t.sendPasswordMail,"onUpdate:modelValue":a[0]||(a[0]=r=>t.sendPasswordMail=r),type:"switch"},{default:i(()=>[m(d(o.t("sharebymail","Send password by mail")),1)]),_:1},8,["modelValue"]),l(n,{modelValue:t.replyToInitiator,"onUpdate:modelValue":a[1]||(a[1]=r=>t.replyToInitiator=r),type:"switch"},{default:i(()=>[m(d(o.t("sharebymail","Reply to initiator")),1)]),_:1},8,["modelValue"])]),_:1},8,["name","description"])}const P=S(V,[["render",v]]),_=f(P);_.mount("#vue-admin-sharebymail");
//# sourceMappingURL=sharebymail-admin-settings.mjs.map
