"use strict";(self.webpackChunk_bitwarden_web_vault=self.webpackChunk_bitwarden_web_vault||[]).push([[825],{33825:(e,t,n)=>{n.r(t),n.d(t,{AcceptEmergencyComponent:()=>k});var i=n(80885),c=n(25065),s=n(9413),r=n(80755),a=n(3867),o=n(64195),u=n(86842),d=n(37115),l=n(50700),p=n(68455),m=n(5253),h=n(56898),y=n(58806),g=n(88016),f=function(e,t,n,i){return new(n||(n=Promise))((function(c,s){function r(e){try{o(i.next(e))}catch(t){s(t)}}function a(e){try{o(i.throw(e))}catch(t){s(t)}}function o(e){var t;e.done?c(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}o((i=i.apply(e,t||[])).next())}))};const v=e=>({email:e});function b(e,t){1&e&&(a.j41(0,"div",2)(1,"div")(2,"p",3),a.nrm(3,"i",4),a.nI1(4,"i18n"),a.j41(5,"span",5),a.EFF(6),a.nI1(7,"i18n"),a.k0s()()()()),2&e&&(a.R7$(3),a.FS9("title",a.bMT(4,2,"loading")),a.R7$(3),a.JRh(a.bMT(7,4,"loading")))}function w(e,t){if(1&e){const e=a.RV6();a.j41(0,"div")(1,"p",6),a.EFF(2),a.k0s(),a.j41(3,"p",7),a.EFF(4),a.nI1(5,"i18n"),a.k0s(),a.nrm(6,"hr"),a.j41(7,"div",8)(8,"a",9),a.EFF(9),a.nI1(10,"i18n"),a.k0s(),a.j41(11,"button",10),a.bIt("click",(function(){a.eBV(e);const t=a.XpG();return a.Njj(t.register())})),a.EFF(12),a.nI1(13,"i18n"),a.k0s()()()}if(2&e){const e=a.XpG();a.R7$(2),a.SpI(" ",e.name," "),a.R7$(2),a.JRh(a.bMT(5,7,"acceptEmergencyAccess")),a.R7$(4),a.Y8G("queryParams",a.eq3(13,v,e.email))("block",!0),a.R7$(),a.SpI(" ",a.bMT(10,9,"logIn")," "),a.R7$(2),a.Y8G("block",!0),a.R7$(),a.SpI(" ",a.bMT(13,11,"createAccount")," ")}}class k extends i.X{constructor(e,t,n,i,c,s){super(e,t,n,i,c),this.emergencyAccessService=s,this.requiredParameters=["id","name","email","token"],this.failedShortMessage="emergencyInviteAcceptFailedShort",this.failedMessage="emergencyInviteAcceptFailed"}authedHandler(e){return f(this,void 0,void 0,(function*(){this.actionPromise=this.emergencyAccessService.accept(e.id,e.token),yield this.actionPromise,this.platformUtilService.showToast("success",this.i18nService.t("inviteAccepted"),this.i18nService.t("emergencyInviteAcceptedDesc"),{timeout:1e4}),this.router.navigate(["/vault"])}))}unauthedHandler(e){return f(this,void 0,void 0,(function*(){this.name=e.name,null!=this.name&&(this.name=this.name.replace(/\+/g," ")),e.id&&(this.emergencyAccessId=e.id),e.token&&(this.acceptEmergencyAccessInviteToken=e.token)}))}register(){return f(this,void 0,void 0,(function*(){yield this.router.navigate(["/finish-signup"],{queryParams:{email:this.email,acceptEmergencyAccessInviteToken:this.acceptEmergencyAccessInviteToken,emergencyAccessId:this.emergencyAccessId}})}))}}k.ɵfac=function(e){return new(e||k)(a.rXU(o.Ix),a.rXU(d.y),a.rXU(l.W),a.rXU(o.nX),a.rXU(p.u),a.rXU(r.p))},k.ɵcmp=a.VBU({type:k,selectors:[["ng-component"]],features:[a.Vt3],decls:2,vars:2,consts:[["class","tw-mt-5 tw-flex tw-justify-center",4,"ngIf"],[4,"ngIf"],[1,"tw-mt-5","tw-flex","tw-justify-center"],[1,"tw-text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"],["bitTypography","body1",1,"tw-text-center"],["bitTypography","body1"],[1,"tw-flex","tw-gap-2"],["bitButton","","buttonType","primary","routerLink","/login",3,"queryParams","block"],["type","button","bitButton","","buttonType","primary",3,"click","block"]],template:function(e,t){1&e&&a.DNE(0,b,8,6,"div",0)(1,w,14,15,"div",1),2&e&&(a.Y8G("ngIf",t.loading),a.R7$(),a.Y8G("ngIf",!t.loading&&!t.authed))},dependencies:[c.G,m.bT,u.Wk,h.Q,y.r,g.$,s.S],encapsulation:2})}}]);
//# sourceMappingURL=825.8260e0a2f2631df03a70.js.map