2FAuth/public/build/assets/Options-e3b3035d.js
2024-03-15 15:37:37 +01:00

2 lines
9.7 KiB
JavaScript
Vendored

import{_ as P}from"./SettingTabs-beebcb43.js";import{Q as T,a as F,T as I,b as c,a2 as G,r as M,v as q,o as R,a0 as S,e as p,f as $,g as Q,m as l,h as i,p as _,t as u,i as o,j as V,J as L,I as j,a3 as W}from"./app-94c6def1.js";/*! 2FAuth version 5.1.0 - Copyright (c) 2023 Bubka - https://github.com/Bubka/2FAuth */const E={class:"options-tabs"},J={class:"block"},z={class:"title is-4 has-text-grey-light"},H={class:"field help"},K={class:"ml-2",href:"https://crowdin.com/project/2fauth"},X={class:"title is-4 pt-4 has-text-grey-light"},Y={class:"title is-4 pt-4 has-text-grey-light"},Z={class:"title is-4 pt-4 has-text-grey-light"},oe={__name:"Options",setup(ee){const f=T("2fauth"),s=F(),v=I(),b=c(),y=G(f.prefix+"returnTo","accounts"),O=[{text:"settings.forms.grid",value:"grid",icon:"th"},{text:"settings.forms.list",value:"list",icon:"list"}],h=[{text:"settings.forms.light",value:"light",icon:"sun"},{text:"settings.forms.dark",value:"dark",icon:"moon"},{text:"settings.forms.automatic",value:"system",icon:"desktop"}],w=[{text:"12 34 56",value:2,legend:"settings.forms.pair",title:"settings.forms.pair_legend"},{text:"123 456",value:3,legend:"settings.forms.trio",title:"settings.forms.trio_legend"},{text:"1234 5678",value:.5,legend:"settings.forms.half",title:"settings.forms.half_legend"}],x=[{text:"settings.forms.never",value:0},{text:"settings.forms.on_otp_copy",value:-1},{text:"settings.forms.1_minutes",value:1},{text:"settings.forms.5_minutes",value:5},{text:"settings.forms.10_minutes",value:10},{text:"settings.forms.15_minutes",value:15},{text:"settings.forms.30_minutes",value:30},{text:"settings.forms.1_hour",value:60},{text:"settings.forms.1_day",value:1440}],g=M([{text:"groups.no_group",value:0},{text:"groups.active_group",value:-1}]),C=[{text:"settings.forms.livescan",value:"livescan"},{text:"settings.forms.upload",value:"upload"},{text:"settings.forms.advanced_form",value:"advancedForm"}],D=[{text:"settings.forms.otp_generation_on_request",value:!0,legend:"settings.forms.otp_generation_on_request_legend",title:"settings.forms.otp_generation_on_request_title"},{text:"settings.forms.otp_generation_on_home",value:!1,legend:"settings.forms.otp_generation_on_home_legend",title:"settings.forms.otp_generation_on_home_title"}],U=q(()=>{let n=[{text:"languages.browser_preference",value:"browser"}];for(const e of f.langs)n.push({text:"languages."+e,value:e});return n});R(()=>{v.items.forEach(n=>{n.id>0&&g.value.push({text:n.name,value:n.id})}),s.refreshPreferences()});function r(n,e){L.updatePreference(n,e).then(m=>{c().success({type:"is-success",text:j("settings.forms.setting_saved")}),n==="lang"&&W()!==e?s.applyLanguage():n==="theme"&&s.applyTheme()})}return S(n=>{n.name.startsWith("settings.")||b.clear()}),(n,e)=>{const m=p("FormSelect"),N=p("FontAwesomeIcon"),d=p("FormToggle"),a=p("FormCheckbox"),k=p("FormWrapper"),A=p("ButtonBackCloseCancel"),B=p("VueFooter");return $(),Q("div",null,[l(P,{activeTab:"settings.options"}),i("div",E,[l(k,null,{default:_(()=>[i("form",null,[i("div",J,[i("h4",z,u(n.$t("settings.general")),1),l(m,{modelValue:o(s).preferences.lang,"onUpdate:modelValue":[e[0]||(e[0]=t=>o(s).preferences.lang=t),e[1]||(e[1]=t=>r("lang",t))],options:o(U),fieldName:"lang",label:"settings.forms.language.label",help:"settings.forms.language.help"},null,8,["modelValue","options"]),i("div",H,[V(u(n.$t("settings.forms.some_translation_are_missing"))+" ",1),i("a",K,[V(u(n.$t("settings.forms.help_translate_2fauth"))+" ",1),l(N,{icon:["fas","external-link-alt"]})])]),l(d,{modelValue:o(s).preferences.displayMode,"onUpdate:modelValue":[e[2]||(e[2]=t=>o(s).preferences.displayMode=t),e[3]||(e[3]=t=>r("displayMode",t))],choices:O,fieldName:"displayMode",label:"settings.forms.display_mode.label",help:"settings.forms.display_mode.help"},null,8,["modelValue"]),l(d,{modelValue:o(s).preferences.theme,"onUpdate:modelValue":[e[4]||(e[4]=t=>o(s).preferences.theme=t),e[5]||(e[5]=t=>r("theme",t))],choices:h,fieldName:"theme",label:"settings.forms.theme.label",help:"settings.forms.theme.help"},null,8,["modelValue"]),l(a,{modelValue:o(s).preferences.showAccountsIcons,"onUpdate:modelValue":[e[6]||(e[6]=t=>o(s).preferences.showAccountsIcons=t),e[7]||(e[7]=t=>r("showAccountsIcons",t))],fieldName:"showAccountsIcons",label:"settings.forms.show_accounts_icons.label",help:"settings.forms.show_accounts_icons.help"},null,8,["modelValue"]),l(a,{modelValue:o(s).preferences.getOfficialIcons,"onUpdate:modelValue":[e[8]||(e[8]=t=>o(s).preferences.getOfficialIcons=t),e[9]||(e[9]=t=>r("getOfficialIcons",t))],fieldName:"getOfficialIcons",label:"settings.forms.get_official_icons.label",help:"settings.forms.get_official_icons.help"},null,8,["modelValue"]),l(a,{modelValue:o(s).preferences.formatPassword,"onUpdate:modelValue":[e[10]||(e[10]=t=>o(s).preferences.formatPassword=t),e[11]||(e[11]=t=>r("formatPassword",t))],fieldName:"formatPassword",label:"settings.forms.password_format.label",help:"settings.forms.password_format.help"},null,8,["modelValue"]),l(d,{modelValue:o(s).preferences.formatPasswordBy,"onUpdate:modelValue":[e[12]||(e[12]=t=>o(s).preferences.formatPasswordBy=t),e[13]||(e[13]=t=>r("formatPasswordBy",t))],choices:w,fieldName:"formatPasswordBy",isDisabled:!o(s).preferences.formatPassword},null,8,["modelValue","isDisabled"]),l(a,{modelValue:o(s).preferences.clearSearchOnCopy,"onUpdate:modelValue":[e[14]||(e[14]=t=>o(s).preferences.clearSearchOnCopy=t),e[15]||(e[15]=t=>r("clearSearchOnCopy",t))],fieldName:"clearSearchOnCopy",label:"settings.forms.clear_search_on_copy.label",help:"settings.forms.clear_search_on_copy.help"},null,8,["modelValue"]),i("h4",X,u(n.$t("groups.groups")),1),l(m,{modelValue:o(s).preferences.defaultGroup,"onUpdate:modelValue":[e[16]||(e[16]=t=>o(s).preferences.defaultGroup=t),e[17]||(e[17]=t=>r("defaultGroup",t))],options:o(g),fieldName:"defaultGroup",label:"settings.forms.default_group.label",help:"settings.forms.default_group.help"},null,8,["modelValue","options"]),l(a,{modelValue:o(s).preferences.rememberActiveGroup,"onUpdate:modelValue":[e[18]||(e[18]=t=>o(s).preferences.rememberActiveGroup=t),e[19]||(e[19]=t=>r("rememberActiveGroup",t))],fieldName:"rememberActiveGroup",label:"settings.forms.remember_active_group.label",help:"settings.forms.remember_active_group.help"},null,8,["modelValue"]),l(a,{modelValue:o(s).preferences.viewDefaultGroupOnCopy,"onUpdate:modelValue":[e[20]||(e[20]=t=>o(s).preferences.viewDefaultGroupOnCopy=t),e[21]||(e[21]=t=>r("viewDefaultGroupOnCopy",t))],fieldName:"viewDefaultGroupOnCopy",label:"settings.forms.view_default_group_on_copy.label",help:"settings.forms.view_default_group_on_copy.help"},null,8,["modelValue"]),i("h4",Y,u(n.$t("settings.security")),1),l(m,{modelValue:o(s).preferences.kickUserAfter,"onUpdate:modelValue":[e[22]||(e[22]=t=>o(s).preferences.kickUserAfter=t),e[23]||(e[23]=t=>r("kickUserAfter",t))],options:x,fieldName:"kickUserAfter",label:"settings.forms.auto_lock.label",help:"settings.forms.auto_lock.help"},null,8,["modelValue"]),l(d,{modelValue:o(s).preferences.getOtpOnRequest,"onUpdate:modelValue":[e[24]||(e[24]=t=>o(s).preferences.getOtpOnRequest=t),e[25]||(e[25]=t=>r("getOtpOnRequest",t))],choices:D,fieldName:"getOtpOnRequest",label:"settings.forms.otp_generation.label",help:"settings.forms.otp_generation.help"},null,8,["modelValue"]),l(a,{modelValue:o(s).preferences.closeOtpOnCopy,"onUpdate:modelValue":[e[26]||(e[26]=t=>o(s).preferences.closeOtpOnCopy=t),e[27]||(e[27]=t=>r("closeOtpOnCopy",t))],fieldName:"closeOtpOnCopy",label:"settings.forms.close_otp_on_copy.label",help:"settings.forms.close_otp_on_copy.help",isDisabled:!o(s).preferences.getOtpOnRequest,isIndented:!0},null,8,["modelValue","isDisabled"]),l(a,{modelValue:o(s).preferences.copyOtpOnDisplay,"onUpdate:modelValue":[e[28]||(e[28]=t=>o(s).preferences.copyOtpOnDisplay=t),e[29]||(e[29]=t=>r("copyOtpOnDisplay",t))],fieldName:"copyOtpOnDisplay",label:"settings.forms.copy_otp_on_display.label",help:"settings.forms.copy_otp_on_display.help",isDisabled:!o(s).preferences.getOtpOnRequest,isIndented:!0},null,8,["modelValue","isDisabled"]),l(a,{modelValue:o(s).preferences.showOtpAsDot,"onUpdate:modelValue":[e[30]||(e[30]=t=>o(s).preferences.showOtpAsDot=t),e[31]||(e[31]=t=>r("showOtpAsDot",t))],fieldName:"showOtpAsDot",label:"settings.forms.show_otp_as_dot.label",help:"settings.forms.show_otp_as_dot.help"},null,8,["modelValue"]),l(a,{modelValue:o(s).preferences.revealDottedOTP,"onUpdate:modelValue":[e[32]||(e[32]=t=>o(s).preferences.revealDottedOTP=t),e[33]||(e[33]=t=>r("revealDottedOTP",t))],fieldName:"revealDottedOTP",label:"settings.forms.reveal_dotted_otp.label",help:"settings.forms.reveal_dotted_otp.help",isDisabled:!o(s).preferences.showOtpAsDot,isIndented:!0},null,8,["modelValue","isDisabled"]),i("h4",Z,u(n.$t("settings.data_input")),1),l(a,{modelValue:o(s).preferences.useBasicQrcodeReader,"onUpdate:modelValue":[e[34]||(e[34]=t=>o(s).preferences.useBasicQrcodeReader=t),e[35]||(e[35]=t=>r("useBasicQrcodeReader",t))],fieldName:"useBasicQrcodeReader",label:"settings.forms.use_basic_qrcode_reader.label",help:"settings.forms.use_basic_qrcode_reader.help"},null,8,["modelValue"]),l(a,{modelValue:o(s).preferences.useDirectCapture,"onUpdate:modelValue":[e[36]||(e[36]=t=>o(s).preferences.useDirectCapture=t),e[37]||(e[37]=t=>r("useDirectCapture",t))],fieldName:"useDirectCapture",label:"settings.forms.useDirectCapture.label",help:"settings.forms.useDirectCapture.help"},null,8,["modelValue"]),l(m,{modelValue:o(s).preferences.defaultCaptureMode,"onUpdate:modelValue":[e[38]||(e[38]=t=>o(s).preferences.defaultCaptureMode=t),e[39]||(e[39]=t=>r("defaultCaptureMode",t))],options:C,fieldName:"defaultCaptureMode",label:"settings.forms.defaultCaptureMode.label",help:"settings.forms.defaultCaptureMode.help"},null,8,["modelValue"])])])]),_:1})]),l(B,{showButtons:!0},{default:_(()=>[l(A,{returnTo:{name:o(y)},action:"close"},null,8,["returnTo"])]),_:1})])}}};export{oe as default};