import{_ as h}from"./AdminTabs-CAsvsm7h.js";import{L as y,b as k,S as D,a2 as E,r as C,a1 as F,o as N,e as n,f as v,g as B,m as i,h as u,p as f,t as g,i as s,a7 as L,H as U}from"./app-CuhK3jij.js";import{u as a}from"./appSettingsUpdater-DcxdiO4R.js";/*! 2FAuth version 5.4.2 - Copyright (c) 2024 Bubka - https://github.com/Bubka/2FAuth */const x={class:"options-tabs"},I={class:"title is-4 pt-4 has-text-grey-light"},O={class:"title is-4 pt-4 has-text-grey-light"},W={__name:"Auth",setup(T){const V=y("2fauth"),m=k(),l=D(),c=E(V.prefix+"returnTo","accounts"),d=C({restrictList:null,restrictRule:null});async function p(r,e){if(d.value[r]=null,e=="")L.delete(r,{returnError:!0}).then(o=>{l[r]="",m.success({type:"is-success",text:U("settings.forms.setting_saved")})}).catch(o=>{o.response.status!==404&&m.error(o)});else{const{error:o}=await a(r,e,!0);o&&(d.value[r]=o.response.data.message)}}return F(r=>{r.name.startsWith("admin.")||m.clear()}),N(async()=>{await l.fetch()}),(r,e)=>{const o=n("FormCheckbox"),b=n("FormField"),R=n("FormWrapper"),S=n("ButtonBackCloseCancel"),_=n("VueFooter");return v(),B("div",null,[i(h,{activeTab:"admin.auth"}),u("div",x,[i(R,null,{default:f(()=>[u("form",null,[u("h4",I,g(r.$t("admin.single_sign_on")),1),i(o,{modelValue:s(l).enableSso,"onUpdate:modelValue":[e[0]||(e[0]=t=>s(l).enableSso=t),e[1]||(e[1]=t=>s(a)("enableSso",t))],fieldName:"enableSso",label:"admin.forms.enable_sso.label",help:"admin.forms.enable_sso.help"},null,8,["modelValue"]),i(o,{modelValue:s(l).useSsoOnly,"onUpdate:modelValue":[e[2]||(e[2]=t=>s(l).useSsoOnly=t),e[3]||(e[3]=t=>s(a)("useSsoOnly",t))],fieldName:"useSsoOnly",label:"admin.forms.use_sso_only.label",help:"admin.forms.use_sso_only.help",isDisabled:!s(l).enableSso,isIndented:!0},null,8,["modelValue","isDisabled"]),u("h4",O,g(r.$t("admin.registrations")),1),i(o,{modelValue:s(l).restrictRegistration,"onUpdate:modelValue":[e[4]||(e[4]=t=>s(l).restrictRegistration=t),e[5]||(e[5]=t=>s(a)("restrictRegistration",t))],fieldName:"restrictRegistration",isDisabled:s(l).disableRegistration,label:"admin.forms.restrict_registration.label",help:"admin.forms.restrict_registration.help"},null,8,["modelValue","isDisabled"]),i(b,{modelValue:s(l).restrictList,"onUpdate:modelValue":e[6]||(e[6]=t=>s(l).restrictList=t),"onChange:modelValue":e[7]||(e[7]=t=>p("restrictList",t)),fieldError:s(d).restrictList,fieldName:"restrictList",isDisabled:!s(l).restrictRegistration||s(l).disableRegistration,label:"admin.forms.restrict_list.label",help:"admin.forms.restrict_list.help",isIndented:!0},null,8,["modelValue","fieldError","isDisabled"]),i(b,{modelValue:s(l).restrictRule,"onUpdate:modelValue":e[8]||(e[8]=t=>s(l).restrictRule=t),"onChange:modelValue":e[9]||(e[9]=t=>p("restrictRule",t)),fieldError:s(d).restrictRule,fieldName:"restrictRule",isDisabled:!s(l).restrictRegistration||s(l).disableRegistration,label:"admin.forms.restrict_rule.label",help:"admin.forms.restrict_rule.help",isIndented:!0,leftIcon:"slash",rightIcon:"slash"},null,8,["modelValue","fieldError","isDisabled"]),i(o,{modelValue:s(l).disableRegistration,"onUpdate:modelValue":[e[10]||(e[10]=t=>s(l).disableRegistration=t),e[11]||(e[11]=t=>s(a)("disableRegistration",t))],fieldName:"disableRegistration",label:"admin.forms.disable_registration.label",help:"admin.forms.disable_registration.help"},null,8,["modelValue"]),i(o,{modelValue:s(l).keepSsoRegistrationEnabled,"onUpdate:modelValue":[e[12]||(e[12]=t=>s(l).keepSsoRegistrationEnabled=t),e[13]||(e[13]=t=>s(a)("keepSsoRegistrationEnabled",t))],fieldName:"keepSsoRegistrationEnabled",isDisabled:!s(l).enableSso||!s(l).disableRegistration,label:"admin.forms.keep_sso_registration_enabled.label",help:"admin.forms.keep_sso_registration_enabled.help",isIndented:!0},null,8,["modelValue","isDisabled"])])]),_:1})]),i(_,{showButtons:!0},{default:f(()=>[i(S,{returnTo:{name:s(c)},action:"close"},null,8,["returnTo"])]),_:1})])}}};export{W as default};
