2FAuth/public/build/assets/CreateUpdate-030b151d.js

2 lines
15 KiB
JavaScript
Raw Normal View History

2024-01-19 15:49:01 +01:00
import{Y as xe,r as f,e as h,f as a,g as u,h as s,i as e,n as $,T as Z,k as E,p as v,D as L,m as r,U as H,l as c,F as X,P as Le,u as Me,Z as Se,a as Be,c as Ne,b as qe,d as W,v as Oe,o as Ue,J as T,O as fe,x as J,G as pe,E as me,t as g,j as ve,w as he,I as x}from"./app-347ef106.js";import{F as Y}from"./Form-893a9a1a.js";import{_ as _e}from"./OtpDisplay-1a3c1737.js";import{_ as Ae}from"./QrContentDisplay-1d6d5b3f.js";import{u as De}from"./bus-2e7bf732.js";import"./Spinner-8bfb7257.js";/*! 2FAuth version 5.0.3 - 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"},Je=["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(X,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",Z({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,Je)):c("",!0)],64)}}}),Ye=["onSubmit"],Ze={class:"container preview has-text-centered"},Xe={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 Y({service:"",account:"",otp_type:"",icon:"",secret:"",algorithm:"",digits:null,counter:null,period:null,image:""})),O=W(new Y({qrcode:null})),C=W(new Y({icon:null})),ye=[{text:"TOTP",value:"totp"},{text:"HOTP",value:"hotp"},{text:"STEAM",value:"steamtotp"}],be