(()=>{"use strict";vare,o={85781:(e,o,n)=>{vars=n(32981),a=n(85471),c=n(56760),r=n(18740),d=n(84237),i=(n(51257),n(96763));constl={name:"PersonalSettings",components:{NcButton:r.A,NcLoadingIcon:d.A},data:()=>({generatingCodes:!1}),computed:{downloadUrl(){returnthis.codes?"data:text/plain,"+encodeURIComponent(this.codes.reduce(((t,e)=>t+e+"\r\n"),"")):""},downloadFilename:()=>(OC.theme.name||"Nextcloud")+"-backup-codes.txt",enabled(){returnthis.$store.state.enabled},total(){returnthis.$store.state.total},used(){returnthis.$store.state.used},codes(){returnthis.$store.state.codes},name:()=>OC.theme.name||"Nextcloud",haveCodes(){returnthis.codes&&this.codes.length>0}},methods:{generateBackupCodes(){(0,c.C)().then((()=>{this.generatingCodes=!0,this.$store.dispatch("generate").then((()=>{this.generatingCodes=!1})).catch((e=>{throwOC.Notification.showTemporary(t("twofactor_backupcodes","An error occurred while generating your backup codes")),this.generatingCodes=!1,e}))})).catch(i.error.bind(this))},getPrintData:t=>t?t.reduce(((t,e)=>t+e+"<br>"),""):"",printCodes(){!function(e){consto=OC.theme.name||"Nextcloud",n=window.open("",t("twofactor_backupcodes","{name} backup codes",{name:o}));n.document.write("<h1>"+t("twofactor_backupcodes","{name} backup codes",{name:o})+"</h1>"),n.document.write("<pre>"+e+"</pre>"),n.print(),n.close()}(this.getPrintData(this.codes))}}};varu=n(85072),p=n.n(u),b=n(97825),f=n.n(b),g=n(77659),h=n.n(g),_=n(55056),v=n.n(_),A=n(10540),m=n.n(A),k=n(41113),C=n.n(k),w=n(40097),y={};y.styleTagTransform=C(),y.setAttributes=v(),y.insert=h().bind(null,"head"),y.domAPI=f(),y.insertStyleElement=m(),p()(w.A,y),w.A&&w.A.locals&&w.A.locals;constx=(0,n(14486).A)(l,(function(){vart=this,e=t._self._c;returne("div",{staticClass:"backupcodes-settings"},[t.enabled?[e("p",{staticClass:"backupcodes-settings__codes"},[t.haveCodes?[t._v("\n\t\t\t\t"+t._s(t.t("twofactor_backupcodes","These are your backup codes. Please save and/or print them as you will not be able to read the codes again later."))+"\n\t\t\t\t"),e("ul",t._l(t.codes,(function(o){returne("li",{key:o,staticClass:"backupcodes-settings__codes__code"},[t._v("\n\t\t\t\t\t\t"+t._s(o)+"\n\t\t\t\t\t")])})),0)]:[t._v("\n\t\t\t\t"+t._s(t.t("twofactor_backupcodes","Backup codes have been generated. {used} of {total} codes have been used.",{used:t.used,total:t.total}))+"\n\t\t\t")]],2),t._v(" "),e("p",{staticClass:"backupcodes-settings__actions"},[t.haveCodes?[e("NcButton",{attrs:{href:t.downloadUrl,download:t.downloadFilename,type:"primary"}},[t._v("\n\t\t\t\t\t"+t._s(t.t("twofactor_backupcodes","Save backup codes"))+"\n\t\t\t\t")]),t._v(" "),e("NcButton",{on:{click:t.printCodes}},[t._v("\n\t\t\t\t\t"+t._s(t.t("twofactor_backupcodes","Print backup codes"))+"\n\t\t\t\t")])]:t._e(),t._v(" "),e("NcButton",{attrs:{id:"generate-backup-codes"},on:{click:t.generateBackupCodes}},[t._v("\n\t\t\t\t"+t._s(t.t("twofactor_backupcodes","Regenerate backup codes"))+"\n\t\t\t")])],2),t._v(" "),e("p",[e("em",[t._v("\n\t\t\t\t"+t._s(t.t("twofactor_backupcodes","If you regenerate backup codes, you automatically invalidate old codes."))+"\n\t\t\t")])])]:e("NcButton",{attrs:{id:"generate-backup-codes",disabled:t.generatingCodes},on:{click:t.generateBackupCodes},scopedSlots:t._u([{key:"icon",fn:function(){return[t.generatingCodes?e("NcLoadingIcon"):t._e()]},proxy:!0}],null,!1,4108280908)},[t._v("\n\t\t"+t._s(t.t("twofactor_backupcodes","Generate backup codes"))+"\n\t")])],2)}),[],!1,null,"70ee3f3c",null).exports;varO=n(95353),B=n(65043),P=n(63814);a.Ay.use(O.Ay);constN={setEnabled(t,e){a.Ay.set(t,"enabled",e)},setTotal(t,e){a.Ay.set(t,"total",e)},setUsed(t,e){a.Ay.set(t,"used",e)},setCodes(t,e){a.Ay.set(t,"codes",e)}},S={generate(t){let{commit:e}=t;returne("setEnabled",!1),function(){constt=(0,P.Jv)("/apps/twofactor_backupcodes/settings/create");returnB.Ay.post(t,{}).then((t=>t.data))}().then((t=>{let{codes:o,state:n}=t;returne("setEnabled",n.enabled),e("setTotal",n.total),e("setUsed",n.used),e("setCodes",o),!0}))}},T=newO.il({strict:!1,state:{enabled:!1,total:0,used:0,cod