2FAuth/public/build/assets/CreateUpdate-cda5c55e.js

2 lines
15 KiB
JavaScript
Raw Normal View History

2024-02-23 15:31:08 +01:00
import{Z as xe,r as f,e as h,f as a,g as u,h as s,i as e,n as $,V as X,k as E,p as v,D as L,m as r,U as H,l as c,F as Y,Q as Le,u as Me,_ as Se,a as Be,c as Ne,b as qe,d as W,v as Ue,o as Oe,K as T,P as fe,x as Z,G as pe,E as me,t as g,j as ve,w as he,I as x}from"./app-06176200.js";import{F as J}from"./Form-87bc0477.js";import{_ as _e}from"./OtpDisplay-6b6605f3.js";import{_ as Ae}from"./QrContentDisplay-f8870613.js";import{u as De}from"./bus-01c5df37.js";import"./Spinner-1a29b2e3.js";/*! 2FAuth version 5.0.4 - Copyright (c) 2023 Bubka - https://github.com/Bubka/2FAuth */const He={class:"field",style:{"margin-bottom":"0.5rem"}},Pe=["for","innerHTML"],Ke=["disabled","id","type","value","placeholder","maxlength"],Qe={key:0,class:"control"},je=["title"],ze={class:"icon"},Re={key:1,class:"control"},Ge=["title"],We={class:"icon has-text-danger"},Ze=["innerHTML"],ge=Object.assign({inheritAttrs:!1},{__name:"FormLockField",props:{modelValue:[String,Number,Boolean],isEditMode:{type:Boolean,default:!1},label:{type:String,default:""},fieldName:{type:String,default:"",required:!0},fieldError:[String],inputType:{type:String,default:"text"},placeholder:{type:String,default:""},help:{type:String,default:""},hasOffset:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!0},maxLength:{type:Number,default:null}},setup(d){const b=d,{inputId:q}=xe(b.inputType,b.fieldName),y=f(b.isDisabled||b.isEditMode);return(w,_)=>{const I=h("FontAwesomeIcon"),M=h("FieldError");return a(),u(Y,null,[s("div",He,[s("label",{for:e(q),class:"label",innerHTML:w.$t(d.label)},null,8,Pe)]),s("div",{class:$(["field has-addons",{"pt-3":d.hasOffset}])},[s("div",{class:$(["control",{"is-expanded":d.isExpanded}])},[s("input",X({disabled:e(y),id:e(q),type:d.inputType,class:"input",value:d.modelValue,placeholder:d.placeholder},w.$attrs,{onInput:_[0]||(_[0]=p=>w.$emit("update:modelValue",p.target.value)),maxlength:d.maxLength}),null,16,Ke)],2),d.isEditMode?(a(),E(e(H),{key:0},{default:v(({mode:p})=>[e(y)?(a(),u("div",Qe,[s("button",{type:"button",class:$(["button field-lock",{"is-dark":p=="dark"}]),onClick:_[1]||(_[1]=L(t=>y.value=!1,["stop"])),title:w.$t("twofaccounts.forms.unlock.title")},[s("span",ze,[r(I,{icon:["fas","lock"]})])],10,je)])):(a(),u("div",Re,[s("button",{type:"button",class:$(["button field-unlock",{"is-dark":p=="dark"}]),onClick:_[2]||(_[2]=L(t=>y.value=!0,["stop"])),title:w.$t("twofaccounts.forms.lock.title")},[s("span",We,[r(I,{icon:["fas","lock-open"]})])],10,Ge)]))]),_:1})):c("",!0)],2),d.fieldError!=null?(a(),E(M,{key:0,error:d.fieldError,field:d.fieldName},null,8,["error","field"])):c("",!0),d.help?(a(),u("p",{key:1,class:"help",innerHTML:w.$t(d.help)},null,8,Ze)):c("",!0)],64)}}}),Je=["onSubmit"],Xe={class:"container preview has-text-centered"},Ye={class:"columns is-mobile"},et={class:"column"},tt={key:1,class:"add-icon-button"},ot=["onClick"],lt={class:"columns is-mobile",role:"alert"},st={key:0,class:"column"},nt={class:"columns is-mobile"},at={class:"column quickform-footer"},rt={class:"field is-grouped is-grouped-centered"},it={class:"control"},ct=["onSubmit"],ut={key:0,class:"field is-grouped"},dt={class:"control"},ft=["title"],pt={class:"file-cta"},mt={class:"file-icon"},vt={class:"file-label"},ht={class:"label"},_t={class:"field is-grouped"},gt={key:0,class:"control"},yt={class:"icon is-small"},bt={class:"control is-flex"},wt={class:"file-cta"},kt={class:"file-icon"},Et={class:"file-label"},$t=["src","alt"],Vt=["onClick","aria-label"],Ft={class:"field"},It=["innerHTML"],Ct={key:2},Tt={key:0},xt={class:"title is-4 mt-5 mb-2"},Lt={class:"help mb-4"},Mt={class:"control"},St={key:0,class:"control"},Dt={__name:"CreateUpdate",props:{twofaccountId:[Number,String]},setup(d){const b=d,q=Le("2fauth"),y=Me(),w=Se(),_=Be(),I=Ne(),M=De(),p=qe(),t=W(new J({service:"",account:"",otp_type:"",icon:"",secret:"",algorithm:"",digits:null,counter:null,period:null,image:""})),U=W(new J({qrcode:null})),C=W(new J({icon:null})),ye=[{text:"TOTP",value:"totp"},{text:"HOTP",value:"hotp"},{text:"STEAM",value:"steamtotp"}],be