vaultwarden.db94.xyz Open in urlscan Pro
2606:4700:3031::6815:39e  Public Scan

Submitted URL: http://vaultwarden.db94.xyz/app/main.930ad6391bde0ab2fc73.js
Effective URL: https://vaultwarden.db94.xyz/app/main.930ad6391bde0ab2fc73.js
Submission: On August 13 via api from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

(()=>{var e,t,i,n,s,o={28753:(e,t,i)=>{"use strict";i.d(t,{x:()=>n});class n{constructor(){this.policies=[]}addPolicies(e){this.policies.push(...e)}getPolicies(){return this.policies}}},63078:(e,t,i)=>{"use strict";i.d(t,{KF:()=>d.K,WO:()=>s,lT:()=>y,Rq:()=>p,My:()=>w,Qg:()=>_,XD:()=>x});var n=i(85762);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=n.oAB({type:s}),s.ɵinj=n.cJS({});var o=i(3289),r=i(42844),a=i(88652),l=i(58043);class c extends l.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.name=this.getResponseProperty("Name"),this.accessAll=this.getResponseProperty("AccessAll"),this.externalId=this.getResponseProperty("ExternalId")}}class u extends c{constructor(e){super(e),this.collections=[];const t=this.getResponseProperty("Collections");null!=t&&(this.collections=t.map((e=>new a.Y(e))))}}var d=i(50342);class p{constructor(){this.collections=[],this.members=[]}static fromResponse(e){const t=Object.assign(new p,e);return e instanceof u&&null!=e.collections&&(t.collections=e.collections.map((e=>new d.K(e)))),t}}class h{constructor(){this.collections=[],this.users=[]}}class g{constructor(e){this.ids=null==e?[]:e}}var f=i(55602),m=i(65254),v=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class y{constructor(e,t){this.apiService=e,this.configService=t}get(e,t){return v(this,void 0,void 0,(function*(){const i=yield this.apiService.send("GET","/organizations/"+e+"/groups/"+t+"/details",null,!0,!0);return p.fromResponse(new u(i))}))}getAll(e){var t,i;return v(this,void 0,void 0,(function*(){const n=yield this.apiService.send("GET","/organizations/"+e+"/groups",null,!0,!0),s=new r.L(n,u);return null!==(i=Promise.all(null===(t=s.data)||void 0===t?void 0:t.map((e=>p.fromResponse(e)))))&&void 0!==i?i:[]}))}}y.ɵfac=function(e){return new(e||y)(n.LFG(f.s),n.LFG(m.E))},y.ɵprov=n.Yz7({token:y,factory:y.ɵfac,providedIn:"root"});class w extends y{constructor(e,t){super(e,t),this.apiService=e,this.configService=t}delete(e,t){return v(this,void 0,void 0,(function*(){yield this.apiService.send("DELETE","/organizations/"+e+"/groups/"+t,null,!0,!1)}))}deleteMany(e,t){return v(this,void 0,void 0,(function*(){yield this.apiService.send("DELETE","/organizations/"+e+"/groups",new g(t),!0,!0)}))}save(e){return v(this,void 0,void 0,(function*(){const t=new h;return t.name=e.name,t.accessAll=e.accessAll,t.users=e.members,t.collections=e.collections.map((e=>new o.d(e.id,e.readOnly,e.hidePasswords,e.manage))),null==e.id?yield this.postGroup(e.organizationId,t):yield this.putGroup(e.organizationId,e.id,t)}))}postGroup(e,t){return v(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/groups",t,!0,!0);return p.fromResponse(new c(i))}))}putGroup(e,t,i){return v(this,void 0,void 0,(function*(){const n=yield this.apiService.send("PUT","/organizations/"+e+"/groups/"+t,i,!0,!0);return p.fromResponse(new c(n))}))}}w.ɵfac=function(e){return new(e||w)(n.LFG(f.s),n.LFG(m.E))},w.ɵprov=n.Yz7({token:w,factory:w.ɵfac,providedIn:s});class b{constructor(){this.collections=[],this.groups=[]}}class U{constructor(){this.emails=[],this.collections=[]}}class _{constructor(){this.collections=[],this.groups=[]}}var A=i(47244),Z=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class x{constructor(e,t){this.configService=e,this.organizationUserService=t}get(e,t){return Z(this,void 0,void 0,(function*(){const i=yield this.organizationUserService.getOrganizationUser(e,t,{includeGroups:!0});if(null==i)return;const[n]=yield this.decryptMany(e,[i]);return n}))}save(e){return Z(this,void 0,void 0,(function*(){const t=new b;t.accessAll=e.accessAll,t.permissions=e.permissions,t.type=e.type,t.collections=e.collections,t.groups=e.groups,t.accessSecretsManager=e.accessSecretsManager,yield this.organizationUserService.putOrganizationUser(e.organizationId,e.id,t)}))}invite(e,t){return Z(this,void 0,void 0,(function*(){const i=new U;i.emails=e,i.accessAll=t.accessAll,i.permissions=t.permissions,i.type=t.type,i.collections=t.collections,i.groups=t.groups,i.accessSecretsManager=t.accessSecretsManager,yield this.organizationUserService.postOrganizationUserInvite(t.organizationId,i)}))}decryptMany(e,t){return Z(this,void 0,void 0,(function*(){const i=t.map((t=>Z(this,void 0,void 0,(function*(){const i=new _;return i.id=t.id,i.organizationId=e,i.userId=t.userId,i.type=t.type,i.status=t.status,i.externalId=t.externalId,i.accessAll=t.accessAll,i.permissions=t.permissions,i.resetPasswordEnrolled=t.resetPasswordEnrolled,i.collections=t.collections.map((e=>({id:e.id,hidePasswords:e.hidePasswords,readOnly:e.readOnly,manage:e.manage}))),i.groups=t.groups,i.accessSecretsManager=t.accessSecretsManager,i.hasMasterPassword=t.hasMasterPassword,i}))));return yield Promise.all(i)}))}}x.ɵfac=function(e){return new(e||x)(n.LFG(m.E),n.LFG(A.t))},x.ɵprov=n.Yz7({token:x,factory:x.ɵfac,providedIn:s})},50342:(e,t,i)=>{"use strict";i.d(t,{K:()=>s});class n{}class s extends n{constructor(e){super(),e&&(this.id=e.id,this.readOnly=e.readOnly,this.hidePasswords=e.hidePasswords,this.manage=e.manage)}}},96085:(e,t,i)=>{"use strict";i.d(t,{f:()=>ve});var n=i(28508),s=i(8111),o=i(54019),r=i(68362),a=i(92786),l=i(86742),c=i(5344),u=i(58691),d=i(92614),p=i(59281),h=i(33760),g=i(5261),f=i(38261),m=i(49781),v=i(48641),y=i(85762),w=i(33031),b=i(33245),U=i(82933);class _{}_.ɵfac=function(e){return new(e||_)},_.ɵcmp=y.Xpm({type:_,selectors:[["bit-nav-divider"]],decls:2,vars:0,consts:[[1,"tw-h-px","tw-w-full","tw-bg-secondary-300"]],template:function(e,t){1&e&&(y._UZ(0,"div",0),y._uU(1,"\n"))},encapsulation:2});var A=i(11169),Z=i(59880);function x(e,t){1&e&&(y._UZ(0,"i",5),y.ALo(1,"i18n"),y.ALo(2,"i18n")),2&e&&(y.s9C("appA11yTitle",y.lcZ(2,4,"organizationIsDisabled")),y.uIk("aria-label",y.lcZ(1,2,"organizationIsDisabled")))}function S(e,t){1&e&&(y._UZ(0,"i",9),y.ALo(1,"i18n"),y.ALo(2,"i18n")),2&e&&(y.s9C("appA11yTitle",y.lcZ(2,4,"organizationIsDisabled")),y.uIk("aria-label",y.lcZ(1,2,"organizationIsDisabled")))}const T=function(e,t){return[e,t]},C=function(e){return["../",e]},O=function(){return{exact:!0}};function k(e,t){if(1&e){const e=y.EpF();y.TgZ(0,"bit-nav-item",7),y.NdJ("mainContentClicked",(function(){y.CHM(e);const t=y.oxw(3);return y.KtG(t.toggle())})),y.ALo(1,"i18n"),y._uU(2,"\n      "),y.YNc(3,S,3,6,"i",8),y._uU(4,"\n    "),y.qZA()}if(2&e){const e=t.$implicit;y.Q6J("text",e.name)("ariaLabel",y.WLB(7,T,y.lcZ(1,5,"organization"),e.name).join(" "))("route",y.VKq(10,C,e.id))("routerLinkActiveOptions",y.DdM(12,O)),y.xp6(3),y.Q6J("ngIf",0==e.enabled)}}function P(e,t){if(1&e&&(y.ynx(0),y._uU(1,"\n    "),y.YNc(2,k,5,13,"bit-nav-item",6),y._uU(3,"\n  "),y.BQk()),2&e){const e=t.ngIf;y.xp6(2),y.Q6J("ngForOf",e)}}function q(e,t){1&e&&(y._UZ(0,"bit-nav-item",10),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"newOrganization"))}function I(e,t){if(1&e){const e=y.EpF();y.TgZ(0,"bit-nav-group",1),y.NdJ("openChange",(function(t){y.CHM(e);const i=y.oxw();return y.KtG(i.open=t)})),y.ALo(1,"i18n"),y._uU(2,"\n  "),y.YNc(3,x,3,6,"i",2),y._uU(4,"\n  "),y.YNc(5,P,4,1,"ng-container",3),y.ALo(6,"async"),y._uU(7,"\n  "),y.YNc(8,q,2,3,"bit-nav-item",4),y._uU(9,"\n  "),y._UZ(10,"bit-nav-divider"),y._uU(11,"\n"),y.qZA()}if(2&e){const e=t.ngIf,i=y.oxw();y.Q6J("text",e.name)("ariaLabel",y.WLB(12,T,y.lcZ(1,8,"organization"),e.name).join(" "))("route",y.VKq(15,C,e.id))("routerLinkActiveOptions",y.DdM(17,O))("open",i.open),y.xp6(3),y.Q6J("ngIf",!e.enabled),y.xp6(2),y.Q6J("ngIf",y.lcZ(6,10,i.organizations$)),y.xp6(3),y.Q6J("ngIf",!i.hideNewButton)}}class M{constructor(e,t){this.route=e,this.organizationService=t,this.organizations$=this.organizationService.organizations$.pipe((0,a.U)((e=>e.filter((e=>this.filter(e))).sort(((e,t)=>e.name.localeCompare(t.name)))))),this.activeOrganization$=(0,w.a)([this.route.paramMap,this.organizations$]).pipe((0,a.U)((([e,t])=>t.find((t=>t.id===e.get("organizationId")))))),this.filter=()=>!0,this.open=!1,this.openChange=new y.vpe,this.hideNewButton=!1}toggle(e){null==e||e.stopPropagation(),this.open=!this.open,this.openChange.emit(this.open)}}M.ɵfac=function(e){return new(e||M)(y.Y36(s.gz),y.Y36(u.Mn))},M.ɵcmp=y.Xpm({type:M,selectors:[["org-switcher"]],inputs:{filter:"filter",open:"open",hideNewButton:"hideNewButton"},outputs:{openChange:"openChange"},standalone:!0,features:[y.jDz],decls:3,vars:3,consts:[["icon","bwi-business",3,"text","ariaLabel","route","routerLinkActiveOptions","open","openChange",4,"ngIf"],["icon","bwi-business",3,"text","ariaLabel","route","routerLinkActiveOptions","open","openChange"],["slot","end","class","bwi bwi-exclamation-triangle tw-my-auto !text-alt-2",3,"appA11yTitle",4,"ngIf"],[4,"ngIf"],["icon","bwi-plus","route","/create-organization",3,"text",4,"ngIf"],["slot","end",1,"bwi","bwi-exclamation-triangle","tw-my-auto","!text-alt-2",3,"appA11yTitle"],[3,"text","ariaLabel","route","routerLinkActiveOptions","mainContentClicked",4,"ngFor","ngForOf"],[3,"text","ariaLabel","route","routerLinkActiveOptions","mainContentClicked"],["slot","end","class","bwi bwi-exclamation-triangle !text-alt-2",3,"appA11yTitle",4,"ngIf"],["slot","end",1,"bwi","bwi-exclamation-triangle","!text-alt-2",3,"appA11yTitle"],["icon","bwi-plus","route","/create-organization",3,"text"]],template:function(e,t){1&e&&(y.YNc(0,I,12,18,"bit-nav-group",0),y.ALo(1,"async"),y._uU(2,"\n")),2&e&&y.Q6J("ngIf",y.lcZ(1,1,t.activeOrganization$))},dependencies:[n.ez,n.sg,n.O5,n.Ov,c.b,b.B,U.C,f.A,_,A.W,Z.H],encapsulation:2});var N=i(53423);const L=i(66997).W4`
<svg version="1.1" viewBox="0 0 800 200" xmlns="http://www.w3.org/2000/svg">
 <path class="tw-fill-text-alt2" d="m457.16 129.39-11.407-36.49q-1.0783-3.3482-4.0292-15.209h-.454q-2.27 9.9313-3.9725 15.322l-11.747 36.377h-10.896l-16.968-62.197h9.8744q6.0158 23.438 9.137 35.696 3.178 12.258 3.632 16.514h.454q.62424-3.2347 1.9863-8.342 1.4188-5.1642 2.4402-8.1717l11.407-35.696h10.215l11.123 35.696q3.178 9.7611 4.313 16.401h.454q.227-2.043 1.1918-6.2993 1.0215-4.2562 11.861-45.797h9.7611l-17.195 62.197zm77.858 0-1.8727-8.8528h-.454q-4.6535 5.8455-9.3072 7.9451-4.5968 2.043-11.52 2.043-9.2503 0-14.528-4.767-5.221-4.767-5.221-13.563 0-18.841 30.134-19.749l10.555-.3405v-3.859q0-7.3209-3.178-10.783-3.1212-3.5185-10.045-3.5185-7.7748 0-17.592 4.767l-2.8943-7.207q4.5968-2.497 10.045-3.9158 5.5048-1.4187 11.009-1.4187 11.123 0 16.457 4.9373 5.3912 4.9373 5.3912 15.833v42.449zm-21.281-6.6399q8.7964 0 13.79-4.8238 5.0508-4.8238 5.0508-13.506v-5.6183l-9.4205.39725q-11.237.39725-16.231 3.5185-4.9372 3.0645-4.9372 9.5908 0 5.1075 3.0645 7.7748 3.1212 2.6672 8.6825 2.6672zm76.045-56.693q4.1428 0 7.4343.68101l-1.3053 8.7395q-3.859-.85122-6.8101-.85122-7.5476 0-12.939 6.1291-5.3345 6.1291-5.3345 15.266v33.369h-9.4205v-62.197h7.7748l1.0783 11.52h.454q3.4617-6.0721 8.3425-9.3636 4.8805-3.2915 10.726-3.2915zm59.077 54.991h-.51081q-6.526 9.4775-19.522 9.4775-12.201 0-19.011-8.342-6.7532-8.342-6.7532-23.721t6.8102-23.892q6.8101-8.5122 18.954-8.5122 12.655 0 19.408 9.1933h.73779l-.39725-4.4832-.22704-4.3697v-25.311h9.4205v88.301h-7.6615zm-18.841 1.589q9.6478 0 13.96-5.221 4.3697-5.2777 4.3697-16.968v-1.9863q0-13.223-4.4264-18.841-4.3698-5.675-14.017-5.675-8.2856 0-12.712 6.4696-4.3698 6.4127-4.3698 18.16 0 11.918 4.3698 17.99 4.3697 6.0721 12.825 6.0721zm74 7.8881q-13.79 0-21.792-8.3989-7.9451-8.3989-7.9451-23.324 0-15.039 7.3773-23.892 7.4343-8.8528 19.919-8.8528 11.69 0 18.501 7.7179 6.8101 7.6615 6.8101 20.26v5.9588h-42.846q.28376 10.953 5.5048 16.628 5.2777 5.675 14.812 5.675 10.045 0 19.863-4.1995v8.3989q-4.994 2.1565-9.4775 3.0645-4.4265.96478-10.726.96478zm-2.5537-56.58q-7.4912 0-11.975 4.8805-4.4265 4.8805-5.221 13.506h32.518q0-8.9097-3.9725-13.62-3.9725-4.767-11.35-4.767zm84.047 55.445v-40.236q0-7.6045-3.4617-11.35-3.4618-3.7455-10.839-3.7455-9.7611 0-14.301 5.2777t-4.54 17.422v32.631h-9.4205v-62.197h7.6615l1.5322 8.5122h.45403q2.8942-4.5968 8.1153-7.0937 5.221-2.5537 11.634-2.5537 11.237 0 16.912 5.448 5.675 5.3912 5.675 17.309v40.576z"/>
 <path class="tw-fill-text-alt2" d="m213.24 129.39-3.3482-8.6261h-.454q-4.3697 5.5048-9.023 7.6615-4.5968 2.0998-12.031 2.0998-9.137 0-14.415-5.221-5.221-5.221-5.221-14.869 0-10.102 7.0368-14.869 7.0937-4.8238 21.338-5.3345l11.009-.3405v-2.7808q0-9.6478-9.8744-9.6478-7.6045 0-17.876 4.5968l-5.7318-11.69q10.953-5.7318 24.289-5.7318 12.769 0 19.579 5.5615 6.8102 5.5615 6.8102 16.912v42.279zm-5.1075-29.397-6.6962.227q-7.5476.227-11.237 2.724-3.6888 2.497-3.6888 7.6045 0 7.321 8.3989 7.321 6.0158 0 9.5908-3.4617 3.632-3.4617 3.632-9.1933zm79.962 29.397-2.3268-8.1153h-.908q-2.7808 4.4265-7.8881 6.8665-5.1075 2.3835-11.634 2.3835-11.18 0-16.855-5.9588-5.675-6.0158-5.675-17.252v-41.371h17.309v37.058q0 6.8665 2.4402 10.328 2.4402 3.405 7.7748 3.405 7.264 0 10.499-4.8238 3.2348-4.8805 3.2348-16.117v-29.85h17.309v63.447zm48.748 0h-17.309v-88.301h17.309zm44.889-12.655q4.54 0 10.896-1.9863v12.882q-6.4696 2.8943-15.89 2.8943-10.385 0-15.152-5.221-4.7103-5.2777-4.7103-15.776v-30.588h-8.2856v-7.321l9.5338-5.7885 4.994-13.393h11.066v13.506h17.763v12.996h-17.763v30.588q0 3.6887 2.043 5.448 2.0998 1.7592 5.5047 1.7592z"/>
 <path class="tw-fill-text-alt2" d="m51.982 33.947-15.322.002 41.131 115.17h14.518l41.131-115.17h-15.162l-25.971 73.872c-1.7205 4.7315-3.1706 9.1927-4.3535 13.387-1.1829 4.086-2.1516 8.0119-2.9043 11.775-.75272-3.7636-1.7195-7.7417-2.9023-11.936-1.1829-4.1938-2.635-8.7098-4.3555-13.549l-25.809-73.552z"/>
 <path class="tw-fill-text-alt2" d="m84.264 5.0749a2.3288 2.3288 0 00-1.2122.99654l-4.145 6.9077c-.72599.06029-1.4502.12529-2.1701.20657l-5.406-5.9599a2.3288 2.3288 0 00-3.9203.77975l-2.7161 7.5796c-.7008.20184-1.4008.40458-2.0929.62653l-6.4616-4.7875a2.3288 2.3288 0 00-3.691 1.53l-1.1884 7.9871c-.63834.33084-1.2749.66363-1.9023 1.0124l-7.297-3.4482a2.3288 2.3288 0 00-3.3222 2.2201l.39272 8.0937c-.55229.44111-1.0997.8874-1.639 1.3438l-7.8588-1.9647a2.3288 2.3288 0 00-2.825 2.825l1.9647 7.8588c-.45646.53923-.90273 1.0867-1.3439 1.639l-8.0937-.39271a2.3288 2.3288 0 00-2.2201 3.3222l3.4482 7.297c-.3488.62737-.68158 1.2639-1.0124 1.9023l-7.9871 1.1884a2.3288 2.3288 0 00-1.53 3.6911l4.7875 6.4616c-.22196.69217-.4247 1.3921-.62653 2.093l-7.5796 2.7161a2.3288 2.3288 0 00-.77976 3.9203l5.9599 5.4061c-.08128.71995-.14628 1.4442-.20657 2.1701l-6.9077 4.1451a2.3288 2.3288 0 000 3.9952l6.9077 4.1439c.06028.72636.12524 1.451.20657 2.1713l-5.9599 5.4061a2.3288 2.3288 0 00.77976 3.9192l7.5796 2.7161c.20188.70099.4045 1.4017.62653 2.0941l-4.7875 6.4605a2.3288 2.3288 0 001.53 3.6922l7.9871 1.1884c.33079.63822.6637 1.275 1.0124 1.9023l-3.4482 7.297a2.3288 2.3288 0 002.2201 3.3222l8.0937-.39272c.44117.55235.88734 1.0997 1.3439 1.639l-1.9647 7.8588a2.3288 2.3288 0 002.825 2.825l7.8588-1.9647c.53923.45647 1.0867.90273 1.639 1.3438l-.39272 8.0926a2.3288 2.3288 0 003.3222 2.2201l7.297-3.447c.62736.34881 1.2639.68158 1.9023 1.0124l1.1884 7.987a2.3288 2.3288 0 003.691 1.5289l6.4616-4.7864c.69217.22197 1.3921.4247 2.0929.62654l2.7161 7.5796a2.3288 2.3288 0 003.9203.7786l5.4049-5.9588c.72031.0813 1.4449.14624 2.1713.20656l4.145 6.9077a2.3288 2.3288 0 003.9952 0l4.1439-6.9077c.72674-.0603 1.4517-.12518 2.1724-.20656l5.4049 5.9588a2.3288 2.3288 0 003.9192-.7786l2.7161-7.5796c.70103-.20189 1.4017-.4045 2.0941-.62654l6.4605 4.7864a2.3288 2.3288 0 003.6922-1.5289l1.1884-7.987c.63823-.33079 1.275-.6637 1.9023-1.0124l7.297 3.447a2.3288 2.3288 0 003.3222-2.2201l-.39271-8.0926c.55234-.44117 1.0997-.88734 1.639-1.3438l7.8588 1.9647a2.3288 2.3288 0 002.825-2.825l-1.9647-7.8588c.4565-.53928.90269-1.0866 1.3438-1.639l8.0926.39272a2.3288 2.3288 0 002.2201-3.3222l-3.447-7.297c.34872-.62723.68163-1.264 1.0124-1.9023l7.987-1.1884a2.3288 2.3288 0 001.5289-3.6922l-4.7863-6.4605c.22202-.69235.42462-1.3931.62652-2.0941l7.5796-2.7161a2.3288 2.3288 0 00.77862-3.9192l-5.9588-5.4049c.0814-.72069.14623-1.4457.20658-2.1724l6.9077-4.1439a2.3288 2.3288 0 000-3.9952l-6.9077-4.1451c-.0603-.72635-.12524-1.451-.20658-2.1713l5.9588-5.4049a2.3288 2.3288 0 00-.77862-3.9203l-7.5796-2.7161c-.20184-.70082-.40457-1.4008-.62652-2.093l4.7863-6.4616a2.3288 2.3288 0 00-1.5289-3.6911l-7.987-1.1884c-.33084-.63836-.66362-1.2749-1.0124-1.9023l3.447-7.297a2.3288 2.3288 0 00-2.2201-3.3222l-8.0926.39271c-.44112-.55229-.8874-1.0997-1.3438-1.639l1.9647-7.8588a2.3288 2.3288 0 00-2.825-2.825l-7.8588 1.9647c-.53927-.4565-1.0866-.9027-1.639-1.3438l.39271-8.0937a2.3288 2.3288 0 00-3.3222-2.2201l-7.297 3.4482c-.62726-.34873-1.264-.68165-1.9023-1.0124l-1.1884-7.9871a2.3288 2.3288 0 00-3.6922-1.53l-6.4605 4.7875c-.69236-.22201-1.3931-.42463-2.0941-.62653l-2.7161-7.5796a2.3288 2.3288 0 00-3.9192-.77975l-5.406 5.9599c-.72032-.08133-1.4449-.14626-2.1713-.20657l-4.1439-6.9077a2.3288 2.3288 0 00-2.783-.99654zm.78543 14.613a4.657 4.657 0 014.6569 4.6569 4.657 4.657 0 01-4.6569 4.6569 4.657 4.657 0 01-4.6569-4.6569 4.657 4.657 0 014.6569-4.6569zm-10.998 8.0064 7.7056 7.7056a4.6575 4.6575 0 006.5853 0l7.7056-7.7056c17.959 3.3214 33.023 14.65 41.468 30.141l-4.943 9.6998a4.6575 4.6575 0 002.0351 6.263l9.7123 4.9486c.32157 2.5182.49487 5.0839.49487 7.692 0 15.934-6.1974 30.369-16.306 41.066l-10.796-1.7093a4.6575 4.6575 0 00-5.3277 3.8704l-1.7116 10.804c-7.7603 3.6739-16.443 5.734-25.624 5.734-9.1812 0-17.864-2.0608-25.625-5.7352l-1.7116-10.803a4.6575 4.6575 0 00-5.3277-3.8715l-10.795 1.7105c-10.108-10.697-16.306-25.132-16.306-41.066 0-2.608.1733-5.1738.49487-7.692l9.7111-4.9486a4.6575 4.6575 0 002.0351-6.263l-4.9418-9.6986c8.4449-15.492 23.508-26.821 41.468-30.142zm-47.923 34.902a4.657 4.657 0 011.3064.22587 4.657 4.657 0 012.9896 5.868 4.657 4.657 0 01-5.868 2.9907 4.657 4.657 0 01-2.9907-5.8691 4.657 4.657 0 014.5627-3.2155zm117.84 0a4.657 4.657 0 014.5616 3.2155 4.657 4.657 0 01-2.9896 5.8691 4.657 4.657 0 01-5.868-2.9907 4.657 4.657 0 012.9896-5.868 4.657 4.657 0 011.3064-.22587zm-95.153 69.428a4.657 4.657 0 012.4709.88189 4.657 4.657 0 011.0306 6.5047 4.657 4.657 0 01-6.5047 1.0306 4.657 4.657 0 01-1.0306-6.5047 4.657 4.657 0 014.0338-1.9125zm72.463 0a4.657 4.657 0 014.0338 1.9125 4.657 4.657 0 01-1.0306 6.5047 4.657 4.657 0 01-6.5047-1.0306 4.657 4.657 0 011.0306-6.5047 4.657 4.657 0 012.4709-.88189z"/>
 <path class="tw-fill-text-alt2" d="m406.1 185.44-4.8026-12.342h-15.803l-4.7468 12.342h-5.0817l15.58-40.04h4.5232l15.524 40.04zm-10.778-28.871q-.16753-.44674-.55844-1.6194-.3909-1.1727-.7818-2.4012-.33505-1.2844-.55843-1.9545-.39091 1.7312-.89345 3.4064-.50261 1.6194-.83768 2.5687l-4.5233 12.062h12.62zm31.384 29.429q-5.5844 0-8.9346-3.8532-3.3506-3.9091-3.3506-11.615t3.3506-11.615q3.4064-3.9649 8.9905-3.9649 3.4623 0 5.6402 1.2844 2.2338 1.2844 3.6298 3.1271h.33506q-.0559-.72595-.22337-2.122-.11169-1.4518-.11169-2.2895v-11.951h4.9142v42.441h-3.9649l-.72593-4.0207h-.22339q-1.3403 1.8987-3.574 3.2389-2.2338 1.3402-5.7519 1.3402zm.7818-4.0765q4.7468 0 6.6452-2.5687 1.9545-2.6246 1.9545-7.8738v-.89347q0-5.5844-1.8428-8.544-1.8428-3.0155-6.8127-3.0155-3.9649 0-5.975 3.1831-1.9545 3.1272-1.9545 8.4322 0 5.3609 1.9545 8.3206 2.0103 2.9597 6.0309 2.9597zm55.788-26.972q5.0817 0 7.5946 2.6246 2.5129 2.5687 2.5129 8.3764v19.489h-4.8584v-19.266q0-7.092-6.0867-7.092-4.3558 0-6.2542 2.5129-1.8428 2.5129-1.8428 7.3154v16.529h-4.8584v-19.266q0-7.092-6.1426-7.092-4.5232 0-6.2542 2.7922-1.7312 2.7922-1.7312 8.0414v15.524h-4.9142v-29.933h3.9649l.72595 4.0766h.27922q1.3961-2.3454 3.7416-3.4623 2.4012-1.1727 5.0817-1.1727 7.0362 0 9.1582 5.0258h.27921q1.5078-2.5687 4.0766-3.7974 2.6246-1.2286 5.5284-1.2286zm21.891-10.666q1.1169 0 1.9545.78178.89355.72598.89355 2.3454 0 1.5636-.89355 2.3454-.83765.78179-1.9545.78179-1.2286 0-2.0662-.78179-.83766-.7818-.83766-2.3454 0-1.6194.83766-2.3454.83763-.78178 2.0662-.78178zm2.4012 11.225v29.933h-4.9141v-29.933zm23.901-.55843q5.3609 0 8.0972 2.6246 2.7363 2.5687 2.7363 8.3765v19.489h-4.8584v-19.154q0-7.2037-6.701-7.2037-4.97 0-6.8686 2.7922-1.8987 2.7922-1.8987 8.0414v15.524h-4.9142v-29.933h3.9649l.72596 4.0766h.27921q1.4519-2.3454 4.0207-3.4623 2.5687-1.1727 5.4167-1.1727zm52.381-5.5285q-6.4218 0-10.108 4.3-3.6857 4.3-3.6857 11.783 0 7.4271 3.4064 11.783 3.4623 4.3 10.331 4.3 2.6246 0 4.97-.44675 2.3454-.44675 4.5792-1.1169v4.3558q-2.2337.83766-4.635 1.2286-2.3454.3909-5.6402.3909-6.0867 0-10.163-2.5129-4.0768-2.5129-6.1426-7.1479-2.0103-4.635-2.0103-10.889 0-6.0309 2.1778-10.61 2.2337-4.6351 6.5335-7.2037 4.3-2.6246 10.443-2.6246 6.3101 0 11.001 2.3454l-2.0103 4.2441q-1.8428-.83766-4.1325-1.5078-2.2337-.67011-4.9141-.67011zm43.558 20.997q0 7.4271-3.7974 11.503-3.7416 4.0765-10.163 4.0765-3.9649 0-7.092-1.787-3.0713-1.8428-4.8584-5.3051-1.787-3.5181-1.787-8.4881 0-7.4271 3.7416-11.448 3.7416-4.0207 10.163-4.0207 4.0765 0 7.1479 1.8428 3.1271 1.787 4.8584 5.2492 1.787 3.4064 1.787 8.3764zm-22.617 0q0 5.3051 2.0662 8.4322 2.122 3.0714 6.701 3.0714 4.5233 0 6.6452-3.0714 2.122-3.1271 2.122-8.4322t-2.122-8.3206q-2.122-3.0155-6.701-3.0155-4.5792 0-6.6452 3.0155-2.0662 3.0155-2.0662 8.3206zm44.786-15.468q5.361 0 8.0973 2.6246 2.7363 2.5687 2.7363 8.3765v19.489h-4.8584v-19.154q0-7.2037-6.701-7.2037-4.97 0-6.8685 2.7922-1.8987 2.7922-1.8987 8.0414v15.524h-4.9142v-29.933h3.9649l.72597 4.0765h.2792q1.4519-2.3454 4.0207-3.4623 2.5687-1.1727 5.4168-1.1727zm39.593 22.225q0 4.3558-3.2389 6.5894-3.2389 2.2338-8.7119 2.2338-3.1271 0-5.4168-.5026-2.2338-.50258-3.9649-1.396v-4.4675q1.787.89346 4.3 1.6753 2.5687.72594 5.1934.72594 3.7416 0 5.4168-1.1727 1.6752-1.2286 1.6752-3.2389 0-1.1169-.61424-2.0103-.61426-.89347-2.2337-1.787-1.5636-.89346-4.5233-2.0103-2.9039-1.1169-4.97-2.2337-2.0662-1.1169-3.1831-2.6805-1.1169-1.5636-1.1169-4.0208 0-3.7974 3.0714-5.8635 3.1272-2.0662 8.153-2.0662 2.7363 0 5.0818.55842 2.4012.50259 4.4675 1.4519l-1.6752 3.9091q-1.8987-.78179-3.9649-1.3403-2.0662-.55842-4.2441-.55842-3.0155 0-4.6351 1.0052-1.5636.94937-1.5636 2.6246 0 1.2286.72596 2.122.72595.83764 2.4012 1.6753 1.7311.78179 4.5792 1.8987 2.848 1.061 4.8584 2.1779 2.0104 1.1169 3.0713 2.7363 1.0611 1.5636 1.0611 3.9649zm33.283-6.7569q0 7.4271-3.7974 11.503-3.7416 4.0766-10.163 4.0766-3.9649 0-7.092-1.787-3.0714-1.8428-4.8583-5.3051-1.787-3.5181-1.787-8.4881 0-7.4271 3.7416-11.448 3.7416-4.0207 10.163-4.0207 4.0766 0 7.1479 1.8428 3.1271 1.787 4.8584 5.2492 1.787 3.4064 1.787 8.3764zm-22.617 0q0 5.3051 2.0662 8.4322 2.122 3.0714 6.701 3.0714 4.5233 0 6.6452-3.0714 2.122-3.1271 2.122-8.4322 0-5.3051-2.122-8.3206-2.122-3.0155-6.701-3.0155t-6.6452 3.0155q-2.0662 3.0155-2.0662 8.3206zm35.293 15.022h-4.9142v-42.441h4.9142zm21.053-30.491q3.8532 0 6.5894 1.6753 2.7922 1.6754 4.2441 4.7468 1.5078 3.0155 1.5078 7.092v2.9597h-20.494q.11169 5.0818 2.5687 7.7621 2.5129 2.6246 6.9803 2.6246 2.848 0 5.0259-.50258 2.2337-.55844 4.5792-1.5636v4.3q-2.2895 1.0052-4.5233 1.4519-2.2337.5026-5.3051.5026-4.2441 0-7.5388-1.7312-3.2389-1.7312-5.0817-5.1376-1.787-3.4623-1.787-8.4322 0-4.9142 1.6194-8.4322 1.6754-3.5181 4.635-5.4168 3.0155-1.8986 6.9803-1.8986zm-.0559 4.0207q-3.5181 0-5.5844 2.2895-2.0103 2.2337-2.4012 6.2543h15.245q-.0559-3.7974-1.787-6.1426-1.7311-2.4012-5.4726-2.4012z" stroke-width=".93783"/>
</svg>
`;var D=i(99721),E=i(65254),F=i(83924),R=i(22221),J=i(40041),z=i(28004),Y=i(12492),K=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const B=function(e){return["/organizations",e,"billing","payment-method"]};function Q(e,t){if(1&e){const e=y.EpF();y.ynx(0),y._uU(1,"\n  "),y.TgZ(2,"bit-banner",1),y.NdJ("onClose",(function(){const t=y.CHM(e).$implicit,i=y.oxw();return y.KtG(i.closeWarning(t.organizationId))})),y._uU(3),y.ALo(4,"i18n"),y.TgZ(5,"a",2),y._uU(6),y.ALo(7,"i18n"),y.qZA(),y._uU(8,".\n  "),y.qZA(),y._uU(9,"\n"),y.BQk()}if(2&e){const e=t.$implicit;y.xp6(3),y.hij("\n    ",y.xi3(4,3,"maintainYourSubscription",e.organizationName),"\n    "),y.xp6(2),y.Q6J("routerLink",y.VKq(8,B,e.organizationId)),y.xp6(1),y.Oqu(y.lcZ(7,6,"addAPaymentMethod"))}}class G{constructor(e){this.paymentMethodWarningService=e,this.warnings$=this.paymentMethodWarningService.paymentMethodWarnings$.pipe((0,a.U)((e=>Object.entries(null!=e?e:[]).filter((([e,t])=>t.risksSubscriptionFailure&&!t.acknowledged)).map((([e,{organizationName:t}])=>({organizationId:e,organizationName:t}))))))}closeWarning(e){return K(this,void 0,void 0,(function*(){yield this.paymentMethodWarningService.acknowledge(e)}))}}G.ɵfac=function(e){return new(e||G)(y.Y36(z.I))},G.ɵcmp=y.Xpm({type:G,selectors:[["app-payment-method-warnings"]],decls:3,vars:3,consts:[[4,"ngFor","ngForOf"],["bannerType","warning",1,"-tw-m-6","tw-flex","tw-flex-col","tw-pb-6",3,"onClose"],["bitLink","","linkType","contrast",3,"routerLink"]],template:function(e,t){1&e&&(y.YNc(0,Q,10,10,"ng-container",0),y.ALo(1,"async"),y._uU(2,"\n")),2&e&&y.Q6J("ngForOf",y.lcZ(1,1,t.warnings$))},dependencies:[J.S,n.sg,s.rH,Y.r,n.Ov,U.C],encapsulation:2});var j=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function V(e,t){if(1&e&&(y.TgZ(0,"bit-nav-item",13),y.ALo(1,"i18n"),y._uU(2,"\n    "),y.qZA()),2&e){const e=y.oxw().ngIf;y.Q6J("text",y.lcZ(1,1,e.flexibleCollections?"collections":"vault"))}}function $(e,t){1&e&&(y._UZ(0,"bit-nav-item",14),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"members"))}function H(e,t){1&e&&(y._UZ(0,"bit-nav-item",15),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"groups"))}function W(e,t){1&e&&(y._UZ(0,"bit-nav-item",19),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"eventLogs"))}function X(e,t){1&e&&(y._UZ(0,"bit-nav-item",20),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"reports"))}function ee(e,t){if(1&e&&(y.TgZ(0,"bit-nav-group",16),y.ALo(1,"i18n"),y._uU(2,"\n      "),y.YNc(3,W,2,3,"bit-nav-item",17),y._uU(4,"\n      "),y.YNc(5,X,2,3,"bit-nav-item",18),y._uU(6,"\n    "),y.qZA()),2&e){const e=y.oxw().ngIf,t=y.oxw();y.Q6J("text",y.lcZ(1,3,t.getReportTabLabel(e))),y.xp6(3),y.Q6J("ngIf",e.canAccessEventLogs),y.xp6(2),y.Q6J("ngIf",e.canAccessReports)}}function te(e,t){1&e&&(y.ynx(0),y._uU(1,"\n        "),y._UZ(2,"bit-nav-item",23),y.ALo(3,"i18n"),y._uU(4,"\n        "),y._UZ(5,"bit-nav-item",24),y.ALo(6,"i18n"),y._uU(7,"\n      "),y.BQk()),2&e&&(y.xp6(2),y.Q6J("text",y.lcZ(3,2,"paymentMethod")),y.xp6(3),y.Q6J("text",y.lcZ(6,4,"billingHistory")))}function ie(e,t){if(1&e&&(y.TgZ(0,"bit-nav-group",21),y.ALo(1,"i18n"),y._uU(2,"\n      "),y._UZ(3,"bit-nav-item",22),y.ALo(4,"i18n"),y._uU(5,"\n      "),y.YNc(6,te,8,6,"ng-container",2),y.ALo(7,"async"),y._uU(8,"\n    "),y.qZA()),2&e){const e=y.oxw(2);y.Q6J("text",y.lcZ(1,3,"billing")),y.xp6(3),y.Q6J("text",y.lcZ(4,5,"subscription")),y.xp6(3),y.Q6J("ngIf",y.lcZ(7,7,e.showPaymentAndHistory$))}}function ne(e,t){1&e&&(y._UZ(0,"bit-nav-item",35),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"organizationInfo"))}function se(e,t){1&e&&(y._UZ(0,"bit-nav-item",36),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"policies"))}function oe(e,t){1&e&&(y._UZ(0,"bit-nav-item",37),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"twoStepLogin"))}function re(e,t){1&e&&(y._UZ(0,"bit-nav-item",38),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"importData"))}function ae(e,t){1&e&&(y._UZ(0,"bit-nav-item",39),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"exportVault"))}function le(e,t){1&e&&(y._UZ(0,"bit-nav-item",40),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"domainVerification"))}function ce(e,t){1&e&&(y._UZ(0,"bit-nav-item",41),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"singleSignOn"))}function ue(e,t){1&e&&(y._UZ(0,"bit-nav-item",42),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"deviceApprovals"))}function de(e,t){1&e&&(y._UZ(0,"bit-nav-item",43),y.ALo(1,"i18n")),2&e&&y.Q6J("text",y.lcZ(1,1,"scim"))}function pe(e,t){if(1&e&&(y.TgZ(0,"bit-nav-group",25),y.ALo(1,"i18n"),y._uU(2,"\n      "),y.YNc(3,ne,2,3,"bit-nav-item",26),y._uU(4,"\n      "),y.YNc(5,se,2,3,"bit-nav-item",27),y._uU(6,"\n      "),y.YNc(7,oe,2,3,"bit-nav-item",28),y._uU(8,"\n      "),y.YNc(9,re,2,3,"bit-nav-item",29),y._uU(10,"\n      "),y.YNc(11,ae,2,3,"bit-nav-item",30),y._uU(12,"\n      "),y.YNc(13,le,2,3,"bit-nav-item",31),y._uU(14,"\n      "),y.YNc(15,ce,2,3,"bit-nav-item",32),y._uU(16,"\n      "),y.YNc(17,ue,2,3,"bit-nav-item",33),y._uU(18,"\n      "),y.YNc(19,de,2,3,"bit-nav-item",34),y._uU(20,"\n    "),y.qZA()),2&e){const e=y.oxw().ngIf;y.Q6J("text",y.lcZ(1,10,"settings")),y.xp6(3),y.Q6J("ngIf",e.isOwner),y.xp6(2),y.Q6J("ngIf",e.canManagePolicies),y.xp6(2),y.Q6J("ngIf",e.use2fa&&e.isOwner),y.xp6(2),y.Q6J("ngIf",e.canAccessImportExport),y.xp6(2),y.Q6J("ngIf",e.canAccessImportExport),y.xp6(2),y.Q6J("ngIf",null==e?null:e.canManageDomainVerification),y.xp6(2),y.Q6J("ngIf",e.canManageSso),y.xp6(2),y.Q6J("ngIf",e.canManageDeviceApprovals),y.xp6(2),y.Q6J("ngIf",e.canManageScim)}}function he(e,t){if(1&e&&(y.TgZ(0,"nav",3),y._uU(1,"\n    "),y.TgZ(2,"a",4),y.ALo(3,"i18n"),y._uU(4,"\n      "),y._UZ(5,"bit-icon",5),y._uU(6,"\n    "),y.qZA(),y._uU(7,"\n    "),y._UZ(8,"org-switcher",6),y.ALo(9,"async"),y._uU(10,"\n\n    "),y.YNc(11,V,3,3,"bit-nav-item",7),y._uU(12,"\n    "),y.YNc(13,$,2,3,"bit-nav-item",8),y._uU(14,"\n    "),y.YNc(15,H,2,3,"bit-nav-item",9),y._uU(16,"\n    "),y.YNc(17,ee,7,5,"bit-nav-group",10),y._uU(18,"\n    "),y.YNc(19,ie,9,9,"bit-nav-group",11),y._uU(20,"\n    "),y.YNc(21,pe,21,12,"bit-nav-group",12),y._uU(22,"\n\n    "),y._UZ(23,"app-toggle-width"),y._uU(24,"\n  "),y.qZA()),2&e){const e=t.ngIf,i=y.oxw();y.xp6(2),y.Q6J("appA11yTitle",y.lcZ(3,10,"adminConsole")),y.xp6(3),y.Q6J("icon",i.logo),y.xp6(3),y.Q6J("filter",i.orgFilter)("hideNewButton",y.lcZ(9,12,i.hideNewOrgButton$)),y.xp6(3),y.Q6J("ngIf",i.canShowVaultTab(e)),y.xp6(2),y.Q6J("ngIf",i.canShowMembersTab(e)),y.xp6(2),y.Q6J("ngIf",i.canShowGroupsTab(e)),y.xp6(2),y.Q6J("ngIf",i.canShowReportsTab(e)),y.xp6(2),y.Q6J("ngIf",i.canShowBillingTab(e)),y.xp6(2),y.Q6J("ngIf",i.canShowSettingsTab(e))}}function ge(e,t){if(1&e&&(y.TgZ(0,"bit-banner",45),y._uU(1),y.ALo(2,"i18n"),y.qZA()),2&e){const e=y.oxw().ngIf;y.Q6J("showClose",!1),y.xp6(1),y.hij("\n      ",y.xi3(2,2,"accessingUsingProvider",e.providerName),"\n    ")}}function fe(e,t){1&e&&y._UZ(0,"app-payment-method-warnings")}function me(e,t){if(1&e&&(y.ynx(0),y._uU(1,"\n    "),y.YNc(2,ge,3,5,"bit-banner",44),y._uU(3,"\n    "),y.YNc(4,fe,1,0,"app-payment-method-warnings",2),y.ALo(5,"async"),y._uU(6,"\n  "),y.BQk()),2&e){const e=t.ngIf,i=y.oxw();y.xp6(2),y.Q6J("ngIf",e.isProviderUser),y.xp6(2),y.Q6J("ngIf",y.lcZ(5,2,i.showPaymentMethodWarningBanners$))}}class ve{constructor(e,t,i,n,s){this.route=e,this.organizationService=t,this.platformUtilsService=i,this.configService=n,this.policyService=s,this.logo=L,this.orgFilter=e=>(0,u.gW)(e),this._destroy=new o.x,this.showPaymentMethodWarningBanners$=this.configService.getFeatureFlag$(p.T.ShowPaymentMethodWarningBanners)}ngOnInit(){return j(this,void 0,void 0,(function*(){document.body.classList.remove("layout_frontend"),this.organization$=this.route.params.pipe((0,r.R)(this._destroy)).pipe((0,a.U)((e=>e.organizationId))).pipe((0,l.z)((e=>this.organizationService.organizations$.pipe((0,r.R)(this._destroy)).pipe((0,u.$9)(e))))),this.showPaymentAndHistory$=this.organization$.pipe((0,a.U)((e=>!this.platformUtilsService.isSelfHost()&&(null==e?void 0:e.canViewBillingHistory)&&(null==e?void 0:e.canEditPaymentMethods)))),this.hideNewOrgButton$=this.policyService.policyAppliesToActiveUser$(d.Mi.SingleOrg)}))}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}canShowVaultTab(e){return(0,u.Po)(e)}canShowSettingsTab(e){return(0,u.DL)(e)}canShowMembersTab(e){return(0,u.tt)(e)}canShowGroupsTab(e){return(0,u.WW)(e)}canShowReportsTab(e){return(0,u.$G)(e)}canShowBillingTab(e){return!1}getReportTabLabel(e){return e.useEvents?"reporting":"reports"}}ve.ɵfac=function(e){return new(e||ve)(y.Y36(s.gz),y.Y36(u.Mn),y.Y36(D.P),y.Y36(E.E),y.Y36(F.d))},ve.ɵcmp=y.Xpm({type:ve,selectors:[["app-organization-layout"]],standalone:!0,features:[y.jDz],decls:11,vars:6,consts:[["variant","secondary"],["slot","sidebar",4,"ngIf"],[4,"ngIf"],["slot","sidebar"],["routerLink",".",1,"tw-m-5","tw-mt-7","tw-block",3,"appA11yTitle"],[3,"icon"],[3,"filter","hideNewButton"],["icon","bwi-collection","route","vault",3,"text",4,"ngIf"],["icon","bwi-user","route","members",3,"text",4,"ngIf"],["icon","bwi-users","route","groups",3,"text",4,"ngIf"],["icon","bwi-sliders","route","reporting",3,"text",4,"ngIf"],["icon","bwi-billing","route","billing",3,"text",4,"ngIf"],["icon","bwi-cog","route","settings",3,"text",4,"ngIf"],["icon","bwi-collection","route","vault",3,"text"],["icon","bwi-user","route","members",3,"text"],["icon","bwi-users","route","groups",3,"text"],["icon","bwi-sliders","route","reporting",3,"text"],["route","reporting/events",3,"text",4,"ngIf"],["route","reporting/reports",3,"text",4,"ngIf"],["route","reporting/events",3,"text"],["route","reporting/reports",3,"text"],["icon","bwi-billing","route","billing",3,"text"],["route","billing/subscription",3,"text"],["route","billing/payment-method",3,"text"],["route","billing/history",3,"text"],["icon","bwi-cog","route","settings",3,"text"],["route","settings/account",3,"text",4,"ngIf"],["route","settings/policies",3,"text",4,"ngIf"],["route","settings/two-factor",3,"text",4,"ngIf"],["route","settings/tools/import",3,"text",4,"ngIf"],["route","settings/tools/export",3,"text",4,"ngIf"],["route","settings/domain-verification",3,"text",4,"ngIf"],["route","settings/sso",3,"text",4,"ngIf"],["route","settings/device-approvals",3,"text",4,"ngIf"],["route","settings/scim",3,"text",4,"ngIf"],["route","settings/account",3,"text"],["route","settings/policies",3,"text"],["route","settings/two-factor",3,"text"],["route","settings/tools/import",3,"text"],["route","settings/tools/export",3,"text"],["route","settings/domain-verification",3,"text"],["route","settings/sso",3,"text"],["route","settings/device-approvals",3,"text"],["route","settings/scim",3,"text"],["class","-tw-m-6 tw-flex tw-flex-col tw-pb-6",3,"showClose",4,"ngIf"],[1,"-tw-m-6","tw-flex","tw-flex-col","tw-pb-6",3,"showClose"]],template:function(e,t){1&e&&(y.TgZ(0,"bit-layout",0),y._uU(1,"\n  "),y.YNc(2,he,25,14,"nav",1),y.ALo(3,"async"),y._uU(4,"\n\n  "),y.YNc(5,me,7,4,"ng-container",2),y.ALo(6,"async"),y._uU(7,"\n\n  "),y._UZ(8,"router-outlet"),y._uU(9,"\n"),y.qZA(),y._uU(10,"\n")),2&e&&(y.xp6(2),y.Q6J("ngIf",y.lcZ(3,2,t.organization$)),y.xp6(3),y.Q6J("ngIf",y.lcZ(6,4,t.organization$)))},dependencies:[n.ez,n.O5,n.Ov,s.Bz,s.lC,s.rH,c.b,b.B,U.C,h.$,g.Q,R.G,f.A,A.W,Z.H,M,m.s,J.S,v.eV,G,N.x],encapsulation:2})},98157:(e,t,i)=>{"use strict";i.d(t,{v:()=>y});var n=i(58691),s=i(54427),o=i(82558),r=i(88160),a=i(44879),l=i(27646),c=i(70427),u=i(55637),d=i(85762),p=i(76528),h=i(85540),g=i(47244),f=i(97360),m=i(78627),v=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class y{constructor(e,t,i,n,s,o){this.cryptoService=e,this.encryptService=t,this.organizationService=i,this.organizationUserService=n,this.organizationApiService=s,this.i18nService=o}buildRecoveryKey(e,t){return v(this,void 0,void 0,(function*(){const i=yield this.organizationApiService.getKeys(e);if(null==i)throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));const n=l.c.fromB64ToArray(i.publicKey);if(null!=t||(t=yield this.cryptoService.getUserKey()),null==t)throw new Error("No user key found");return(yield this.cryptoService.rsaEncrypt(t.key,n)).encryptedString}))}resetMasterPassword(e,t,i,n){return v(this,void 0,void 0,(function*(){const o=yield this.organizationUserService.getOrganizationUserResetPasswordDetails(n,i);if(null==o)throw new Error(this.i18nService.t("resetPasswordDetailsError"));const l=yield this.cryptoService.getOrgKey(n);if(null==l)throw new Error("No org key found");const d=yield this.encryptService.decryptToBytes(new c._(o.encryptedPrivateKey),l),p=yield this.cryptoService.rsaDecrypt(o.resetPasswordKey,d),h=new u.N(p),g=o.kdf===a.G3.PBKDF2_SHA256?new r.S(o.kdfIterations):new r.H(o.kdfIterations,o.kdfMemory,o.kdfParallelism),f=yield this.cryptoService.makeMasterKey(e,t.trim().toLowerCase(),g),m=yield this.cryptoService.hashMasterKey(e,f),v=yield this.cryptoService.encryptUserKeyWithMasterKey(f,h),y=new s.s;y.key=v[1].encryptedString,y.newMasterPasswordHash=m,yield this.organizationUserService.putOrganizationUserResetPassword(n,i,y)}))}getRotatedKeys(e){return v(this,void 0,void 0,(function*(){if(null==e)throw new Error("New user key is required for rotation.");const t=yield this.organizationService.getAll();if(!t)return;const i=[];for(const n of t){if(!n.resetPasswordEnrolled)continue;const t=yield this.buildRecoveryKey(n.id,e),s=new o.u;s.organizationId=n.id,s.resetPasswordKey=t,s.masterPasswordHash="ignored",i.push(s)}return i}))}postLegacyRotation(e,t){return v(this,void 0,void 0,(function*(){if(null!=t)for(const i of t)yield this.organizationUserService.putOrganizationUserResetPasswordEnrollment(i.organizationId,e,i)}))}}y.ɵfac=function(e){return new(e||y)(d.LFG(p.$),d.LFG(h.U),d.LFG(n.Mn),d.LFG(g.t),d.LFG(f.M),d.LFG(m.D))},y.ɵprov=d.Yz7({token:y,factory:y.ɵfac,providedIn:"root"})},96963:(e,t,i)=>{"use strict";i.d(t,{v2:()=>h,WS:()=>O,bT:()=>q,tc:()=>M,K:()=>_e,I2:()=>o,UG:()=>L,jR:()=>J,mD:()=>Y,qT:()=>B,n6:()=>G});var n=i(71146),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.m,n.f]});var r=i(37513);class a{}class l{display(e){return!0}}class c{constructor(){this.enabled=new r.p4(!1),this.data=null}ngOnInit(){this.enabled.setValue(this.policyResponse.enabled),null!=this.policyResponse.data&&this.loadData()}loadData(){var e;this.data.patchValue(null!==(e=this.policyResponse.data)&&void 0!==e?e:{})}buildRequestData(){return null!=this.data?this.data.value:null}buildRequest(e){const t=new a;return t.enabled=this.enabled.value,t.type=this.policy.type,t.data=this.buildRequestData(),Promise.resolve(t)}}c.ɵfac=function(e){return new(e||c)},c.ɵdir=s.lG2({type:c,inputs:{policyResponse:"policyResponse",policy:"policy"}});var u=i(92614),d=i(53707),p=i(82933);class h extends l{constructor(){super(...arguments),this.name="disableSend",this.description="disableSendPolicyDesc",this.type=u.Mi.DisableSend,this.component=g}}class g extends c{}g.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(g)))(t||g)}}(),g.ɵcmp=s.Xpm({type:g,selectors:[["policy-disable-send"]],features:[s.qOj],decls:16,vars:7,consts:[["type","warning"],[1,"form-group"],[1,"form-check"],["type","checkbox","id","enabled","name","Enabled",1,"form-check-input",3,"formControl"],["for","enabled",1,"form-check-label"]],template:function(e,t){1&e&&(s.TgZ(0,"app-callout",0),s._uU(1),s.ALo(2,"i18n"),s.qZA(),s._uU(3,"\n\n"),s.TgZ(4,"div",1),s._uU(5,"\n  "),s.TgZ(6,"div",2),s._uU(7,"\n    "),s._UZ(8,"input",3),s._uU(9,"\n    "),s.TgZ(10,"label",4),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n  "),s.qZA(),s._uU(14,"\n"),s.qZA(),s._uU(15,"\n")),2&e&&(s.xp6(1),s.hij("\n  ",s.lcZ(2,3,"disableSendExemption"),"\n"),s.xp6(7),s.Q6J("formControl",t.enabled),s.xp6(3),s.Oqu(s.lcZ(12,5,"turnOn")))},dependencies:[r.Wl,r.JJ,r.oH,d.O,p.C],encapsulation:2});var f=i(58691),m=i(27646),v=i(78627),y=i(28508),w=i(7172),b=i(24637),U=i(11512),_=i(75734),A=i(36179),Z=i(28975),x=i(30469),S=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function T(e,t){1&e&&(s.TgZ(0,"app-callout",14),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n  ",s.lcZ(2,1,"keyConnectorPolicyRestriction"),"\n"))}function C(e,t){if(1&e&&s._UZ(0,"bit-option",15),2&e){const e=t.$implicit;s.Q6J("value",e.value)("label",e.name)}}class O extends l{constructor(){super(...arguments),this.name="masterPassPolicyTitle",this.description="masterPassPolicyDesc",this.type=u.Mi.MasterPassword,this.component=k}}class k extends c{constructor(e,t,i){super(),this.formBuilder=e,this.organizationService=i,this.MinPasswordLength=m.c.minimumPasswordLength,this.data=this.formBuilder.group({minComplexity:[null],minLength:[this.MinPasswordLength,[r.kI.min(m.c.minimumPasswordLength)]],requireUpper:[!1],requireLower:[!1],requireNumbers:[!1],requireSpecial:[!1],enforceOnLogin:[!1]}),this.showKeyConnectorInfo=!1,this.passwordScores=[{name:"-- "+t.t("select")+" --",value:null},{name:t.t("weak")+" (0)",value:0},{name:t.t("weak")+" (1)",value:1},{name:t.t("weak")+" (2)",value:2},{name:t.t("good")+" (3)",value:3},{name:t.t("strong")+" (4)",value:4}]}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return S(this,void 0,void 0,(function*(){e.ngOnInit.call(this);const t=yield this.organizationService.get(this.policyResponse.organizationId);this.showKeyConnectorInfo=t.keyConnectorEnabled}))}}function P(e,t){if(1&e&&(s.TgZ(0,"option",32),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}k.ɵfac=function(e){return new(e||k)(s.Y36(r.qu),s.Y36(v.D),s.Y36(f.Mn))},k.ɵcmp=s.Xpm({type:k,selectors:[["policy-master-password"]],features:[s.qOj],decls:79,vars:17,consts:[["type","info",4,"ngIf"],[3,"formGroup"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],["type","checkbox","bitCheckbox","","formControlName","enforceOnLogin","id","enforceOnLogin"],[1,"tw-flex","tw-space-x-4"],[1,"tw-flex-auto"],["formControlName","minComplexity","id","minComplexity"],[3,"value","label",4,"ngFor","ngForOf"],["bitInput","","type","number","formControlName","minLength","id","minLength",3,"min"],[1,"!tw-mb-2"],["type","checkbox","bitCheckbox","","formControlName","requireUpper","id","requireUpper"],["type","checkbox","bitCheckbox","","formControlName","requireLower","id","requireLower"],["type","checkbox","bitCheckbox","","formControlName","requireNumbers","id","requireNumbers"],["type","checkbox","bitCheckbox","","formControlName","requireSpecial","id","requireSpecial"],["type","info"],[3,"value","label"]],template:function(e,t){1&e&&(s.YNc(0,T,3,3,"app-callout",0),s._uU(1,"\n\n"),s.TgZ(2,"div",1),s._uU(3,"\n  "),s.TgZ(4,"bit-form-control"),s._uU(5,"\n    "),s._UZ(6,"input",2),s._uU(7,"\n    "),s.TgZ(8,"bit-label"),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n  "),s.qZA(),s._uU(12,"\n\n  "),s.TgZ(13,"bit-form-control"),s._uU(14,"\n    "),s._UZ(15,"input",3),s._uU(16,"\n    "),s.TgZ(17,"bit-label"),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n  "),s.qZA(),s._uU(21,"\n\n  "),s.TgZ(22,"div",4),s._uU(23,"\n    "),s.TgZ(24,"bit-form-field",5),s._uU(25,"\n      "),s.TgZ(26,"bit-label"),s._uU(27),s.ALo(28,"i18n"),s.qZA(),s._uU(29,"\n      "),s.TgZ(30,"bit-select",6),s._uU(31,"\n        "),s.YNc(32,C,1,2,"bit-option",7),s._uU(33,"\n      "),s.qZA(),s._uU(34,"\n    "),s.qZA(),s._uU(35,"\n    "),s.TgZ(36,"bit-form-field",5),s._uU(37,"\n      "),s.TgZ(38,"bit-label"),s._uU(39),s.ALo(40,"i18n"),s.qZA(),s._uU(41,"\n      "),s._UZ(42,"input",8),s._uU(43,"\n    "),s.qZA(),s._uU(44,"\n  "),s.qZA(),s._uU(45,"\n\n  "),s.TgZ(46,"bit-form-control",9),s._uU(47,"\n    "),s._UZ(48,"input",10),s._uU(49,"\n    "),s.TgZ(50,"bit-label"),s._uU(51,"A-Z"),s.qZA(),s._uU(52,"\n  "),s.qZA(),s._uU(53,"\n  "),s.TgZ(54,"bit-form-control",9),s._uU(55,"\n    "),s._UZ(56,"input",11),s._uU(57,"\n    "),s.TgZ(58,"bit-label"),s._uU(59,"a-z"),s.qZA(),s._uU(60,"\n  "),s.qZA(),s._uU(61,"\n  "),s.TgZ(62,"bit-form-control",9),s._uU(63,"\n    "),s._UZ(64,"input",12),s._uU(65,"\n    "),s.TgZ(66,"bit-label"),s._uU(67,"0-9"),s.qZA(),s._uU(68,"\n  "),s.qZA(),s._uU(69,"\n  "),s.TgZ(70,"bit-form-control"),s._uU(71,"\n    "),s._UZ(72,"input",13),s._uU(73,"\n    "),s.TgZ(74,"bit-label"),s._uU(75,"!@#$%^&*"),s.qZA(),s._uU(76,"\n  "),s.qZA(),s._uU(77,"\n"),s.qZA(),s._uU(78,"\n")),2&e&&(s.Q6J("ngIf",t.showKeyConnectorInfo),s.xp6(2),s.Q6J("formGroup",t.data),s.xp6(4),s.Q6J("formControl",t.enabled),s.xp6(3),s.Oqu(s.lcZ(10,9,"turnOn")),s.xp6(9),s.Oqu(s.lcZ(19,11,"enforceOnLoginDesc")),s.xp6(9),s.Oqu(s.lcZ(28,13,"minComplexityScore")),s.xp6(5),s.Q6J("ngForOf",t.passwordScores),s.xp6(7),s.Oqu(s.lcZ(40,15,"minLength")),s.xp6(3),s.Q6J("min",t.MinPasswordLength))},dependencies:[y.sg,y.O5,r.Fj,r.wV,r.Wl,r.JJ,r.JL,r.qQ,r.oH,r.sg,r.u,d.O,w.b,b.d,U.G,_.A,A.u,Z.H,x.x,p.C],encapsulation:2});class q extends l{constructor(){super(...arguments),this.name="passwordGenerator",this.description="passwordGeneratorPolicyDesc",this.type=u.Mi.PasswordGenerator,this.component=I}}class I extends c{constructor(e,t){super(),this.formBuilder=e,this.data=this.formBuilder.group({defaultType:[null],minLength:[null],useUpper:[null],useLower:[null],useNumbers:[null],useSpecial:[null],minNumbers:[null],minSpecial:[null],minNumberWords:[null],capitalize:[null],includeNumber:[null]}),this.defaultTypes=[{name:t.t("userPreference"),value:null},{name:t.t("password"),value:"password"},{name:t.t("passphrase"),value:"passphrase"}]}}I.ɵfac=function(e){return new(e||I)(s.Y36(r.QS),s.Y36(v.D))},I.ɵcmp=s.Xpm({type:I,selectors:[["policy-password-generator"]],features:[s.qOj],decls:133,vars:33,consts:[[3,"formGroup"],[1,"form-group"],[1,"form-check"],["type","checkbox","id","enabled","name","Enabled",1,"form-check-input",3,"formControl"],["for","enabled",1,"form-check-label"],[1,"row"],[1,"col-6","form-group","mb-0"],["for","defaultType"],["id","defaultType","name","defaultType","formControlName","defaultType",1,"form-control"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"mt-4"],[1,"col-6","form-group"],["for","minLength"],["id","minLength","type","number","name","minLength","min","5","max","128","formControlName","minLength",1,"form-control"],["for","minNumbers"],["id","minNumbers","type","number","name","minNumbers","min","0","max","9","formControlName","minNumbers",1,"form-control"],["for","minSpecial"],["id","minSpecial","type","number","name","minSpecial","min","0","max","9","formControlName","minSpecial",1,"form-control"],["type","checkbox","id","useUpper","formControlName","useUpper","name","useUpper",1,"form-check-input"],["for","useUpper",1,"form-check-label"],["type","checkbox","id","useLower","name","useLower","formControlName","useLower",1,"form-check-input"],["for","useLower",1,"form-check-label"],["type","checkbox","id","useNumbers","name","useNumbers","formControlName","useNumbers",1,"form-check-input"],["for","useNumbers",1,"form-check-label"],["type","checkbox","id","useSpecial","name","useSpecial","formControlName","useSpecial",1,"form-check-input"],["for","useSpecial",1,"form-check-label"],["for","minNumberWords"],["id","minNumberWords","type","number","name","minNumberWords","min","3","max","20","formControlName","minNumberWords",1,"form-control"],["type","checkbox","id","capitalize","name","capitalize","formControlName","capitalize",1,"form-check-input"],["for","capitalize",1,"form-check-label"],["type","checkbox","id","includeNumber","name","includeNumber","formControlName","includeNumber",1,"form-check-input"],["for","includeNumber",1,"form-check-label"],[3,"ngValue"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"div",2),s._uU(5,"\n      "),s._UZ(6,"input",3),s._uU(7,"\n      "),s.TgZ(8,"label",4),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n    "),s.qZA(),s._uU(12,"\n  "),s.qZA(),s._uU(13,"\n\n  "),s.TgZ(14,"div",5),s._uU(15,"\n    "),s.TgZ(16,"div",6),s._uU(17,"\n      "),s.TgZ(18,"label",7),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n      "),s.TgZ(22,"select",8),s._uU(23,"\n        "),s.YNc(24,P,2,2,"option",9),s._uU(25,"\n      "),s.qZA(),s._uU(26,"\n    "),s.qZA(),s._uU(27,"\n  "),s.qZA(),s._uU(28,"\n  "),s.TgZ(29,"h3",10),s._uU(30),s.ALo(31,"i18n"),s.qZA(),s._uU(32,"\n  "),s.TgZ(33,"div",5),s._uU(34,"\n    "),s.TgZ(35,"div",11),s._uU(36,"\n      "),s.TgZ(37,"label",12),s._uU(38),s.ALo(39,"i18n"),s.qZA(),s._uU(40,"\n      "),s._UZ(41,"input",13),s._uU(42,"\n    "),s.qZA(),s._uU(43,"\n  "),s.qZA(),s._uU(44,"\n  "),s.TgZ(45,"div",5),s._uU(46,"\n    "),s.TgZ(47,"div",11),s._uU(48,"\n      "),s.TgZ(49,"label",14),s._uU(50),s.ALo(51,"i18n"),s.qZA(),s._uU(52,"\n      "),s._UZ(53,"input",15),s._uU(54,"\n    "),s.qZA(),s._uU(55,"\n    "),s.TgZ(56,"div",11),s._uU(57,"\n      "),s.TgZ(58,"label",16),s._uU(59),s.ALo(60,"i18n"),s.qZA(),s._uU(61,"\n      "),s._UZ(62,"input",17),s._uU(63,"\n    "),s.qZA(),s._uU(64,"\n  "),s.qZA(),s._uU(65,"\n  "),s.TgZ(66,"div",2),s._uU(67,"\n    "),s._UZ(68,"input",18),s._uU(69,"\n    "),s.TgZ(70,"label",19),s._uU(71,"A-Z"),s.qZA(),s._uU(72,"\n  "),s.qZA(),s._uU(73,"\n  "),s.TgZ(74,"div",2),s._uU(75,"\n    "),s._UZ(76,"input",20),s._uU(77,"\n    "),s.TgZ(78,"label",21),s._uU(79,"a-z"),s.qZA(),s._uU(80,"\n  "),s.qZA(),s._uU(81,"\n  "),s.TgZ(82,"div",2),s._uU(83,"\n    "),s._UZ(84,"input",22),s._uU(85,"\n    "),s.TgZ(86,"label",23),s._uU(87,"0-9"),s.qZA(),s._uU(88,"\n  "),s.qZA(),s._uU(89,"\n  "),s.TgZ(90,"div",2),s._uU(91,"\n    "),s._UZ(92,"input",24),s._uU(93,"\n    "),s.TgZ(94,"label",25),s._uU(95,"!@#$%^&*"),s.qZA(),s._uU(96,"\n  "),s.qZA(),s._uU(97,"\n  "),s.TgZ(98,"h3",10),s._uU(99),s.ALo(100,"i18n"),s.qZA(),s._uU(101,"\n  "),s.TgZ(102,"div",5),s._uU(103,"\n    "),s.TgZ(104,"div",11),s._uU(105,"\n      "),s.TgZ(106,"label",26),s._uU(107),s.ALo(108,"i18n"),s.qZA(),s._uU(109,"\n      "),s._UZ(110,"input",27),s._uU(111,"\n    "),s.qZA(),s._uU(112,"\n  "),s.qZA(),s._uU(113,"\n  "),s.TgZ(114,"div",2),s._uU(115,"\n    "),s._UZ(116,"input",28),s._uU(117,"\n    "),s.TgZ(118,"label",29),s._uU(119),s.ALo(120,"i18n"),s.qZA(),s._uU(121,"\n  "),s.qZA(),s._uU(122,"\n  "),s.TgZ(123,"div",2),s._uU(124,"\n    "),s._UZ(125,"input",30),s._uU(126,"\n    "),s.TgZ(127,"label",31),s._uU(128),s.ALo(129,"i18n"),s.qZA(),s._uU(130,"\n  "),s.qZA(),s._uU(131,"\n"),s.qZA(),s._uU(132,"\n")),2&e&&(s.Q6J("formGroup",t.data),s.xp6(6),s.Q6J("formControl",t.enabled),s.xp6(3),s.Oqu(s.lcZ(10,13,"turnOn")),s.xp6(10),s.Oqu(s.lcZ(20,15,"defaultType")),s.xp6(5),s.Q6J("ngForOf",t.defaultTypes),s.xp6(6),s.Oqu(s.lcZ(31,17,"password")),s.xp6(8),s.Oqu(s.lcZ(39,19,"minLength")),s.xp6(12),s.Oqu(s.lcZ(51,21,"minNumbers")),s.xp6(9),s.Oqu(s.lcZ(60,23,"minSpecial")),s.xp6(40),s.Oqu(s.lcZ(100,25,"passphrase")),s.xp6(8),s.Oqu(s.lcZ(108,27,"minimumNumberOfWords")),s.xp6(12),s.Oqu(s.lcZ(120,29,"capitalize")),s.xp6(9),s.Oqu(s.lcZ(129,31,"includeNumber")))},dependencies:[y.sg,r.YN,r.Kr,r.Fj,r.wV,r.Wl,r.EJ,r.JJ,r.JL,r.qQ,r.Fd,r.oH,r.sg,r.u,p.C],encapsulation:2});class M extends l{constructor(){super(...arguments),this.name="personalOwnership",this.description="personalOwnershipPolicyDesc",this.type=u.Mi.PersonalOwnership,this.component=N}}class N extends c{}N.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(N)))(t||N)}}(),N.ɵcmp=s.Xpm({type:N,selectors:[["policy-personal-ownership"]],features:[s.qOj],decls:16,vars:7,consts:[["type","warning"],[1,"form-group"],[1,"form-check"],["type","checkbox","id","enabled","name","Enabled",1,"form-check-input",3,"formControl"],["for","enabled",1,"form-check-label"]],template:function(e,t){1&e&&(s.TgZ(0,"app-callout",0),s._uU(1),s.ALo(2,"i18n"),s.qZA(),s._uU(3,"\n\n"),s.TgZ(4,"div",1),s._uU(5,"\n  "),s.TgZ(6,"div",2),s._uU(7,"\n    "),s._UZ(8,"input",3),s._uU(9,"\n    "),s.TgZ(10,"label",4),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n  "),s.qZA(),s._uU(14,"\n"),s.qZA(),s._uU(15,"\n")),2&e&&(s.xp6(1),s.hij("\n  ",s.lcZ(2,3,"personalOwnershipExemption"),"\n"),s.xp6(7),s.Q6J("formControl",t.enabled),s.xp6(3),s.Oqu(s.lcZ(12,5,"turnOn")))},dependencies:[r.Wl,r.JJ,r.oH,d.O,p.C],encapsulation:2});class L extends l{constructor(){super(...arguments),this.name="requireSso",this.description="requireSsoPolicyDesc",this.type=u.Mi.RequireSso,this.component=D}display(e){return e.useSso}}class D extends c{constructor(e){super(),this.i18nService=e}buildRequest(e){var t;const i=null!==(t=e.get(u.Mi.SingleOrg))&&void 0!==t&&t;if(this.enabled.value&&!i)throw new Error(this.i18nService.t("requireSsoPolicyReqError"));return super.buildRequest(e)}}D.ɵfac=function(e){return new(e||D)(s.Y36(v.D))},D.ɵcmp=s.Xpm({type:D,selectors:[["policy-require-sso"]],features:[s.qOj],decls:21,vars:13,consts:[["type","tip",3,"title"],["type","warning"],[1,"form-group"],[1,"form-check"],["type","checkbox","id","enabled","name","Enabled",1,"form-check-input",3,"formControl"],["for","enabled",1,"form-check-label"]],template:function(e,t){1&e&&(s.TgZ(0,"app-callout",0),s.ALo(1,"i18n"),s._uU(2),s.ALo(3,"i18n"),s.qZA(),s._uU(4,"\n"),s.TgZ(5,"app-callout",1),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n\n"),s.TgZ(9,"div",2),s._uU(10,"\n  "),s.TgZ(11,"div",3),s._uU(12,"\n    "),s._UZ(13,"input",4),s._uU(14,"\n    "),s.TgZ(15,"label",5),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n  "),s.qZA(),s._uU(19,"\n"),s.qZA(),s._uU(20,"\n")),2&e&&(s.s9C("title",s.lcZ(1,5,"prerequisite")),s.xp6(2),s.hij("\n  ",s.lcZ(3,7,"requireSsoPolicyReq"),"\n"),s.xp6(4),s.hij("\n  ",s.lcZ(7,9,"requireSsoExemption"),"\n"),s.xp6(7),s.Q6J("formControl",t.enabled),s.xp6(3),s.Oqu(s.lcZ(17,11,"turnOn")))},dependencies:[r.Wl,r.JJ,r.oH,d.O,p.C],encapsulation:2});var E=i(24083),F=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function R(e,t){1&e&&(s.TgZ(0,"bit-callout",7),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n  ",s.lcZ(2,1,"keyConnectorPolicyRestriction"),"\n"))}class J extends l{constructor(){super(...arguments),this.name="accountRecoveryPolicy",this.description="accountRecoveryPolicyDesc",this.type=u.Mi.ResetPassword,this.component=z}display(e){return e.useResetPassword}}class z extends c{constructor(e,t){super(),this.formBuilder=e,this.organizationService=t,this.data=this.formBuilder.group({autoEnrollEnabled:!1}),this.showKeyConnectorInfo=!1}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return F(this,void 0,void 0,(function*(){e.ngOnInit.call(this);const t=yield this.organizationService.get(this.policyResponse.organizationId);this.showKeyConnectorInfo=t.keyConnectorEnabled}))}}z.ɵfac=function(e){return new(e||z)(s.Y36(r.qu),s.Y36(f.Mn))},z.ɵcmp=s.Xpm({type:z,selectors:[["policy-reset-password"]],features:[s.qOj],decls:32,vars:18,consts:[["type","info",4,"ngIf"],["type","success","icon","bwi-lightbulb",3,"title"],["type","warning"],[1,"!tw-mb-1"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],[3,"formGroup"],["type","checkbox","bitCheckbox","","formControlName","autoEnrollEnabled","id","autoEnrollEnabled"],["type","info"]],template:function(e,t){1&e&&(s.YNc(0,R,3,3,"bit-callout",0),s._uU(1,"\n\n"),s.TgZ(2,"bit-callout",1),s.ALo(3,"i18n"),s._uU(4),s.ALo(5,"i18n"),s.qZA(),s._uU(6,"\n\n"),s.TgZ(7,"bit-callout",2),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n\n"),s.TgZ(11,"bit-form-control",3),s._uU(12,"\n  "),s._UZ(13,"input",4),s._uU(14,"\n  "),s.TgZ(15,"bit-label"),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n"),s.qZA(),s._uU(19,"\n\n"),s.ynx(20,5),s._uU(21,"\n  "),s.TgZ(22,"bit-form-control",3),s._uU(23,"\n    "),s._UZ(24,"input",6),s._uU(25,"\n    "),s.TgZ(26,"bit-label"),s._uU(27),s.ALo(28,"i18n"),s.qZA(),s._uU(29,"\n  "),s.qZA(),s._uU(30,"\n"),s.BQk(),s._uU(31,"\n")),2&e&&(s.Q6J("ngIf",t.showKeyConnectorInfo),s.xp6(2),s.Q6J("title",s.lcZ(3,8,"prerequisite")),s.xp6(2),s.hij("\n  ",s.lcZ(5,10,"accountRecoverySingleOrgRequirementDesc"),"\n"),s.xp6(4),s.hij("\n  ",s.lcZ(9,12,"accountRecoveryPolicyWarning"),"\n"),s.xp6(5),s.Q6J("formControl",t.enabled),s.xp6(3),s.Oqu(s.lcZ(17,14,"turnOn")),s.xp6(4),s.Q6J("formGroup",t.data),s.xp6(7),s.Oqu(s.lcZ(28,16,"resetPasswordPolicyAutoEnrollCheckbox")))},dependencies:[y.O5,r.Wl,r.JJ,r.JL,r.oH,r.sg,r.u,E.O,w.b,_.A,A.u,p.C],encapsulation:2});class Y extends l{constructor(){super(...arguments),this.name="sendOptions",this.description="sendOptionsPolicyDesc",this.type=u.Mi.SendOptions,this.component=K}}class K extends c{constructor(e){super(),this.formBuilder=e,this.data=this.formBuilder.group({disableHideEmail:!1})}}K.ɵfac=function(e){return new(e||K)(s.Y36(r.QS))},K.ɵcmp=s.Xpm({type:K,selectors:[["policy-send-options"]],features:[s.qOj],decls:32,vars:14,consts:[["type","warning"],[1,"form-group"],[1,"form-check"],["type","checkbox","id","enabled","name","Enabled",1,"form-check-input",3,"formControl"],["for","enabled",1,"form-check-label"],[3,"formGroup"],[1,"mt-4"],["type","checkbox","id","disableHideEmail","name","DisableHideEmail","formControlName","disableHideEmail",1,"form-check-input"],["for","disableHideEmail",1,"form-check-label"]],template:function(e,t){1&e&&(s.TgZ(0,"app-callout",0),s._uU(1),s.ALo(2,"i18n"),s.qZA(),s._uU(3,"\n\n"),s.TgZ(4,"div",1),s._uU(5,"\n  "),s.TgZ(6,"div",2),s._uU(7,"\n    "),s._UZ(8,"input",3),s._uU(9,"\n    "),s.TgZ(10,"label",4),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n  "),s.qZA(),s._uU(14,"\n"),s.qZA(),s._uU(15,"\n\n"),s.TgZ(16,"div",5),s._uU(17,"\n  "),s.TgZ(18,"h3",6),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n  "),s.TgZ(22,"div",2),s._uU(23,"\n    "),s._UZ(24,"input",7),s._uU(25,"\n    "),s.TgZ(26,"label",8),s._uU(27),s.ALo(28,"i18n"),s.qZA(),s._uU(29,"\n  "),s.qZA(),s._uU(30,"\n"),s.qZA(),s._uU(31,"\n")),2&e&&(s.xp6(1),s.hij("\n  ",s.lcZ(2,6,"sendOptionsExemption"),"\n"),s.xp6(7),s.Q6J("formControl",t.enabled),s.xp6(3),s.Oqu(s.lcZ(12,8,"turnOn")),s.xp6(5),s.Q6J("formGroup",t.data),s.xp6(3),s.Oqu(s.lcZ(20,10,"options")),s.xp6(8),s.Oqu(s.lcZ(28,12,"disableHideEmail")))},dependencies:[r.Wl,r.JJ,r.JL,r.oH,r.sg,r.u,d.O,p.C],encapsulation:2});class B extends l{constructor(){super(...arguments),this.name="singleOrg",this.description="singleOrgDesc",this.type=u.Mi.SingleOrg,this.component=Q}}class Q extends c{constructor(e){super(),this.i18nService=e}buildRequest(e){var t,i;if(!this.enabled.value){if(null!==(t=e.get(u.Mi.RequireSso))&&void 0!==t&&t)throw new Error(this.i18nService.t("disableRequiredError",this.i18nService.t("requireSso")));if(null!==(i=e.get(u.Mi.MaximumVaultTimeout))&&void 0!==i&&i)throw new Error(this.i18nService.t("disableRequiredError",this.i18nService.t("maximumVaultTimeoutLabel")))}return super.buildRequest(e)}}Q.ɵfac=function(e){return new(e||Q)(s.Y36(v.D))},Q.ɵcmp=s.Xpm({type:Q,selectors:[["policy-single-org"]],features:[s.qOj],decls:16,vars:7,consts:[["type","warning"],[1,"form-group"],[1,"form-check"],["type","checkbox","id","enabled","name","Enabled",1,"form-check-input",3,"formControl"],["for","enabled",1,"form-check-label"]],template:function(e,t){1&e&&(s.TgZ(0,"app-callout",0),s._uU(1),s.ALo(2,"i18n"),s.qZA(),s._uU(3,"\n\n"),s.TgZ(4,"div",1),s._uU(5,"\n  "),s.TgZ(6,"div",2),s._uU(7,"\n    "),s._UZ(8,"input",3),s._uU(9,"\n    "),s.TgZ(10,"label",4),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n  "),s.qZA(),s._uU(14,"\n"),s.qZA(),s._uU(15,"\n")),2&e&&(s.xp6(1),s.hij("\n  ",s.lcZ(2,3,"singleOrgPolicyWarning"),"\n"),s.xp6(7),s.Q6J("formControl",t.enabled),s.xp6(3),s.Oqu(s.lcZ(12,5,"turnOn")))},dependencies:[r.Wl,r.JJ,r.oH,d.O,p.C],encapsulation:2});class G extends l{constructor(){super(...arguments),this.name="twoStepLoginPolicyTitle",this.description="twoStepLoginPolicyDesc",this.type=u.Mi.TwoFactorAuthentication,this.component=j}}class j extends c{}j.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(j)))(t||j)}}(),j.ɵcmp=s.Xpm({type:j,selectors:[["policy-two-factor-authentication"]],features:[s.qOj],decls:13,vars:7,consts:[["type","warning"],["type","checkbox","bitCheckbox","",3,"formControl"]],template:function(e,t){1&e&&(s.TgZ(0,"app-callout",0),s._uU(1),s.ALo(2,"i18n"),s.qZA(),s._uU(3,"\n\n"),s.TgZ(4,"bit-form-control"),s._uU(5,"\n  "),s._UZ(6,"input",1),s._uU(7,"\n  "),s.TgZ(8,"bit-label"),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n"),s.qZA(),s._uU(12,"\n")),2&e&&(s.xp6(1),s.hij("\n  ",s.lcZ(2,3,"twoStepLoginPolicyWarning"),"\n"),s.xp6(5),s.Q6J("formControl",t.enabled),s.xp6(3),s.Oqu(s.lcZ(10,5,"turnOn")))},dependencies:[r.Wl,r.JJ,r.oH,d.O,w.b,_.A,A.u,p.C],encapsulation:2});var V=i(19887),$=i(61374),H=i(41489),W=i(50137),X=i(99721),ee=i(66459),te=i(33245),ie=i(24610),ne=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const se=["policyForm"];function oe(e,t){1&e&&(s.TgZ(0,"div",8),s._uU(1,"\n          "),s._UZ(2,"i",16),s.ALo(3,"i18n"),s._uU(4,"\n          "),s.TgZ(5,"span",17),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n        "),s.qZA()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function re(e,t){}class ae{constructor(e,t,i,n,o){this.policyApiService=e,this.i18nService=t,this.platformUtilsService=i,this.cdr=n,this.logService=o,this.policiesEnabledMap=new Map,this.onSavedPolicy=new s.vpe,this.policyType=u.Mi,this.loading=!0,this.enabled=!1}ngAfterViewInit(){return ne(this,void 0,void 0,(function*(){yield this.load(),this.loading=!1,this.policyComponent=this.policyFormRef.createComponent(this.policy.component).instance,this.policyComponent.policy=this.policy,this.policyComponent.policyResponse=this.policyResponse,this.cdr.detectChanges()}))}load(){return ne(this,void 0,void 0,(function*(){try{this.policyResponse=yield this.policyApiService.getPolicy(this.organizationId,this.policy.type)}catch(e){if(404!==e.statusCode)throw e;this.policyResponse=new H.j({Enabled:!1})}}))}submit(){return ne(this,void 0,void 0,(function*(){let e;try{e=yield this.policyComponent.buildRequest(this.policiesEnabledMap)}catch(t){return void this.platformUtilsService.showToast("error",null,t.message)}try{this.formPromise=this.policyApiService.putPolicy(this.organizationId,this.policy.type,e),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("editedPolicyId",this.i18nService.t(this.policy.name))),this.onSavedPolicy.emit()}catch(t){this.logService.error(t)}}))}}ae.ɵfac=function(e){return new(e||ae)(s.Y36(W.P),s.Y36(v.D),s.Y36(X.P),s.Y36(s.sBO),s.Y36(ee.$))},ae.ɵcmp=s.Xpm({type:ae,selectors:[["app-policy-edit"]],viewQuery:function(e,t){if(1&e&&s.Gf(se,7,s.s_b),2&e){let e;s.iGM(e=s.CRH())&&(t.policyFormRef=e.first)}},inputs:{policy:"policy",organizationId:"organizationId",policiesEnabledMap:"policiesEnabledMap"},outputs:{onSavedPolicy:"onSavedPolicy"},decls:57,vars:25,consts:[["role","dialog","aria-modal","true","aria-labelledby","policiesEditTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","policiesEditTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["class","modal-body",4,"ngIf"],[3,"hidden"],["policyForm",""],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"]],template:function(e,t){if(1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"form",2,3),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(6,"\n      "),s.TgZ(7,"div",4),s._uU(8,"\n        "),s.TgZ(9,"h1",5),s._uU(10),s.ALo(11,"i18n"),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n        "),s.TgZ(14,"button",6),s.ALo(15,"i18n"),s._uU(16,"\n          "),s.TgZ(17,"span",7),s._uU(18,"×"),s.qZA(),s._uU(19,"\n        "),s.qZA(),s._uU(20,"\n      "),s.qZA(),s._uU(21,"\n\n      "),s.TgZ(22,"div",8),s._uU(23,"\n        "),s.YNc(24,oe,9,6,"div",9),s._uU(25,"\n        "),s.TgZ(26,"div",10),s._uU(27,"\n          "),s.TgZ(28,"p"),s._uU(29),s.ALo(30,"i18n"),s.qZA(),s._uU(31,"\n          "),s.YNc(32,re,0,0,"ng-template",null,11,s.W1O),s._uU(34,"\n        "),s.qZA(),s._uU(35,"\n      "),s.qZA(),s._uU(36,"\n      "),s.TgZ(37,"div",12),s._uU(38,"\n        "),s.TgZ(39,"button",13),s._uU(40,"\n          "),s._UZ(41,"i",14),s.ALo(42,"i18n"),s._uU(43,"\n          "),s.TgZ(44,"span"),s._uU(45),s.ALo(46,"i18n"),s.qZA(),s._uU(47,"\n        "),s.qZA(),s._uU(48,"\n        "),s.TgZ(49,"button",15),s._uU(50),s.ALo(51,"i18n"),s.qZA(),s._uU(52,"\n      "),s.qZA(),s._uU(53,"\n    "),s.qZA(),s._uU(54,"\n  "),s.qZA(),s._uU(55,"\n"),s.qZA(),s._uU(56,"\n")),2&e){const e=s.MAs(5);s.xp6(4),s.Q6J("appApiAction",t.formPromise),s.xp6(6),s.AsE("\n          ",s.lcZ(11,11,"editPolicy")," - ",s.lcZ(12,13,t.policy.name),"\n        "),s.xp6(4),s.s9C("appA11yTitle",s.lcZ(15,15,"close")),s.xp6(10),s.Q6J("ngIf",t.loading),s.xp6(2),s.Q6J("hidden",t.loading),s.xp6(3),s.Oqu(s.lcZ(30,17,t.policy.description)),s.xp6(10),s.Q6J("disabled",e.loading),s.xp6(2),s.s9C("title",s.lcZ(42,19,"loading")),s.xp6(4),s.Oqu(s.lcZ(46,21,"save")),s.xp6(5),s.hij("\n          ",s.lcZ(51,23,"cancel"),"\n        ")}},dependencies:[y.O5,r.JL,r.F,te.B,ie.b,p.C],encapsulation:2});var le=i(8111),ce=i(28753),ue=i(2051),de=i(66385),pe=i(81168),he=i(58618),ge=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const fe=["editTemplate"];function me(e,t){1&e&&(s.ynx(0),s._uU(1,"\n    "),s._UZ(2,"i",3),s.ALo(3,"i18n"),s._uU(4,"\n    "),s.TgZ(5,"span",4),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n  "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function ve(e,t){1&e&&(s.TgZ(0,"span",10),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"on")))}function ye(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"td"),s._uU(1,"\n          "),s.TgZ(2,"a",7),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(2);return s.KtG(i.edit(t))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.YNc(6,ve,3,3,"span",8),s._uU(7,"\n          "),s.TgZ(8,"small",9),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n        "),s.qZA()}if(2&e){const e=s.oxw().$implicit,t=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,3,e.name)),s.xp6(3),s.Q6J("ngIf",t.policiesEnabledMap.get(e.type)),s.xp6(3),s.Oqu(s.lcZ(10,5,e.description))}}function we(e,t){if(1&e&&(s.TgZ(0,"tr"),s._uU(1,"\n        "),s.YNc(2,ye,12,7,"td",0),s._uU(3,"\n      "),s.qZA()),2&e){const e=t.$implicit,i=s.oxw(2);s.xp6(2),s.Q6J("ngIf",e.display(i.organization))}}function be(e,t){if(1&e&&(s.TgZ(0,"table",5),s._uU(1,"\n    "),s.TgZ(2,"tbody"),s._uU(3,"\n      "),s.YNc(4,we,4,1,"tr",6),s._uU(5,"\n    "),s.qZA(),s._uU(6,"\n  "),s.qZA()),2&e){const e=s.oxw();s.xp6(4),s.Q6J("ngForOf",e.policies)}}function Ue(e,t){}class _e{constructor(e,t,i,n,s,o){this.route=e,this.modalService=t,this.organizationService=i,this.policyApiService=n,this.policyListService=s,this.router=o,this.loading=!0,this.policiesEnabledMap=new Map}ngOnInit(){return ge(this,void 0,void 0,(function*(){this.route.parent.parent.params.subscribe((e=>ge(this,void 0,void 0,(function*(){this.organizationId=e.organizationId,this.organization=yield this.organizationService.get(this.organizationId),this.policies=this.policyListService.getPolicies(),yield this.load(),this.route.queryParams.pipe((0,V.P)()).subscribe((e=>ge(this,void 0,void 0,(function*(){if(null!=e.policyId){const t=e.policyId;for(const e of this.orgPolicies)if(e.id===t){for(let t=0;t<this.policies.length;t++)if(this.policies[t].type===e.type){this.edit(this.policies[t]);break}break}}}))))}))))}))}load(){return ge(this,void 0,void 0,(function*(){const e=yield this.policyApiService.getPolicies(this.organizationId);this.orgPolicies=null!=e.data&&e.data.length>0?e.data:[],this.orgPolicies.forEach((e=>{this.policiesEnabledMap.set(e.type,e.enabled)})),this.loading=!1}))}edit(e){return ge(this,void 0,void 0,(function*(){const[t]=yield this.modalService.openViewRef(ae,this.editModalRef,(i=>{i.policy=e,i.organizationId=this.organizationId,i.policiesEnabledMap=this.policiesEnabledMap,i.onSavedPolicy.subscribe((()=>{t.close(),this.load()}))}))}))}}_e.ɵfac=function(e){return new(e||_e)(s.Y36(le.gz),s.Y36($.Z),s.Y36(f.Mn),s.Y36(W.P),s.Y36(ce.x),s.Y36(le.F0))},_e.ɵcmp=s.Xpm({type:_e,selectors:[["app-org-policies"]],viewQuery:function(e,t){if(1&e&&s.Gf(fe,7,s.s_b),2&e){let e;s.iGM(e=s.CRH())&&(t.editModalRef=e.first)}},decls:12,vars:2,consts:[[4,"ngIf"],["class","table table-hover table-list",4,"ngIf"],["editTemplate",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],[1,"table","table-hover","table-list"],[4,"ngFor","ngForOf"],["href","#","appStopClick","",3,"click"],["bitBadge","","variant","success",4,"ngIf"],[1,"text-muted","d-block"],["bitBadge","","variant","success"]],template:function(e,t){1&e&&(s._UZ(0,"app-header"),s._uU(1,"\n\n"),s.TgZ(2,"bit-container"),s._uU(3,"\n  "),s.YNc(4,me,9,6,"ng-container",0),s._uU(5,"\n  "),s.YNc(6,be,7,1,"table",1),s._uU(7,"\n  "),s.YNc(8,Ue,0,0,"ng-template",null,2,s.W1O),s._uU(10,"\n"),s.qZA(),s._uU(11,"\n")),2&e&&(s.xp6(4),s.Q6J("ngIf",t.loading),s.xp6(2),s.Q6J("ngIf",!t.loading))},dependencies:[y.sg,y.O5,ue.O,de.l,pe.e,he.k,p.C],encapsulation:2})},13159:(e,t,i)=>{"use strict";i.d(t,{_P:()=>n,j1:()=>E});var n,s=i(28783),o=i(37513),r=i(54019),a=i(33031),l=i(68362),c=i(58691),u=i(27646),d=i(89474),p=i(4519),h=i(85921),g=i(85762),f=i(78627),m=i(99721),v=i(42304),y=i(92236),w=i(97360),b=i(28508),U=i(53707),_=i(46246),A=i(36338),Z=i(81974),x=i(29465),S=i(18362),T=i(82933),C=i(94516),O=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function k(e,t){1&e&&(g.ynx(0),g._uU(1),g.ALo(2,"i18n"),g.BQk()),2&e&&(g.xp6(1),g.hij("\n          ",g.lcZ(2,1,"orgCreatedSponsorshipInvalid"),"\n        "))}function P(e,t){if(1&e&&(g.TgZ(0,"li"),g._uU(1),g.ALo(2,"i18n"),g.qZA()),2&e){const e=t.$implicit;g.xp6(1),g.AsE("\n                ",e.count," ",g.lcZ(2,2,e.localizationKey),"\n              ")}}function q(e,t){if(1&e&&(g.ynx(0),g._uU(1),g.ALo(2,"i18n"),g.TgZ(3,"ul"),g._uU(4,"\n              "),g.YNc(5,P,3,4,"li",13),g._uU(6,"\n            "),g.qZA(),g._uU(7),g.ALo(8,"i18n"),g.BQk()),2&e){const e=g.oxw(2);g.xp6(1),g.hij("\n            ",g.xi3(2,3,"deletingOrganizationContentWarning",null==e.organization?null:e.organization.name),"\n            "),g.xp6(4),g.Q6J("ngForOf",e.organizationContentSummary.itemCountByType),g.xp6(2),g.hij("\n            ",g.lcZ(8,6,"deletingOrganizationActiveUserAccountsWarning"),"\n          ")}}function I(e,t){if(1&e&&(g._uU(0,"\n          "),g.YNc(1,q,9,8,"ng-container",12),g._uU(2,"\n        ")),2&e){const e=g.oxw();g.xp6(1),g.Q6J("ngIf",e.organizationContentSummary.totalItemCount>0)}}class M{getKey(e){return 1==e?this.singular:this.plural}constructor(e,t){this.singular=e,this.plural=t}}class N{get localizationKey(){return this.localizationKeyOptions.getKey(this.count)}constructor(e,t){this.count=e,this.localizationKeyOptions=t}}class L{constructor(){this.totalItemCount=0,this.itemCountByType=[]}}!function(e){e.Deleted="deleted",e.Canceled="canceled"}(n||(n={}));class D{constructor(e,t,i,s,a,l,c,u,d){this.params=e,this.dialogRef=t,this.i18nService=i,this.platformUtilsService=s,this.userVerificationService=a,this.cipherService=l,this.organizationService=c,this.organizationApiService=u,this.formBuilder=d,this.destroy$=new r.x,this.deleteOrganizationRequestType="RegularDelete",this.organizationContentSummary=new L,this.formGroup=this.formBuilder.group({secret:new o.NI(null,[o.kI.required])}),this.submit=()=>O(this,void 0,void 0,(function*(){yield this.userVerificationService.buildRequest(this.formGroup.value.secret).then((e=>this.organizationApiService.delete(this.organization.id,e))),this.platformUtilsService.showToast("success",this.i18nService.t("organizationDeleted"),this.i18nService.t("organizationDeletedDesc")),this.dialogRef.close(n.Deleted)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngOnInit(){return O(this,void 0,void 0,(function*(){this.deleteOrganizationRequestType=this.params.requestType,(0,a.a)([this.organizationService.get$(this.params.organizationId),this.cipherService.getAllFromApiForOrganization(this.params.organizationId)]).pipe((0,l.R)(this.destroy$)).subscribe((([e,t])=>{this.organization=e,this.organizationContentSummary=this.buildOrganizationContentSummary(t),this.loaded=!0}))}))}buildOrganizationContentSummary(e){const t=new L,i=e.filter((e=>null==e.deletedDate));if(i.length<1)return t;t.totalItemCount=i.length;for(const n of u.c.iterateEnum(d.Ou)){const e=this.getOrganizationItemCountByType(i,n);e>0&&t.itemCountByType.push(new N(e,this.getOrganizationItemLocalizationKeysByType(d.Ou[n])))}return t}getOrganizationItemCountByType(e,t){return e.filter((e=>e.type==t)).length}getOrganizationItemLocalizationKeysByType(e){return new M(`type${e}`,`type${e}Plural`)}}function E(e,t){return e.open(D,t)}D.ɵfac=function(e){return new(e||D)(g.Y36(s.Kt),g.Y36(s.zj),g.Y36(f.D),g.Y36(m.P),g.Y36(v.i),g.Y36(y.u),g.Y36(c.Mn),g.Y36(w.M),g.Y36(o.qu))},D.ɵcmp=g.Xpm({type:D,selectors:[["app-delete-organization"]],standalone:!0,features:[g.jDz],decls:39,vars:19,consts:[[3,"formGroup","bitSubmit"],[3,"loading"],["bitDialogTitle",""],["bitDialogContent",""],["type","warning"],["id","organizationDeleteDescription"],[4,"ngIf","ngIfElse"],["regularDelete",""],["formControlName","secret"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","danger",3,"disabled"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""],[4,"ngIf"],[4,"ngFor","ngForOf"]],template:function(e,t){if(1&e&&(g.TgZ(0,"form",0),g._uU(1,"\n  "),g.TgZ(2,"bit-dialog",1),g._uU(3,"\n    "),g.TgZ(4,"span",2),g._uU(5),g.ALo(6,"i18n"),g.qZA(),g._uU(7,"\n    "),g.TgZ(8,"div",3),g._uU(9,"\n      "),g.TgZ(10,"app-callout",4),g._uU(11),g.ALo(12,"i18n"),g.qZA(),g._uU(13,"\n      "),g.TgZ(14,"p",5),g._uU(15,"\n        "),g.YNc(16,k,3,3,"ng-container",6),g._uU(17,"\n        "),g.YNc(18,I,3,1,"ng-template",null,7,g.W1O),g._uU(20,"\n      "),g.qZA(),g._uU(21,"\n      "),g.TgZ(22,"app-user-verification",8),g._uU(23," "),g.qZA(),g._uU(24,"\n    "),g.qZA(),g._uU(25,"\n    "),g.TgZ(26,"div",9),g._uU(27,"\n      "),g.TgZ(28,"button",10),g._uU(29),g.ALo(30,"i18n"),g.qZA(),g._uU(31,"\n      "),g.TgZ(32,"button",11),g._uU(33),g.ALo(34,"i18n"),g.qZA(),g._uU(35,"\n    "),g.qZA(),g._uU(36,"\n  "),g.qZA(),g._uU(37,"\n"),g.qZA(),g._uU(38,"\n")),2&e){const e=g.MAs(19);g.Q6J("formGroup",t.formGroup)("bitSubmit",t.submit),g.xp6(2),g.Q6J("loading",!t.loaded),g.xp6(3),g.Oqu(g.lcZ(6,10,"deleteOrganization")),g.xp6(6),g.Oqu(g.xi3(12,12,"deletingOrganizationIsPermanentWarning",null==t.organization?null:t.organization.name)),g.xp6(5),g.Q6J("ngIf","InvalidFamiliesForEnterprise"===t.deleteOrganizationRequestType)("ngIfElse",e),g.xp6(12),g.Q6J("disabled",!t.loaded),g.xp6(1),g.hij("\n        ",g.lcZ(30,15,"deleteOrganization"),"\n      "),g.xp6(4),g.hij("\n        ",g.lcZ(34,17,"cancel"),"\n      ")}},dependencies:[h.m,b.sg,b.O5,o._Y,o.JJ,o.JL,o.sg,o.u,U.O,_.b,A.u,Z.r,x.a,S.f,T.C,p.Zn,C.W],encapsulation:2})},36689:(e,t,i)=>{"use strict";i.d(t,{f:()=>te,R:()=>ee});var n=i(85762),s=i(37513),o=i(54019),r=i(68362);function a(e,t,i){let n=0,s=e.length||0,o=-1,r=0;for(;n<s;)if(o=Math.floor((n+s)/2),r=i(e[o],t),r<0)n=o+1;else{if(!(r>0))return o;s=o}return n}class l{constructor(e,t){this.controlFactory=e,this.compareFn=t,this.allItems=[],this.selectedItems=[],this.deselectedItems=[],this.formArray=new s.Oe([])}selectItems(e,t){for(const i of e)this.selectItem(i,t)}deselectItems(e){for(const t of e)this.deselectItem(t)}deselectAll(){this.formArray.clear(),this.selectedItems=[],this.deselectedItems=[...this.allItems]}selectItem(e,t){const i=this.deselectedItems.findIndex((t=>t.id===e));if(-1===i)return;const n=this.deselectedItems[i];this.deselectedItems=[...this.deselectedItems.slice(0,i),...this.deselectedItems.slice(i+1)];const s=a(this.selectedItems,n,this.compareFn);this.selectedItems=[...this.selectedItems.slice(0,s),n,...this.selectedItems.slice(s)];const o=this.controlFactory(n);o.patchValue(Object.assign({id:e},t)),this.formArray.insert(s,o)}deselectItem(e){const t=this.selectedItems.findIndex((t=>t.id===e));if(-1===t)return;const i=this.selectedItems[t];this.selectedItems=[...this.selectedItems.slice(0,t),...this.selectedItems.slice(t+1)],this.formArray.removeAt(t);const n=a(this.deselectedItems,i,this.compareFn);this.deselectedItems=[...this.deselectedItems.slice(0,n),i,...this.deselectedItems.slice(n)]}populateItems(e,t=[]){this.formArray.clear(),this.allItems=[...e].sort(this.compareFn),this.selectedItems=[],this.deselectedItems=[...this.allItems];for(const i of t)this.selectItem(i.id,i)}forEachControlItem(e){for(let t=0;t<this.formArray.length;t++)e(this.formArray.at(t),this.selectedItems[t])}}var c=i(34632),u=i(78627),d=i(28508),p=i(33245),h=i(14970),g=i(66385),f=i(24637),m=i(11512),v=i(6378),y=i(36179),w=i(44358),b=i(21656),U=i(54735),_=i(50941),A=i(26361),Z=i(82933),x=i(92614);class S{constructor(e){this.i18nService=e}transform(e,t){if(null==e)return null!=t?t:this.i18nService.t("unknown");switch(e){case x.je.Owner:return this.i18nService.t("owner");case x.je.Admin:return this.i18nService.t("admin");case x.je.User:return this.i18nService.t("user");case x.je.Manager:return this.i18nService.t("manager");case x.je.Custom:return this.i18nService.t("custom")}}}S.ɵfac=function(e){return new(e||S)(n.Y36(u.D,16))},S.ɵpipe=n.Yjl({name:"userType",type:S,pure:!0});var T=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function C(e,t){if(1&e&&(n.TgZ(0,"option",15),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e){const e=t.$implicit;n.Q6J("value",e.perm),n.xp6(1),n.hij("\n        ",n.lcZ(2,2,e.labelId),"\n      ")}}const O=function(){return{standalone:!0}};function k(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"bit-form-field",12),n._uU(1,"\n    "),n.TgZ(2,"bit-label"),n._uU(3),n.ALo(4,"i18n"),n.qZA(),n._uU(5,"\n    "),n._uU(6,"\n    "),n.TgZ(7,"select",13),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw(2);return n.KtG(i.initialPermission=t)}))("blur",(function(){n.CHM(e);const t=n.oxw(2);return n.KtG(t.handleBlur())})),n._uU(8,"\n      "),n.YNc(9,C,3,4,"option",14),n._uU(10,"\n    "),n.qZA(),n._uU(11,"\n  "),n.qZA()}if(2&e){const e=n.oxw(2);n.xp6(3),n.Oqu(n.lcZ(4,5,"permission")),n.xp6(4),n.Q6J("disabled",e.disabled)("ngModel",e.initialPermission)("ngModelOptions",n.DdM(7,O)),n.xp6(2),n.Q6J("ngForOf",e.permissionList)}}function P(e,t){if(1&e&&(n.TgZ(0,"bit-hint"),n._uU(1),n.qZA()),2&e){const e=n.oxw(3);n.xp6(1),n.Oqu(e.selectorHelpText)}}function q(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"bit-form-field",16),n._uU(1,"\n    "),n.TgZ(2,"bit-label"),n._uU(3),n.qZA(),n._uU(4,"\n    "),n.TgZ(5,"bit-multi-select",17),n.NdJ("onItemsConfirmed",(function(t){n.CHM(e);const i=n.oxw(2);return n.KtG(i.selectItems(t))}))("blur",(function(){n.CHM(e);const t=n.oxw(2);return n.KtG(t.handleBlur())})),n.qZA(),n._uU(6,"\n    "),n.YNc(7,P,2,1,"bit-hint",18),n._uU(8,"\n  "),n.qZA()}if(2&e){const e=n.oxw(2);n.xp6(3),n.Oqu(e.selectorLabelText),n.xp6(2),n.Q6J("baseItems",e.selectionList.deselectedItems)("removeSelectedItems",!0)("disabled",e.disabled),n.xp6(2),n.Q6J("ngIf",e.selectorHelpText)}}function I(e,t){if(1&e&&(n.TgZ(0,"div",9),n._uU(1,"\n  "),n.YNc(2,k,12,8,"bit-form-field",10),n._uU(3,"\n\n  "),n.YNc(4,q,9,5,"bit-form-field",11),n._uU(5,"\n"),n.qZA()),2&e){const e=n.oxw();n.xp6(2),n.Q6J("ngIf","edit"==e.permissionMode),n.xp6(2),n.Q6J("ngIf",!e.disabled)}}function M(e,t){1&e&&(n.TgZ(0,"th",19),n._uU(1,"\n        "),n.TgZ(2,"div",20),n._uU(3),n.ALo(4,"i18n"),n.qZA(),n._uU(5,"\n      "),n.qZA()),2&e&&(n.xp6(3),n.hij("\n          ",n.lcZ(4,1,"permission"),"\n        "))}function N(e,t){1&e&&(n.TgZ(0,"th",21),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"role")))}function L(e,t){1&e&&(n.TgZ(0,"th",22),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"group")))}function D(e,t){1&e&&(n.TgZ(0,"span",36),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.hij("\n                ",n.lcZ(2,1,"invited"),"\n              "))}function E(e,t){if(1&e&&(n.TgZ(0,"div",37),n._uU(1),n.qZA()),2&e){const e=n.oxw(2).$implicit;n.xp6(1),n.hij("\n              ",e.email,"\n            ")}}function F(e,t){if(1&e&&(n.TgZ(0,"div",31),n._uU(1,"\n          "),n._UZ(2,"bit-avatar",32),n._uU(3,"\n          "),n.TgZ(4,"div",33),n._uU(5,"\n            "),n.TgZ(6,"div"),n._uU(7),n.YNc(8,D,3,3,"span",34),n._uU(9,"\n            "),n.qZA(),n._uU(10,"\n            "),n.YNc(11,E,2,1,"div",35),n._uU(12,"\n          "),n.qZA(),n._uU(13,"\n        "),n.qZA()),2&e){const e=n.oxw().$implicit;n.xp6(2),n.s9C("text",e.labelName),n.xp6(5),n.hij("\n              ",e.labelName,"\n              "),n.xp6(1),n.Q6J("ngIf",0==e.status),n.xp6(3),n.Q6J("ngIf",0!=e.status)}}function R(e,t){if(1&e&&(n.TgZ(0,"div",31),n._uU(1,"\n          "),n._UZ(2,"i",38),n._uU(3,"\n          "),n.TgZ(4,"span"),n._uU(5),n.qZA(),n._uU(6,"\n        "),n.qZA()),2&e){const e=n.oxw().$implicit,t=n.oxw(2);n.xp6(2),n.Q6J("ngClass",e.icon||t.itemIcon(e)),n.xp6(3),n.Oqu(e.labelName)}}function J(e,t){if(1&e&&(n.TgZ(0,"option",15),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e){const e=t.$implicit;n.Q6J("value",e.perm),n.xp6(1),n.hij("\n                ",n.lcZ(2,2,e.labelId),"\n              ")}}function z(e,t){if(1&e){const e=n.EpF();n.ynx(0),n._uU(1,"\n          "),n.TgZ(2,"label",41),n._uU(3),n.ALo(4,"i18n"),n.qZA(),n._uU(5,"\n          "),n.TgZ(6,"div",42),n._uU(7,"\n            "),n.TgZ(8,"select",43),n.NdJ("blur",(function(){n.CHM(e);const t=n.oxw(4);return n.KtG(t.handleBlur())})),n._uU(9,"\n              "),n.YNc(10,J,3,4,"option",14),n._uU(11,"\n            "),n.qZA(),n._uU(12,"\n            "),n.TgZ(13,"label",44),n._uU(14,"\n              "),n._UZ(15,"i",45),n._uU(16,"\n            "),n.qZA(),n._uU(17,"\n          "),n.qZA(),n._uU(18,"\n        "),n.BQk()}if(2&e){const e=n.oxw(2),t=e.index,i=e.$implicit,s=n.oxw(2);n.xp6(2),n.Q6J("for","permission"+t),n.xp6(1),n.AsE("",i.labelName," ",n.lcZ(4,6,"permission"),""),n.xp6(5),n.Q6J("id","permission"+t),n.xp6(2),n.Q6J("ngForOf",s.permissionList),n.xp6(3),n.Q6J("for","permission"+t)}}function Y(e,t){if(1&e&&(n.TgZ(0,"div",48),n.ALo(1,"i18n"),n._uU(2),n.ALo(3,"i18n"),n._UZ(4,"i",49),n._uU(5,"\n          "),n.qZA()),2&e){const e=n.oxw(3).$implicit,t=n.oxw(2);n.Q6J("appA11yTitle",n.lcZ(1,2,t.accessAllLabelId(e))),n.xp6(2),n.hij("\n            ",n.lcZ(3,4,"canEdit"),"\n            ")}}function K(e,t){if(1&e&&(n.TgZ(0,"div",50),n.ALo(1,"i18n"),n._uU(2),n.ALo(3,"i18n"),n.qZA()),2&e){const e=n.oxw(3).$implicit,t=n.oxw(2);n.Q6J("title",n.lcZ(1,2,t.permissionLabelId(e.readonlyPermission))),n.xp6(2),n.hij("\n            ",n.lcZ(3,4,t.permissionLabelId(e.readonlyPermission)),"\n          ")}}function B(e,t){if(1&e&&(n._uU(0,"\n          "),n.YNc(1,Y,6,6,"div",46),n._uU(2,"\n\n          "),n.YNc(3,K,4,6,"div",47),n._uU(4,"\n        ")),2&e){const e=n.oxw(2).$implicit,t=n.oxw(2);n.xp6(1),n.Q6J("ngIf",e.accessAllItems),n.xp6(2),n.Q6J("ngIf",e.readonly||t.disabled)}}function Q(e,t){if(1&e&&(n.TgZ(0,"td",3),n._uU(1,"\n        "),n.YNc(2,z,19,8,"ng-container",39),n._uU(3,"\n\n        "),n.YNc(4,B,5,2,"ng-template",null,40,n.W1O),n._uU(6,"\n      "),n.qZA()),2&e){const e=n.MAs(5),t=n.oxw().$implicit,i=n.oxw(2);n.xp6(2),n.Q6J("ngIf",i.canEditItemPermission(t))("ngIfElse",e)}}function G(e,t){if(1&e&&(n.TgZ(0,"td",3),n._uU(1),n.ALo(2,"userType"),n.qZA()),2&e){const e=n.oxw().$implicit;n.xp6(1),n.hij("\n        ",n.xi3(2,1,e.role,"-"),"\n      ")}}function j(e,t){if(1&e&&(n.TgZ(0,"td",3),n._uU(1),n.qZA()),2&e){const e=n.oxw().$implicit;let t;n.xp6(1),n.hij("\n        ",null!==(t=e.viaGroupName)&&void 0!==t?t:"-","\n      ")}}function V(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"button",51),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw().$implicit,i=n.oxw(2);return i.selectionList.deselectItem(t.id),n.KtG(i.handleBlur())})),n.ALo(1,"i18n"),n.qZA()}if(2&e){const e=n.oxw().$implicit,t=n.oxw(2);n.hYB("appA11yTitle","",n.lcZ(1,3,"remove")," ",e.labelName,""),n.Q6J("disabled",t.disabled)}}const $=function(e){return{"tw-text-muted":e}};function H(e,t){if(1&e&&(n.TgZ(0,"tr",24),n._uU(1,"\n      "),n.TgZ(2,"td",25),n._uU(3,"\n        "),n.YNc(4,F,14,4,"div",26),n._uU(5,"\n\n        "),n.YNc(6,R,7,2,"div",27),n._uU(7,"\n      "),n.qZA(),n._uU(8,"\n\n      "),n.YNc(9,Q,7,2,"td",28),n._uU(10,"\n\n      "),n.YNc(11,G,3,4,"td",28),n._uU(12,"\n\n      "),n.YNc(13,j,2,1,"td",28),n._uU(14,"\n\n      "),n.TgZ(15,"td",29),n._uU(16,"\n        "),n.YNc(17,V,2,5,"button",30),n._uU(18,"\n      "),n.qZA(),n._uU(19,"\n    "),n.qZA()),2&e){const e=t.$implicit,i=t.index,s=n.oxw(2);n.Q6J("formGroupName",i)("ngClass",n.VKq(8,$,e.readonly)),n.xp6(2),n.Q6J("ngSwitch",e.type),n.xp6(2),n.Q6J("ngSwitchCase",s.itemType.Member),n.xp6(5),n.Q6J("ngIf","hidden"!=s.permissionMode),n.xp6(2),n.Q6J("ngIf",s.showMemberRoles),n.xp6(2),n.Q6J("ngIf",s.showGroupColumn),n.xp6(4),n.Q6J("ngIf",!s.disabled&&!e.readonly)}}function W(e,t){if(1&e&&(n.TgZ(0,"tr"),n._uU(1,"\n      "),n.TgZ(2,"td",3),n._uU(3),n.qZA(),n._uU(4,"\n    "),n.qZA()),2&e){const e=n.oxw(2);n.xp6(3),n.Oqu(e.emptySelectionText)}}function X(e,t){if(1&e&&(n._uU(0,"\n    "),n.YNc(1,H,20,10,"tr",23),n._uU(2,"\n    "),n.YNc(3,W,5,1,"tr",18),n._uU(4,"\n  ")),2&e){const e=n.oxw();n.xp6(1),n.Q6J("ngForOf",e.selectionList.selectedItems),n.xp6(2),n.Q6J("ngIf",0==e.selectionList.selectedItems.length)}}var ee;!function(e){e.Hidden="hidden",e.Readonly="readonly",e.Edit="edit"}(ee||(ee={}));class te{get items(){return this.selectionList.allItems}set items(e){var t;const i=(null!==(t=this.selectionList.formArray.getRawValue())&&void 0!==t?t:[]).concat(e.filter((e=>e.readonly)));this.selectionList.populateItems(e.map((e=>{var t;return e.icon=null!==(t=e.icon)&&void 0!==t?t:this.itemIcon(e),e})),i)}get permissionMode(){return this._permissionMode}set permissionMode(e){this._permissionMode=e,this.updateAllRowControlDisableStates()}set flexibleCollectionsEnabled(e){this._flexibleCollectionsEnabled=e,this.permissionList=(0,c.pZ)(e)}constructor(e,t){this.formBuilder=e,this.i18nService=t,this.destroy$=new o.x,this.updateRowControlDisableState=(e,t)=>{t.readonly?e.disable():(e.enable(),(t.accessAllItems||this.permissionMode!=ee.Edit)&&e.controls.permission.disable())},this.updateAllRowControlDisableStates=()=>{this.selectionList.forEachControlItem(((e,t)=>{this.updateRowControlDisableState(e,t)}))},this.selectionList=new l((e=>{const t=this.formBuilder.control(this.initialPermission),i=this.formBuilder.group({id:new s.NI(e.id),type:new s.NI(e.type),permission:t});return this.updateRowControlDisableState(i,e),i}),this._itemComparator.bind(this)),this.formGroup=this.formBuilder.group({items:this.selectionList.formArray}),this.itemType=c.zD,this.initialPermission=c.OU.View,this._permissionMode=ee.Hidden,this.hideMultiSelect=!1}registerOnChange(e){this.notifyOnChange=e}registerOnTouched(e){this.notifyOnTouch=e}setDisabledState(e){this.disabled=e,this.disabled?(this.permissionMode=ee.Readonly,this.formGroup.disable()):(this.formGroup.enable(),this.updateAllRowControlDisableStates())}writeValue(e){if(this.pauseChangeNotification=!0,this.selectionList.deselectAll(),this.selectionList.selectItems(this.items.filter((e=>e.readonly)).map((e=>e.id))),null!=e){if(!Array.isArray(e))throw new Error("The access selector component only supports Array form values!");for(const t of e)this.selectionList.selectItem(t.id,t);this.pauseChangeNotification=!1}else this.pauseChangeNotification=!1}ngOnInit(){return T(this,void 0,void 0,(function*(){this.permissionList=(0,c.pZ)(this._flexibleCollectionsEnabled),this.selectionList.formArray.valueChanges.pipe((0,r.R)(this.destroy$)).subscribe((e=>{this.notifyOnChange&&!this.pauseChangeNotification&&(this.selectionList.formArray.disabled?this.notifyOnChange([]):this.notifyOnChange(e))}))}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}handleBlur(){this.notifyOnTouch&&this.notifyOnTouch()}selectItems(e){this.pauseChangeNotification=!0,this.selectionList.selectItems(e.map((e=>e.id))),this.pauseChangeNotification=!1,null!=this.notifyOnChange&&this.notifyOnChange(this.selectionList.formArray.value)}itemIcon(e){switch(e.type){case c.zD.Collection:return"bwi-collection";case c.zD.Group:return"bwi-users";case c.zD.Member:return"bwi-user"}}permissionLabelId(e){var t;return null===(t=this.permissionList.find((t=>t.perm==e)))||void 0===t?void 0:t.labelId}accessAllLabelId(e){return e.type==c.zD.Group?"groupAccessAll":"memberAccessAll"}canEditItemPermission(e){return this.permissionMode==ee.Edit&&!e.readonly&&!e.accessAllItems}_itemComparator(e,t){return e.type-t.type||this.i18nService.collator.compare(e.listName,t.listName)||this.i18nService.collator.compare(e.labelName,t.labelName)||Number(t.readonly)-Number(e.readonly)}}te.ɵfac=function(e){return new(e||te)(n.Y36(s.qu),n.Y36(u.D))},te.ɵcmp=n.Xpm({type:te,selectors:[["bit-access-selector"]],inputs:{items:"items",permissionMode:"permissionMode",columnHeader:"columnHeader",selectorLabelText:"selectorLabelText",selectorHelpText:"selectorHelpText",emptySelectionText:"emptySelectionText",showMemberRoles:"showMemberRoles",showGroupColumn:"showGroupColumn",flexibleCollectionsEnabled:"flexibleCollectionsEnabled",hideMultiSelect:"hideMultiSelect"},features:[n._Bn([{provide:s.JU,useExisting:(0,n.Gpc)((()=>te)),multi:!0}])],decls:26,vars:6,consts:[["class","tw-flex",4,"ngIf"],[3,"formGroup"],["header",""],["bitCell",""],["bitCell","","id","permissionColHeading",4,"ngIf"],["bitCell","","id","roleColHeading",4,"ngIf"],["bitCell","","id","groupColHeading",4,"ngIf"],["bitCell","",1,"tw-w-20"],["body","","formArrayName","items"],[1,"tw-flex"],["class","tw-mr-3 tw-shrink-0",4,"ngIf"],["class","tw-grow",4,"ngIf"],[1,"tw-mr-3","tw-shrink-0"],["bitInput","",1,"tw-h-[35px]",3,"disabled","ngModel","ngModelOptions","ngModelChange","blur"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"tw-grow"],[1,"tw-w-full",3,"baseItems","removeSelectedItems","disabled","onItemsConfirmed","blur"],[4,"ngIf"],["bitCell","","id","permissionColHeading"],[1,"tw-border","tw-border-solid","tw-border-transparent"],["bitCell","","id","roleColHeading"],["bitCell","","id","groupColHeading"],["bitRow","",3,"formGroupName","ngClass",4,"ngFor","ngForOf"],["bitRow","",3,"formGroupName","ngClass"],["bitCell","",3,"ngSwitch"],["class","tw-flex tw-items-center",4,"ngSwitchCase"],["class","tw-flex tw-items-center",4,"ngSwitchDefault"],["bitCell","",4,"ngIf"],["bitCell","",1,"tw-text-right"],["type","button","bitIconButton","bwi-close","buttonType","muted",3,"appA11yTitle","disabled","click",4,"ngIf"],[1,"tw-flex","tw-items-center"],["size","small",1,"tw-mr-3",3,"text"],[1,"tw-flex","tw-flex-col"],["bitBadge","","variant","secondary",4,"ngIf"],["class","tw-text-xs tw-text-muted",4,"ngIf"],["bitBadge","","variant","secondary"],[1,"tw-text-xs","tw-text-muted"],["aria-hidden","true",1,"bwi","tw-mr-3","tw-px-0.5","tw-text-2xl",3,"ngClass"],[4,"ngIf","ngIfElse"],["readOnlyPerm",""],[1,"sr-only",3,"for"],[1,"tw-relative","tw-inline-block"],["bitInput","","formControlName","permission",1,"tw-apperance-none","-tw-ml-3","tw-max-w-40","tw-appearance-none","tw-overflow-ellipsis","!tw-rounded","tw-border-transparent","!tw-bg-transparent","tw-pr-6","tw-font-bold","hover:tw-border-primary-700",3,"id","blur"],[1,"tw-absolute","tw-inset-y-0","tw-right-4","tw-mb-0","tw-flex","tw-items-center",3,"for"],[1,"bwi","bwi-sm","bwi-angle-down","tw-leading-[0]"],["class","tw-max-w-40 tw-overflow-hidden tw-overflow-ellipsis tw-whitespace-nowrap tw-border tw-border-solid tw-border-transparent tw-font-bold tw-text-muted",3,"appA11yTitle",4,"ngIf"],["class","tw-max-w-40 tw-overflow-hidden tw-overflow-ellipsis tw-whitespace-nowrap tw-font-bold tw-text-muted",3,"title",4,"ngIf"],[1,"tw-max-w-40","tw-overflow-hidden","tw-overflow-ellipsis","tw-whitespace-nowrap","tw-border","tw-border-solid","tw-border-transparent","tw-font-bold","tw-text-muted",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-filter","tw-ml-1"],[1,"tw-max-w-40","tw-overflow-hidden","tw-overflow-ellipsis","tw-whitespace-nowrap","tw-font-bold","tw-text-muted",3,"title"],["type","button","bitIconButton","bwi-close","buttonType","muted",3,"appA11yTitle","disabled","click"]],template:function(e,t){1&e&&(n._uU(0,"\n"),n._uU(1,"\n"),n.YNc(2,I,6,2,"div",0),n._uU(3,"\n\n"),n.TgZ(4,"bit-table",1),n._uU(5,"\n  "),n.ynx(6,2),n._uU(7,"\n    "),n.TgZ(8,"tr"),n._uU(9,"\n      "),n.TgZ(10,"th",3),n._uU(11),n.qZA(),n._uU(12,"\n      "),n.YNc(13,M,6,3,"th",4),n._uU(14,"\n      "),n.YNc(15,N,3,3,"th",5),n._uU(16,"\n      "),n.YNc(17,L,3,3,"th",6),n._uU(18,"\n      "),n._UZ(19,"th",7),n._uU(20,"\n    "),n.qZA(),n._uU(21,"\n  "),n.BQk(),n._uU(22,"\n  "),n.YNc(23,X,5,2,"ng-template",8),n._uU(24,"\n"),n.qZA(),n._uU(25,"\n")),2&e&&(n.xp6(2),n.Q6J("ngIf",!t.hideMultiSelect),n.xp6(2),n.Q6J("formGroup",t.formGroup),n.xp6(7),n.Oqu(t.columnHeader),n.xp6(2),n.Q6J("ngIf","hidden"!=t.permissionMode),n.xp6(2),n.Q6J("ngIf",t.showMemberRoles),n.xp6(2),n.Q6J("ngIf",t.showGroupColumn))},dependencies:[d.mk,d.sg,d.O5,d.RF,d.n9,d.ED,s.YN,s.Kr,s.EJ,s.JJ,s.JL,s.On,s.sg,s.u,s.x0,s.CE,p.B,h.A,g.l,f.d,m.G,v.O,y.u,w.M,b.Q,U.a,_.Y,A.v,U.f,Z.C,S],encapsulation:2})},34632:(e,t,i)=>{"use strict";i.d(t,{E2:()=>l,OU:()=>n,XL:()=>p,d4:()=>a,hs:()=>d,pZ:()=>r,zD:()=>s});var n,s,o=i(63078);!function(e){e.View="view",e.ViewExceptPass="viewExceptPass",e.Edit="edit",e.EditExceptPass="editExceptPass",e.Manage="manage"}(n||(n={})),function(e){e[e.Collection=0]="Collection",e[e.Group=1]="Group",e[e.Member=2]="Member"}(s||(s={}));const r=e=>{const t=[{perm:n.View,labelId:"canView"},{perm:n.ViewExceptPass,labelId:"canViewExceptPass"},{perm:n.Edit,labelId:"canEdit"},{perm:n.EditExceptPass,labelId:"canEditExceptPass"}];return e&&t.push({perm:n.Manage,labelId:"canManage"}),t},a=e=>{if(null!=e)return e.manage?n.Manage:e.readOnly?e.hidePasswords?n.ViewExceptPass:n.View:e.hidePasswords?n.EditExceptPass:n.Edit},l=e=>new o.KF({id:e.id,readOnly:c(e.permission),hidePasswords:u(e.permission),manage:e.permission===n.Manage}),c=e=>[n.View,n.ViewExceptPass].includes(e),u=e=>[n.ViewExceptPass,n.EditExceptPass].includes(e);function d(e){return{id:e.id,type:s.Group,listName:e.name,labelName:e.name,accessAllItems:e.accessAll,readonly:e.accessAll}}function p(e){var t,i;return{id:e.id,type:s.Member,email:e.email,role:e.type,listName:(null===(t=e.name)||void 0===t?void 0:t.length)>0?`${e.name} (${e.email})`:e.email,labelName:null!==(i=e.name)&&void 0!==i?i:e.email,status:e.status,accessAllItems:e.accessAll,readonly:e.accessAll}}},1176:(e,t,i)=>{"use strict";i.d(t,{k:()=>o});var n=i(71146),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.m]})},29428:(e,t,i)=>{"use strict";i.d(t,{x:()=>r});var n=i(17682),s=i(2978),o=i(85762);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵmod=o.oAB({type:r}),r.ɵinj=o.cJS({providers:[n.N,s.d]})},10945:(e,t,i)=>{"use strict";var n;i.d(t,{L:()=>n}),function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed",e[e.RecoveryInitiated=3]="RecoveryInitiated",e[e.RecoveryApproved=4]="RecoveryApproved"}(n||(n={}))},76736:(e,t,i)=>{"use strict";i.d(t,{x:()=>n.x,d:()=>s.d});var n=i(29428),s=i(2978)},17682:(e,t,i)=>{"use strict";i.d(t,{N:()=>g});var n=i(41489),s=i(42844),o=i(58043),r=i(5094);class a extends o.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.granteeId=this.getResponseProperty("GranteeId"),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email"),this.type=this.getResponseProperty("Type"),this.status=this.getResponseProperty("Status"),this.waitTimeDays=this.getResponseProperty("WaitTimeDays"),this.creationDate=this.getResponseProperty("CreationDate"),this.avatarColor=this.getResponseProperty("AvatarColor")}}class l extends o.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.grantorId=this.getResponseProperty("GrantorId"),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email"),this.type=this.getResponseProperty("Type"),this.status=this.getResponseProperty("Status"),this.waitTimeDays=this.getResponseProperty("WaitTimeDays"),this.creationDate=this.getResponseProperty("CreationDate"),this.avatarColor=this.getResponseProperty("AvatarColor")}}class c extends o.c{constructor(e){super(e),this.keyEncrypted=this.getResponseProperty("KeyEncrypted"),this.kdf=this.getResponseProperty("Kdf"),this.kdfIterations=this.getResponseProperty("KdfIterations"),this.kdfMemory=this.getResponseProperty("KdfMemory"),this.kdfParallelism=this.getResponseProperty("KdfParallelism")}}class u extends o.c{constructor(e){super(e),this.ciphers=[],this.keyEncrypted=this.getResponseProperty("KeyEncrypted");const t=this.getResponseProperty("Ciphers");null!=t&&(this.ciphers=t.map((e=>new r.r(e))))}}var d=i(85762),p=i(55602),h=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class g{constructor(e){this.apiService=e}getEmergencyAccessTrusted(){return h(this,void 0,void 0,(function*(){const e=yield this.apiService.send("GET","/emergency-access/trusted",null,!0,!0);return new s.L(e,a)}))}getEmergencyAccessGranted(){return h(this,void 0,void 0,(function*(){const e=yield this.apiService.send("GET","/emergency-access/granted",null,!0,!0);return new s.L(e,l)}))}getEmergencyAccess(e){return h(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/emergency-access/"+e,null,!0,!0);return new a(t)}))}getEmergencyGrantorPolicies(e){return h(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/emergency-access/"+e+"/policies",null,!0,!0);return new s.L(t,n.j)}))}putEmergencyAccess(e,t){return this.apiService.send("PUT","/emergency-access/"+e,t,!0,!1)}deleteEmergencyAccess(e){return this.apiService.send("DELETE","/emergency-access/"+e,null,!0,!1)}postEmergencyAccessInvite(e){return this.apiService.send("POST","/emergency-access/invite",e,!0,!1)}postEmergencyAccessReinvite(e){return this.apiService.send("POST","/emergency-access/"+e+"/reinvite",null,!0,!1)}postEmergencyAccessAccept(e,t){return this.apiService.send("POST","/emergency-access/"+e+"/accept",t,!0,!1)}postEmergencyAccessConfirm(e,t){return this.apiService.send("POST","/emergency-access/"+e+"/confirm",t,!0,!1)}postEmergencyAccessInitiate(e){return this.apiService.send("POST","/emergency-access/"+e+"/initiate",null,!0,!1)}postEmergencyAccessApprove(e){return this.apiService.send("POST","/emergency-access/"+e+"/approve",null,!0,!1)}postEmergencyAccessReject(e){return this.apiService.send("POST","/emergency-access/"+e+"/reject",null,!0,!1)}postEmergencyAccessTakeover(e){return h(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/emergency-access/"+e+"/takeover",null,!0,!0);return new c(t)}))}postEmergencyAccessPassword(e,t){return h(this,void 0,void 0,(function*(){yield this.apiService.send("POST","/emergency-access/"+e+"/password",t,!0,!0)}))}postEmergencyAccessView(e){return h(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/emergency-access/"+e+"/view",null,!0,!0);return new u(t)}))}}g.ɵfac=function(e){return new(e||g)(d.LFG(p.s))},g.ɵprov=d.Yz7({token:g,factory:g.ɵfac})},2978:(e,t,i)=>{"use strict";i.d(t,{d:()=>x});var n=i(63700),s=i(90692),o=i(88160),r=i(44879),a=i(27646),l=i(55637),c=i(19572),u=i(10945);class d{}class p{}class h{}class g{}class f{}class m extends f{}var v=i(17682),y=i(85762),w=i(55602),b=i(76528),U=i(85540),_=i(92236),A=i(66459),Z=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class x{constructor(e,t,i,n,s,o){this.emergencyAccessApiService=e,this.apiService=t,this.cryptoService=i,this.encryptService=n,this.cipherService=s,this.logService=o}getEmergencyAccess(e){return this.emergencyAccessApiService.getEmergencyAccess(e)}getEmergencyAccessTrusted(){return Z(this,void 0,void 0,(function*(){return(yield this.emergencyAccessApiService.getEmergencyAccessTrusted()).data}))}getEmergencyAccessGranted(){return Z(this,void 0,void 0,(function*(){return(yield this.emergencyAccessApiService.getEmergencyAccessGranted()).data}))}getGrantorPolicies(e){return Z(this,void 0,void 0,(function*(){const t=yield this.emergencyAccessApiService.getEmergencyGrantorPolicies(e);let i;return null!=t.data&&t.data.length>0&&(i=t.data.map((e=>new s.G(new n.n(e))))),i}))}invite(e,t,i){return Z(this,void 0,void 0,(function*(){const n=new h;n.email=e.trim(),n.type=t,n.waitTimeDays=i,yield this.emergencyAccessApiService.postEmergencyAccessInvite(n)}))}reinvite(e){return this.emergencyAccessApiService.postEmergencyAccessReinvite(e)}update(e,t,i){return Z(this,void 0,void 0,(function*(){const n=new f;n.type=t,n.waitTimeDays=i,yield this.emergencyAccessApiService.putEmergencyAccess(e,n)}))}accept(e,t){return Z(this,void 0,void 0,(function*(){const i=new d;i.token=t,yield this.emergencyAccessApiService.postEmergencyAccessAccept(e,i)}))}confirm(e,t){return Z(this,void 0,void 0,(function*(){const i=yield this.cryptoService.getUserKey();if(!i)throw new Error("No user key found");const n=yield this.apiService.getUserPublicKey(t),s=a.c.fromB64ToArray(n.publicKey);try{this.logService.debug("User's fingerprint: "+(yield this.cryptoService.getFingerprint(t,s)).join("-"))}catch(r){}const o=new p;o.key=yield this.encryptKey(i,s),yield this.emergencyAccessApiService.postEmergencyAccessConfirm(e,o)}))}delete(e){return this.emergencyAccessApiService.deleteEmergencyAccess(e)}requestAccess(e){return this.emergencyAccessApiService.postEmergencyAccessInitiate(e)}approve(e){return this.emergencyAccessApiService.postEmergencyAccessApprove(e)}reject(e){return this.emergencyAccessApiService.postEmergencyAccessReject(e)}getViewOnlyCiphers(e){return Z(this,void 0,void 0,(function*(){const t=yield this.emergencyAccessApiService.postEmergencyAccessView(e),i=yield this.cryptoService.getPrivateKey();if(null==i)throw new Error("Active user does not have a private key, cannot get view only ciphers.");const n=yield this.cryptoService.rsaDecrypt(t.keyEncrypted,i),s=new l.N(n);return(yield this.encryptService.decryptItems(t.ciphers.map((e=>new c.t(e))),s)).sort(this.cipherService.getLocaleSortingFunction())}))}takeover(e,t,i){return Z(this,void 0,void 0,(function*(){const n=yield this.emergencyAccessApiService.postEmergencyAccessTakeover(e),s=yield this.cryptoService.getPrivateKey();if(null==s)throw new Error("Active user does not have a private key, cannot complete a takeover.");const a=yield this.cryptoService.rsaDecrypt(n.keyEncrypted,s);if(null==a)throw new Error("Failed to decrypt grantor key");const c=new l.N(a);let u;switch(n.kdf){case r.G3.PBKDF2_SHA256:u=new o.S(n.kdfIterations);break;case r.G3.Argon2id:u=new o.H(n.kdfIterations,n.kdfMemory,n.kdfParallelism)}const d=yield this.cryptoService.makeMasterKey(t,i,u),p=yield this.cryptoService.hashMasterKey(t,d),h=yield this.cryptoService.encryptUserKeyWithMasterKey(d,c),f=new g;f.newMasterPasswordHash=p,f.key=h[1].encryptedString,this.emergencyAccessApiService.postEmergencyAccessPassword(e,f)}))}getRotatedKeys(e){return Z(this,void 0,void 0,(function*(){const t=[],i=yield this.emergencyAccessApiService.getEmergencyAccessTrusted();if(!i||0===i.data.length)return t;const n=new Set([u.L.Confirmed,u.L.RecoveryInitiated,u.L.RecoveryApproved]),s=i.data.filter((e=>n.has(e.status)));for(const o of s){const i=yield this.apiService.getUserPublicKey(o.granteeId),n=a.c.fromB64ToArray(i.publicKey),s=yield this.encryptKey(e,n),r=new m;r.id=o.id,r.type=o.type,r.waitTimeDays=o.waitTimeDays,r.keyEncrypted=s,t.push(r)}return t}))}encryptKey(e,t){return Z(this,void 0,void 0,(function*(){return(yield this.cryptoService.rsaEncrypt(e.key,t)).encryptedString}))}postLegacyRotation(e){return Z(this,void 0,void 0,(function*(){if(null!=e)for(const t of e)yield this.emergencyAccessApiService.putEmergencyAccess(t.id,t)}))}}x.ɵfac=function(e){return new(e||x)(y.LFG(v.N),y.LFG(w.s),y.LFG(b.$),y.LFG(U.U),y.LFG(_.u),y.LFG(A.$))},x.ɵprov=y.Yz7({token:x,factory:x.ɵfac})},82421:(e,t,i)=>{"use strict";i.d(t,{k:()=>u});var n=i(85762),s=i(8111),o=i(2184),r=i(67855),a=i(27646),l=i(70062),c=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function u(){return(t,i)=>c(this,void 0,void 0,(function*(){const t=(0,n.f3M)(o.e),c=(0,n.f3M)(s.F0),u=(0,n.f3M)(l.c),d=i.url,p=u.getPreviousUrl();if((yield t.getAuthStatus())===r.y.Unlocked){const e=yield u.getAndClearLoginRedirectUrl();return!!a.c.isNullOrEmpty(e)||c.navigateByUrl(e)}return e(d)?yield u.persistLoginRedirectUrl(d):e(p)&&(yield u.persistLoginRedirectUrl(p)),!0}));function e(e){return!a.c.isNullOrEmpty(e)&&!(null==e?void 0:e.toLocaleLowerCase().includes("/lock"))}}},79797:(e,t,i)=>{"use strict";i.d(t,{D:()=>o});var n=i(85762),s=i(55602);class o{constructor(){this.apiService=(0,n.f3M)(s.s)}postUserKeyUpdate(e){return this.apiService.send("POST","/accounts/key",e,!0,!1)}}o.ɵfac=function(e){return new(e||o)},o.ɵprov=n.Yz7({token:o,factory:o.ɵfac})},41366:(e,t,i)=>{"use strict";i.d(t,{N:()=>r});var n=i(79797),s=i(92879),o=i(85762);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵmod=o.oAB({type:r}),r.ɵinj=o.cJS({providers:[s.j,n.D]})},92879:(e,t,i)=>{"use strict";i.d(t,{j:()=>Z});var n=i(99042),s=i(59281),o=i(41412),r=i(79971),a=i(98157),l=i(76736);class c{constructor(){this.ciphers=[],this.folders=[],this.sends=[],this.emergencyAccessKeys=[],this.resetPasswordKeys=[]}}var u=i(79797),d=i(85762),p=i(42842),h=i(92236),g=i(23031),f=i(92649),m=i(51651),v=i(76528),y=i(85540),w=i(58172),b=i(47724),U=i(65254),_=i(85420),A=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Z{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h){this.masterPasswordService=e,this.apiService=t,this.cipherService=i,this.folderService=n,this.sendService=s,this.emergencyAccessService=o,this.resetPasswordService=r,this.deviceTrustService=a,this.cryptoService=l,this.encryptService=c,this.stateService=u,this.accountService=d,this.configService=p,this.kdfConfigService=h}rotateUserKeyAndEncryptedData(e){var t;return A(this,void 0,void 0,(function*(){if(!e)throw new Error("Invalid master password");const i=yield this.cryptoService.makeMasterKey(e,yield this.stateService.getEmail(),yield this.kdfConfigService.getKdfConfig());if(!i)throw new Error("Master key could not be created");const o=null===(t=yield(0,n.z)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;yield this.masterPasswordService.setMasterKey(i,o);const[r,a]=yield this.cryptoService.makeUserKey(i);if(!r||!a)throw new Error("User key could not be created");const l=new c;l.key=a.encryptedString;const u=yield this.cryptoService.hashMasterKey(e,i);l.masterPasswordHash=u,l.privateKey=yield this.encryptPrivateKey(r),l.ciphers=yield this.encryptCiphers(r),l.folders=yield this.encryptFolders(r),l.sends=yield this.sendService.getRotatedKeys(r),l.emergencyAccessKeys=yield this.emergencyAccessService.getRotatedKeys(r),l.resetPasswordKeys=yield this.resetPasswordService.getRotatedKeys(r),(yield this.configService.getFeatureFlag(s.T.KeyRotationImprovements))?yield this.apiService.postUserKeyUpdate(l):yield this.rotateUserKeyAndEncryptedDataLegacy(l);const d=yield(0,n.z)(this.accountService.activeAccount$);yield this.deviceTrustService.rotateDevicesTrust(d.id,r,u)}))}encryptPrivateKey(e){return A(this,void 0,void 0,(function*(){const t=yield this.cryptoService.getPrivateKey();if(t)return(yield this.encryptService.encrypt(t,e)).encryptedString}))}encryptCiphers(e){return A(this,void 0,void 0,(function*(){const t=yield this.cipherService.getAllDecrypted();return t?yield Promise.all(t.map((t=>A(this,void 0,void 0,(function*(){const i=yield this.cipherService.encrypt(t,e);return new o.K(i)}))))):[]}))}encryptFolders(e){return A(this,void 0,void 0,(function*(){const t=yield(0,n.z)(this.folderService.folderViews$);return t?yield Promise.all(t.map((t=>A(this,void 0,void 0,(function*(){const i=yield this.folderService.encrypt(t,e);return new r.C(i)}))))):[]}))}rotateUserKeyAndEncryptedDataLegacy(e){return A(this,void 0,void 0,(function*(){yield this.apiService.postUserKeyUpdate(e),yield this.emergencyAccessService.postLegacyRotation(e.emergencyAccessKeys);const t=yield this.stateService.getUserId();yield this.resetPasswordService.postLegacyRotation(t,e.resetPasswordKeys)}))}}Z.ɵfac=function(e){return new(e||Z)(d.LFG(p.R),d.LFG(u.D),d.LFG(h.u),d.LFG(g.s),d.LFG(f.N),d.LFG(l.d),d.LFG(a.v),d.LFG(m.U),d.LFG(v.$),d.LFG(y.U),d.LFG(w.b),d.LFG(b.BR),d.LFG(U.E),d.LFG(_.d))},Z.ɵprov=d.Yz7({token:Z,factory:Z.ɵfac})},99005:(e,t,i)=>{"use strict";i.d(t,{Q:()=>r});var n=i(33970),s=i(71146),o=i(85762);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵmod=o.oAB({type:r}),r.ɵinj=o.cJS({imports:[s.m,n.ey]})},31978:(e,t,i)=>{"use strict";i.d(t,{q:()=>l});var n=i(5344),s=i(33229),o=i(85762),r=i(28315),a=i(82933);class l{}l.ɵfac=function(e){return new(e||l)},l.ɵcmp=o.Xpm({type:l,selectors:[["app-danger-zone"]],standalone:!0,features:[o.jDz],ngContentSelectors:["*"],decls:16,vars:6,consts:[["bitTypography","h1",1,"tw-mt-16","tw-pb-2.5","!tw-text-danger"],[1,"tw-rounded","tw-border","tw-border-solid","tw-border-danger-600","tw-p-5"],[1,"tw-flex","tw-flex-row","tw-gap-2"]],template:function(e,t){1&e&&(o.F$t(),o.TgZ(0,"h1",0),o._uU(1),o.ALo(2,"i18n"),o.qZA(),o._uU(3,"\n\n"),o.TgZ(4,"div",1),o._uU(5,"\n  "),o.TgZ(6,"p"),o._uU(7),o.ALo(8,"i18n"),o.qZA(),o._uU(9,"\n\n  "),o.TgZ(10,"div",2),o._uU(11,"\n    "),o.Hsn(12),o._uU(13,"\n  "),o.qZA(),o._uU(14,"\n"),o.qZA(),o._uU(15,"\n")),2&e&&(o.xp6(1),o.Oqu(o.lcZ(2,2,"dangerZone")),o.xp6(6),o.Oqu(o.lcZ(8,4,"dangerZoneDesc")))},dependencies:[s.Z,r.t,n.b,a.C],encapsulation:2})},99877:(e,t,i)=>{"use strict";i.d(t,{d:()=>F});var n=i(85762),s=i(54019),o=i(68362),r=i(61374);class a{constructor(e,t){this.culture="en-US",this.name=e,this.masterPasswordHint=t||null}}var l=i(59554),c=i(27027),u=i(99042),d=i(27646),p=i(78627),h=i(99721),g=i(66459),f=i(44647),m=i(28508),v=i(37513),y=i(33245),w=i(53707),b=i(2051),U=i(14970);class _{constructor(){this.border=!1,this.selected=!1,this.select=new n.vpe}onFire(){this.select.emit(this.color)}get classList(){return["tw-rounded-full tw-inline-block"].concat(["tw-cursor-pointer","tw-outline","tw-outline-solid","tw-outline-offset-1"]).concat(this.selected?["tw-outline-[3px]","tw-outline-primary-600"]:["tw-outline-0","hover:tw-outline-1","hover:tw-outline-primary-300","focus:tw-outline-2","focus:tw-outline-primary-600"])}}_.ɵfac=function(e){return new(e||_)},_.ɵcmp=n.Xpm({type:_,selectors:[["selectable-avatar"]],inputs:{id:"id",text:"text",title:"title",color:"color",border:"border",selected:"selected"},outputs:{select:"select"},decls:5,vars:9,consts:[["tabindex","0",3,"title","ngClass","click","keyup.enter"],["appStopClick","","size","xlarge",3,"text","color","border","id","title"]],template:function(e,t){1&e&&(n.TgZ(0,"span",0),n.NdJ("click",(function(){return t.onFire()}))("keyup.enter",(function(){return t.onFire()})),n._uU(1,"\n    "),n.TgZ(2,"bit-avatar",1),n._uU(3,"\n    "),n.qZA(),n._uU(4,"\n  "),n.qZA()),2&e&&(n.Q6J("title",t.title)("ngClass",t.classList),n.xp6(2),n.Q6J("text",t.text)("text",t.text)("color",t.color)("border",!1)("id",t.id)("border",t.border)("title",t.title))},dependencies:[m.mk,b.O,U.A],encapsulation:2});var A=i(82933),Z=i(19576),x=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const S=["colorPicker"];function T(e,t){1&e&&(n.TgZ(0,"div",21),n._uU(1,"\n          "),n._UZ(2,"i",19),n.ALo(3,"i18n"),n._uU(4),n.ALo(5,"i18n"),n.qZA()),2&e&&(n.xp6(2),n.s9C("title",n.lcZ(3,2,"loading")),n.xp6(2),n.hij("\n          ",n.lcZ(5,4,"loading"),"\n        "))}function C(e,t){if(1&e&&(n.TgZ(0,"app-callout",22),n._uU(1),n.qZA()),2&e){const e=n.oxw();n.xp6(1),n.hij("\n          ",e.error,"\n        ")}}function O(e,t){if(1&e){const e=n.EpF();n.ynx(0),n._uU(1,"\n            "),n.TgZ(2,"selectable-avatar",23),n.NdJ("select",(function(){const t=n.CHM(e).$implicit,i=n.oxw();return n.KtG(i.setSelection(t.color))})),n.ALo(3,"userName"),n._uU(4,"\n            "),n.qZA(),n._uU(5,"\n          "),n.BQk()}if(2&e){const e=t.$implicit,i=n.oxw();n.xp6(2),n.s9C("text",n.lcZ(3,5,i.profile)),n.Q6J("selected",e.selected)("title",e.name)("color",e.color)("border",!0)}}const k=function(e){return{"!tw-outline-[3px] tw-outline-primary-600 hover:tw-outline-[3px] hover:tw-outline-primary-600":e}};class P{constructor(e,t,i,o){this.i18nService=e,this.platformUtilsService=t,this.logService=i,this.avatarService=o,this.changeColor=new n.vpe,this.onSaved=new n.vpe,this.loading=!1,this.defaultColorPalette=[{name:"brightBlue",color:"#16cbfc"},{name:"green",color:"#94cc4b"},{name:"orange",color:"#ffb520"},{name:"lavender",color:"#e5beed"},{name:"yellow",color:"#fcff41"},{name:"indigo",color:"#acbdf7"},{name:"teal",color:"#8ecdc5"},{name:"salmon",color:"#ffa3a3"},{name:"pink",color:"#ffa2d4"}],this.customColorSelected=!1,this.customColor$=new l.X(null),this.customTextColor$=new l.X("#000000"),this.destroy$=new s.x}ngOnInit(){return x(this,void 0,void 0,(function*(){this.defaultColorPalette.forEach((e=>e.name=this.i18nService.t(e.name))),this.customColor$.pipe((0,c.b)(200),(0,o.R)(this.destroy$)).subscribe((e=>{null!=e&&(this.customTextColor$.next(d.c.pickTextColorBasedOnBgColor(e)),this.customColorSelected=!0,this.currentSelection=e)})),yield this.setSelection(yield(0,u.z)(this.avatarService.avatarColor$))}))}showCustomPicker(){return x(this,void 0,void 0,(function*(){this.customColorSelected=!0,this.colorPickerElement.nativeElement.click(),this.setSelection(this.customColor$.value)}))}generateAvatarColor(){return x(this,void 0,void 0,(function*(){d.c.stringToColor(this.profile.name.toString())}))}submit(){return x(this,void 0,void 0,(function*(){try{d.c.validateHexColor(this.currentSelection)||null==this.currentSelection?(yield this.avatarService.setAvatarColor(this.currentSelection),this.changeColor.emit(this.currentSelection),this.platformUtilsService.showToast("success",null,this.i18nService.t("avatarUpdated"))):this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}catch(e){this.logService.error(e),this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}}))}ngOnDestroy(){return x(this,void 0,void 0,(function*(){this.destroy$.next(),this.destroy$.complete()}))}setSelection(e){return x(this,void 0,void 0,(function*(){if(this.defaultColorPalette.filter((e=>e.selected)).forEach((e=>e.selected=!1)),null!=e)if(e=e.toLowerCase(),this.customColorSelected=!1,this.currentSelection===e)this.currentSelection=null;else{const t=this.defaultColorPalette.findIndex((t=>t.color===e));-1!==t?(this.defaultColorPalette[t].selected=!0,this.currentSelection=e):this.customColor$.next(e)}}))}}P.ɵfac=function(e){return new(e||P)(n.Y36(p.D),n.Y36(h.P),n.Y36(g.$),n.Y36(f.o))},P.ɵcmp=n.Xpm({type:P,selectors:[["app-change-avatar"]],viewQuery:function(e,t){if(1&e&&n.Gf(S,5),2&e){let e;n.iGM(e=n.CRH())&&(t.colorPickerElement=e.first)}},inputs:{profile:"profile"},outputs:{changeColor:"changeColor",onSaved:"onSaved"},decls:73,vars:40,consts:[["role","dialog","aria-modal","true","aria-labelledby","customizeTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","tw-w-[600px]","tw-max-w-none"],[1,"modal-content"],[1,"modal-header"],["id","customizeTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["class","card-body text-center",4,"ngIf"],["type","error",4,"ngIf"],[1,"tw-text-lg"],[1,"tw-flex","tw-flex-wrap","tw-justify-center","tw-gap-8"],[4,"ngFor","ngForOf"],[1,"tw-outline-solid","tw-bg-white","tw-relative","tw-flex","tw-h-24","tw-w-24","tw-cursor-pointer","tw-place-content-center","tw-content-center","tw-justify-center","tw-rounded-full","tw-border","tw-border-solid","tw-border-secondary-600","tw-outline","tw-outline-0","tw-outline-offset-1","hover:tw-outline-1","hover:tw-outline-primary-300","focus:tw-outline-2","focus:tw-outline-primary-600",3,"tabIndex","title","ngClass","keyup.enter","click"],[1,"bwi","bwi-pencil","tw-m-auto","tw-text-3xl"],["tabindex","-1","type","color",1,"tw-absolute","tw-bottom-0","tw-right-0","tw-h-px","tw-w-px","tw-border-none","tw-bg-transparent","tw-opacity-0",3,"ngModel","ngModelChange"],["colorPicker",""],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled","click"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"card-body","text-center"],["type","error"],["appStopClick","",3,"selected","title","text","color","border","select"]],template:function(e,t){1&e&&(n._uU(0,"\n"),n._uU(1,"\n"),n.TgZ(2,"div",0),n._uU(3,"\n  "),n.TgZ(4,"div",1),n._uU(5,"\n    "),n.TgZ(6,"div",2),n._uU(7,"\n      "),n.TgZ(8,"div",3),n._uU(9,"\n        "),n.TgZ(10,"h2",4),n._uU(11),n.ALo(12,"i18n"),n.qZA(),n._uU(13,"\n        "),n.TgZ(14,"button",5),n.ALo(15,"i18n"),n._uU(16,"\n          "),n.TgZ(17,"span",6),n._uU(18,"×"),n.qZA(),n._uU(19,"\n        "),n.qZA(),n._uU(20,"\n      "),n.qZA(),n._uU(21,"\n      "),n.TgZ(22,"div",7),n._uU(23,"\n        "),n.YNc(24,T,6,6,"div",8),n._uU(25,"\n        "),n.YNc(26,C,2,1,"app-callout",9),n._uU(27,"\n        "),n.TgZ(28,"p",10),n._uU(29),n.ALo(30,"i18n"),n.qZA(),n._uU(31,"\n        "),n.TgZ(32,"div",11),n._uU(33,"\n          "),n.YNc(34,O,6,7,"ng-container",12),n._uU(35,"\n          "),n.TgZ(36,"span"),n._uU(37,"\n            "),n.TgZ(38,"span",13),n.NdJ("keyup.enter",(function(){return t.showCustomPicker()}))("click",(function(){return t.showCustomPicker()})),n.ALo(39,"async"),n.ALo(40,"i18n"),n._uU(41,"\n              "),n.TgZ(42,"i",14),n.ALo(43,"async"),n.qZA(),n._uU(44,"\n              "),n.TgZ(45,"input",15,16),n.NdJ("ngModelChange",(function(e){return t.customColor$.next(e)})),n.ALo(47,"async"),n.qZA(),n._uU(48,"\n            "),n.qZA(),n._uU(49,"\n          "),n.qZA(),n._uU(50,"\n        "),n.qZA(),n._uU(51,"\n      "),n.qZA(),n._uU(52,"\n      "),n.TgZ(53,"div",17),n._uU(54,"\n        "),n.TgZ(55,"button",18),n.NdJ("click",(function(){return t.submit()})),n._uU(56,"\n          "),n._UZ(57,"i",19),n.ALo(58,"i18n"),n._uU(59,"\n          "),n.TgZ(60,"span"),n._uU(61),n.ALo(62,"i18n"),n.qZA(),n._uU(63,"\n        "),n.qZA(),n._uU(64,"\n        "),n.TgZ(65,"button",20),n._uU(66),n.ALo(67,"i18n"),n.qZA(),n._uU(68,"\n      "),n.qZA(),n._uU(69,"\n    "),n.qZA(),n._uU(70,"\n  "),n.qZA(),n._uU(71,"\n"),n.qZA(),n._uU(72,"\n")),2&e&&(n.xp6(11),n.Oqu(n.lcZ(12,18,"customizeAvatar")),n.xp6(3),n.s9C("appA11yTitle",n.lcZ(15,20,"close")),n.xp6(10),n.Q6J("ngIf",t.loading),n.xp6(2),n.Q6J("ngIf",t.error),n.xp6(3),n.Oqu(n.lcZ(30,22,"pickAnAvatarColor")),n.xp6(5),n.Q6J("ngForOf",t.defaultColorPalette),n.xp6(4),n.Udp("background-color",n.lcZ(39,24,t.customColor$)),n.s9C("title",n.lcZ(40,26,"customColor")),n.Q6J("tabIndex",0)("ngClass",n.VKq(38,k,t.customColorSelected)),n.xp6(4),n.Udp("color",n.lcZ(43,28,t.customTextColor$)),n.xp6(3),n.Q6J("ngModel",n.lcZ(47,30,t.customColor$)),n.xp6(10),n.Q6J("disabled",t.loading),n.xp6(2),n.s9C("title",n.lcZ(58,32,"loading")),n.xp6(4),n.Oqu(n.lcZ(62,34,"save")),n.xp6(5),n.hij("\n          ",n.lcZ(67,36,"close"),"\n        "))},dependencies:[m.mk,m.sg,m.O5,v.Fj,v.JJ,v.On,y.B,w.O,b.O,_,m.Ov,A.C,Z.z],encapsulation:2});var q=i(55602),I=i(58172),M=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const N=["avatarModalTemplate"];function L(e,t){1&e&&(n.TgZ(0,"div"),n._uU(1,"\n  "),n._UZ(2,"i",3),n.ALo(3,"i18n"),n._uU(4,"\n  "),n.TgZ(5,"span",4),n._uU(6),n.ALo(7,"i18n"),n.qZA(),n._uU(8,"\n"),n.qZA()),2&e&&(n.xp6(2),n.s9C("title",n.lcZ(3,2,"loading")),n.xp6(4),n.Oqu(n.lcZ(7,4,"loading")))}function D(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"form",5,6),n.NdJ("ngSubmit",(function(){n.CHM(e);const t=n.oxw();return n.KtG(t.submit())})),n._uU(2,"\n  "),n.TgZ(3,"div",7),n._uU(4,"\n    "),n.TgZ(5,"div",8),n._uU(6,"\n      "),n.TgZ(7,"div",9),n._uU(8,"\n        "),n.TgZ(9,"label",10),n._uU(10),n.ALo(11,"i18n"),n.qZA(),n._uU(12,"\n        "),n.TgZ(13,"input",11),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.profile.name=t)})),n.qZA(),n._uU(14,"\n      "),n.qZA(),n._uU(15,"\n      "),n.TgZ(16,"div",9),n._uU(17,"\n        "),n.TgZ(18,"label",12),n._uU(19),n.ALo(20,"i18n"),n.qZA(),n._uU(21,"\n        "),n.TgZ(22,"input",13),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.profile.email=t)})),n.qZA(),n._uU(23,"\n      "),n.qZA(),n._uU(24,"\n    "),n.qZA(),n._uU(25,"\n    "),n.TgZ(26,"div",8),n._uU(27,"\n      "),n.TgZ(28,"div",14),n._uU(29,"\n        "),n.TgZ(30,"dynamic-avatar",15),n.ALo(31,"userName"),n._uU(32,"\n        "),n.qZA(),n._uU(33,"\n        "),n.TgZ(34,"button",16),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw();return n.KtG(t.openChangeAvatar())})),n._uU(35,"\n          "),n._UZ(36,"i",17),n._uU(37,"\n          Customize\n        "),n.qZA(),n._uU(38,"\n      "),n.qZA(),n._uU(39,"\n      "),n.TgZ(40,"app-account-fingerprint",18),n.ALo(41,"i18n"),n._uU(42,"\n      "),n.qZA(),n._uU(43,"\n    "),n.qZA(),n._uU(44,"\n  "),n.qZA(),n._uU(45,"\n  "),n.TgZ(46,"button",19),n._uU(47,"\n    "),n._UZ(48,"i",20),n.ALo(49,"i18n"),n._uU(50,"\n    "),n.TgZ(51,"span"),n._uU(52),n.ALo(53,"i18n"),n.qZA(),n._uU(54,"\n  "),n.qZA(),n._uU(55,"\n"),n.qZA()}if(2&e){const e=n.MAs(1),t=n.oxw();n.Q6J("appApiAction",t.formPromise),n.xp6(10),n.Oqu(n.lcZ(11,13,"name")),n.xp6(3),n.Q6J("ngModel",t.profile.name),n.xp6(6),n.Oqu(n.lcZ(20,15,"email")),n.xp6(3),n.Q6J("ngModel",t.profile.email),n.xp6(8),n.s9C("text",n.lcZ(31,17,t.profile)),n.Q6J("id",t.profile.id)("size","large"),n.xp6(10),n.s9C("fingerprintLabel",n.lcZ(41,19,"yourAccountsFingerprint")),n.Q6J("fingerprintMaterial",t.fingerprintMaterial),n.xp6(6),n.Q6J("disabled",e.loading),n.xp6(2),n.s9C("title",n.lcZ(49,21,"loading")),n.xp6(4),n.Oqu(n.lcZ(53,23,"save"))}}function E(e,t){}class F{constructor(e,t,i,n,o,r){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.logService=n,this.stateService=o,this.modalService=r,this.loading=!0,this.destroy$=new s.x}ngOnInit(){return M(this,void 0,void 0,(function*(){this.profile=yield this.apiService.getProfile(),this.loading=!1,this.fingerprintMaterial=yield this.stateService.getUserId()}))}ngOnDestroy(){return M(this,void 0,void 0,(function*(){this.destroy$.next(),this.destroy$.complete()}))}openChangeAvatar(){return M(this,void 0,void 0,(function*(){const e=yield this.modalService.openViewRef(P,this.avatarModalRef,(t=>{t.profile=this.profile,t.changeColor.pipe((0,o.R)(this.destroy$)).subscribe((()=>{e[0].close()}))}))}))}submit(){return M(this,void 0,void 0,(function*(){try{const e=new a(this.profile.name,this.profile.masterPasswordHint);this.formPromise=this.apiService.putProfile(e),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("accountUpdated"))}catch(e){this.logService.error(e)}}))}}F.ɵfac=function(e){return new(e||F)(n.Y36(q.s),n.Y36(p.D),n.Y36(h.P),n.Y36(g.$),n.Y36(I.b),n.Y36(r.Z))},F.ɵcmp=n.Xpm({type:F,selectors:[["app-profile"]],viewQuery:function(e,t){if(1&e&&n.Gf(N,7,n.s_b),2&e){let e;n.iGM(e=n.CRH())&&(t.avatarModalRef=e.first)}},decls:7,vars:2,consts:[[4,"ngIf"],["ngNativeValidate","",3,"appApiAction","ngSubmit",4,"ngIf"],["avatarModalTemplate",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],["ngNativeValidate","",3,"appApiAction","ngSubmit"],["form",""],[1,"row"],[1,"col-6"],[1,"form-group"],["for","name"],["id","name","type","text","name","Name",1,"form-control",3,"ngModel","ngModelChange"],["for","email"],["id","email","type","text","name","Email","readonly","",1,"form-control",3,"ngModel","ngModelChange"],[1,"mb-3"],[3,"text","id","size"],["type","button","appStopClick","","appStopProp","",1,"btn","btn-outline-secondary","tw-ml-3.5",3,"click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-pencil-square"],[3,"fingerprintMaterial","fingerprintLabel"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"]],template:function(e,t){1&e&&(n.YNc(0,L,9,6,"div",0),n._uU(1,"\n"),n.YNc(2,D,56,25,"form",1),n._uU(3,"\n"),n.YNc(4,E,0,0,"ng-template",null,2,n.W1O),n._uU(6,"\n")),2&e&&(n.Q6J("ngIf",t.loading),n.xp6(2),n.Q6J("ngIf",t.profile&&!t.loading))},encapsulation:2})},64447:(e,t,i)=>{"use strict";i.d(t,{B:()=>y});var n=i(85762),s=i(42304),o=i(66459),r=i(28508),a=i(37513),l=i(33245),c=i(24610),u=i(53707),d=i(94516),p=i(82933),h=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function g(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"app-user-verification",15),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.masterPassword=t)})),n._uU(1,"\n        "),n.qZA()}if(2&e){const e=n.oxw();n.Q6J("ngModel",e.masterPassword)}}function f(e,t){if(1&e&&(n.TgZ(0,"app-callout",16),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e){const e=n.oxw();n.xp6(1),n.Oqu(n.lcZ(2,1,e.apiKeyWarning))}}function m(e,t){if(1&e&&(n.TgZ(0,"app-callout",17),n.ALo(1,"i18n"),n._uU(2,"\n          "),n.TgZ(3,"p",18),n._uU(4,"\n            "),n.TgZ(5,"strong"),n._uU(6,"client_id:"),n.qZA(),n._UZ(7,"br"),n._uU(8,"\n            "),n.TgZ(9,"code"),n._uU(10),n.qZA(),n._uU(11,"\n          "),n.qZA(),n._uU(12,"\n          "),n.TgZ(13,"p",18),n._uU(14,"\n            "),n.TgZ(15,"strong"),n._uU(16,"client_secret:"),n.qZA(),n._UZ(17,"br"),n._uU(18,"\n            "),n.TgZ(19,"code"),n._uU(20),n.qZA(),n._uU(21,"\n          "),n.qZA(),n._uU(22,"\n          "),n.TgZ(23,"p",18),n._uU(24,"\n            "),n.TgZ(25,"strong"),n._uU(26,"scope:"),n.qZA(),n._UZ(27,"br"),n._uU(28,"\n            "),n.TgZ(29,"code"),n._uU(30),n.qZA(),n._uU(31,"\n          "),n.qZA(),n._uU(32,"\n          "),n.TgZ(33,"p",19),n._uU(34,"\n            "),n.TgZ(35,"strong"),n._uU(36,"grant_type:"),n.qZA(),n._UZ(37,"br"),n._uU(38,"\n            "),n.TgZ(39,"code"),n._uU(40),n.qZA(),n._uU(41,"\n          "),n.qZA(),n._uU(42,"\n        "),n.qZA()),2&e){const e=n.oxw();n.s9C("title",n.lcZ(1,5,"oauth2ClientCredentials")),n.xp6(10),n.Oqu(e.clientId),n.xp6(10),n.Oqu(e.clientSecret),n.xp6(10),n.Oqu(e.scope),n.xp6(10),n.Oqu(e.grantType)}}function v(e,t){if(1&e&&(n.TgZ(0,"button",20),n._uU(1,"\n          "),n._UZ(2,"i",21),n.ALo(3,"i18n"),n._uU(4,"\n          "),n.TgZ(5,"span"),n._uU(6),n.ALo(7,"i18n"),n.qZA(),n._uU(8,"\n        "),n.qZA()),2&e){const e=n.oxw(),t=n.MAs(5);n.Q6J("disabled",t.loading),n.xp6(2),n.s9C("title",n.lcZ(3,3,"loading")),n.xp6(4),n.Oqu(n.lcZ(7,5,e.isRotation?"rotateApiKey":"viewApiKey"))}}class y{constructor(e,t){this.userVerificationService=e,this.logService=t}submit(){return h(this,void 0,void 0,(function*(){try{this.formPromise=this.userVerificationService.buildRequest(this.masterPassword).then((e=>this.postKey(this.entityId,e)));const e=yield this.formPromise;this.clientSecret=e.apiKey,this.clientId=`${this.keyType}.${this.entityId}`}catch(e){this.logService.error(e)}}))}}y.ɵfac=function(e){return new(e||y)(n.Y36(s.i),n.Y36(o.$))},y.ɵcmp=n.Xpm({type:y,selectors:[["app-api-key"]],decls:46,vars:17,consts:[["role","dialog","aria-modal","true","aria-labelledby","apiKeyTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","apiKeyTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["ngDefaultControl","","name","secret",3,"ngModel","ngModelChange",4,"ngIf"],["type","warning",4,"ngIf"],["type","info","icon","bwi bwi-key",3,"title",4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit",3,"disabled",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["ngDefaultControl","","name","secret",3,"ngModel","ngModelChange"],["type","warning"],["type","info","icon","bwi bwi-key",3,"title"],[1,"mb-1"],[1,"mb-0"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"]],template:function(e,t){1&e&&(n.TgZ(0,"div",0),n._uU(1,"\n  "),n.TgZ(2,"div",1),n._uU(3,"\n    "),n.TgZ(4,"form",2,3),n.NdJ("ngSubmit",(function(){return t.submit()})),n._uU(6,"\n      "),n.TgZ(7,"div",4),n._uU(8,"\n        "),n.TgZ(9,"h1",5),n._uU(10),n.ALo(11,"i18n"),n.qZA(),n._uU(12,"\n        "),n.TgZ(13,"button",6),n.ALo(14,"i18n"),n._uU(15,"\n          "),n.TgZ(16,"span",7),n._uU(17,"×"),n.qZA(),n._uU(18,"\n        "),n.qZA(),n._uU(19,"\n      "),n.qZA(),n._uU(20,"\n      "),n.TgZ(21,"div",8),n._uU(22,"\n        "),n.TgZ(23,"p"),n._uU(24),n.ALo(25,"i18n"),n.qZA(),n._uU(26,"\n        "),n.YNc(27,g,2,1,"app-user-verification",9),n._uU(28,"\n\n        "),n.YNc(29,f,3,3,"app-callout",10),n._uU(30,"\n        "),n.YNc(31,m,43,7,"app-callout",11),n._uU(32,"\n      "),n.qZA(),n._uU(33,"\n      "),n.TgZ(34,"div",12),n._uU(35,"\n        "),n.YNc(36,v,9,7,"button",13),n._uU(37,"\n        "),n.TgZ(38,"button",14),n._uU(39),n.ALo(40,"i18n"),n.qZA(),n._uU(41,"\n      "),n.qZA(),n._uU(42,"\n    "),n.qZA(),n._uU(43,"\n  "),n.qZA(),n._uU(44,"\n"),n.qZA(),n._uU(45,"\n")),2&e&&(n.xp6(4),n.Q6J("appApiAction",t.formPromise),n.xp6(6),n.Oqu(n.lcZ(11,9,t.apiKeyTitle)),n.xp6(3),n.s9C("appA11yTitle",n.lcZ(14,11,"close")),n.xp6(11),n.Oqu(n.lcZ(25,13,t.apiKeyDescription)),n.xp6(3),n.Q6J("ngIf",!t.clientSecret),n.xp6(2),n.Q6J("ngIf",t.clientSecret),n.xp6(2),n.Q6J("ngIf",t.clientSecret),n.xp6(5),n.Q6J("ngIf",!t.clientSecret),n.xp6(3),n.hij("\n          ",n.lcZ(40,15,"close"),"\n        "))},dependencies:[r.O5,a.Fj,a.JJ,a.JL,a.On,a.F,l.B,c.b,u.O,d.W,p.C],encapsulation:2})},90668:(e,t,i)=>{"use strict";i.d(t,{c:()=>g});var n=i(85762),s=i(48103),o=i(91667);class r extends o.Y{}var a=i(55602),l=i(78627),c=i(99721),u=i(66459),d=i(42304),p=i(73369),h=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class g{constructor(e,t,i,o,r,a){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.logService=o,this.userVerificationService=r,this.dialogService=a,this.onUpdated=new n.vpe,this.twoFactorProviderType=s.L,this.enabled=!1,this.authed=!1,this.componentName=""}auth(e){this.hashedSecret=e.secret,this.verificationType=e.verificationType,this.authed=!0}enable(e){return h(this,void 0,void 0,(function*(){try{yield e(),this.onUpdated.emit(!0)}catch(t){this.logService.error(t)}}))}disable(e){return h(this,void 0,void 0,(function*(){if(yield this.dialogService.openSimpleDialog({title:{key:"disable"},content:{key:"twoStepDisableDesc"},type:"warning"}))try{const t=yield this.buildRequestModel(r);t.type=this.type,e=null!=this.organizationId?this.apiService.putTwoFactorOrganizationDisable(this.organizationId,t):this.apiService.putTwoFactorDisable(t),yield e,this.enabled=!1,this.platformUtilsService.showToast("success",null,this.i18nService.t("twoStepDisabled")),this.onUpdated.emit(!1)}catch(t){this.logService.error(t)}}))}buildRequestModel(e){return h(this,void 0,void 0,(function*(){return this.userVerificationService.buildRequest({secret:this.hashedSecret,type:this.verificationType},e,!0)}))}}g.ɵfac=function(e){return new(e||g)(n.Y36(a.s),n.Y36(l.D),n.Y36(c.P),n.Y36(u.$),n.Y36(d.i),n.Y36(p.x))},g.ɵdir=n.lG2({type:g,outputs:{onUpdated:"onUpdated"}})},41648:(e,t,i)=>{"use strict";i.d(t,{C:()=>T});var n=i(48103),s=i(91667);class o extends s.Y{}var r=i(90668),a=i(85762),l=i(55602),c=i(78627),u=i(99721),d=i(66459),p=i(42304),h=i(73369),g=i(28508),f=i(37513),m=i(33245),v=i(24610),y=i(53707),w=i(85356),b=i(82933),U=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function _(e,t){if(1&e&&(a.ynx(0),a._uU(1,"\n            "),a.TgZ(2,"app-callout",16),a.ALo(3,"i18n"),a._uU(4),a.ALo(5,"i18n"),a.qZA(),a._uU(6,"\n            "),a._UZ(7,"img",17),a._uU(8,"\n            "),a.TgZ(9,"strong"),a._uU(10),a.ALo(11,"i18n"),a.qZA(),a._uU(12),a._UZ(13,"br"),a._uU(14,"\n            "),a.TgZ(15,"strong"),a._uU(16),a.ALo(17,"i18n"),a.qZA(),a._uU(18),a._UZ(19,"br"),a._uU(20,"\n            "),a.TgZ(21,"strong"),a._uU(22),a.ALo(23,"i18n"),a.qZA(),a._uU(24),a.BQk()),2&e){const e=a.oxw(2);a.xp6(2),a.s9C("title",a.lcZ(3,8,"enabled")),a.xp6(2),a.hij("\n              ",a.lcZ(5,10,"twoStepLoginProviderEnabled"),"\n            "),a.xp6(6),a.hij("",a.lcZ(11,12,"twoFactorDuoIntegrationKey"),":"),a.xp6(2),a.hij(" ",e.ikey,"\n            "),a.xp6(4),a.hij("",a.lcZ(17,14,"twoFactorDuoSecretKey"),":"),a.xp6(2),a.hij(" ",e.skey,"\n            "),a.xp6(4),a.hij("",a.lcZ(23,16,"twoFactorDuoApiHostname"),":"),a.xp6(2),a.hij(" ",e.host,"\n          ")}}function A(e,t){if(1&e){const e=a.EpF();a.ynx(0),a._uU(1,"\n            "),a._UZ(2,"img",17),a._uU(3,"\n            "),a.TgZ(4,"p"),a._uU(5),a.ALo(6,"i18n"),a.qZA(),a._uU(7,"\n            "),a.TgZ(8,"div",18),a._uU(9,"\n              "),a.TgZ(10,"label",19),a._uU(11),a.ALo(12,"i18n"),a.qZA(),a._uU(13,"\n              "),a.TgZ(14,"input",20),a.NdJ("ngModelChange",(function(t){a.CHM(e);const i=a.oxw(2);return a.KtG(i.ikey=t)})),a.qZA(),a._uU(15,"\n            "),a.qZA(),a._uU(16,"\n            "),a.TgZ(17,"div",18),a._uU(18,"\n              "),a.TgZ(19,"label",21),a._uU(20),a.ALo(21,"i18n"),a.qZA(),a._uU(22,"\n              "),a.TgZ(23,"input",22),a.NdJ("ngModelChange",(function(t){a.CHM(e);const i=a.oxw(2);return a.KtG(i.skey=t)})),a.qZA(),a._uU(24,"\n            "),a.qZA(),a._uU(25,"\n            "),a.TgZ(26,"div",18),a._uU(27,"\n              "),a.TgZ(28,"label",23),a._uU(29),a.ALo(30,"i18n"),a.qZA(),a._uU(31,"\n              "),a.TgZ(32,"input",24),a.NdJ("ngModelChange",(function(t){a.CHM(e);const i=a.oxw(2);return a.KtG(i.host=t)})),a.ALo(33,"i18n"),a.qZA(),a._uU(34,"\n            "),a.qZA(),a._uU(35,"\n          "),a.BQk()}if(2&e){const e=a.oxw(2);a.xp6(5),a.Oqu(a.lcZ(6,8,"twoFactorDuoDesc")),a.xp6(6),a.Oqu(a.lcZ(12,10,"twoFactorDuoIntegrationKey")),a.xp6(3),a.Q6J("ngModel",e.ikey),a.xp6(6),a.Oqu(a.lcZ(21,12,"twoFactorDuoSecretKey")),a.xp6(3),a.Q6J("ngModel",e.skey),a.xp6(6),a.Oqu(a.lcZ(30,14,"twoFactorDuoApiHostname")),a.xp6(3),a.MGl("placeholder","",a.lcZ(33,16,"ex")," api-xxxxxxxx.duosecurity.com"),a.Q6J("ngModel",e.host)}}function Z(e,t){1&e&&(a.TgZ(0,"span"),a._uU(1),a.ALo(2,"i18n"),a.qZA()),2&e&&(a.xp6(1),a.Oqu(a.lcZ(2,1,"enable")))}function x(e,t){1&e&&(a.TgZ(0,"span"),a._uU(1),a.ALo(2,"i18n"),a.qZA()),2&e&&(a.xp6(1),a.Oqu(a.lcZ(2,1,"disable")))}function S(e,t){if(1&e){const e=a.EpF();a.TgZ(0,"form",8,9),a.NdJ("ngSubmit",(function(){a.CHM(e);const t=a.oxw();return a.KtG(t.submit())})),a._uU(2,"\n        "),a.TgZ(3,"div",10),a._uU(4,"\n          "),a.YNc(5,_,25,18,"ng-container",11),a._uU(6,"\n          "),a.YNc(7,A,36,18,"ng-container",11),a._uU(8,"\n        "),a.qZA(),a._uU(9,"\n        "),a.TgZ(10,"div",12),a._uU(11,"\n          "),a.TgZ(12,"button",13),a._uU(13,"\n            "),a._UZ(14,"i",14),a.ALo(15,"i18n"),a._uU(16,"\n            "),a.YNc(17,Z,3,3,"span",11),a._uU(18,"\n            "),a.YNc(19,x,3,3,"span",11),a._uU(20,"\n          "),a.qZA(),a._uU(21,"\n          "),a.TgZ(22,"button",15),a._uU(23),a.ALo(24,"i18n"),a.qZA(),a._uU(25,"\n        "),a.qZA(),a._uU(26,"\n      "),a.qZA()}if(2&e){const e=a.MAs(1),t=a.oxw();a.Q6J("appApiAction",t.formPromise),a.xp6(5),a.Q6J("ngIf",t.enabled),a.xp6(2),a.Q6J("ngIf",!t.enabled),a.xp6(5),a.Q6J("disabled",e.loading),a.xp6(2),a.s9C("title",a.lcZ(15,8,"loading")),a.xp6(3),a.Q6J("ngIf",!t.enabled),a.xp6(2),a.Q6J("ngIf",t.enabled),a.xp6(4),a.hij("\n            ",a.lcZ(24,10,"close"),"\n          ")}}class T extends r.c{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.type=n.L.Duo,this.componentName="app-two-factor-duo"}auth(e){super.auth(e),this.processResponse(e.response)}submit(){return this.enabled?super.disable(this.formPromise):this.enable()}enable(){const e=Object.create(null,{enable:{get:()=>super.enable}});return U(this,void 0,void 0,(function*(){const t=yield this.buildRequestModel(o);return t.integrationKey=this.ikey,t.secretKey=this.skey,t.host=this.host,e.enable.call(this,(()=>U(this,void 0,void 0,(function*(){null!=this.organizationId?this.formPromise=this.apiService.putTwoFactorOrganizationDuo(this.organizationId,t):this.formPromise=this.apiService.putTwoFactorDuo(t);const e=yield this.formPromise;yield this.processResponse(e)}))))}))}processResponse(e){this.ikey=e.integrationKey,this.skey=e.secretKey,this.host=e.host,this.enabled=e.enabled}}T.ɵfac=function(e){return new(e||T)(a.Y36(l.s),a.Y36(c.D),a.Y36(u.P),a.Y36(d.$),a.Y36(p.i),a.Y36(h.x))},T.ɵcmp=a.Xpm({type:T,selectors:[["app-two-factor-duo"]],features:[a.qOj],decls:28,vars:7,consts:[["role","dialog","aria-modal","true","aria-labelledby","2faDuoTitle",1,"modal","fade"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],["id","2faDuoTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["ngNativeValidate","","autocomplete","off",3,"appApiAction","ngSubmit",4,"ngIf"],["ngNativeValidate","","autocomplete","off",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-body"],[4,"ngIf"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["type","success","icon","bwi bwi-check-circle",3,"title"],["alt","Duo logo",1,"float-right","ml-3","mfaType2"],[1,"form-group"],["for","ikey"],["id","ikey","type","text","name","IntegrationKey","required","","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"],["for","skey"],["id","skey","type","password","name","SecretKey","required","","appInputVerbatim","","autocomplete","new-password",1,"form-control",3,"ngModel","ngModelChange"],["for","host"],["id","host","type","text","name","Host","required","","appInputVerbatim","",1,"form-control",3,"ngModel","placeholder","ngModelChange"]],template:function(e,t){1&e&&(a.TgZ(0,"div",0),a._uU(1,"\n  "),a.TgZ(2,"div",1),a._uU(3,"\n    "),a.TgZ(4,"div",2),a._uU(5,"\n      "),a.TgZ(6,"div",3),a._uU(7,"\n        "),a.TgZ(8,"h1",4),a._uU(9),a.ALo(10,"i18n"),a.TgZ(11,"small"),a._uU(12,"Duo"),a.qZA(),a._uU(13,"\n        "),a.qZA(),a._uU(14,"\n        "),a.TgZ(15,"button",5),a.ALo(16,"i18n"),a._uU(17,"\n          "),a.TgZ(18,"span",6),a._uU(19,"×"),a.qZA(),a._uU(20,"\n        "),a.qZA(),a._uU(21,"\n      "),a.qZA(),a._uU(22,"\n      "),a.YNc(23,S,27,12,"form",7),a._uU(24,"\n    "),a.qZA(),a._uU(25,"\n  "),a.qZA(),a._uU(26,"\n"),a.qZA(),a._uU(27,"\n")),2&e&&(a.xp6(9),a.hij("\n          ",a.lcZ(10,3,"twoStepLogin"),"\n          "),a.xp6(6),a.s9C("appA11yTitle",a.lcZ(16,5,"close")),a.xp6(8),a.Q6J("ngIf",t.authed))},dependencies:[g.O5,f.Fj,f.JJ,f.JL,f.Q7,f.On,f.F,m.B,v.b,y.O,w.b,b.C],encapsulation:2})},37480:(e,t,i)=>{"use strict";i.d(t,{x:()=>Tt});var n=i(85762),s=i(54019),o=i(68362),r=i(70032),a=i(99042),l=i(61374),c=i(92614),u=i(48103),d=i(66990),p=i(51303),h=i(34961),g=i(91667);class f extends g.Y{}var m=i(27646),v=i(90668),y=i(55602),w=i(78627),b=i(42304),U=i(99721),_=i(66459),A=i(58172),Z=i(73369),x=i(28508),S=i(37513),T=i(33245),C=i(24610),O=i(53707),k=i(85356),P=i(82933),q=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function I(e,t){1&e&&(n.ynx(0),n._uU(1,"\n            "),n._UZ(2,"img",26),n._uU(3,"\n            "),n.TgZ(4,"p"),n._uU(5),n.ALo(6,"i18n"),n.qZA(),n._uU(7,"\n            "),n.TgZ(8,"p"),n._uU(9,"\n              "),n.TgZ(10,"strong"),n._uU(11),n.ALo(12,"i18n"),n.qZA(),n._uU(13,"\n            "),n.qZA(),n._uU(14,"\n          "),n.BQk()),2&e&&(n.xp6(5),n.Oqu(n.lcZ(6,2,"twoStepAuthenticatorDesc")),n.xp6(6),n.hij("1. ",n.lcZ(12,4,"twoStepAuthenticatorDownloadApp"),""))}function M(e,t){1&e&&(n.ynx(0),n._uU(1,"\n            "),n.TgZ(2,"app-callout",27),n.ALo(3,"i18n"),n._uU(4,"\n              "),n.TgZ(5,"p"),n._uU(6),n.ALo(7,"i18n"),n.qZA(),n._uU(8),n.ALo(9,"i18n"),n.qZA(),n._uU(10,"\n            "),n._UZ(11,"img",26),n._uU(12,"\n            "),n.TgZ(13,"p"),n._uU(14),n.ALo(15,"i18n"),n.qZA(),n._uU(16,"\n          "),n.BQk()),2&e&&(n.xp6(2),n.s9C("title",n.lcZ(3,4,"enabled")),n.xp6(4),n.Oqu(n.lcZ(7,6,"twoStepLoginProviderEnabled")),n.xp6(2),n.hij("\n              ",n.lcZ(9,8,"twoStepAuthenticatorReaddDesc"),"\n            "),n.xp6(6),n.Oqu(n.lcZ(15,10,"twoStepAuthenticatorNeedApp")))}function N(e,t){1&e&&(n.TgZ(0,"p"),n._uU(1,"\n            "),n.TgZ(2,"strong"),n._uU(3),n.ALo(4,"i18n"),n.qZA(),n._uU(5,"\n          "),n.qZA()),2&e&&(n.xp6(3),n.hij("2. ",n.lcZ(4,1,"twoStepAuthenticatorScanCode"),""))}function L(e,t){1&e&&n._UZ(0,"hr")}function D(e,t){if(1&e){const e=n.EpF();n.ynx(0),n._uU(1,"\n            "),n.TgZ(2,"label",28),n._uU(3),n.ALo(4,"i18n"),n.qZA(),n._uU(5,"\n            "),n.TgZ(6,"input",29),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw(2);return n.KtG(i.token=t)})),n.qZA(),n._uU(7,"\n          "),n.BQk()}if(2&e){const e=n.oxw(2);n.xp6(3),n.hij("3. ",n.lcZ(4,2,"twoStepAuthenticatorEnterCode"),""),n.xp6(3),n.Q6J("ngModel",e.token)}}function E(e,t){1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"enable")))}function F(e,t){1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"disable")))}const R=function(e){return{"mb-0":e}};function J(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"form",8,9),n.NdJ("ngSubmit",(function(){n.CHM(e);const t=n.oxw();return n.KtG(t.submit())})),n._uU(2,"\n        "),n.TgZ(3,"div",10),n._uU(4,"\n          "),n.YNc(5,I,15,6,"ng-container",11),n._uU(6,"\n          "),n.YNc(7,M,17,12,"ng-container",11),n._uU(8,"\n          "),n.TgZ(9,"ul",12),n._uU(10,"\n            "),n.TgZ(11,"li"),n._uU(12,"\n              "),n._UZ(13,"i",13),n._uU(14),n.ALo(15,"i18n"),n.TgZ(16,"a",14),n._uU(17,"Authy"),n.qZA(),n._uU(18,"\n            "),n.qZA(),n._uU(19,"\n            "),n.TgZ(20,"li"),n._uU(21,"\n              "),n._UZ(22,"i",15),n._uU(23),n.ALo(24,"i18n"),n.TgZ(25,"a",16),n._uU(26,"Authy"),n.qZA(),n._uU(27,"\n            "),n.qZA(),n._uU(28,"\n            "),n.TgZ(29,"li"),n._uU(30,"\n              "),n._UZ(31,"i",17),n._uU(32),n.ALo(33,"i18n"),n.TgZ(34,"a",18),n._uU(35,"Microsoft Authenticator"),n.qZA(),n._uU(36,"\n            "),n.qZA(),n._uU(37,"\n          "),n.qZA(),n._uU(38,"\n          "),n.TgZ(39,"p"),n._uU(40),n.ALo(41,"i18n"),n.qZA(),n._uU(42,"\n          "),n.YNc(43,N,6,3,"p",11),n._uU(44,"\n          "),n.YNc(45,L,1,0,"hr",11),n._uU(46,"\n          "),n.TgZ(47,"p",19),n._uU(48,"\n            "),n._UZ(49,"canvas",20)(50,"br"),n._uU(51,"\n            "),n.TgZ(52,"code",21),n.ALo(53,"i18n"),n._uU(54),n.qZA(),n._uU(55,"\n          "),n.qZA(),n._uU(56,"\n          "),n.YNc(57,D,8,4,"ng-container",11),n._uU(58,"\n        "),n.qZA(),n._uU(59,"\n        "),n.TgZ(60,"div",22),n._uU(61,"\n          "),n.TgZ(62,"button",23),n._uU(63,"\n            "),n._UZ(64,"i",24),n.ALo(65,"i18n"),n._uU(66,"\n            "),n.YNc(67,E,3,3,"span",11),n._uU(68,"\n            "),n.YNc(69,F,3,3,"span",11),n._uU(70,"\n          "),n.qZA(),n._uU(71,"\n          "),n.TgZ(72,"button",25),n._uU(73),n.ALo(74,"i18n"),n.qZA(),n._uU(75,"\n        "),n.qZA(),n._uU(76,"\n      "),n.qZA()}if(2&e){const e=n.MAs(1),t=n.oxw();n.Q6J("appApiAction",t.formPromise),n.xp6(5),n.Q6J("ngIf",!t.enabled),n.xp6(2),n.Q6J("ngIf",t.enabled),n.xp6(7),n.hij("",n.lcZ(15,18,"iosDevices"),":\n              "),n.xp6(9),n.hij("",n.lcZ(24,20,"androidDevices"),":\n              "),n.xp6(9),n.hij("",n.lcZ(33,22,"windowsDevices"),":\n              "),n.xp6(8),n.Oqu(n.lcZ(41,24,"twoStepAuthenticatorAppsRecommended")),n.xp6(3),n.Q6J("ngIf",!t.enabled),n.xp6(2),n.Q6J("ngIf",t.enabled),n.xp6(2),n.Q6J("ngClass",n.VKq(32,R,t.enabled)),n.xp6(5),n.s9C("appA11yTitle",n.lcZ(53,26,"key")),n.xp6(2),n.Oqu(t.key),n.xp6(3),n.Q6J("ngIf",!t.enabled),n.xp6(5),n.Q6J("disabled",e.loading),n.xp6(2),n.s9C("title",n.lcZ(65,28,"loading")),n.xp6(3),n.Q6J("ngIf",!t.enabled),n.xp6(2),n.Q6J("ngIf",t.enabled),n.xp6(4),n.hij("\n            ",n.lcZ(74,30,"close"),"\n          ")}}class z extends v.c{constructor(e,t,i,n,s,o,r){super(e,t,n,s,i,r),this.stateService=o,this.type=u.L.Authenticator,this.componentName="app-two-factor-authenticator",this.qrScript=window.document.createElement("script"),this.qrScript.src="scripts/qrious.min.js",this.qrScript.async=!0}ngOnInit(){window.document.body.appendChild(this.qrScript)}ngOnDestroy(){window.document.body.removeChild(this.qrScript)}auth(e){return super.auth(e),this.processResponse(e.response)}submit(){return this.enabled?super.disable(this.formPromise):this.enable()}enable(){const e=Object.create(null,{enable:{get:()=>super.enable}});return q(this,void 0,void 0,(function*(){const t=yield this.buildRequestModel(f);return t.token=this.token,t.key=this.key,e.enable.call(this,(()=>q(this,void 0,void 0,(function*(){this.formPromise=this.apiService.putTwoFactorAuthenticator(t);const e=yield this.formPromise;yield this.processResponse(e)}))))}))}processResponse(e){return q(this,void 0,void 0,(function*(){this.token=null,this.enabled=e.enabled,this.key=e.key;const t=yield this.stateService.getEmail();window.setTimeout((()=>{new window.QRious({element:document.getElementById("qr"),value:"otpauth://totp/Vaultwarden:"+m.c.encodeRFC3986URIComponent(t)+"?secret="+encodeURIComponent(this.key)+"&issuer=Vaultwarden",size:160})}),100)}))}}z.ɵfac=function(e){return new(e||z)(n.Y36(y.s),n.Y36(w.D),n.Y36(b.i),n.Y36(U.P),n.Y36(_.$),n.Y36(A.b),n.Y36(Z.x))},z.ɵcmp=n.Xpm({type:z,selectors:[["app-two-factor-authenticator"]],features:[n.qOj],decls:29,vars:10,consts:[["role","dialog","aria-modal","true","aria-labelledby","2faAuthenticatorTitle",1,"modal","fade"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],["id","2faAuthenticatorTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["ngNativeValidate","",3,"appApiAction","ngSubmit",4,"ngIf"],["ngNativeValidate","",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-body"],[4,"ngIf"],[1,"bwi-ul"],[1,"bwi","bwi-li","bwi-apple"],["href","https://itunes.apple.com/us/app/authy/id494168017?mt=8","target","_blank","rel","noreferrer"],[1,"bwi","bwi-li","bwi-android"],["href","https://play.google.com/store/apps/details?id=com.authy.authy","target","_blank","rel","noreferrer"],[1,"bwi","bwi-li","bwi-windows"],["href","https://www.microsoft.com/p/authenticator/9wzdncrfj3rj","target","_blank","rel","noreferrer"],[1,"text-center",3,"ngClass"],["id","qr"],[3,"appA11yTitle"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["alt","Authenticator app logo",1,"float-right","mfaType0"],["type","success","icon","bwi bwi-check-circle",3,"title"],["for","token"],["id","token","type","text","name","Token","required","","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"]],template:function(e,t){1&e&&(n.TgZ(0,"div",0),n._uU(1,"\n  "),n.TgZ(2,"div",1),n._uU(3,"\n    "),n.TgZ(4,"div",2),n._uU(5,"\n      "),n.TgZ(6,"div",3),n._uU(7,"\n        "),n.TgZ(8,"h1",4),n._uU(9),n.ALo(10,"i18n"),n.TgZ(11,"small"),n._uU(12),n.ALo(13,"i18n"),n.qZA(),n._uU(14,"\n        "),n.qZA(),n._uU(15,"\n        "),n.TgZ(16,"button",5),n.ALo(17,"i18n"),n._uU(18,"\n          "),n.TgZ(19,"span",6),n._uU(20,"×"),n.qZA(),n._uU(21,"\n        "),n.qZA(),n._uU(22,"\n      "),n.qZA(),n._uU(23,"\n      "),n.YNc(24,J,77,34,"form",7),n._uU(25,"\n    "),n.qZA(),n._uU(26,"\n  "),n.qZA(),n._uU(27,"\n"),n.qZA(),n._uU(28,"\n")),2&e&&(n.xp6(9),n.hij("\n          ",n.lcZ(10,4,"twoStepLogin"),"\n          "),n.xp6(3),n.Oqu(n.lcZ(13,6,"authenticatorAppTitle")),n.xp6(4),n.s9C("appA11yTitle",n.lcZ(17,8,"close")),n.xp6(8),n.Q6J("ngIf",t.authed))},dependencies:[x.mk,x.O5,S.Fj,S.JJ,S.JL,S.Q7,S.On,S.F,T.B,C.b,O.O,k.b,P.C],encapsulation:2});var Y=i(41648),K=i(15800);class B extends g.Y{}var Q=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function G(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n            "),n.TgZ(2,"app-callout",16),n.ALo(3,"i18n"),n._uU(4),n.ALo(5,"i18n"),n.qZA(),n._uU(6,"\n            "),n.TgZ(7,"strong"),n._uU(8),n.ALo(9,"i18n"),n.qZA(),n._uU(10),n.BQk()),2&e){const e=n.oxw(2);n.xp6(2),n.s9C("title",n.lcZ(3,4,"enabled")),n.xp6(2),n.hij("\n              ",n.lcZ(5,6,"twoStepLoginProviderEnabled"),"\n            "),n.xp6(4),n.hij("",n.lcZ(9,8,"email"),":"),n.xp6(2),n.hij(" ",e.email,"\n          ")}}function j(e,t){if(1&e&&(n.TgZ(0,"span",29),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e){const e=n.oxw(3);n.xp6(1),n.hij("\n                ",n.xi3(2,1,"verificationCodeEmailSent",e.sentEmail),"\n              ")}}function V(e,t){if(1&e){const e=n.EpF();n.ynx(0),n._uU(1,"\n            "),n.TgZ(2,"p",17),n._uU(3,"\n              "),n.TgZ(4,"span",18),n._uU(5),n.ALo(6,"i18n"),n.qZA(),n._uU(7,"\n              "),n._UZ(8,"img",19),n._uU(9,"\n            "),n.qZA(),n._uU(10,"\n            "),n.TgZ(11,"div",20),n._uU(12,"\n              "),n.TgZ(13,"label",21),n._uU(14),n.ALo(15,"i18n"),n.qZA(),n._uU(16,"\n              "),n.TgZ(17,"input",22),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw(2);return n.KtG(i.email=t)})),n.qZA(),n._uU(18,"\n            "),n.qZA(),n._uU(19,"\n            "),n.TgZ(20,"div",23),n._uU(21,"\n              "),n.TgZ(22,"button",24,25),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw(2);return n.KtG(t.sendEmail())})),n._uU(24,"\n                "),n._UZ(25,"i",14),n.ALo(26,"i18n"),n._uU(27,"\n                "),n.TgZ(28,"span"),n._uU(29),n.ALo(30,"i18n"),n.qZA(),n._uU(31,"\n              "),n.qZA(),n._uU(32,"\n              "),n.YNc(33,j,3,4,"span",26),n._uU(34,"\n            "),n.qZA(),n._uU(35,"\n            "),n.TgZ(36,"div",20),n._uU(37,"\n              "),n.TgZ(38,"label",27),n._uU(39),n.ALo(40,"i18n"),n.qZA(),n._uU(41,"\n              "),n.TgZ(42,"input",28),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw(2);return n.KtG(i.token=t)})),n.qZA(),n._uU(43,"\n            "),n.qZA(),n._uU(44,"\n          "),n.BQk()}if(2&e){const e=n.MAs(23),t=n.oxw(2);n.xp6(5),n.Oqu(n.lcZ(6,10,"twoFactorEmailDesc")),n.xp6(9),n.hij("1. ",n.lcZ(15,12,"twoFactorEmailEnterEmail"),""),n.xp6(3),n.Q6J("ngModel",t.email),n.xp6(5),n.Q6J("appApiAction",t.emailPromise)("disabled",e.loading),n.xp6(3),n.s9C("title",n.lcZ(26,14,"loading")),n.xp6(4),n.Oqu(n.lcZ(30,16,"sendEmail")),n.xp6(4),n.Q6J("ngIf",t.sentEmail),n.xp6(6),n.hij("2. ",n.lcZ(40,18,"twoFactorEmailEnterCode"),""),n.xp6(3),n.Q6J("ngModel",t.token)}}function $(e,t){1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"enable")))}function H(e,t){1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"disable")))}function W(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"form",8,9),n.NdJ("ngSubmit",(function(){n.CHM(e);const t=n.oxw();return n.KtG(t.submit())})),n._uU(2,"\n        "),n.TgZ(3,"div",10),n._uU(4,"\n          "),n.YNc(5,G,11,10,"ng-container",11),n._uU(6,"\n          "),n.YNc(7,V,45,20,"ng-container",11),n._uU(8,"\n        "),n.qZA(),n._uU(9,"\n        "),n.TgZ(10,"div",12),n._uU(11,"\n          "),n.TgZ(12,"button",13),n._uU(13,"\n            "),n._UZ(14,"i",14),n.ALo(15,"i18n"),n._uU(16,"\n            "),n.YNc(17,$,3,3,"span",11),n._uU(18,"\n            "),n.YNc(19,H,3,3,"span",11),n._uU(20,"\n          "),n.qZA(),n._uU(21,"\n          "),n.TgZ(22,"button",15),n._uU(23),n.ALo(24,"i18n"),n.qZA(),n._uU(25,"\n        "),n.qZA(),n._uU(26,"\n      "),n.qZA()}if(2&e){const e=n.MAs(1),t=n.oxw();n.Q6J("appApiAction",t.formPromise),n.xp6(5),n.Q6J("ngIf",t.enabled),n.xp6(2),n.Q6J("ngIf",!t.enabled),n.xp6(5),n.Q6J("disabled",e.loading),n.xp6(2),n.s9C("title",n.lcZ(15,8,"loading")),n.xp6(3),n.Q6J("ngIf",!t.enabled),n.xp6(2),n.Q6J("ngIf",t.enabled),n.xp6(4),n.hij("\n            ",n.lcZ(24,10,"close"),"\n          ")}}class X extends v.c{constructor(e,t,i,n,s,o,r){super(e,t,i,n,s,r),this.stateService=o,this.type=u.L.Email,this.componentName="app-two-factor-email"}auth(e){return super.auth(e),this.processResponse(e.response)}submit(){return this.enabled?super.disable(this.formPromise):this.enable()}sendEmail(){return Q(this,void 0,void 0,(function*(){try{const e=yield this.buildRequestModel(K.U);e.email=this.email,this.emailPromise=this.apiService.postTwoFactorEmailSetup(e),yield this.emailPromise,this.sentEmail=this.email}catch(e){this.logService.error(e)}}))}enable(){const e=Object.create(null,{enable:{get:()=>super.enable}});return Q(this,void 0,void 0,(function*(){const t=yield this.buildRequestModel(B);return t.email=this.email,t.token=this.token,e.enable.call(this,(()=>Q(this,void 0,void 0,(function*(){this.formPromise=this.apiService.putTwoFactorEmail(t);const e=yield this.formPromise;yield this.processResponse(e)}))))}))}processResponse(e){return Q(this,void 0,void 0,(function*(){this.token=null,this.email=e.email,this.enabled=e.enabled,this.enabled||null!=this.email&&""!==this.email||(this.email=yield this.stateService.getEmail())}))}}function ee(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n            "),n.TgZ(2,"p"),n._uU(3),n.ALo(4,"i18n"),n.qZA(),n._uU(5,"\n            "),n.TgZ(6,"code",12),n._uU(7),n.qZA(),n._uU(8,"\n          "),n.BQk()),2&e){const e=n.oxw(2);n.xp6(3),n.hij("",n.lcZ(4,2,"twoFactorRecoveryYourCode"),":"),n.xp6(4),n.Oqu(e.code)}}function te(e,t){1&e&&(n.ynx(0),n._uU(1),n.ALo(2,"i18n"),n.BQk()),2&e&&(n.xp6(1),n.hij("\n            ",n.lcZ(2,1,"twoFactorRecoveryNoCode"),"\n          "))}function ie(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"button",13),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw(2);return n.KtG(t.print())})),n._uU(1),n.ALo(2,"i18n"),n.qZA()}2&e&&(n.xp6(1),n.hij("\n            ",n.lcZ(2,1,"printCode"),"\n          "))}function ne(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n        "),n.TgZ(2,"div",8),n._uU(3,"\n          "),n.YNc(4,ee,9,4,"ng-container",7),n._uU(5,"\n          "),n.YNc(6,te,3,3,"ng-container",7),n._uU(7,"\n        "),n.qZA(),n._uU(8,"\n        "),n.TgZ(9,"div",9),n._uU(10,"\n          "),n.YNc(11,ie,3,3,"button",10),n._uU(12,"\n          "),n.TgZ(13,"button",11),n._uU(14),n.ALo(15,"i18n"),n.qZA(),n._uU(16,"\n        "),n.qZA(),n._uU(17,"\n      "),n.BQk()),2&e){const e=n.oxw();n.xp6(4),n.Q6J("ngIf",e.code),n.xp6(2),n.Q6J("ngIf",!e.code),n.xp6(5),n.Q6J("ngIf",e.code),n.xp6(3),n.hij("\n            ",n.lcZ(15,4,"close"),"\n          ")}}X.ɵfac=function(e){return new(e||X)(n.Y36(y.s),n.Y36(w.D),n.Y36(U.P),n.Y36(_.$),n.Y36(b.i),n.Y36(A.b),n.Y36(Z.x))},X.ɵcmp=n.Xpm({type:X,selectors:[["app-two-factor-email"]],features:[n.qOj],decls:29,vars:10,consts:[["role","dialog","aria-modal","true","aria-labelledby","2faEmailTitle",1,"modal","fade"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],["id","2faEmailTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["ngNativeValidate","",3,"appApiAction","ngSubmit",4,"ngIf"],["ngNativeValidate","",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-body"],[4,"ngIf"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["type","success","icon","bwi bwi-check-circle",3,"title"],[1,"d-flex"],[1,"mr-3"],["alt","Email logo",1,"float-right","ml-auto","mfaType1"],[1,"form-group"],["for","email"],["id","email","type","text","name","Email","required","","inputmode","email","appInputVerbatim","false",1,"form-control",3,"ngModel","ngModelChange"],[1,"mb-3","d-flex"],["type","button",1,"btn","btn-outline-primary","btn-sm","btn-submit","align-self-start",3,"appApiAction","disabled","click"],["sendBtn",""],["class","text-success ml-3",4,"ngIf"],["for","token"],["id","token","type","text","name","Token","required","","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"],[1,"text-success","ml-3"]],template:function(e,t){1&e&&(n.TgZ(0,"div",0),n._uU(1,"\n  "),n.TgZ(2,"div",1),n._uU(3,"\n    "),n.TgZ(4,"div",2),n._uU(5,"\n      "),n.TgZ(6,"div",3),n._uU(7,"\n        "),n.TgZ(8,"h1",4),n._uU(9),n.ALo(10,"i18n"),n.TgZ(11,"small"),n._uU(12),n.ALo(13,"i18n"),n.qZA(),n._uU(14,"\n        "),n.qZA(),n._uU(15,"\n        "),n.TgZ(16,"button",5),n.ALo(17,"i18n"),n._uU(18,"\n          "),n.TgZ(19,"span",6),n._uU(20,"×"),n.qZA(),n._uU(21,"\n        "),n.qZA(),n._uU(22,"\n      "),n.qZA(),n._uU(23,"\n      "),n.YNc(24,W,27,12,"form",7),n._uU(25,"\n    "),n.qZA(),n._uU(26,"\n  "),n.qZA(),n._uU(27,"\n"),n.qZA(),n._uU(28,"\n")),2&e&&(n.xp6(9),n.hij("\n          ",n.lcZ(10,4,"twoStepLogin"),"\n          "),n.xp6(3),n.Oqu(n.lcZ(13,6,"emailTitle")),n.xp6(4),n.s9C("appA11yTitle",n.lcZ(17,8,"close")),n.xp6(8),n.Q6J("ngIf",t.authed))},dependencies:[x.O5,S.Fj,S.JJ,S.JL,S.Q7,S.On,S.F,T.B,C.b,O.O,k.b,P.C],encapsulation:2});class se{constructor(e){this.i18nService=e,this.type=-1,this.twoFactorProviderType=u.L}auth(e){this.authed=!0,this.processResponse(e.response)}print(){const e=window.open();e.document.write('<div style="font-size: 18px; text-align: center;"><p>'+this.i18nService.t("twoFactorRecoveryYourCode")+":</p><code style=\"font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;\">"+this.code+'</code></div><p style="text-align: center;">'+new Date+"</p>"),e.onafterprint=()=>e.close(),e.print()}formatString(e){return null==e?null:e.replace(/(.{4})/g,"$1 ").trim().toUpperCase()}processResponse(e){this.code=this.formatString(e.code)}}se.ɵfac=function(e){return new(e||se)(n.Y36(w.D))},se.ɵcmp=n.Xpm({type:se,selectors:[["app-two-factor-recovery"]],decls:29,vars:10,consts:[["role","dialog","aria-modal","true","aria-labelledby","2faRecoveryTitle",1,"modal","fade"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],["id","2faRecoveryTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[4,"ngIf"],[1,"modal-body","text-center"],[1,"modal-footer"],["type","button","class","btn btn-primary",3,"click",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"text-lg"],["type","button",1,"btn","btn-primary",3,"click"]],template:function(e,t){1&e&&(n.TgZ(0,"div",0),n._uU(1,"\n  "),n.TgZ(2,"div",1),n._uU(3,"\n    "),n.TgZ(4,"div",2),n._uU(5,"\n      "),n.TgZ(6,"div",3),n._uU(7,"\n        "),n.TgZ(8,"h1",4),n._uU(9),n.ALo(10,"i18n"),n.TgZ(11,"small"),n._uU(12),n.ALo(13,"i18n"),n.qZA(),n._uU(14,"\n        "),n.qZA(),n._uU(15,"\n        "),n.TgZ(16,"button",5),n.ALo(17,"i18n"),n._uU(18,"\n          "),n.TgZ(19,"span",6),n._uU(20,"×"),n.qZA(),n._uU(21,"\n        "),n.qZA(),n._uU(22,"\n      "),n.qZA(),n._uU(23,"\n      "),n.YNc(24,ne,18,6,"ng-container",7),n._uU(25,"\n    "),n.qZA(),n._uU(26,"\n  "),n.qZA(),n._uU(27,"\n"),n.qZA(),n._uU(28,"\n")),2&e&&(n.xp6(9),n.hij("\n          ",n.lcZ(10,4,"twoStepLogin"),"\n          "),n.xp6(3),n.Oqu(n.lcZ(13,6,"recoveryCodeTitle")),n.xp6(4),n.s9C("appA11yTitle",n.lcZ(17,8,"close")),n.xp6(8),n.Q6J("ngIf",t.authed))},dependencies:[x.O5,T.B,P.C],encapsulation:2});var oe=i(28783),re=i(70138),ae=i(46246),le=i(36338),ce=i(81974),ue=i(29465),de=i(18362),pe=i(62026),he=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ge{constructor(e,t,i,s,o){this.data=e,this.dialogRef=t,this.apiService=i,this.i18nService=s,this.userVerificationService=o,this.onAuthed=new n.vpe,this.formGroup=new S.cw({secret:new S.NI(null)}),this.submit=()=>he(this,void 0,void 0,(function*(){let e;this.formPromise=this.userVerificationService.buildRequest(this.formGroup.value.secret).then((t=>(e=this.formGroup.value.secret.type===re.R.MasterPassword?t.masterPasswordHash:t.otp,this.apiCall(t))));const t=yield this.formPromise;this.dialogRef.close({response:t,secret:e,verificationType:this.formGroup.value.secret.type})})),this.type=e.type,this.organizationId=e.organizationId}get dialogTitle(){switch(this.type){case-1:return this.i18nService.t("recoveryCodeTitle");case u.L.Duo:return"Duo";case u.L.Email:return this.i18nService.t("emailTitle");case u.L.WebAuthn:return this.i18nService.t("webAuthnTitle");case u.L.Authenticator:return this.i18nService.t("authenticatorAppTitle");case u.L.Yubikey:return"Yubikey"}}apiCall(e){switch(this.type){case-1:return this.apiService.getTwoFactorRecover(e);case u.L.Duo:case u.L.OrganizationDuo:return null!=this.organizationId?this.apiService.getTwoFactorOrganizationDuo(this.organizationId,e):this.apiService.getTwoFactorDuo(e);case u.L.Email:return this.apiService.getTwoFactorEmail(e);case u.L.WebAuthn:return this.apiService.getTwoFactorWebAuthn(e);case u.L.Authenticator:return this.apiService.getTwoFactorAuthenticator(e);case u.L.Yubikey:return this.apiService.getTwoFactorYubiKey(e)}}static open(e,t){return e.open(ge,t)}}ge.ɵfac=function(e){return new(e||ge)(n.Y36(oe.Kt),n.Y36(oe.zj),n.Y36(y.s),n.Y36(w.D),n.Y36(b.i))},ge.ɵcmp=n.Xpm({type:ge,selectors:[["app-two-factor-verify"]],outputs:{onAuthed:"onAuthed"},decls:29,vars:12,consts:[[3,"formGroup","bitSubmit"],["dialogSize","default"],["bitDialogTitle",""],[1,"tw-text-muted"],["bitDialogContent",""],["formControlName","secret","ngDefaultControl","","name","secret"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(n.TgZ(0,"form",0),n._uU(1,"\n  "),n.TgZ(2,"bit-dialog",1),n._uU(3,"\n    "),n.TgZ(4,"span",2),n._uU(5),n.ALo(6,"i18n"),n.TgZ(7,"small",3),n._uU(8),n.qZA(),n._uU(9,"\n    "),n.qZA(),n._uU(10,"\n    "),n.ynx(11,4),n._uU(12,"\n      "),n._UZ(13,"app-user-verification-form-input",5),n._uU(14,"\n    "),n.BQk(),n._uU(15,"\n    "),n.ynx(16,6),n._uU(17,"\n      "),n.TgZ(18,"button",7),n._uU(19),n.ALo(20,"i18n"),n.qZA(),n._uU(21,"\n      "),n.TgZ(22,"button",8),n._uU(23),n.ALo(24,"i18n"),n.qZA(),n._uU(25,"\n    "),n.BQk(),n._uU(26,"\n  "),n.qZA(),n._uU(27,"\n"),n.qZA(),n._uU(28,"\n")),2&e&&(n.Q6J("formGroup",t.formGroup)("bitSubmit",t.submit),n.xp6(5),n.hij("\n      ",n.lcZ(6,6,"twoStepLogin"),"\n      "),n.xp6(3),n.Oqu(t.dialogTitle),n.xp6(11),n.hij("\n        ",n.lcZ(20,8,"continue"),"\n      "),n.xp6(4),n.hij("\n        ",n.lcZ(24,10,"close"),"\n      "))},dependencies:[S._Y,S.Fj,S.JJ,S.JL,S.sg,S.u,ae.b,le.u,ce.r,ue.a,de.f,pe.F,P.C],encapsulation:2});class fe extends g.Y{}class me extends g.Y{}var ve=i(2051),ye=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function we(e,t){1&e&&(n.TgZ(0,"app-callout",29),n.ALo(1,"i18n"),n._uU(2),n.ALo(3,"i18n"),n.qZA()),2&e&&(n.s9C("title",n.lcZ(1,2,"enabled")),n.xp6(2),n.hij("\n            ",n.lcZ(3,4,"twoStepLoginProviderEnabled"),"\n          "))}function be(e,t){if(1&e&&(n.TgZ(0,"strong"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e){const e=n.oxw().index;n.xp6(1),n.Oqu(n.xi3(2,1,"webAuthnkeyX",e+1))}}function Ue(e,t){if(1&e&&(n.TgZ(0,"strong"),n._uU(1),n.qZA()),2&e){const e=n.oxw().$implicit;n.xp6(1),n.Oqu(e.name)}}function _e(e,t){1&e&&(n.ynx(0),n._uU(1,"\n                  "),n.TgZ(2,"span"),n._uU(3),n.ALo(4,"i18n"),n.qZA(),n._uU(5,"\n                "),n.BQk()),2&e&&(n.xp6(3),n.Oqu(n.lcZ(4,1,"webAuthnMigrated")))}function Ae(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n                "),n.YNc(2,_e,6,3,"ng-container",23),n._uU(3,"\n              "),n.BQk()),2&e){const e=n.oxw().$implicit;n.xp6(2),n.Q6J("ngIf",e.migrated)}}function Ze(e,t){1&e&&(n._UZ(0,"i",35),n.ALo(1,"i18n")),2&e&&n.s9C("title",n.lcZ(1,1,"loading"))}function xe(e,t){if(1&e){const e=n.EpF();n.ynx(0),n._uU(1,"\n                "),n.YNc(2,Ze,2,3,"i",33),n._uU(3,"\n                -\n                "),n.TgZ(4,"a",34),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw().$implicit,i=n.oxw(2);return n.KtG(i.remove(t))})),n._uU(5),n.ALo(6,"i18n"),n.qZA(),n._uU(7,"\n              "),n.BQk()}if(2&e){n.oxw();const e=n.MAs(1);n.xp6(2),n.Q6J("ngIf",e.loading),n.xp6(3),n.Oqu(n.lcZ(6,2,"remove"))}}function Se(e,t){if(1&e&&(n.TgZ(0,"li",30,31),n._uU(2,"\n              "),n._UZ(3,"i",32),n._uU(4,"\n              "),n.YNc(5,be,3,4,"strong",23),n._uU(6,"\n              "),n.YNc(7,Ue,2,1,"strong",23),n._uU(8,"\n              "),n.YNc(9,Ae,4,1,"ng-container",23),n._uU(10,"\n              "),n.YNc(11,xe,8,4,"ng-container",23),n._uU(12,"\n            "),n.qZA()),2&e){const e=t.$implicit,i=n.MAs(1),s=n.oxw(2);n.Q6J("appApiAction",e.removePromise),n.xp6(5),n.Q6J("ngIf",!e.configured||!e.name),n.xp6(2),n.Q6J("ngIf",e.configured&&e.name),n.xp6(2),n.Q6J("ngIf",e.configured&&!i.loading),n.xp6(2),n.Q6J("ngIf",s.keysConfiguredCount>1&&e.configured)}}function Te(e,t){1&e&&(n.ynx(0),n._uU(1,"\n            "),n._UZ(2,"i",36),n._uU(3,"\n          "),n.BQk())}function Ce(e,t){1&e&&(n.ynx(0),n._uU(1,"\n              "),n._UZ(2,"i",36),n._uU(3),n.ALo(4,"i18n"),n.BQk()),2&e&&(n.xp6(3),n.hij("\n              ",n.lcZ(4,1,"twoFactorU2fWaiting"),"...\n            "))}function Oe(e,t){1&e&&(n.ynx(0),n._uU(1,"\n              "),n._UZ(2,"i",37),n._uU(3),n.ALo(4,"i18n"),n.BQk()),2&e&&(n.xp6(3),n.hij("\n              ",n.lcZ(4,1,"twoFactorU2fClickSave"),"\n            "))}function ke(e,t){1&e&&(n.ynx(0),n._uU(1,"\n              "),n._UZ(2,"i",38),n._uU(3),n.ALo(4,"i18n"),n.BQk()),2&e&&(n.xp6(3),n.hij("\n              ",n.lcZ(4,1,"twoFactorU2fProblemReadingTryAgain"),"\n            "))}function Pe(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n            "),n.YNc(2,Ce,5,3,"ng-container",23),n._uU(3,"\n            "),n.YNc(4,Oe,5,3,"ng-container",23),n._uU(5,"\n            "),n.YNc(6,ke,5,3,"ng-container",23),n._uU(7,"\n          "),n.BQk()),2&e){const e=n.oxw(2);n.xp6(2),n.Q6J("ngIf",e.webAuthnListening),n.xp6(2),n.Q6J("ngIf",e.webAuthnResponse),n.xp6(2),n.Q6J("ngIf",e.webAuthnError)}}function qe(e,t){1&e&&(n._UZ(0,"i",39),n.ALo(1,"i18n")),2&e&&n.s9C("title",n.lcZ(1,1,"loading"))}function Ie(e,t){1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"save")))}function Me(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"button",40,41),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw(2);return n.KtG(t.disable())})),n._uU(2,"\n            "),n._UZ(3,"i",39),n.ALo(4,"i18n"),n._uU(5,"\n            "),n.TgZ(6,"span"),n._uU(7),n.ALo(8,"i18n"),n.qZA(),n._uU(9,"\n          "),n.qZA()}if(2&e){const e=n.MAs(1);n.Q6J("disabled",e.loading),n.xp6(3),n.s9C("title",n.lcZ(4,3,"loading")),n.xp6(4),n.Oqu(n.lcZ(8,5,"disableAllKeys"))}}function Ne(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"form",8,9),n.NdJ("ngSubmit",(function(){n.CHM(e);const t=n.oxw();return n.KtG(t.submit())})),n._uU(2,"\n        "),n.TgZ(3,"div",10),n._uU(4,"\n          "),n.YNc(5,we,4,6,"app-callout",11),n._uU(6,"\n          "),n.TgZ(7,"app-callout",12),n._uU(8,"\n            "),n.TgZ(9,"p"),n._uU(10),n.ALo(11,"i18n"),n.qZA(),n._uU(12,"\n            "),n.TgZ(13,"ul",13),n._uU(14,"\n              "),n.TgZ(15,"li"),n._uU(16),n.ALo(17,"i18n"),n.qZA(),n._uU(18,"\n            "),n.qZA(),n._uU(19,"\n          "),n.qZA(),n._uU(20,"\n          "),n._UZ(21,"img",14),n._uU(22,"\n          "),n.TgZ(23,"ul",15),n._uU(24,"\n            "),n.YNc(25,Se,13,5,"li",16),n._uU(26,"\n          "),n.qZA(),n._uU(27,"\n          "),n._UZ(28,"hr"),n._uU(29,"\n          "),n.TgZ(30,"p"),n._uU(31),n.ALo(32,"i18n"),n.qZA(),n._uU(33,"\n          "),n.TgZ(34,"ol"),n._uU(35,"\n            "),n.TgZ(36,"li"),n._uU(37),n.ALo(38,"i18n"),n.qZA(),n._uU(39,"\n            "),n.TgZ(40,"li"),n._uU(41),n.ALo(42,"i18n"),n.qZA(),n._uU(43,"\n            "),n.TgZ(44,"li"),n._uU(45),n.ALo(46,"i18n"),n.qZA(),n._uU(47,"\n            "),n.TgZ(48,"li"),n._uU(49),n.ALo(50,"i18n"),n.qZA(),n._uU(51,"\n          "),n.qZA(),n._uU(52,"\n          "),n.TgZ(53,"div",17),n._uU(54,"\n            "),n.TgZ(55,"div",18),n._uU(56,"\n              "),n.TgZ(57,"label",19),n._uU(58),n.ALo(59,"i18n"),n.qZA(),n._uU(60,"\n              "),n.TgZ(61,"input",20),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.name=t)})),n.qZA(),n._uU(62,"\n            "),n.qZA(),n._uU(63,"\n          "),n.qZA(),n._uU(64,"\n          "),n.TgZ(65,"button",21,22),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw();return n.KtG(t.readKey())})),n._uU(67),n.ALo(68,"i18n"),n.qZA(),n._uU(69,"\n          "),n.YNc(70,Te,4,0,"ng-container",23),n._uU(71,"\n          "),n.YNc(72,Pe,8,3,"ng-container",23),n._uU(73,"\n        "),n.qZA(),n._uU(74,"\n        "),n.TgZ(75,"div",24),n._uU(76,"\n          "),n.TgZ(77,"button",25),n._uU(78,"\n            "),n.YNc(79,qe,2,3,"i",26),n._uU(80,"\n            "),n.YNc(81,Ie,3,3,"span",23),n._uU(82,"\n          "),n.qZA(),n._uU(83,"\n          "),n.YNc(84,Me,10,7,"button",27),n._uU(85,"\n          "),n.TgZ(86,"button",28),n._uU(87),n.ALo(88,"i18n"),n.qZA(),n._uU(89,"\n        "),n.qZA(),n._uU(90,"\n      "),n.qZA()}if(2&e){const e=n.MAs(1),t=n.MAs(66),i=n.oxw();n.Q6J("appApiAction",i.formPromise),n.xp6(5),n.Q6J("ngIf",i.enabled),n.xp6(5),n.Oqu(n.lcZ(11,23,"twoFactorWebAuthnWarning")),n.xp6(6),n.Oqu(n.lcZ(17,25,"twoFactorWebAuthnSupportWeb")),n.xp6(9),n.Q6J("ngForOf",i.keys),n.xp6(6),n.hij("",n.lcZ(32,27,"twoFactorWebAuthnAdd"),":"),n.xp6(6),n.Oqu(n.lcZ(38,29,"twoFactorU2fGiveName")),n.xp6(4),n.Oqu(n.lcZ(42,31,"twoFactorU2fPlugInReadKey")),n.xp6(4),n.Oqu(n.lcZ(46,33,"twoFactorU2fTouchButton")),n.xp6(4),n.Oqu(n.lcZ(50,35,"twoFactorU2fSaveForm")),n.xp6(9),n.Oqu(n.lcZ(59,37,"name")),n.xp6(3),n.Q6J("ngModel",i.name)("disabled",!i.keyIdAvailable),n.xp6(4),n.Q6J("disabled",t.loading||i.webAuthnListening||!i.keyIdAvailable)("appApiAction",i.challengePromise),n.xp6(2),n.hij("\n            ",n.lcZ(68,39,"readKey"),"\n          "),n.xp6(3),n.Q6J("ngIf",t.loading),n.xp6(2),n.Q6J("ngIf",!t.loading),n.xp6(5),n.Q6J("disabled",e.loading||!i.webAuthnResponse),n.xp6(2),n.Q6J("ngIf",e.loading),n.xp6(2),n.Q6J("ngIf",!e.loading),n.xp6(3),n.Q6J("ngIf",i.enabled),n.xp6(3),n.hij("\n            ",n.lcZ(88,41,"close"),"\n          ")}}class Le extends v.c{constructor(e,t,i,n,s,o,r){super(e,t,i,s,o,r),this.ngZone=n,this.type=u.L.WebAuthn,this.keyIdAvailable=null,this.keysConfiguredCount=0,this.componentName="app-two-factor-webauthn"}auth(e){super.auth(e),this.processResponse(e.response)}submit(){const e=Object.create(null,{enable:{get:()=>super.enable}});return ye(this,void 0,void 0,(function*(){if(null==this.webAuthnResponse||null==this.keyIdAvailable)return Promise.reject();const t=yield this.buildRequestModel(me);return t.deviceResponse=this.webAuthnResponse,t.id=this.keyIdAvailable,t.name=this.name,e.enable.call(this,(()=>ye(this,void 0,void 0,(function*(){this.formPromise=this.apiService.putTwoFactorWebAuthn(t);const e=yield this.formPromise;yield this.processResponse(e)}))))}))}disable(){return super.disable(this.formPromise)}remove(e){return ye(this,void 0,void 0,(function*(){if(this.keysConfiguredCount<=1||null!=e.removePromise)return;const t=null!=e.name?e.name:this.i18nService.t("webAuthnkeyX",e.id);if(!(yield this.dialogService.openSimpleDialog({title:t,content:{key:"removeU2fConfirmation"},type:"warning"})))return;const i=yield this.buildRequestModel(fe);i.id=e.id;try{e.removePromise=this.apiService.deleteTwoFactorWebAuthn(i);const t=yield e.removePromise;e.removePromise=null,yield this.processResponse(t)}catch(n){this.logService.error(n)}}))}readKey(){return ye(this,void 0,void 0,(function*(){if(null==this.keyIdAvailable)return;const e=yield this.buildRequestModel(g.Y);try{this.challengePromise=this.apiService.getTwoFactorWebAuthnChallenge(e);const t=yield this.challengePromise;this.readDevice(t)}catch(t){this.logService.error(t)}}))}readDevice(e){console.log("listening for key..."),this.resetWebAuthn(!0),navigator.credentials.create({publicKey:e}).then((e=>{this.ngZone.run((()=>{this.webAuthnListening=!1,this.webAuthnResponse=e}))})).catch((e=>{console.error(e),this.resetWebAuthn(!1),this.webAuthnError=!0}))}resetWebAuthn(e=!1){this.webAuthnResponse=null,this.webAuthnError=!1,this.webAuthnListening=e}processResponse(e){this.resetWebAuthn(),this.keys=[],this.keyIdAvailable=null,this.name=null,this.keysConfiguredCount=0;for(let t=1;t<=5;t++){if(null!=e.keys){const i=e.keys.filter((e=>e.id===t));if(i.length>0){this.keysConfiguredCount++,this.keys.push({id:t,name:i[0].name,configured:!0,migrated:i[0].migrated,removePromise:null});continue}}this.keys.push({id:t,name:null,configured:!1,removePromise:null}),null==this.keyIdAvailable&&(this.keyIdAvailable=t)}this.enabled=e.enabled}}Le.ɵfac=function(e){return new(e||Le)(n.Y36(y.s),n.Y36(w.D),n.Y36(U.P),n.Y36(n.R0b),n.Y36(_.$),n.Y36(b.i),n.Y36(Z.x))},Le.ɵcmp=n.Xpm({type:Le,selectors:[["app-two-factor-webauthn"]],features:[n.qOj],decls:29,vars:10,consts:[["role","dialog","aria-modal","true","aria-labelledby","2faU2fTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],["id","2faU2fTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["ngNativeValidate","",3,"appApiAction","ngSubmit",4,"ngIf"],["ngNativeValidate","",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-body"],["type","success","icon","bwi bwi-check-circle",3,"title",4,"ngIf"],["type","warning"],[1,"mb-0"],["alt","FIDO2 WebAuthn logo'",1,"float-right","ml-5","mfaType7"],[1,"bwi-ul"],[3,"appApiAction",4,"ngFor","ngForOf"],[1,"row"],[1,"form-group","col-6"],["for","name"],["id","name","type","text","name","Name",1,"form-control",3,"ngModel","disabled","ngModelChange"],["type","button",1,"btn","btn-outline-secondary","mr-2",3,"disabled","appApiAction","click"],["readKeyBtn",""],[4,"ngIf"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary",3,"disabled"],["class","bwi bwi-spinner bwi-spin","aria-hidden","true",3,"title",4,"ngIf"],["type","button","class","btn btn-outline-secondary btn-submit",3,"disabled","click",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["type","success","icon","bwi bwi-check-circle",3,"title"],[3,"appApiAction"],["removeKeyBtn",""],[1,"bwi","bwi-li","bwi-key"],["class","bwi bwi-spin bwi-spinner text-muted bwi-fw","aria-hidden","true",3,"title",4,"ngIf"],["href","#","appStopClick","",3,"click"],["aria-hidden","true",1,"bwi","bwi-spin","bwi-spinner","text-muted","bwi-fw",3,"title"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted"],["aria-hidden","true",1,"bwi","bwi-check-circle","text-success"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle","text-danger"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button",1,"btn","btn-outline-secondary","btn-submit",3,"disabled","click"],["disableBtn",""]],template:function(e,t){1&e&&(n.TgZ(0,"div",0),n._uU(1,"\n  "),n.TgZ(2,"div",1),n._uU(3,"\n    "),n.TgZ(4,"div",2),n._uU(5,"\n      "),n.TgZ(6,"div",3),n._uU(7,"\n        "),n.TgZ(8,"h1",4),n._uU(9),n.ALo(10,"i18n"),n.TgZ(11,"small"),n._uU(12),n.ALo(13,"i18n"),n.qZA(),n._uU(14,"\n        "),n.qZA(),n._uU(15,"\n        "),n.TgZ(16,"button",5),n.ALo(17,"i18n"),n._uU(18,"\n          "),n.TgZ(19,"span",6),n._uU(20,"×"),n.qZA(),n._uU(21,"\n        "),n.qZA(),n._uU(22,"\n      "),n.qZA(),n._uU(23,"\n      "),n.YNc(24,Ne,91,43,"form",7),n._uU(25,"\n    "),n.qZA(),n._uU(26,"\n  "),n.qZA(),n._uU(27,"\n"),n.qZA(),n._uU(28,"\n")),2&e&&(n.xp6(9),n.hij("\n          ",n.lcZ(10,4,"twoStepLogin"),"\n          "),n.xp6(3),n.Oqu(n.lcZ(13,6,"webAuthnTitle")),n.xp6(4),n.s9C("appA11yTitle",n.lcZ(17,8,"close")),n.xp6(8),n.Q6J("ngIf",t.authed))},dependencies:[x.sg,x.O5,S.Fj,S.JJ,S.JL,S.On,S.F,T.B,C.b,O.O,ve.O,P.C],encapsulation:2});class De extends g.Y{}var Ee=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Fe(e,t){1&e&&(n.TgZ(0,"app-callout",27),n.ALo(1,"i18n"),n._uU(2),n.ALo(3,"i18n"),n.qZA()),2&e&&(n.s9C("title",n.lcZ(1,2,"enabled")),n.xp6(2),n.hij("\n            ",n.lcZ(3,4,"twoStepLoginProviderEnabled"),"\n          "))}function Re(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"input",32),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw().$implicit;return n.KtG(i.key=t)})),n.qZA()}if(2&e){const e=n.oxw(),t=e.index,i=e.$implicit;n.MGl("id","key",t+1,"")("name","Key",t+1,""),n.Q6J("ngModel",i.key)}}function Je(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"div",33),n._uU(1,"\n                "),n.TgZ(2,"span",34),n._uU(3),n.qZA(),n._uU(4,"\n                "),n.TgZ(5,"button",35),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw().$implicit,i=n.oxw(2);return n.KtG(i.remove(t))})),n.ALo(6,"i18n"),n._uU(7,"\n                  "),n._UZ(8,"i",36),n._uU(9,"\n                "),n.qZA(),n._uU(10,"\n              "),n.qZA()}if(2&e){const e=n.oxw().$implicit;n.xp6(3),n.Oqu(e.existingKey),n.xp6(2),n.s9C("appA11yTitle",n.lcZ(6,2,"remove"))}}function ze(e,t){if(1&e&&(n.TgZ(0,"div",28),n._uU(1,"\n              "),n.TgZ(2,"label",29),n._uU(3),n.ALo(4,"i18n"),n.qZA(),n._uU(5,"\n              "),n.YNc(6,Re,1,3,"input",30),n._uU(7,"\n              "),n.YNc(8,Je,11,4,"div",31),n._uU(9,"\n            "),n.qZA()),2&e){const e=t.$implicit,i=t.index;n.xp6(2),n.MGl("for","key",i+1,""),n.xp6(1),n.Oqu(n.xi3(4,4,"yubikeyX",i+1)),n.xp6(3),n.Q6J("ngIf",!e.existingKey),n.xp6(2),n.Q6J("ngIf",e.existingKey)}}function Ye(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"button",37,38),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw(2);return n.KtG(t.disable())})),n._uU(2,"\n            "),n._UZ(3,"i",24),n.ALo(4,"i18n"),n._uU(5,"\n            "),n.TgZ(6,"span"),n._uU(7),n.ALo(8,"i18n"),n.qZA(),n._uU(9,"\n          "),n.qZA()}if(2&e){const e=n.MAs(1),t=n.oxw(2);n.Q6J("appApiAction",t.disablePromise)("disabled",e.loading),n.xp6(3),n.s9C("title",n.lcZ(4,4,"loading")),n.xp6(4),n.Oqu(n.lcZ(8,6,"disableAllKeys"))}}function Ke(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"form",8,9),n.NdJ("ngSubmit",(function(){n.CHM(e);const t=n.oxw();return n.KtG(t.submit())})),n._uU(2,"\n        "),n.TgZ(3,"div",10),n._uU(4,"\n          "),n.YNc(5,Fe,4,6,"app-callout",11),n._uU(6,"\n          "),n.TgZ(7,"app-callout",12),n._uU(8,"\n            "),n.TgZ(9,"p"),n._uU(10),n.ALo(11,"i18n"),n.qZA(),n._uU(12,"\n            "),n.TgZ(13,"ul",13),n._uU(14,"\n              "),n.TgZ(15,"li"),n._uU(16),n.ALo(17,"i18n"),n.qZA(),n._uU(18,"\n              "),n.TgZ(19,"li"),n._uU(20),n.ALo(21,"i18n"),n.qZA(),n._uU(22,"\n            "),n.qZA(),n._uU(23,"\n          "),n.qZA(),n._uU(24,"\n          "),n._UZ(25,"img",14),n._uU(26,"\n          "),n.TgZ(27,"p"),n._uU(28),n.ALo(29,"i18n"),n.qZA(),n._uU(30,"\n          "),n.TgZ(31,"ol"),n._uU(32,"\n            "),n.TgZ(33,"li"),n._uU(34),n.ALo(35,"i18n"),n.qZA(),n._uU(36,"\n            "),n.TgZ(37,"li"),n._uU(38),n.ALo(39,"i18n"),n.qZA(),n._uU(40,"\n            "),n.TgZ(41,"li"),n._uU(42),n.ALo(43,"i18n"),n.qZA(),n._uU(44,"\n            "),n.TgZ(45,"li"),n._uU(46),n.ALo(47,"i18n"),n.qZA(),n._uU(48,"\n          "),n.qZA(),n._uU(49,"\n          "),n._UZ(50,"hr"),n._uU(51,"\n          "),n.TgZ(52,"div",15),n._uU(53,"\n            "),n.YNc(54,ze,10,7,"div",16),n._uU(55,"\n          "),n.qZA(),n._uU(56,"\n          "),n.TgZ(57,"strong",17),n._uU(58),n.ALo(59,"i18n"),n.qZA(),n._uU(60,"\n          "),n.TgZ(61,"div",18),n._uU(62,"\n            "),n.TgZ(63,"input",19),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.nfc=t)})),n.qZA(),n._uU(64,"\n            "),n.TgZ(65,"label",20),n._uU(66),n.ALo(67,"i18n"),n.qZA(),n._uU(68,"\n          "),n.qZA(),n._uU(69,"\n          "),n.TgZ(70,"small",21),n._uU(71),n.ALo(72,"i18n"),n.qZA(),n._uU(73,"\n        "),n.qZA(),n._uU(74,"\n        "),n.TgZ(75,"div",22),n._uU(76,"\n          "),n.TgZ(77,"button",23),n._uU(78,"\n            "),n._UZ(79,"i",24),n.ALo(80,"i18n"),n._uU(81,"\n            "),n.TgZ(82,"span"),n._uU(83),n.ALo(84,"i18n"),n.qZA(),n._uU(85,"\n          "),n.qZA(),n._uU(86,"\n          "),n.YNc(87,Ye,10,8,"button",25),n._uU(88,"\n          "),n.TgZ(89,"button",26),n._uU(90),n.ALo(91,"i18n"),n.qZA(),n._uU(92,"\n        "),n.qZA(),n._uU(93,"\n      "),n.qZA()}if(2&e){const e=n.MAs(1),t=n.oxw();n.Q6J("appApiAction",t.formPromise),n.xp6(5),n.Q6J("ngIf",t.enabled),n.xp6(5),n.Oqu(n.lcZ(11,20,"twoFactorYubikeyWarning")),n.xp6(6),n.Oqu(n.lcZ(17,22,"twoFactorYubikeySupportUsb")),n.xp6(4),n.Oqu(n.lcZ(21,24,"twoFactorYubikeySupportMobile")),n.xp6(8),n.hij("",n.lcZ(29,26,"twoFactorYubikeyAdd"),":"),n.xp6(6),n.Oqu(n.lcZ(35,28,"twoFactorYubikeyPlugIn")),n.xp6(4),n.Oqu(n.lcZ(39,30,"twoFactorYubikeySelectKey")),n.xp6(4),n.Oqu(n.lcZ(43,32,"twoFactorYubikeyTouchButton")),n.xp6(4),n.Oqu(n.lcZ(47,34,"twoFactorYubikeySaveForm")),n.xp6(8),n.Q6J("ngForOf",t.keys),n.xp6(4),n.Oqu(n.lcZ(59,36,"nfcSupport")),n.xp6(5),n.Q6J("ngModel",t.nfc),n.xp6(3),n.Oqu(n.lcZ(67,38,"twoFactorYubikeySupportsNfc")),n.xp6(5),n.Oqu(n.lcZ(72,40,"twoFactorYubikeySupportsNfcDesc")),n.xp6(6),n.Q6J("disabled",e.loading),n.xp6(2),n.s9C("title",n.lcZ(80,42,"loading")),n.xp6(4),n.Oqu(n.lcZ(84,44,"save")),n.xp6(4),n.Q6J("ngIf",t.enabled),n.xp6(3),n.hij("\n            ",n.lcZ(91,46,"close"),"\n          ")}}class Be extends v.c{constructor(e,t,i,n,s,o){super(e,t,i,n,s,o),this.type=u.L.Yubikey,this.nfc=!1,this.componentName="app-two-factor-yubikey"}auth(e){super.auth(e),this.processResponse(e.response)}submit(){const e=Object.create(null,{enable:{get:()=>super.enable}});return Ee(this,void 0,void 0,(function*(){const t=yield this.buildRequestModel(De);return t.key1=null!=this.keys&&this.keys.length>0?this.keys[0].key:null,t.key2=null!=this.keys&&this.keys.length>1?this.keys[1].key:null,t.key3=null!=this.keys&&this.keys.length>2?this.keys[2].key:null,t.key4=null!=this.keys&&this.keys.length>3?this.keys[3].key:null,t.key5=null!=this.keys&&this.keys.length>4?this.keys[4].key:null,t.nfc=this.nfc,e.enable.call(this,(()=>Ee(this,void 0,void 0,(function*(){this.formPromise=this.apiService.putTwoFactorYubiKey(t);const e=yield this.formPromise;yield this.processResponse(e),this.platformUtilsService.showToast("success",null,this.i18nService.t("yubikeysUpdated"))}))))}))}disable(){return super.disable(this.disablePromise)}remove(e){e.existingKey=null,e.key=null}processResponse(e){this.enabled=e.enabled,this.keys=[{key:e.key1,existingKey:this.padRight(e.key1)},{key:e.key2,existingKey:this.padRight(e.key2)},{key:e.key3,existingKey:this.padRight(e.key3)},{key:e.key4,existingKey:this.padRight(e.key4)},{key:e.key5,existingKey:this.padRight(e.key5)}],this.nfc=e.nfc||!e.enabled}padRight(e,t="•",i=44){if(null==e||null==t||e.length>=i)return e;const n=(i-e.length)/t.length;for(let s=0;s<n;s++)e+=t;return e}}Be.ɵfac=function(e){return new(e||Be)(n.Y36(y.s),n.Y36(w.D),n.Y36(U.P),n.Y36(_.$),n.Y36(b.i),n.Y36(Z.x))},Be.ɵcmp=n.Xpm({type:Be,selectors:[["app-two-factor-yubikey"]],features:[n.qOj],decls:28,vars:7,consts:[["role","dialog","aria-modal","true","aria-labelledby","2faYubiKeyTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],["id","2faYubiKeyTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["ngNativeValidate","","autocomplete","off",3,"appApiAction","ngSubmit",4,"ngIf"],["ngNativeValidate","","autocomplete","off",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-body"],["type","success","icon","bwi bwi-check-circle",3,"title",4,"ngIf"],["type","warning"],[1,"mb-0"],["alt","YubiKey OTP security key logo",1,"float-right","mfaType3"],[1,"row"],["class","form-group col-6",4,"ngFor","ngForOf"],[1,"d-block","mb-2"],[1,"form-check"],["type","checkbox","id","nfc","name","Nfc",1,"form-check-input",3,"ngModel","ngModelChange"],["for","nfc",1,"form-check-label"],[1,"form-text","text-muted"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button","class","btn btn-outline-secondary btn-submit",3,"appApiAction","disabled","click",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["type","success","icon","bwi bwi-check-circle",3,"title"],[1,"form-group","col-6"],[3,"for"],["type","password","class","form-control","appInputVerbatim","","autocomplete","new-password",3,"id","name","ngModel","ngModelChange",4,"ngIf"],["class","d-flex",4,"ngIf"],["type","password","appInputVerbatim","","autocomplete","new-password",1,"form-control",3,"id","name","ngModel","ngModelChange"],[1,"d-flex"],[1,"mr-2"],["type","button",1,"btn","btn-link","text-danger","ml-auto",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-minus-circle","bwi-lg"],["type","button",1,"btn","btn-outline-secondary","btn-submit",3,"appApiAction","disabled","click"],["disableBtn",""]],template:function(e,t){1&e&&(n.TgZ(0,"div",0),n._uU(1,"\n  "),n.TgZ(2,"div",1),n._uU(3,"\n    "),n.TgZ(4,"div",2),n._uU(5,"\n      "),n.TgZ(6,"div",3),n._uU(7,"\n        "),n.TgZ(8,"h1",4),n._uU(9),n.ALo(10,"i18n"),n.TgZ(11,"small"),n._uU(12,"YubiKey"),n.qZA(),n._uU(13,"\n        "),n.qZA(),n._uU(14,"\n        "),n.TgZ(15,"button",5),n.ALo(16,"i18n"),n._uU(17,"\n          "),n.TgZ(18,"span",6),n._uU(19,"×"),n.qZA(),n._uU(20,"\n        "),n.qZA(),n._uU(21,"\n      "),n.qZA(),n._uU(22,"\n      "),n.YNc(23,Ke,94,48,"form",7),n._uU(24,"\n    "),n.qZA(),n._uU(25,"\n  "),n.qZA(),n._uU(26,"\n"),n.qZA(),n._uU(27,"\n")),2&e&&(n.xp6(9),n.hij("\n          ",n.lcZ(10,3,"twoStepLogin"),"\n          "),n.xp6(6),n.s9C("appA11yTitle",n.lcZ(16,5,"close")),n.xp6(8),n.Q6J("ngIf",t.authed))},dependencies:[x.sg,x.O5,S.Fj,S.Wl,S.JJ,S.JL,S.On,S.F,T.B,C.b,O.O,k.b,P.C],encapsulation:2});var Qe=i(83924),Ge=i(384),je=i(8111),Ve=i(24083),$e=i(81168),He=i(58618),We=i(55039),Xe=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const et=["recoveryTemplate"],tt=["authenticatorTemplate"],it=["yubikeyTemplate"],nt=["duoTemplate"],st=["emailTemplate"],ot=["webAuthnTemplate"];function rt(e,t){1&e&&n._UZ(0,"app-header")}function at(e,t){1&e&&(n.TgZ(0,"h1"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"twoStepLogin")))}function lt(e,t){1&e&&(n.TgZ(0,"h1"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"twoStepLoginEnforcement")))}function ct(e,t){if(1&e&&(n.TgZ(0,"div",12),n._uU(1,"\n    "),n.YNc(2,at,3,3,"h1",0),n._uU(3,"\n    "),n.YNc(4,lt,3,3,"h1",0),n._uU(5,"\n  "),n.qZA()),2&e){const e=n.oxw();n.xp6(2),n.Q6J("ngIf",!e.organizationId||!e.isEnterpriseOrg),n.xp6(2),n.Q6J("ngIf",e.organizationId&&e.isEnterpriseOrg)}}function ut(e,t){1&e&&(n.TgZ(0,"p"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"twoStepLoginDesc")))}function dt(e,t){1&e&&(n.ynx(0),n._uU(1),n.ALo(2,"i18n"),n.TgZ(3,"a",15),n._uU(4),n.ALo(5,"i18n"),n.qZA(),n._uU(6,"\n        "),n._UZ(7,"br"),n._uU(8),n.ALo(9,"i18n"),n._UZ(10,"br"),n._uU(11,"\n        "),n._UZ(12,"br"),n._uU(13,"\n        "),n.TgZ(14,"p"),n._uU(15),n.ALo(16,"i18n"),n.qZA(),n._uU(17,"\n      "),n.BQk()),2&e&&(n.xp6(1),n.hij("\n        ",n.lcZ(2,4,"twoStepLoginEnterpriseDescStart"),"\n        "),n.xp6(3),n.hij("",n.lcZ(5,6,"twoStepLoginPolicy"),"."),n.xp6(4),n.hij("\n        ",n.lcZ(9,8,"twoStepLoginOrganizationDuoDesc"),"\n        "),n.xp6(7),n.Oqu(n.lcZ(16,10,"twoStepLoginOrganizationSsoDesc")))}function pt(e,t){1&e&&(n._uU(0),n.ALo(1,"i18n"),n._UZ(2,"br"),n._uU(3),n.ALo(4,"i18n")),2&e&&(n.hij("\n        ",n.lcZ(1,2,"twoStepLoginTeamsDesc"),"\n        "),n.xp6(3),n.hij("\n        ",n.lcZ(4,4,"twoStepLoginOrganizationDuoDesc"),"\n      "))}function ht(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n    "),n.TgZ(2,"p"),n._uU(3,"\n      "),n.YNc(4,dt,18,12,"ng-container",13),n._uU(5,"\n      "),n.YNc(6,pt,5,6,"ng-template",null,14,n.W1O),n._uU(8,"\n    "),n.qZA(),n._uU(9,"\n  "),n.BQk()),2&e){const e=n.MAs(7),t=n.oxw();n.xp6(4),n.Q6J("ngIf",t.isEnterpriseOrg)("ngIfElse",e)}}function gt(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"bit-callout",16),n._uU(1,"\n    "),n.TgZ(2,"p"),n._uU(3),n.ALo(4,"i18n"),n.qZA(),n._uU(5,"\n    "),n.TgZ(6,"button",17),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw();return n.KtG(t.recoveryCode())})),n._uU(7),n.ALo(8,"i18n"),n.qZA(),n._uU(9,"\n  "),n.qZA()}2&e&&(n.xp6(3),n.Oqu(n.lcZ(4,2,"twoStepLoginRecoveryWarning")),n.xp6(4),n.hij("\n      ",n.lcZ(8,4,"viewRecoveryCode"),"\n    "))}function ft(e,t){1&e&&(n.TgZ(0,"small"),n._uU(1,"\n      "),n._UZ(2,"i",18),n.ALo(3,"i18n"),n._uU(4,"\n      "),n.TgZ(5,"span",19),n._uU(6),n.ALo(7,"i18n"),n.qZA(),n._uU(8,"\n    "),n.qZA()),2&e&&(n.xp6(2),n.s9C("title",n.lcZ(3,2,"loading")),n.xp6(4),n.Oqu(n.lcZ(7,4,"loading")))}function mt(e,t){1&e&&(n.TgZ(0,"bit-callout",16),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.hij("\n    ",n.lcZ(2,1,"twoStepLoginPolicyUserWarning"),"\n  "))}function vt(e,t){1&e&&(n.ynx(0),n._uU(1,"\n            "),n._UZ(2,"i",27),n.ALo(3,"i18n"),n._uU(4,"\n            "),n.TgZ(5,"span",19),n._uU(6),n.ALo(7,"i18n"),n.qZA(),n._uU(8,"\n          "),n.BQk()),2&e&&(n.xp6(2),n.s9C("title",n.lcZ(3,2,"enabled")),n.xp6(4),n.Oqu(n.lcZ(7,4,"enabled")))}function yt(e,t){1&e&&n._UZ(0,"app-premium-badge")}function wt(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"li",20),n._uU(1,"\n      "),n.TgZ(2,"div",21),n._uU(3,"\n        "),n._UZ(4,"img",22),n._uU(5,"\n      "),n.qZA(),n._uU(6,"\n      "),n.TgZ(7,"div",23),n._uU(8,"\n        "),n.TgZ(9,"h3",24),n._uU(10),n.YNc(11,vt,9,6,"ng-container",0),n._uU(12,"\n          "),n.YNc(13,yt,1,0,"app-premium-badge",0),n._uU(14,"\n        "),n.qZA(),n._uU(15),n.qZA(),n._uU(16,"\n      "),n.TgZ(17,"div",25),n._uU(18,"\n        "),n.TgZ(19,"button",26),n.NdJ("click",(function(){const t=n.CHM(e).$implicit,i=n.oxw();return n.KtG(i.manage(t.type))})),n.ALo(20,"async"),n._uU(21),n.ALo(22,"i18n"),n.qZA(),n._uU(23,"\n      "),n.qZA(),n._uU(24,"\n    "),n.qZA()}if(2&e){const e=t.$implicit,i=n.oxw();n.xp6(4),n.Tol("mfaType"+e.type),n.Q6J("alt",e.name+" logo"),n.xp6(6),n.hij("\n          ",e.name,"\n          "),n.xp6(1),n.Q6J("ngIf",e.enabled),n.xp6(2),n.Q6J("ngIf",e.premium),n.xp6(2),n.hij("\n        ",e.description,"\n      "),n.xp6(4),n.Q6J("disabled",!n.lcZ(20,9,i.canAccessPremium$)&&e.premium),n.xp6(2),n.hij("\n          ",n.lcZ(22,11,"manage"),"\n        ")}}function bt(e,t){}function Ut(e,t){}function _t(e,t){}function At(e,t){}function Zt(e,t){}function xt(e,t){}const St=function(e){return{"mt-5":e}};class Tt{constructor(e,t,i,n,o,r){this.dialogService=e,this.apiService=t,this.modalService=i,this.messagingService=n,this.policyService=o,this.providers=[],this.showPolicyWarning=!1,this.loading=!0,this.tabbedHeader=!0,this.destroy$=new s.x,this.canAccessPremium$=r.hasPremiumFromAnySource$}ngOnInit(){return Xe(this,void 0,void 0,(function*(){for(const e in d.Vz){if(!d.Vz.hasOwnProperty(e))continue;const t=d.Vz[e];this.filterProvider(t.type)||this.providers.push({type:t.type,name:t.name,description:t.description,enabled:!1,premium:t.premium,sort:t.sort})}this.providers.sort(((e,t)=>e.sort-t.sort)),this.policyService.policyAppliesToActiveUser$(c.Mi.TwoFactorAuthentication).pipe((0,o.R)(this.destroy$)).subscribe((e=>{this.twoFactorAuthPolicyAppliesToActiveUser=e})),yield this.load()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}load(){return Xe(this,void 0,void 0,(function*(){this.loading=!0;(yield this.getTwoFactorProviders()).data.forEach((e=>{this.providers.forEach((t=>{e.type===t.type&&(t.enabled=e.enabled)}))})),this.evaluatePolicies(),this.loading=!1}))}callTwoFactorVerifyDialog(e){return Xe(this,void 0,void 0,(function*(){const t=ge.open(this.dialogService,{data:{type:e,organizationId:this.organizationId}});return yield(0,r.n)(t.closed)}))}manage(e){return Xe(this,void 0,void 0,(function*(){switch(e){case u.L.Authenticator:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=yield this.openModal(this.authenticatorModalRef,z);yield i.auth(t),i.onUpdated.pipe((0,o.R)(this.destroy$)).subscribe((e=>{this.updateStatus(e,u.L.Authenticator)}));break}case u.L.Yubikey:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=yield this.openModal(this.yubikeyModalRef,Be);i.auth(t),i.onUpdated.pipe((0,o.R)(this.destroy$)).subscribe((e=>{this.updateStatus(e,u.L.Yubikey)}));break}case u.L.Duo:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=yield this.openModal(this.duoModalRef,Y.C);i.auth(t),i.onUpdated.pipe((0,o.R)(this.destroy$)).subscribe((e=>{this.updateStatus(e,u.L.Duo)}));break}case u.L.Email:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=yield this.openModal(this.emailModalRef,X);yield i.auth(t),i.onUpdated.pipe((0,o.R)(this.destroy$)).subscribe((e=>{this.updateStatus(e,u.L.Email)}));break}case u.L.WebAuthn:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=yield this.openModal(this.webAuthnModalRef,Le);i.auth(t),i.onUpdated.pipe((0,o.R)(this.destroy$)).subscribe((e=>{this.updateStatus(e,u.L.WebAuthn)}));break}}}))}recoveryCode(){return Xe(this,void 0,void 0,(function*(){const e=yield this.callTwoFactorVerifyDialog(-1);if(e){(yield this.openModal(this.recoveryModalRef,se)).auth(e)}}))}premiumRequired(){return Xe(this,void 0,void 0,(function*(){(yield(0,a.z)(this.canAccessPremium$))||this.messagingService.send("premiumRequired")}))}getTwoFactorProviders(){return this.apiService.getTwoFactorProviders()}filterProvider(e){return e===u.L.OrganizationDuo}openModal(e,t){return Xe(this,void 0,void 0,(function*(){const[i,n]=yield this.modalService.openViewRef(t,e);return this.modal=i,n}))}updateStatus(e,t){e||null==this.modal||this.modal.close(),this.providers.forEach((i=>{i.type===t&&(i.enabled=e)})),this.evaluatePolicies()}evaluatePolicies(){null==this.organizationId&&1===this.providers.filter((e=>e.enabled)).length?this.showPolicyWarning=this.twoFactorAuthPolicyAppliesToActiveUser:this.showPolicyWarning=!1}get isEnterpriseOrg(){var e;return(null===(e=this.organization)||void 0===e?void 0:e.planProductType)===p.kv.Enterprise}}Tt.ɵfac=function(e){return new(e||Tt)(n.Y36(Z.x),n.Y36(y.s),n.Y36(l.Z),n.Y36(h.o),n.Y36(Qe.d),n.Y36(Ge.M))},Tt.ɵcmp=n.Xpm({type:Tt,selectors:[["app-two-factor-setup"]],viewQuery:function(e,t){if(1&e&&(n.Gf(et,7,n.s_b),n.Gf(tt,7,n.s_b),n.Gf(it,7,n.s_b),n.Gf(nt,7,n.s_b),n.Gf(st,7,n.s_b),n.Gf(ot,7,n.s_b)),2&e){let e;n.iGM(e=n.CRH())&&(t.recoveryModalRef=e.first),n.iGM(e=n.CRH())&&(t.authenticatorModalRef=e.first),n.iGM(e=n.CRH())&&(t.yubikeyModalRef=e.first),n.iGM(e=n.CRH())&&(t.duoModalRef=e.first),n.iGM(e=n.CRH())&&(t.emailModalRef=e.first),n.iGM(e=n.CRH())&&(t.webAuthnModalRef=e.first)}},decls:44,vars:14,consts:[[4,"ngIf"],["class","tabbed-header",4,"ngIf"],["type","warning",4,"ngIf"],[3,"ngClass"],[1,"list-group","list-group-2fa"],["class","list-group-item d-flex align-items-center",4,"ngFor","ngForOf"],["authenticatorTemplate",""],["recoveryTemplate",""],["duoTemplate",""],["emailTemplate",""],["yubikeyTemplate",""],["webAuthnTemplate",""],[1,"tabbed-header"],[4,"ngIf","ngIfElse"],["teamsDescription",""],["routerLink","../policies"],["type","warning"],["type","button","bitButton","","buttonType","secondary",3,"click"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-fw","text-muted",3,"title"],[1,"sr-only"],[1,"list-group-item","d-flex","align-items-center"],[1,"logo-2fa","d-flex","justify-content-center"],[3,"alt"],[1,"mx-4"],[1,"mb-0"],[1,"ml-auto"],["type","button","bitButton","","buttonType","secondary",3,"disabled","click"],["aria-hidden","true",1,"bwi","bwi-check","text-success","bwi-fw",3,"title"]],template:function(e,t){1&e&&(n.YNc(0,rt,1,0,"app-header",0),n._uU(1,"\n\n"),n.TgZ(2,"bit-container"),n._uU(3,"\n  "),n.YNc(4,ct,6,2,"div",1),n._uU(5,"\n\n  "),n.YNc(6,ut,3,3,"p",0),n._uU(7,"\n  "),n.YNc(8,ht,10,2,"ng-container",0),n._uU(9,"\n  "),n.YNc(10,gt,10,6,"bit-callout",2),n._uU(11,"\n  "),n.TgZ(12,"h2",3),n._uU(13),n.ALo(14,"i18n"),n.YNc(15,ft,9,6,"small",0),n._uU(16,"\n  "),n.qZA(),n._uU(17,"\n  "),n.YNc(18,mt,3,3,"bit-callout",2),n._uU(19,"\n  "),n.TgZ(20,"ul",4),n._uU(21,"\n    "),n.YNc(22,wt,25,13,"li",5),n._uU(23,"\n  "),n.qZA(),n._uU(24,"\n"),n.qZA(),n._uU(25,"\n\n"),n.YNc(26,bt,0,0,"ng-template",null,6,n.W1O),n._uU(28,"\n"),n.YNc(29,Ut,0,0,"ng-template",null,7,n.W1O),n._uU(31,"\n"),n.YNc(32,_t,0,0,"ng-template",null,8,n.W1O),n._uU(34,"\n"),n.YNc(35,At,0,0,"ng-template",null,9,n.W1O),n._uU(37,"\n"),n.YNc(38,Zt,0,0,"ng-template",null,10,n.W1O),n._uU(40,"\n"),n.YNc(41,xt,0,0,"ng-template",null,11,n.W1O),n._uU(43,"\n")),2&e&&(n.Q6J("ngIf",null!=t.organizationId),n.xp6(4),n.Q6J("ngIf",null==t.organizationId),n.xp6(2),n.Q6J("ngIf",!t.organizationId),n.xp6(2),n.Q6J("ngIf",t.organizationId),n.xp6(2),n.Q6J("ngIf",!t.organizationId),n.xp6(2),n.Q6J("ngClass",n.VKq(12,St,!t.organizationId)),n.xp6(1),n.hij("\n    ",n.lcZ(14,10,"providers"),"\n    "),n.xp6(2),n.Q6J("ngIf",t.loading),n.xp6(3),n.Q6J("ngIf",t.showPolicyWarning),n.xp6(4),n.Q6J("ngForOf",t.providers))},dependencies:[x.mk,x.sg,x.O5,je.rH,ce.r,Ve.O,$e.e,He.k,We.R,x.Ov,P.C],encapsulation:2})},4519:(e,t,i)=>{"use strict";i.d(t,{Zn:()=>r});var n=i(37513),s=i(85921),o=i(85762);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵmod=o.oAB({type:r}),r.ɵinj=o.cJS({imports:[s.m,n.u5,n.UX]});var a=i(94516),l=i(28783),c=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class u{constructor(e,t,i,n,s,o){this.modalRef=e,this.config=t,this.userVerificationService=i,this.formBuilder=n,this.platformUtilsService=s,this.i18nService=o,this.confirmDescription=this.config.confirmDescription,this.confirmButtonText=this.config.confirmButtonText,this.modalTitle=this.config.modalTitle,this.formGroup=this.formBuilder.group({secret:this.formBuilder.control(null)}),this.invalidSecret=!1,this.submit=()=>c(this,void 0,void 0,(function*(){if(this.formGroup.markAllAsTouched(),!this.formGroup.invalid){try{yield this.userVerificationService.verifyUser(this.secret.value),this.invalidSecret=!1}catch(e){return this.invalidSecret=!0,void this.platformUtilsService.showToast("error",this.i18nService.t("error"),e.message)}this.close(!0)}}))}get secret(){return this.formGroup.controls.secret}close(e){this.modalRef.close(e)}}u.ɵfac=function(e){o.$Z()},u.ɵdir=o.lG2({type:u});var d=i(42304),p=i(99721),h=i(78627),g=i(46246),f=i(36338),m=i(81974),v=i(29465),y=i(18362),w=i(28315),b=i(82933);class U extends u{constructor(e,t,i,n,s,o){super(null,e,i,n,s,o),this.dialogRef=t}close(e){this.dialogRef.close(e)}}U.ɵfac=function(e){return new(e||U)(o.Y36(l.Kt),o.Y36(l.zj),o.Y36(d.i),o.Y36(n.qu),o.Y36(p.P),o.Y36(h.D))},U.ɵcmp=o.Xpm({type:U,selectors:[["ng-component"]],features:[o.qOj],decls:30,vars:15,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["bitTypography","body1"],["formControlName","secret",3,"invalidSecret","invalidSecretChange"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(o.TgZ(0,"form",0),o._uU(1,"\n  "),o.TgZ(2,"bit-dialog"),o._uU(3,"\n    "),o.TgZ(4,"span",1),o._uU(5),o.ALo(6,"i18n"),o.qZA(),o._uU(7,"\n    "),o.ynx(8,2),o._uU(9,"\n      "),o.TgZ(10,"p",3),o._uU(11),o.ALo(12,"i18n"),o.qZA(),o._uU(13,"\n      "),o.TgZ(14,"app-user-verification",4),o.NdJ("invalidSecretChange",(function(e){return t.invalidSecret=e})),o.qZA(),o._uU(15,"\n    "),o.BQk(),o._uU(16,"\n    "),o.ynx(17,5),o._uU(18,"\n      "),o.TgZ(19,"button",6),o._uU(20),o.ALo(21,"i18n"),o.qZA(),o._uU(22,"\n      "),o.TgZ(23,"button",7),o._uU(24),o.ALo(25,"i18n"),o.qZA(),o._uU(26,"\n    "),o.BQk(),o._uU(27,"\n  "),o.qZA(),o._uU(28,"\n"),o.qZA(),o._uU(29,"\n")),2&e&&(o.Q6J("formGroup",t.formGroup)("bitSubmit",t.submit),o.xp6(5),o.Oqu(o.lcZ(6,7,t.modalTitle)),o.xp6(6),o.Oqu(o.lcZ(12,9,t.confirmDescription)),o.xp6(3),o.Q6J("invalidSecret",t.invalidSecret),o.xp6(6),o.hij("\n        ",o.lcZ(21,11,t.confirmButtonText),"\n      "),o.xp6(4),o.hij("\n        ",o.lcZ(25,13,"cancel"),"\n      "))},dependencies:[n._Y,n.JJ,n.JL,n.sg,n.u,g.b,f.u,m.r,v.a,y.f,w.t,a.W,b.C],encapsulation:2})},94516:(e,t,i)=>{"use strict";i.d(t,{W:()=>P});var n=i(88444),s=i(37513),o=i(85762),r=i(54019),a=i(68362),l=i(70138),c=i(27646),u=i(76528),d=i(42304),p=i(78627),h=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class g{get invalidSecret(){return this._invalidSecret}set invalidSecret(e){this._invalidSecret=e,this.invalidSecretChange.emit(e),e&&this.secret.markAsTouched(),this.secret.updateValueAndValidity({emitEvent:!1})}constructor(e,t,i){this.cryptoService=e,this.userVerificationService=t,this.i18nService=i,this._invalidSecret=!1,this.invalidSecretChange=new o.vpe,this.hasMasterPassword=!0,this.disableRequestOTP=!1,this.sentCode=!1,this.secret=new s.NI("",[s.kI.required,()=>{if(this.invalidSecret)return{invalidSecret:{message:this.hasMasterPassword?this.i18nService.t("incorrectPassword"):this.i18nService.t("incorrectCode")}}}]),this.destroy$=new r.x,this.requestOTP=()=>h(this,void 0,void 0,(function*(){if(!this.hasMasterPassword){this.disableRequestOTP=!0;try{yield this.userVerificationService.requestOTP(),this.sentCode=!0}finally{this.disableRequestOTP=!1}}}))}ngOnInit(){return h(this,void 0,void 0,(function*(){this.hasMasterPassword=yield this.userVerificationService.hasMasterPasswordAndMasterKeyHash(),this.processChanges(this.secret.value),this.secret.valueChanges.pipe((0,a.R)(this.destroy$)).subscribe((e=>this.processChanges(e)))}))}writeValue(e){this.secret.setValue(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disableRequestOTP=e,e?this.secret.disable():this.secret.enable()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}processChanges(e){this.invalidSecret=!1,null!=this.onChange&&this.onChange({type:this.hasMasterPassword?l.R.MasterPassword:l.R.OTP,secret:c.c.isNullOrWhitespace(e)?null:e})}}g.ɵfac=function(e){return new(e||g)(o.Y36(u.$),o.Y36(d.i),o.Y36(p.D))},g.ɵdir=o.lG2({type:g,selectors:[["app-user-verification"]],inputs:{invalidSecret:"invalidSecret"},outputs:{invalidSecretChange:"invalidSecretChange"}});var f=i(28508),m=i(62357),v=i(85356),y=i(98205),w=i(81974),b=i(24637),U=i(11512),_=i(54666),A=i(1e4),Z=i(36179),x=i(44358),S=i(21656),T=i(82933);function C(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n  "),o.TgZ(2,"bit-form-field",1),o._uU(3,"\n    "),o.TgZ(4,"bit-label"),o._uU(5),o.ALo(6,"i18n"),o.qZA(),o._uU(7,"\n    "),o._UZ(8,"input",2),o._uU(9,"\n    "),o._UZ(10,"button",3),o._uU(11,"\n    "),o.TgZ(12,"bit-hint"),o._uU(13),o.ALo(14,"i18n"),o.qZA(),o._uU(15,"\n  "),o.qZA(),o._uU(16,"\n"),o.BQk()),2&e){const e=o.oxw();o.xp6(5),o.Oqu(o.lcZ(6,3,"masterPass")),o.xp6(3),o.Q6J("formControl",e.secret),o.xp6(5),o.Oqu(o.lcZ(14,5,"confirmIdentity"))}}function O(e,t){1&e&&(o.TgZ(0,"span",9),o._uU(1,"\n      "),o._UZ(2,"i",10),o._uU(3),o.ALo(4,"i18n"),o.qZA()),2&e&&(o.Q6J("@sent",void 0),o.xp6(3),o.hij("\n      ",o.lcZ(4,2,"codeSent"),"\n    "))}function k(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n  "),o.TgZ(2,"div",4),o._uU(3,"\n    "),o.TgZ(4,"label",5),o._uU(5),o.ALo(6,"i18n"),o.qZA(),o._uU(7,"\n    "),o.TgZ(8,"button",6),o._uU(9),o.ALo(10,"i18n"),o.qZA(),o._uU(11,"\n    "),o.YNc(12,O,5,4,"span",7),o._uU(13,"\n  "),o.qZA(),o._uU(14,"\n\n  "),o.TgZ(15,"bit-form-field",1),o._uU(16,"\n    "),o.TgZ(17,"bit-label"),o._uU(18),o.ALo(19,"i18n"),o.qZA(),o._uU(20,"\n    "),o._UZ(21,"input",8),o._uU(22,"\n    "),o.TgZ(23,"bit-hint"),o._uU(24),o.ALo(25,"i18n"),o.qZA(),o._uU(26,"\n  "),o.qZA(),o._uU(27,"\n"),o.BQk()),2&e){const e=o.oxw();o.xp6(5),o.Oqu(o.lcZ(6,7,"sendVerificationCode")),o.xp6(3),o.Q6J("bitAction",e.requestOTP),o.xp6(1),o.hij("\n      ",o.lcZ(10,9,"sendCode"),"\n    "),o.xp6(3),o.Q6J("ngIf",e.sentCode),o.xp6(6),o.Oqu(o.lcZ(19,11,"verificationCode")),o.xp6(3),o.Q6J("formControl",e.secret),o.xp6(3),o.Oqu(o.lcZ(25,13,"confirmIdentity"))}}class P extends g{}P.ɵfac=function(){let e;return function(t){return(e||(e=o.n5z(P)))(t||P)}}(),P.ɵcmp=o.Xpm({type:P,selectors:[["app-user-verification"]],features:[o._Bn([{provide:s.JU,multi:!0,useExisting:P}]),o.qOj],decls:4,vars:2,consts:[[4,"ngIf"],["disableMargin",""],["bitInput","","id","masterPassword","type","password","name","MasterPasswordHash","appAutofocus","","appInputVerbatim","",3,"formControl"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],[1,"tw-mb-6"],[1,"tw-block"],["type","button","bitButton","","buttonType","secondary","appAutofocus","",3,"bitAction"],["class","tw-ml-2 tw-text-success","role","alert",4,"ngIf"],["bitInput","","type","text","id","verificationCode","name","verificationCode","appInputVerbatim","",3,"formControl"],["role","alert",1,"tw-ml-2","tw-text-success"],["aria-hidden","true",1,"bwi","bwi-check-circle"]],template:function(e,t){1&e&&(o.YNc(0,C,17,7,"ng-container",0),o._uU(1,"\n"),o.YNc(2,k,28,15,"ng-container",0),o._uU(3,"\n")),2&e&&(o.Q6J("ngIf",t.hasMasterPassword),o.xp6(2),o.Q6J("ngIf",!t.hasMasterPassword))},dependencies:[f.O5,s.Fj,s.JJ,s.oH,m.U,v.b,y.Q,w.r,b.d,U.G,_.w,A.e,Z.u,x.M,S.Q,T.C],encapsulation:2,data:{animation:[(0,n.X$)("sent",[(0,n.eR)(":enter",[(0,n.oB)({opacity:0}),(0,n.jt)("100ms",(0,n.oB)({opacity:1}))])])]}})},48641:(e,t,i)=>{"use strict";i.d(t,{ql:()=>Ue,pV:()=>T.p,eV:()=>Ze,Fi:()=>C.F,DT:()=>_e.D});var n=i(95379),s=i(71146),o=i(85762),r=i(99042),a=i(58691),l=i(69485);class c{}var u=i(58172),d=i(55602),p=i(99721),h=i(66459),g=i(65254),f=i(28508),m=i(37513),v=i(33245),y=i(24610),w=i(82933),b=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const U=["ppButtonForm"];function _(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",36),o._uU(1,"\n      "),o.TgZ(2,"div",37),o._uU(3,"\n        "),o.TgZ(4,"input",38),o.NdJ("ngModelChange",(function(t){o.CHM(e);const i=o.oxw();return o.KtG(i.method=t)})),o.qZA(),o._uU(5,"\n        "),o.TgZ(6,"label",39),o._uU(7,"\n          "),o._UZ(8,"i",40),o._uU(9," PayPal"),o.qZA(),o._uU(10,"\n      "),o.qZA(),o._uU(11,"\n      "),o.TgZ(12,"div",37),o._uU(13,"\n        "),o.TgZ(14,"input",41),o.NdJ("ngModelChange",(function(t){o.CHM(e);const i=o.oxw();return o.KtG(i.method=t)})),o.qZA(),o._uU(15,"\n        "),o.TgZ(16,"label",42),o._uU(17,"\n          "),o._UZ(18,"i",43),o._uU(19," Bitcoin"),o.qZA(),o._uU(20,"\n      "),o.qZA(),o._uU(21,"\n    "),o.qZA()}if(2&e){const e=o.oxw();o.xp6(4),o.Q6J("value",e.paymentMethodType.PayPal)("ngModel",e.method),o.xp6(10),o.Q6J("value",e.paymentMethodType.BitPay)("ngModel",e.method)}}class A{constructor(e,t,i,n,s,r){this.stateService=e,this.apiService=t,this.platformUtilsService=i,this.organizationService=n,this.logService=s,this.configService=r,this.showOptions=!0,this.method=l.Lt.PayPal,this.onAdded=new o.vpe,this.onCanceled=new o.vpe,this.paymentMethodType=l.Lt,this.ppLoading=!1;const a="AD3LAUZSNVPJY",c="https://www.sandbox.paypal.com/cgi-bin/webscr";this.ppButtonFormAction=c,this.ppButtonBusinessId=a}ngOnInit(){return b(this,void 0,void 0,(function*(){if(null!=this.organizationId){null==this.creditAmount&&(this.creditAmount="20.00"),this.ppButtonCustomField="organization_id:"+this.organizationId;const e=yield this.organizationService.get(this.organizationId);null!=e&&(this.subject=e.name,this.name=e.name)}else null==this.creditAmount&&(this.creditAmount="10.00"),this.userId=yield this.stateService.getUserId(),this.subject=yield this.stateService.getEmail(),this.email=this.subject,this.ppButtonCustomField="user_id:"+this.userId;this.region=yield(0,r.z)(this.configService.cloudRegion$),this.ppButtonCustomField+=",account_credit:1",this.ppButtonCustomField+=`,region:${this.region}`,this.returnUrl=window.location.href}))}submit(){return b(this,void 0,void 0,(function*(){if(null!=this.creditAmount&&""!==this.creditAmount){if(this.method===l.Lt.PayPal)return this.ppButtonFormRef.nativeElement.submit(),void(this.ppLoading=!0);if(this.method!==l.Lt.BitPay)try{this.onAdded.emit()}catch(e){this.logService.error(e)}else try{const e=new c;e.email=this.email,e.name=this.name,e.credit=!0,e.amount=this.creditAmountNumber,e.organizationId=this.organizationId,e.userId=this.userId,e.returnUrl=this.returnUrl,this.formPromise=this.apiService.postBitPayInvoice(e);const t=yield this.formPromise;this.platformUtilsService.launchUri(t)}catch(e){this.logService.error(e)}}}))}cancel(){this.onCanceled.emit()}formatAmount(){try{if(null!=this.creditAmount&&""!==this.creditAmount){const e=Math.abs(parseFloat(this.creditAmount));if(e>0)return void(this.creditAmount=parseFloat((Math.round(100*e)/100).toString()).toFixed(2).toString())}}catch(e){this.logService.error(e)}this.creditAmount=""}get creditAmountNumber(){if(null!=this.creditAmount&&""!==this.creditAmount)try{return parseFloat(this.creditAmount)}catch(e){this.logService.error(e)}return null}}A.ɵfac=function(e){return new(e||A)(o.Y36(u.b),o.Y36(d.s),o.Y36(p.P),o.Y36(a.Mn),o.Y36(h.$),o.Y36(g.E))},A.ɵcmp=o.Xpm({type:A,selectors:[["app-add-credit"]],viewQuery:function(e,t){if(1&e&&o.Gf(U,7,o.SBq),2&e){let e;o.iGM(e=o.CRH())&&(t.ppButtonFormRef=e.first)}},inputs:{creditAmount:"creditAmount",showOptions:"showOptions",method:"method",organizationId:"organizationId"},outputs:{onAdded:"onAdded",onCanceled:"onCanceled"},decls:94,vars:32,consts:[["ngNativeValidate","",1,"card",3,"appApiAction","ngSubmit"],["form",""],[1,"card-body"],["type","button",1,"close",3,"appA11yTitle","click"],["aria-hidden","true"],[1,"card-body-header"],["class","mb-4 text-lg",4,"ngIf"],[1,"form-group"],[1,"row"],[1,"col-4"],["for","creditAmount"],[1,"input-group"],[1,"input-group-prepend"],[1,"input-group-text"],["id","creditAmount","type","text","name","CreditAmount","required","",1,"form-control",3,"ngModel","ngModelChange","blur"],[1,"form-text","text-muted"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["method","post","target","_top",3,"action"],["ppButtonForm",""],["type","hidden","name","cmd","value","_xclick"],["type","hidden","name","business",3,"value"],["type","hidden","name","button_subtype","value","services"],["type","hidden","name","no_note","value","1"],["type","hidden","name","no_shipping","value","1"],["type","hidden","name","rm","value","1"],["type","hidden","name","return",3,"value"],["type","hidden","name","cancel_return",3,"value"],["type","hidden","name","currency_code","value","USD"],["type","hidden","name","image_url","value","https://bitwarden.com/images/paypal-banner.png"],["type","hidden","name","bn","value","PP-BuyNowBF:btn_buynow_LG.gif:NonHosted"],["type","hidden","name","amount",3,"value"],["type","hidden","name","custom",3,"value"],["type","hidden","name","item_name","value","Bitwarden Account Credit"],["type","hidden","name","item_number",3,"value"],[1,"mb-4","text-lg"],[1,"form-check","form-check-inline"],["type","radio","name","Method","id","credit-method-paypal",1,"form-check-input",3,"value","ngModel","ngModelChange"],["for","credit-method-paypal",1,"form-check-label"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-paypal"],["type","radio","name","Method","id","credit-method-bitcoin",1,"form-check-input",3,"value","ngModel","ngModelChange"],["for","credit-method-bitcoin",1,"form-check-label"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-bitcoin"]],template:function(e,t){if(1&e&&(o.TgZ(0,"form",0,1),o.NdJ("ngSubmit",(function(){return t.submit()})),o._uU(2,"\n  "),o.TgZ(3,"div",2),o._uU(4,"\n    "),o.TgZ(5,"button",3),o.NdJ("click",(function(){return t.cancel()})),o.ALo(6,"i18n"),o._uU(7,"\n      "),o.TgZ(8,"span",4),o._uU(9,"×"),o.qZA(),o._uU(10,"\n    "),o.qZA(),o._uU(11,"\n    "),o.TgZ(12,"h3",5),o._uU(13),o.ALo(14,"i18n"),o.qZA(),o._uU(15,"\n    "),o.YNc(16,_,22,4,"div",6),o._uU(17,"\n    "),o.TgZ(18,"div",7),o._uU(19,"\n      "),o.TgZ(20,"div",8),o._uU(21,"\n        "),o.TgZ(22,"div",9),o._uU(23,"\n          "),o.TgZ(24,"label",10),o._uU(25),o.ALo(26,"i18n"),o.qZA(),o._uU(27,"\n          "),o.TgZ(28,"div",11),o._uU(29,"\n            "),o.TgZ(30,"div",12)(31,"span",13),o._uU(32,"$USD"),o.qZA()(),o._uU(33,"\n            "),o.TgZ(34,"input",14),o.NdJ("ngModelChange",(function(e){return t.creditAmount=e}))("blur",(function(){return t.formatAmount()})),o.qZA(),o._uU(35,"\n          "),o.qZA(),o._uU(36,"\n        "),o.qZA(),o._uU(37,"\n      "),o.qZA(),o._uU(38,"\n      "),o.TgZ(39,"small",15),o._uU(40),o.ALo(41,"i18n"),o.qZA(),o._uU(42,"\n    "),o.qZA(),o._uU(43,"\n    "),o.TgZ(44,"button",16),o._uU(45,"\n      "),o._UZ(46,"i",17),o.ALo(47,"i18n"),o._uU(48,"\n      "),o.TgZ(49,"span"),o._uU(50),o.ALo(51,"i18n"),o.qZA(),o._uU(52,"\n    "),o.qZA(),o._uU(53,"\n    "),o.TgZ(54,"button",18),o.NdJ("click",(function(){return t.cancel()})),o._uU(55),o.ALo(56,"i18n"),o.qZA(),o._uU(57,"\n  "),o.qZA(),o._uU(58,"\n"),o.qZA(),o._uU(59,"\n"),o.TgZ(60,"form",19,20),o._uU(62,"\n  "),o._UZ(63,"input",21),o._uU(64,"\n  "),o._UZ(65,"input",22),o._uU(66,"\n  "),o._UZ(67,"input",23),o._uU(68,"\n  "),o._UZ(69,"input",24),o._uU(70,"\n  "),o._UZ(71,"input",25),o._uU(72,"\n  "),o._UZ(73,"input",26),o._uU(74,"\n  "),o._UZ(75,"input",27),o._uU(76,"\n  "),o._UZ(77,"input",28),o._uU(78,"\n  "),o._UZ(79,"input",29),o._uU(80,"\n  "),o._UZ(81,"input",30),o._uU(82,"\n  "),o._UZ(83,"input",31),o._uU(84,"\n  "),o._UZ(85,"input",32),o._uU(86,"\n  "),o._UZ(87,"input",33),o._uU(88,"\n  "),o._UZ(89,"input",34),o._uU(90,"\n  "),o._UZ(91,"input",35),o._uU(92,"\n"),o.qZA(),o._uU(93,"\n")),2&e){const e=o.MAs(1);o.Q6J("appApiAction",t.formPromise),o.xp6(5),o.s9C("appA11yTitle",o.lcZ(6,18,"cancel")),o.xp6(8),o.Oqu(o.lcZ(14,20,"addCredit")),o.xp6(3),o.Q6J("ngIf",t.showOptions),o.xp6(9),o.Oqu(o.lcZ(26,22,"amount")),o.xp6(9),o.Q6J("ngModel",t.creditAmount),o.xp6(6),o.Oqu(o.lcZ(41,24,"creditDelayed")),o.xp6(4),o.Q6J("disabled",e.loading||t.ppLoading),o.xp6(2),o.s9C("title",o.lcZ(47,26,"loading")),o.xp6(4),o.Oqu(o.lcZ(51,28,"submit")),o.xp6(5),o.hij("\n      ",o.lcZ(56,30,"cancel"),"\n    "),o.xp6(5),o.s9C("action",t.ppButtonFormAction,o.LSH),o.xp6(5),o.s9C("value",t.ppButtonBusinessId),o.xp6(10),o.s9C("value",t.returnUrl),o.xp6(2),o.s9C("value",t.returnUrl),o.xp6(8),o.s9C("value",t.creditAmount),o.xp6(2),o.s9C("value",t.ppButtonCustomField),o.xp6(4),o.s9C("value",t.subject)}},dependencies:[f.O5,m._Y,m.Fj,m._,m.JJ,m.JL,m.Q7,m.On,m.F,v.B,y.b,w.C],encapsulation:2});var Z,x=i(28783),S=i(95608),T=i(42759),C=i(34279),O=i(78627),k=i(97360),P=i(28004),q=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e.Adjusted="adjusted",e.Cancelled="cancelled"}(Z||(Z={}));class I{constructor(e,t,i,n,s,o,r,a){this.dialogRef=e,this.data=t,this.apiService=i,this.i18nService=n,this.platformUtilsService=s,this.logService=o,this.organizationApiService=r,this.paymentMethodWarningService=a,this.paymentMethodType=l.Lt,this.DialogResult=Z,this.formGroup=new m.cw({}),this.submit=()=>q(this,void 0,void 0,(function*(){const e=new S.t,t=this.paymentComponent.createPaymentToken().then((t=>(e.paymentToken=t[0],e.paymentMethodType=t[1],e.postalCode=this.taxInfoComponent.taxInfo.postalCode,e.country=this.taxInfoComponent.taxInfo.country,null==this.organizationId?this.apiService.postAccountPayment(e):(e.taxId=this.taxInfoComponent.taxInfo.taxId,e.state=this.taxInfoComponent.taxInfo.state,e.line1=this.taxInfoComponent.taxInfo.line1,e.line2=this.taxInfoComponent.taxInfo.line2,e.city=this.taxInfoComponent.taxInfo.city,e.state=this.taxInfoComponent.taxInfo.state,this.organizationApiService.updatePayment(this.organizationId,e)))));yield t,this.organizationId&&(yield this.paymentMethodWarningService.removeSubscriptionRisk(this.organizationId)),this.platformUtilsService.showToast("success",null,this.i18nService.t("updatedPaymentMethod")),this.dialogRef.close(Z.Adjusted)})),this.organizationId=t.organizationId,this.currentType=t.currentType}changeCountry(){"US"===this.taxInfoComponent.taxInfo.country?this.paymentComponent.hideBank=!this.organizationId:(this.paymentComponent.hideBank=!0,this.paymentComponent.method===l.Lt.BankAccount&&(this.paymentComponent.method=l.Lt.Card,this.paymentComponent.changeMethod()))}}I.ɵfac=function(e){return new(e||I)(o.Y36(x.zj),o.Y36(x.Kt),o.Y36(d.s),o.Y36(O.D),o.Y36(p.P),o.Y36(h.$),o.Y36(k.M),o.Y36(P.I))},I.ɵcmp=o.Xpm({type:I,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&(o.Gf(T.p,7),o.Gf(C.F,7)),2&e){let e;o.iGM(e=o.CRH())&&(t.paymentComponent=e.first),o.iGM(e=o.CRH())&&(t.taxInfoComponent=e.first)}},decls:25,vars:14,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large",3,"title"],["bitDialogContent",""],[3,"hideBank","hideCredit"],[3,"onCountryChanged"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"bitDialogClose"]],template:function(e,t){1&e&&(o.TgZ(0,"form",0),o._uU(1,"\n  "),o.TgZ(2,"bit-dialog",1),o.ALo(3,"i18n"),o._uU(4,"\n    "),o.ynx(5,2),o._uU(6,"\n      "),o._UZ(7,"app-payment",3),o._uU(8,"\n      "),o.TgZ(9,"app-tax-info",4),o.NdJ("onCountryChanged",(function(){return t.changeCountry()})),o.qZA(),o._uU(10,"\n    "),o.BQk(),o._uU(11,"\n    "),o.ynx(12,5),o._uU(13,"\n      "),o.TgZ(14,"button",6),o._uU(15),o.ALo(16,"i18n"),o.qZA(),o._uU(17,"\n      "),o.TgZ(18,"button",7),o._uU(19),o.ALo(20,"i18n"),o.qZA(),o._uU(21,"\n    "),o.BQk(),o._uU(22,"\n  "),o.qZA(),o._uU(23,"\n"),o.qZA(),o._uU(24,"\n")),2&e&&(o.Q6J("formGroup",t.formGroup)("bitSubmit",t.submit),o.xp6(2),o.Q6J("title",o.lcZ(3,8,null!=t.currentType?"changePaymentMethod":"addPaymentMethod")),o.xp6(5),o.Q6J("hideBank",!t.organizationId)("hideCredit",!0),o.xp6(8),o.hij("\n        ",o.lcZ(16,10,"submit"),"\n      "),o.xp6(3),o.Q6J("bitDialogClose",t.DialogResult.Cancelled),o.xp6(1),o.hij("\n        ",o.lcZ(20,12,"cancel"),"\n      "))},encapsulation:2});class M{}var N,L=i(8111),D=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function E(e,t){if(1&e&&(o.TgZ(0,"bit-hint"),o._uU(1,"\n            "),o.TgZ(2,"strong"),o._uU(3),o.ALo(4,"i18n"),o.qZA(),o._uU(5),o.ALo(6,"currency"),o.ALo(7,"currency"),o.ALo(8,"i18n"),o.qZA()),2&e){const e=o.oxw();o.xp6(3),o.hij("",o.lcZ(4,5,"total"),":"),o.xp6(2),o.HOy("\n            ",e.formGroup.get("storageAdjustment").value||0," GB ×\n            ",o.xi3(6,7,e.storageGbPrice,"$")," = ",o.xi3(7,10,e.adjustedStorageTotal,"$")," /",o.lcZ(8,13,e.interval),"\n          ")}}!function(e){e.Adjusted="adjusted",e.Cancelled="cancelled"}(N||(N={}));class F{constructor(e,t,i,n,s,o,r,a,l){this.dialogRef=e,this.data=t,this.apiService=i,this.i18nService=n,this.platformUtilsService=s,this.router=o,this.activatedRoute=r,this.logService=a,this.organizationApiService=l,this.DialogResult=N,this.formGroup=new m.cw({storageAdjustment:new m.NI(0,[m.kI.required,m.kI.min(0),m.kI.max(99)])}),this.submit=()=>D(this,void 0,void 0,(function*(){const e=new M;e.storageGbAdjustment=this.formGroup.value.storageAdjustment,this.add||(e.storageGbAdjustment*=-1);let t=!1;yield(()=>D(this,void 0,void 0,(function*(){let i;i=null==this.organizationId?this.apiService.postAccountStorage(e):this.organizationApiService.updateStorage(this.organizationId,e);const n=yield i;if(null!=n&&null!=n.paymentIntentClientSecret)try{yield this.paymentComponent.handleStripeCardPayment(n.paymentIntentClientSecret,null)}catch(s){t=!0}})))(),this.dialogRef.close(N.Adjusted),t?(this.platformUtilsService.showToast("warning",null,this.i18nService.t("couldNotChargeCardPayInvoice"),{timeout:1e4}),this.router.navigate(["../billing"],{relativeTo:this.activatedRoute})):this.platformUtilsService.showToast("success",null,this.i18nService.t("adjustedStorage",e.storageGbAdjustment.toString()))})),this.storageGbPrice=t.storageGbPrice,this.add=t.add,this.organizationId=t.organizationId,this.interval=t.interval||"year"}get adjustedStorageTotal(){return this.storageGbPrice*this.formGroup.value.storageAdjustment}}F.ɵfac=function(e){return new(e||F)(o.Y36(x.zj),o.Y36(x.Kt),o.Y36(d.s),o.Y36(O.D),o.Y36(p.P),o.Y36(L.F0),o.Y36(L.gz),o.Y36(h.$),o.Y36(k.M))},F.ɵcmp=o.Xpm({type:F,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&o.Gf(T.p,7),2&e){let e;o.iGM(e=o.CRH())&&(t.paymentComponent=e.first)}},decls:41,vars:20,consts:[[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title"],["bitDialogContent",""],["bitTypography","body1"],[1,"tw-grid","tw-grid-cols-12"],[1,"tw-col-span-7"],["bitInput","","type","number","formControlName","storageAdjustment"],[4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"bitDialogClose"],[3,"showMethods"]],template:function(e,t){1&e&&(o.TgZ(0,"form",0),o._uU(1,"\n  "),o.TgZ(2,"bit-dialog",1),o.ALo(3,"i18n"),o._uU(4,"\n    "),o.ynx(5,2),o._uU(6,"\n      "),o.TgZ(7,"p",3),o._uU(8),o.ALo(9,"i18n"),o.qZA(),o._uU(10,"\n      "),o.TgZ(11,"div",4),o._uU(12,"\n        "),o.TgZ(13,"bit-form-field",5),o._uU(14,"\n          "),o.TgZ(15,"bit-label"),o._uU(16),o.ALo(17,"i18n"),o.qZA(),o._uU(18,"\n          "),o._UZ(19,"input",6),o._uU(20,"\n          "),o.YNc(21,E,9,15,"bit-hint",7),o._uU(22,"\n        "),o.qZA(),o._uU(23,"\n      "),o.qZA(),o._uU(24,"\n    "),o.BQk(),o._uU(25,"\n    "),o.ynx(26,8),o._uU(27,"\n      "),o.TgZ(28,"button",9),o._uU(29),o.ALo(30,"i18n"),o.qZA(),o._uU(31,"\n      "),o.TgZ(32,"button",10),o._uU(33),o.ALo(34,"i18n"),o.qZA(),o._uU(35,"\n    "),o.BQk(),o._uU(36,"\n  "),o.qZA(),o._uU(37,"\n"),o.qZA(),o._uU(38,"\n"),o._UZ(39,"app-payment",11),o._uU(40,"\n")),2&e&&(o.Q6J("formGroup",t.formGroup)("bitSubmit",t.submit),o.xp6(2),o.Q6J("title",o.lcZ(3,10,t.add?"addStorage":"removeStorage")),o.xp6(6),o.Oqu(o.lcZ(9,12,t.add?"storageAddNote":"storageRemoveNote")),o.xp6(8),o.Oqu(o.lcZ(17,14,t.add?"gbStorageAdd":"gbStorageRemove")),o.xp6(5),o.Q6J("ngIf",t.add),o.xp6(8),o.hij("\n        ",o.lcZ(30,16,"submit"),"\n      "),o.xp6(3),o.Q6J("bitDialogClose",t.DialogResult.Cancelled),o.xp6(1),o.hij("\n        ",o.lcZ(34,18,"cancel"),"\n      "),o.xp6(6),o.Q6J("showMethods",!1))},encapsulation:2});var R=i(70032);class J{}var z=i(73369),Y=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const K=function(e){return{"bwi-spin":e}};function B(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",3),o.NdJ("click",(function(){o.CHM(e);const t=o.oxw(2);return o.KtG(t.load())})),o._uU(1,"\n    "),o._UZ(2,"i",4),o._uU(3),o.ALo(4,"i18n"),o.qZA()}if(2&e){const e=o.oxw(2);o.Q6J("disabled",e.loading),o.xp6(2),o.Q6J("ngClass",o.VKq(5,K,e.loading)),o.xp6(1),o.hij("\n    ",o.lcZ(4,3,"refresh"),"\n  ")}}function Q(e,t){if(1&e&&(o.TgZ(0,"app-header"),o._uU(1,"\n  "),o.YNc(2,B,5,7,"button",2),o._uU(3,"\n"),o.qZA()),2&e){const e=o.oxw();o.xp6(2),o.Q6J("ngIf",e.firstLoaded)}}function G(e,t){1&e&&(o.TgZ(0,"div",5),o._uU(1,"\n    "),o._uU(2,"\n    "),o.TgZ(3,"h1"),o._uU(4),o.ALo(5,"i18n"),o.qZA(),o._uU(6,"\n  "),o.qZA()),2&e&&(o.xp6(4),o.Oqu(o.lcZ(5,1,"paymentMethod")))}function j(e,t){1&e&&(o.ynx(0),o._uU(1,"\n    "),o._UZ(2,"i",6),o.ALo(3,"i18n"),o._uU(4,"\n    "),o.TgZ(5,"span",7),o._uU(6),o.ALo(7,"i18n"),o.qZA(),o._uU(8,"\n  "),o.BQk()),2&e&&(o.xp6(2),o.s9C("title",o.lcZ(3,2,"loading")),o.xp6(4),o.Oqu(o.lcZ(7,4,"loading")))}function V(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",13),o.NdJ("click",(function(){o.CHM(e);const t=o.oxw(2);return o.KtG(t.addCredit())})),o._uU(1),o.ALo(2,"i18n"),o.qZA()}2&e&&(o.xp6(1),o.hij("\n      ",o.lcZ(2,1,"addCredit"),"\n    "))}function $(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"app-add-credit",14),o.NdJ("onAdded",(function(){o.CHM(e);const t=o.oxw(2);return o.KtG(t.closeAddCredit(!0))}))("onCanceled",(function(){o.CHM(e);const t=o.oxw(2);return o.KtG(t.closeAddCredit(!1))})),o._uU(1,"\n    "),o.qZA()}if(2&e){const e=o.oxw(2);o.Q6J("organizationId",e.organizationId)}}function H(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1),o.ALo(2,"i18n"),o.qZA()),2&e&&(o.xp6(1),o.Oqu(o.lcZ(2,1,"noPaymentMethod")))}function W(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"app-callout",17),o.ALo(1,"i18n"),o._uU(2,"\n        "),o.TgZ(3,"p"),o._uU(4),o.ALo(5,"i18n"),o.ALo(6,"i18n"),o.qZA(),o._uU(7,"\n        "),o.TgZ(8,"form",18,19),o.NdJ("ngSubmit",(function(){o.CHM(e);const t=o.oxw(3);return o.KtG(t.verifyBank())})),o._uU(10,"\n          "),o.TgZ(11,"bit-form-field",20),o._uU(12,"\n            "),o.TgZ(13,"bit-label"),o._uU(14),o.ALo(15,"i18n"),o.qZA(),o._uU(16,"\n            "),o._UZ(17,"input",21),o._uU(18,"\n            "),o.TgZ(19,"span",22),o._uU(20,"$0."),o.qZA(),o._uU(21,"\n          "),o.qZA(),o._uU(22,"\n          "),o.TgZ(23,"bit-form-field",20),o._uU(24,"\n            "),o.TgZ(25,"bit-label"),o._uU(26),o.ALo(27,"i18n"),o.qZA(),o._uU(28,"\n            "),o._UZ(29,"input",23),o._uU(30,"\n            "),o.TgZ(31,"span",22),o._uU(32,"$0."),o.qZA(),o._uU(33,"\n          "),o.qZA(),o._uU(34,"\n          "),o.TgZ(35,"button",24),o._uU(36,"\n            "),o._UZ(37,"i",25),o.ALo(38,"i18n"),o._uU(39,"\n            "),o.TgZ(40,"span"),o._uU(41),o.ALo(42,"i18n"),o.qZA(),o._uU(43,"\n          "),o.qZA(),o._uU(44,"\n        "),o.qZA(),o._uU(45,"\n      "),o.qZA()}if(2&e){const e=o.MAs(9),t=o.oxw(3);o.s9C("title",o.lcZ(1,10,"verifyBankAccount")),o.xp6(4),o.AsE("",o.lcZ(5,12,"verifyBankAccountDesc")," ",o.lcZ(6,14,"verifyBankAccountFailureWarning"),""),o.xp6(4),o.Q6J("formGroup",t.verifyBankForm)("appApiAction",t.verifyBankPromise),o.xp6(6),o.Oqu(o.xi3(15,16,"amountX","1")),o.xp6(12),o.Oqu(o.xi3(27,19,"amountX","2")),o.xp6(9),o.Q6J("disabled",e.loading),o.xp6(2),o.s9C("title",o.lcZ(38,22,"loading")),o.xp6(4),o.Oqu(o.lcZ(42,24,"verifyBankAccount"))}}function X(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n      "),o.YNc(2,W,46,26,"app-callout",15),o._uU(3,"\n      "),o.TgZ(4,"p"),o._uU(5,"\n        "),o._UZ(6,"i",16),o._uU(7),o.qZA(),o._uU(8,"\n    "),o.BQk()),2&e){const e=o.oxw(2);o.xp6(2),o.Q6J("ngIf",e.forOrganization&&e.paymentSource.type===e.paymentMethodType.BankAccount&&e.paymentSource.needsVerification),o.xp6(4),o.Q6J("ngClass",e.paymentSourceClasses),o.xp6(1),o.hij("\n        ",e.paymentSource.description,"\n      ")}}function ee(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1),o.ALo(2,"i18n"),o.qZA()),2&e&&(o.xp6(1),o.Oqu(o.lcZ(2,1,"paymentChargedWithUnpaidSubscription")))}function te(e,t){1&e&&(o.TgZ(0,"div"),o._uU(1,"\n        "),o._UZ(2,"i",6),o.ALo(3,"i18n"),o._uU(4,"\n        "),o.TgZ(5,"span",7),o._uU(6),o.ALo(7,"i18n"),o.qZA(),o._uU(8,"\n      "),o.qZA()),2&e&&(o.xp6(2),o.s9C("title",o.lcZ(3,2,"loading")),o.xp6(4),o.Oqu(o.lcZ(7,4,"loading")))}function ie(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",27,28),o.NdJ("ngSubmit",(function(){o.CHM(e);const t=o.oxw(3);return o.KtG(t.submitTaxInfo())})),o._uU(2,"\n        "),o._UZ(3,"app-tax-info"),o._uU(4,"\n        "),o.TgZ(5,"button",29),o._uU(6,"\n          "),o._UZ(7,"i",25),o.ALo(8,"i18n"),o._uU(9,"\n          "),o.TgZ(10,"span"),o._uU(11),o.ALo(12,"i18n"),o.qZA(),o._uU(13,"\n        "),o.qZA(),o._uU(14,"\n      "),o.qZA()}if(2&e){const e=o.MAs(1),t=o.oxw(3);o.Q6J("appApiAction",t.taxFormPromise),o.xp6(5),o.Q6J("disabled",e.loading),o.xp6(2),o.s9C("title",o.lcZ(8,4,"loading")),o.xp6(4),o.Oqu(o.lcZ(12,6,"save"))}}function ne(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n      "),o.TgZ(2,"h2",11),o._uU(3),o.ALo(4,"i18n"),o.qZA(),o._uU(5,"\n      "),o.TgZ(6,"p"),o._uU(7),o.ALo(8,"i18n"),o.qZA(),o._uU(9,"\n      "),o.YNc(10,te,9,6,"div",0),o._uU(11,"\n      "),o.YNc(12,ie,15,8,"form",26),o._uU(13,"\n    "),o.BQk()),2&e){const e=o.oxw(2);o.xp6(3),o.Oqu(o.lcZ(4,4,"taxInformation")),o.xp6(4),o.Oqu(o.lcZ(8,6,"taxInformationDesc")),o.xp6(3),o.Q6J("ngIf",!e.org||e.loading),o.xp6(2),o.Q6J("ngIf",e.org&&!e.loading)}}function se(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n    "),o.TgZ(2,"h2"),o._uU(3),o.ALo(4,"i18n"),o.qZA(),o._uU(5,"\n    "),o.TgZ(6,"p",8),o._uU(7,"\n      "),o.TgZ(8,"strong"),o._uU(9),o.ALo(10,"currency"),o.qZA(),o._uU(11,"\n    "),o.qZA(),o._uU(12,"\n    "),o.TgZ(13,"p"),o._uU(14),o.ALo(15,"i18n"),o.qZA(),o._uU(16,"\n    "),o.YNc(17,V,3,3,"button",9),o._uU(18,"\n    "),o.YNc(19,$,2,1,"app-add-credit",10),o._uU(20,"\n    "),o.TgZ(21,"h2",11),o._uU(22),o.ALo(23,"i18n"),o.qZA(),o._uU(24,"\n    "),o.YNc(25,H,3,3,"p",0),o._uU(26,"\n    "),o.YNc(27,X,9,3,"ng-container",0),o._uU(28,"\n    "),o.TgZ(29,"button",12),o._uU(30),o.ALo(31,"i18n"),o.qZA(),o._uU(32,"\n    "),o.YNc(33,ee,3,3,"p",0),o._uU(34,"\n    "),o.YNc(35,ne,14,8,"ng-container",0),o._uU(36,"\n  "),o.BQk()),2&e){const e=o.oxw();o.xp6(3),o.Oqu(o.lcZ(4,12,e.isCreditBalance?"accountCredit":"accountBalance")),o.xp6(6),o.Oqu(o.xi3(10,14,e.creditOrBalance,"$")),o.xp6(5),o.Oqu(o.lcZ(15,17,"creditAppliedDesc")),o.xp6(3),o.Q6J("ngIf",!e.showAddCredit),o.xp6(2),o.Q6J("ngIf",e.showAddCredit),o.xp6(3),o.Oqu(o.lcZ(23,19,"paymentMethod")),o.xp6(3),o.Q6J("ngIf",!e.paymentSource),o.xp6(2),o.Q6J("ngIf",e.paymentSource),o.xp6(2),o.Q6J("bitAction",e.changePayment),o.xp6(1),o.hij("\n      ",o.lcZ(31,21,e.paymentSource?"changePaymentMethod":"addPaymentMethod"),"\n    "),o.xp6(3),o.Q6J("ngIf",e.isUnpaid),o.xp6(2),o.Q6J("ngIf",e.forOrganization)}}class oe{constructor(e,t,i,n,s,o,r,a,c){this.apiService=e,this.organizationApiService=t,this.i18nService=i,this.platformUtilsService=n,this.router=s,this.logService=o,this.route=r,this.formBuilder=a,this.dialogService=c,this.loading=!1,this.firstLoaded=!1,this.showAddCredit=!1,this.paymentMethodType=l.Lt,this.isUnpaid=!1,this.verifyBankForm=this.formBuilder.group({amount1:new m.NI(null,[m.kI.required,m.kI.max(99),m.kI.min(0)]),amount2:new m.NI(null,[m.kI.required,m.kI.max(99),m.kI.min(0)])}),this.changePayment=()=>Y(this,void 0,void 0,(function*(){const e=function(e,t){return e.open(I,t)}(this.dialogService,{data:{organizationId:this.organizationId,currentType:null!==this.paymentSource?this.paymentSource.type:null}});(yield(0,R.n)(e.closed))===Z.Adjusted&&(yield this.load())}))}ngOnInit(){return Y(this,void 0,void 0,(function*(){this.route.params.subscribe((e=>Y(this,void 0,void 0,(function*(){if(e.organizationId)this.organizationId=e.organizationId;else if(this.platformUtilsService.isSelfHost())return void this.router.navigate(["/settings/subscription"]);yield this.load(),this.firstLoaded=!0}))))}))}load(){var e,t;return Y(this,void 0,void 0,(function*(){if(!this.loading){if(this.loading=!0,this.forOrganization){const e=this.organizationApiService.getBilling(this.organizationId),t=this.organizationApiService.getSubscription(this.organizationId);[this.billing,this.org]=yield Promise.all([e,t])}else{const e=this.apiService.getUserBillingPayment(),t=this.apiService.getUserSubscription();[this.billing,this.sub]=yield Promise.all([e,t])}this.isUnpaid=null!==(t="unpaid"===(null===(e=this.subscription)||void 0===e?void 0:e.status))&&void 0!==t&&t,this.loading=!1}}))}addCredit(){this.showAddCredit=!0}closeAddCredit(e){this.showAddCredit=!1,e&&this.load()}verifyBank(){return Y(this,void 0,void 0,(function*(){if(!this.loading&&this.forOrganization)try{const e=new J;e.amount1=this.verifyBankForm.value.amount1,e.amount2=this.verifyBankForm.value.amount2,this.verifyBankPromise=this.organizationApiService.verifyBank(this.organizationId,e),yield this.verifyBankPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("verifiedBankAccount")),this.load()}catch(e){this.logService.error(e)}}))}submitTaxInfo(){return Y(this,void 0,void 0,(function*(){this.taxFormPromise=this.taxInfo.submitTaxInfo(),yield this.taxFormPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("taxInfoUpdated"))}))}get isCreditBalance(){return null==this.billing||this.billing.balance<=0}get creditOrBalance(){return Math.abs(null!=this.billing?this.billing.balance:0)}get paymentSource(){return null!=this.billing?this.billing.paymentSource:null}get forOrganization(){return null!=this.organizationId}get headerClass(){return this.forOrganization?["page-header"]:["tabbed-header"]}get paymentSourceClasses(){if(null==this.paymentSource)return[];switch(this.paymentSource.type){case l.Lt.Card:return["bwi-credit-card"];case l.Lt.BankAccount:return["bwi-bank"];case l.Lt.Check:return["bwi-money"];case l.Lt.PayPal:return["bwi-paypal text-primary"];default:return[]}}get subscription(){var e,t,i,n;return null!==(n=null!==(t=null===(e=this.sub)||void 0===e?void 0:e.subscription)&&void 0!==t?t:null===(i=this.org)||void 0===i?void 0:i.subscription)&&void 0!==n?n:null}}oe.ɵfac=function(e){return new(e||oe)(o.Y36(d.s),o.Y36(k.M),o.Y36(O.D),o.Y36(p.P),o.Y36(L.F0),o.Y36(h.$),o.Y36(L.gz),o.Y36(m.qu),o.Y36(z.x))},oe.ɵcmp=o.Xpm({type:oe,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&o.Gf(C.F,5),2&e){let e;o.iGM(e=o.CRH())&&(t.taxInfo=e.first)}},decls:11,vars:4,consts:[[4,"ngIf"],["class","tabbed-header",4,"ngIf"],["type","button","bitButton","","buttonType","secondary","class","tw-ml-auto",3,"disabled","click",4,"ngIf"],["type","button","bitButton","","buttonType","secondary",1,"tw-ml-auto",3,"disabled","click"],["aria-hidden","true",1,"bwi","bwi-refresh","bwi-fw",3,"ngClass"],[1,"tabbed-header"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],[1,"text-lg"],["type","button","bitButton","","buttonType","secondary",3,"click",4,"ngIf"],[3,"organizationId","onAdded","onCanceled",4,"ngIf"],[1,"spaced-header"],["type","button","bitButton","","buttonType","secondary",3,"bitAction"],["type","button","bitButton","","buttonType","secondary",3,"click"],[3,"organizationId","onAdded","onCanceled"],["type","warning",3,"title",4,"ngIf"],[1,"bwi","bwi-fw",3,"ngClass"],["type","warning",3,"title"],["ngNativeValidate","",1,"form-inline",3,"formGroup","appApiAction","ngSubmit"],["verifyForm",""],[1,"tw-mr-2","tw-w-40"],["bitInput","","type","number","step","1","placeholder","xx","formControlName","amount1"],["bitPrefix",""],["bitInput","","type","number","step","1","placeholder","xx","formControlName","amount2"],["type","button","bitButton","","buttonType","primary","type","submit",1,"btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["ngNativeValidate","",3,"appApiAction","ngSubmit",4,"ngIf"],["ngNativeValidate","",3,"appApiAction","ngSubmit"],["formTax",""],["bitButton","","buttonType","primary","type","submit",1,"btn-submit",3,"disabled"]],template:function(e,t){1&e&&(o.YNc(0,Q,4,1,"app-header",0),o._uU(1,"\n\n"),o.TgZ(2,"bit-container"),o._uU(3,"\n  "),o.YNc(4,G,7,3,"div",1),o._uU(5,"\n\n  "),o.YNc(6,j,9,6,"ng-container",0),o._uU(7,"\n  "),o.YNc(8,se,37,23,"ng-container",0),o._uU(9,"\n"),o.qZA(),o._uU(10,"\n")),2&e&&(o.Q6J("ngIf",t.organizationId),o.xp6(4),o.Q6J("ngIf",!t.organizationId),o.xp6(2),o.Q6J("ngIf",!t.firstLoaded&&t.loading),o.xp6(2),o.Q6J("ngIf",t.billing))},encapsulation:2});var re=i(46246),ae=i(36338),le=i(81974),ce=i(29465),ue=i(18362),de=i(24637),pe=i(11512),he=i(36179),ge=i(44358),fe=i(28315),me=i(53707),ve=i(98205),ye=i(81168),we=i(57139),be=i(58618);class Ue{}Ue.ɵfac=function(e){return new(e||Ue)},Ue.ɵmod=o.oAB({type:Ue}),Ue.ɵinj=o.cJS({imports:[s.m,T.p,C.F,n.O,s.m]}),o.B6R(I,[m._Y,m.JL,m.sg,re.b,ae.u,le.r,ce.a,ue.f,T.p,C.F],[w.C]),o.B6R(F,[f.O5,m._Y,m.Fj,m.wV,m.JJ,m.JL,m.sg,m.u,re.b,ae.u,le.r,ce.a,ue.f,de.d,pe.G,he.u,ge.M,fe.t,T.p],[f.H9,w.C]),o.B6R(oe,[f.mk,f.O5,m.Fj,m.wV,m.JJ,m.JL,m.F,m.sg,m.u,y.b,me.O,ve.Q,le.r,ye.e,de.d,pe.G,we.xO,he.u,C.F,be.k,A],[f.H9,w.C]);var _e=i(7644),Ae=i(49781);class Ze{}Ze.ɵfac=function(e){return new(e||Ze)},Ze.ɵmod=o.oAB({type:Ze}),Ze.ɵinj=o.cJS({imports:[Ae.s,s.m]})},42759:(e,t,i)=>{"use strict";i.d(t,{p:()=>T});var n=i(54019),s=i(68362),o=i(69485),r=i(71146),a=i(85762),l=i(55602),c=i(66459),u=i(81301),d=i(28508),p=i(37513),h=i(33245),g=i(53707),f=i(85356),m=i(82933),v=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function y(e,t){if(1&e){const e=a.EpF();a.TgZ(0,"div",3),a._uU(1,"\n    "),a.TgZ(2,"input",9),a.NdJ("ngModelChange",(function(t){a.CHM(e);const i=a.oxw(2);return a.KtG(i.method=t)}))("change",(function(){a.CHM(e);const t=a.oxw(2);return a.KtG(t.changeMethod())})),a.qZA(),a._uU(3,"\n    "),a.TgZ(4,"label",10),a._uU(5,"\n      "),a._UZ(6,"i",11),a._uU(7),a.ALo(8,"i18n"),a.qZA(),a._uU(9,"\n  "),a.qZA()}if(2&e){const e=a.oxw(2);a.xp6(2),a.Q6J("value",e.paymentMethodType.BankAccount)("ngModel",e.method),a.xp6(5),a.hij(" ",a.lcZ(8,3,"bankAccount"),"")}}function w(e,t){if(1&e){const e=a.EpF();a.TgZ(0,"div",12),a._uU(1,"\n    "),a.TgZ(2,"input",13),a.NdJ("ngModelChange",(function(t){a.CHM(e);const i=a.oxw(2);return a.KtG(i.method=t)}))("change",(function(){a.CHM(e);const t=a.oxw(2);return a.KtG(t.changeMethod())})),a.qZA(),a._uU(3,"\n    "),a.TgZ(4,"label",14),a._uU(5,"\n      "),a._UZ(6,"i",15),a._uU(7," PayPal"),a.qZA(),a._uU(8,"\n  "),a.qZA()}if(2&e){const e=a.oxw(2);a.xp6(2),a.Q6J("value",e.paymentMethodType.PayPal)("ngModel",e.method)}}function b(e,t){if(1&e){const e=a.EpF();a.TgZ(0,"div",12),a._uU(1,"\n    "),a.TgZ(2,"input",16),a.NdJ("ngModelChange",(function(t){a.CHM(e);const i=a.oxw(2);return a.KtG(i.method=t)}))("change",(function(){a.CHM(e);const t=a.oxw(2);return a.KtG(t.changeMethod())})),a.qZA(),a._uU(3,"\n    "),a.TgZ(4,"label",17),a._uU(5,"\n      "),a._UZ(6,"i",18),a._uU(7),a.ALo(8,"i18n"),a.qZA(),a._uU(9,"\n  "),a.qZA()}if(2&e){const e=a.oxw(2);a.xp6(2),a.Q6J("value",e.paymentMethodType.Credit)("ngModel",e.method),a.xp6(5),a.hij(" ",a.lcZ(8,3,"accountCredit"),"")}}function U(e,t){if(1&e){const e=a.EpF();a.TgZ(0,"div",2),a._uU(1,"\n  "),a.TgZ(2,"div",3),a._uU(3,"\n    "),a.TgZ(4,"input",4),a.NdJ("ngModelChange",(function(t){a.CHM(e);const i=a.oxw();return a.KtG(i.method=t)}))("change",(function(){a.CHM(e);const t=a.oxw();return a.KtG(t.changeMethod())})),a.qZA(),a._uU(5,"\n    "),a.TgZ(6,"label",5),a._uU(7,"\n      "),a._UZ(8,"i",6),a._uU(9),a.ALo(10,"i18n"),a.qZA(),a._uU(11,"\n  "),a.qZA(),a._uU(12,"\n  "),a.YNc(13,y,10,5,"div",7),a._uU(14,"\n  "),a.YNc(15,w,9,2,"div",8),a._uU(16,"\n  "),a.YNc(17,b,10,5,"div",8),a._uU(18,"\n"),a.qZA()}if(2&e){const e=a.oxw();a.xp6(4),a.Q6J("value",e.paymentMethodType.Card)("ngModel",e.method),a.xp6(5),a.hij(" ",a.lcZ(10,6,"creditCard"),""),a.xp6(4),a.Q6J("ngIf",!e.hideBank),a.xp6(2),a.Q6J("ngIf",!e.hidePaypal),a.xp6(2),a.Q6J("ngIf",!e.hideCredit)}}function _(e,t){1&e&&(a.TgZ(0,"div",32),a._uU(1,"\n      "),a._UZ(2,"img",33),a._uU(3,"\n    "),a.qZA())}function A(e,t){if(1&e&&(a.ynx(0),a._uU(1,"\n  "),a.TgZ(2,"div",19),a._uU(3,"\n    "),a.TgZ(4,"div",20),a._uU(5,"\n      "),a.TgZ(6,"label",21),a._uU(7),a.ALo(8,"i18n"),a.qZA(),a._uU(9,"\n      "),a._UZ(10,"div",22),a._uU(11,"\n    "),a.qZA(),a._uU(12,"\n    "),a.YNc(13,_,4,0,"div",23),a._uU(14,"\n    "),a.TgZ(15,"div",20),a._uU(16,"\n      "),a.TgZ(17,"label",24),a._uU(18),a.ALo(19,"i18n"),a.qZA(),a._uU(20,"\n      "),a._UZ(21,"div",25),a._uU(22,"\n    "),a.qZA(),a._uU(23,"\n    "),a.TgZ(24,"div",26),a._uU(25,"\n      "),a.TgZ(26,"div",27),a._uU(27,"\n        "),a.TgZ(28,"label",28),a._uU(29),a.ALo(30,"i18n"),a.qZA(),a._uU(31,"\n        "),a.TgZ(32,"a",29),a.ALo(33,"i18n"),a._uU(34,"\n          "),a._UZ(35,"i",30),a._uU(36,"\n        "),a.qZA(),a._uU(37,"\n      "),a.qZA(),a._uU(38,"\n      "),a._UZ(39,"div",31),a._uU(40,"\n    "),a.qZA(),a._uU(41,"\n  "),a.qZA(),a._uU(42,"\n"),a.BQk()),2&e){const e=a.oxw();a.xp6(4),a.Q6J("ngClass",e.trialFlow?"col-5":"col-4"),a.xp6(3),a.Oqu(a.lcZ(8,7,"number")),a.xp6(6),a.Q6J("ngIf",!e.trialFlow),a.xp6(2),a.Q6J("ngClass",e.trialFlow?"col-3":"col-4"),a.xp6(3),a.Oqu(a.lcZ(19,9,"expiration")),a.xp6(11),a.hij("\n          ",a.lcZ(30,11,"securityCode"),"\n        "),a.xp6(3),a.s9C("appA11yTitle",a.lcZ(33,13,"learnMore"))}}function Z(e,t){if(1&e){const e=a.EpF();a.ynx(0),a._uU(1,"\n  "),a.TgZ(2,"app-callout",34),a.ALo(3,"i18n"),a._uU(4),a.ALo(5,"i18n"),a.ALo(6,"i18n"),a.qZA(),a._uU(7,"\n  "),a.TgZ(8,"div",19),a._uU(9,"\n    "),a.TgZ(10,"div",35),a._uU(11,"\n      "),a.TgZ(12,"label",36),a._uU(13),a.ALo(14,"i18n"),a.qZA(),a._uU(15,"\n      "),a.TgZ(16,"input",37),a.NdJ("ngModelChange",(function(t){a.CHM(e);const i=a.oxw();return a.KtG(i.bank.routing_number=t)})),a.qZA(),a._uU(17,"\n    "),a.qZA(),a._uU(18,"\n    "),a.TgZ(19,"div",35),a._uU(20,"\n      "),a.TgZ(21,"label",38),a._uU(22),a.ALo(23,"i18n"),a.qZA(),a._uU(24,"\n      "),a.TgZ(25,"input",39),a.NdJ("ngModelChange",(function(t){a.CHM(e);const i=a.oxw();return a.KtG(i.bank.account_number=t)})),a.qZA(),a._uU(26,"\n    "),a.qZA(),a._uU(27,"\n    "),a.TgZ(28,"div",35),a._uU(29,"\n      "),a.TgZ(30,"label",40),a._uU(31),a.ALo(32,"i18n"),a.qZA(),a._uU(33,"\n      "),a.TgZ(34,"input",41),a.NdJ("ngModelChange",(function(t){a.CHM(e);const i=a.oxw();return a.KtG(i.bank.account_holder_name=t)})),a.qZA(),a._uU(35,"\n    "),a.qZA(),a._uU(36,"\n    "),a.TgZ(37,"div",35),a._uU(38,"\n      "),a.TgZ(39,"label",42),a._uU(40),a.ALo(41,"i18n"),a.qZA(),a._uU(42,"\n      "),a.TgZ(43,"select",43),a.NdJ("ngModelChange",(function(t){a.CHM(e);const i=a.oxw();return a.KtG(i.bank.account_holder_type=t)})),a._uU(44,"\n        "),a.TgZ(45,"option",44),a._uU(46),a.ALo(47,"i18n"),a.qZA(),a._uU(48,"\n        "),a.TgZ(49,"option",45),a._uU(50),a.ALo(51,"i18n"),a.qZA(),a._uU(52,"\n        "),a.TgZ(53,"option",46),a._uU(54),a.ALo(55,"i18n"),a.qZA(),a._uU(56,"\n      "),a.qZA(),a._uU(57,"\n    "),a.qZA(),a._uU(58,"\n  "),a.qZA(),a._uU(59,"\n"),a.BQk()}if(2&e){const e=a.oxw();a.xp6(2),a.s9C("title",a.lcZ(3,14,"verifyBankAccount")),a.xp6(2),a.AsE("\n    ",a.lcZ(5,16,"verifyBankAccountInitialDesc")," ",a.lcZ(6,18,"verifyBankAccountFailureWarning"),"\n  "),a.xp6(9),a.Oqu(a.lcZ(14,20,"routingNumber")),a.xp6(3),a.Q6J("ngModel",e.bank.routing_number),a.xp6(6),a.Oqu(a.lcZ(23,22,"accountNumber")),a.xp6(3),a.Q6J("ngModel",e.bank.account_number),a.xp6(6),a.Oqu(a.lcZ(32,24,"accountHolderName")),a.xp6(3),a.Q6J("ngModel",e.bank.account_holder_name),a.xp6(6),a.Oqu(a.lcZ(41,26,"bankAccountType")),a.xp6(3),a.Q6J("ngModel",e.bank.account_holder_type),a.xp6(3),a.hij("-- ",a.lcZ(47,28,"select")," --"),a.xp6(4),a.Oqu(a.lcZ(51,30,"bankAccountTypeCompany")),a.xp6(4),a.Oqu(a.lcZ(55,32,"bankAccountTypeIndividual"))}}function x(e,t){1&e&&(a.ynx(0),a._uU(1,"\n  "),a.TgZ(2,"div",47),a._uU(3,"\n    "),a._UZ(4,"div",48),a._uU(5,"\n    "),a.TgZ(6,"small",49),a._uU(7),a.ALo(8,"i18n"),a.qZA(),a._uU(9,"\n  "),a.qZA(),a._uU(10,"\n"),a.BQk()),2&e&&(a.xp6(7),a.Oqu(a.lcZ(8,1,"paypalClickSubmit")))}function S(e,t){1&e&&(a.ynx(0),a._uU(1,"\n  "),a.TgZ(2,"app-callout",50),a._uU(3),a.ALo(4,"i18n"),a.qZA(),a._uU(5,"\n"),a.BQk()),2&e&&(a.xp6(3),a.hij("\n    ",a.lcZ(4,1,"makeSureEnoughCredit"),"\n  "))}class T{constructor(e,t,i){this.apiService=e,this.logService=t,this.themingService=i,this.showMethods=!0,this.showOptions=!0,this.method=o.Lt.Card,this.hideBank=!1,this.hidePaypal=!1,this.hideCredit=!1,this.trialFlow=!1,this.destroy$=new n.x,this.bank={routing_number:null,account_number:null,account_holder_name:null,account_holder_type:"",currency:"USD",country:"US"},this.paymentMethodType=o.Lt,this.btInstance=null,this.stripe=null,this.stripeElements=null,this.stripeCardNumberElement=null,this.stripeCardExpiryElement=null,this.stripeCardCvcElement=null,this.stripeScript=window.document.createElement("script"),this.stripeScript.src="https://js.stripe.com/v3/?advancedFraudSignals=false",this.stripeScript.async=!0,this.stripeScript.onload=()=>{this.stripe=window.Stripe("pk_test_KPoCfZXu7mznb9uSCPZ2JpTD"),this.stripeElements=this.stripe.elements(),this.setStripeElement()},this.btScript=window.document.createElement("script"),this.btScript.src="scripts/dropin.js?cache=mtmtsr",this.btScript.async=!0,this.StripeElementStyle={base:{color:null,fontFamily:'"Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"14px",fontSmoothing:"antialiased","::placeholder":{color:null}},invalid:{color:null}},this.StripeElementClasses={focus:"is-focused",empty:"is-empty",invalid:"is-invalid"}}ngOnInit(){return v(this,void 0,void 0,(function*(){this.showOptions||(this.hidePaypal=this.method!==o.Lt.PayPal,this.hideBank=this.method!==o.Lt.BankAccount,this.hideCredit=this.method!==o.Lt.Credit),this.subscribeToTheme(),window.document.head.appendChild(this.stripeScript),this.hidePaypal||window.document.head.appendChild(this.btScript)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.document.head.removeChild(this.stripeScript),window.setTimeout((()=>{Array.from(window.document.querySelectorAll("iframe")).forEach((e=>{if(null!=e.src&&e.src.indexOf("stripe")>-1)try{window.document.body.removeChild(e)}catch(t){this.logService.error(t)}}))}),500),this.hidePaypal||(window.document.head.removeChild(this.btScript),window.setTimeout((()=>{Array.from(window.document.head.querySelectorAll("script")).forEach((e=>{if(null!=e.src&&e.src.indexOf("paypal")>-1)try{window.document.head.removeChild(e)}catch(t){this.logService.error(t)}}));const e=window.document.head.querySelector("#braintree-dropin-stylesheet");if(null!=e)try{window.document.head.removeChild(e)}catch(t){this.logService.error(t)}}),500))}changeMethod(){this.btInstance=null,this.method===o.Lt.PayPal?window.setTimeout((()=>{window.braintree.dropin.create({authorization:"sandbox_r72q8jq6_9pnxkwm75f87sdc2",container:"#bt-dropin-container",paymentOptionPriority:["paypal"],paypal:{flow:"vault",buttonStyle:{label:"pay",size:"medium",shape:"pill",color:"blue",tagline:"false"}}},((e,t)=>{null==e?this.btInstance=t:console.error(e)}))}),250):this.setStripeElement()}createPaymentToken(){return new Promise(((e,t)=>{this.method===o.Lt.Credit?e([null,this.method]):this.method===o.Lt.PayPal?this.btInstance.requestPaymentMethod().then((t=>{e([t.nonce,this.method])})).catch((e=>{t(e.message)})):this.method!==o.Lt.Card&&this.method!==o.Lt.BankAccount||(this.method===o.Lt.Card?this.apiService.postSetupPayment().then((e=>this.stripe.handleCardSetup(e,this.stripeCardNumberElement))).then((i=>{i.error?t(i.error.message):i.setupIntent&&"succeeded"===i.setupIntent.status?e([i.setupIntent.payment_method,this.method]):t()})):this.stripe.createToken("bank_account",this.bank).then((i=>{i.error?t(i.error.message):i.token&&null!=i.token.id?e([i.token.id,this.method]):t()})))}))}handleStripeCardPayment(e,t){return new Promise(((i,n)=>{if(this.showMethods&&null==this.stripeCardNumberElement)return void n();return(()=>this.showMethods?this.stripe.handleCardSetup(e,this.stripeCardNumberElement):this.stripe.handleCardSetup(e))().then((e=>v(this,void 0,void 0,(function*(){e.error?n(e.error.message):e.paymentIntent&&"succeeded"===e.paymentIntent.status?(null!=t&&(yield t()),i()):n()}))))}))}setStripeElement(){window.setTimeout((()=>{this.showMethods&&this.method===o.Lt.Card&&(null==this.stripeCardNumberElement&&(this.stripeCardNumberElement=this.stripeElements.create("cardNumber",{style:this.StripeElementStyle,classes:this.StripeElementClasses,placeholder:""})),null==this.stripeCardExpiryElement&&(this.stripeCardExpiryElement=this.stripeElements.create("cardExpiry",{style:this.StripeElementStyle,classes:this.StripeElementClasses})),null==this.stripeCardCvcElement&&(this.stripeCardCvcElement=this.stripeElements.create("cardCvc",{style:this.StripeElementStyle,classes:this.StripeElementClasses,placeholder:""})),this.stripeCardNumberElement.mount("#stripe-card-number-element"),this.stripeCardExpiryElement.mount("#stripe-card-expiry-element"),this.stripeCardCvcElement.mount("#stripe-card-cvc-element"))}),50)}subscribeToTheme(){this.themingService.theme$.pipe((0,s.R)(this.destroy$)).subscribe((()=>{const e=getComputedStyle(document.documentElement);this.StripeElementStyle.base.color=`rgb(${e.getPropertyValue("--color-text-main")})`,this.StripeElementStyle.base["::placeholder"].color=`rgb(${e.getPropertyValue("--color-text-muted")})`,this.StripeElementStyle.invalid.color=`rgb(${e.getPropertyValue("--color-text-main")})`,this.StripeElementStyle.invalid.borderColor=`rgb(${e.getPropertyValue("--color-danger-600")})`}))}}T.ɵfac=function(e){return new(e||T)(a.Y36(l.s),a.Y36(c.$),a.Y36(u.v))},T.ɵcmp=a.Xpm({type:T,selectors:[["app-payment"]],inputs:{showMethods:"showMethods",showOptions:"showOptions",method:"method",hideBank:"hideBank",hidePaypal:"hidePaypal",hideCredit:"hideCredit",trialFlow:"trialFlow"},standalone:!0,features:[a.jDz],decls:10,vars:5,consts:[["class","mb-4 text-lg",4,"ngIf"],[4,"ngIf"],[1,"mb-4","text-lg"],[1,"form-check","form-check-inline","mr-4"],["type","radio","name","Method","id","method-card",1,"form-check-input",3,"value","ngModel","ngModelChange","change"],["for","method-card",1,"form-check-label"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-credit-card"],["class","form-check form-check-inline mr-4",4,"ngIf"],["class","form-check form-check-inline",4,"ngIf"],["type","radio","name","Method","id","method-bank",1,"form-check-input",3,"value","ngModel","ngModelChange","change"],["for","method-bank",1,"form-check-label"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-bank"],[1,"form-check","form-check-inline"],["type","radio","name","Method","id","method-paypal",1,"form-check-input",3,"value","ngModel","ngModelChange","change"],["for","method-paypal",1,"form-check-label"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-paypal"],["type","radio","name","Method","id","method-credit",1,"form-check-input",3,"value","ngModel","ngModelChange","change"],["for","method-credit",1,"form-check-label"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-dollar"],[1,"row"],[1,"form-group",3,"ngClass"],["for","stripe-card-number-element"],["id","stripe-card-number-element",1,"form-control","stripe-form-control"],["class","form-group col-8 d-flex align-items-end",4,"ngIf"],["for","stripe-card-expiry-element"],["id","stripe-card-expiry-element",1,"form-control","stripe-form-control"],[1,"form-group","col-4"],[1,"d-flex"],["for","stripe-card-cvc-element"],["href","https://www.cvvnumber.com/cvv.html","tabindex","-1","target","_blank","rel","noreferrer",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["id","stripe-card-cvc-element",1,"form-control","stripe-form-control"],[1,"form-group","col-8","d-flex","align-items-end"],["src","../../images/cards.png","alt","Visa, MasterCard, Discover, AmEx, JCB, Diners Club, UnionPay","width","323","height","32"],["type","warning",3,"title"],[1,"form-group","col-6"],["for","routing_number"],["id","routing_number","type","text","name","routing_number","required","","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"],["for","account_number"],["id","account_number","type","text","name","account_number","required","","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"],["for","account_holder_name"],["id","account_holder_name","type","text","name","account_holder_name","required","",1,"form-control",3,"ngModel","ngModelChange"],["for","account_holder_type"],["id","account_holder_type","name","account_holder_type","required","",1,"form-control",3,"ngModel","ngModelChange"],["value",""],["value","company"],["value","individual"],[1,"mb-3"],["id","bt-dropin-container",1,"mb-1"],[1,"text-muted"],["type","note"]],template:function(e,t){1&e&&(a.YNc(0,U,19,8,"div",0),a._uU(1,"\n"),a.YNc(2,A,43,15,"ng-container",1),a._uU(3,"\n"),a.YNc(4,Z,60,34,"ng-container",1),a._uU(5,"\n"),a.YNc(6,x,11,3,"ng-container",1),a._uU(7,"\n"),a.YNc(8,S,6,3,"ng-container",1),a._uU(9,"\n")),2&e&&(a.Q6J("ngIf",t.showOptions&&t.showMethods),a.xp6(2),a.Q6J("ngIf",t.showMethods&&t.method===t.paymentMethodType.Card),a.xp6(2),a.Q6J("ngIf",t.showMethods&&t.method===t.paymentMethodType.BankAccount),a.xp6(2),a.Q6J("ngIf",t.showMethods&&t.method===t.paymentMethodType.PayPal),a.xp6(2),a.Q6J("ngIf",t.showMethods&&t.method===t.paymentMethodType.Credit))},dependencies:[r.m,d.mk,d.O5,p.YN,p.Kr,p.Fj,p.EJ,p._,p.JJ,p.Q7,p.On,h.B,g.O,f.b,m.C],encapsulation:2})},7644:(e,t,i)=>{"use strict";i.d(t,{G:()=>L,D:()=>N});var n=i(37513),s=i(54019),o=i(53634),r=i(68362),a=i(51303);const l=i(66997).W4`
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 580 104" fill="none"><path fill="#fff" d="M102.539 52.27c0 28.315-22.954 51.269-51.27 51.269C22.955 103.539 0 80.585 0 52.269 0 23.955 22.954 1 51.27 1c28.315 0 51.269 22.954 51.269 51.27Z"/><path fill="#175DDC" fill-rule="evenodd" d="M75.971 26.765c-.516-.49-1.111-.777-1.786-.777H28.39c-.675 0-1.31.287-1.786.777-.516.49-.754 1.145-.754 1.84v31.47c0 2.371.437 4.66 1.31 6.95.873 2.288 1.984 4.332 3.294 6.13s2.897 3.515 4.682 5.232a62.036 62.036 0 0 0 5 4.25 82.731 82.731 0 0 0 4.802 3.188c1.667.981 2.857 1.676 3.572 2.003.714.368 1.27.613 1.706.817a2.26 2.26 0 0 0 1.032.246 2.26 2.26 0 0 0 1.032-.246c.436-.204.992-.45 1.706-.817.715-.368 1.905-1.022 3.572-2.003a54.848 54.848 0 0 0 4.801-3.188c1.548-1.103 3.215-2.534 5.04-4.25 1.826-1.717 3.373-3.434 4.683-5.232 1.31-1.798 2.42-3.842 3.294-6.13.912-2.29 1.31-4.62 1.31-6.95v-31.47c.04-.695-.239-1.309-.715-1.84Zm-5.913 33.597c0 11.403-18.77 21.172-18.77 21.172V32.732h18.77v27.63Z" clip-rule="evenodd"/><path fill="#fff" d="M142.208 70.81c-2.804 0-5.243-.511-7.319-1.533-2.075-1.023-3.678-2.447-4.806-4.272-1.129-1.826-1.694-3.943-1.694-6.353h4.807c0 1.497.346 2.884 1.038 4.162.692 1.241 1.693 2.246 3.004 3.012 1.347.73 3.004 1.096 4.97 1.096 2.585 0 4.588-.621 6.008-1.862 1.42-1.242 2.13-2.794 2.13-4.656 0-1.533-.327-2.756-.983-3.669-.655-.95-1.547-1.716-2.676-2.3-1.092-.585-2.367-1.096-3.823-1.534a126.43 126.43 0 0 1-4.479-1.479c-2.95-1.022-5.134-2.281-6.555-3.778-1.42-1.534-2.13-3.524-2.13-5.97-.036-2.045.437-3.852 1.42-5.422.984-1.607 2.367-2.848 4.151-3.724 1.821-.913 3.969-1.37 6.446-1.37 2.439 0 4.551.457 6.335 1.37 1.821.913 3.223 2.172 4.206 3.779 1.02 1.606 1.548 3.432 1.584 5.476h-4.806c0-1.058-.274-2.099-.82-3.121-.546-1.06-1.383-1.917-2.512-2.574-1.093-.658-2.476-.986-4.151-.986-2.076-.037-3.787.493-5.135 1.588-1.31 1.095-1.966 2.61-1.966 4.546 0 1.643.455 2.903 1.366 3.779.946.876 2.257 1.606 3.932 2.19 1.675.548 3.605 1.187 5.79 1.917 1.821.657 3.459 1.424 4.916 2.3 1.456.877 2.585 2.009 3.386 3.396.838 1.388 1.256 3.158 1.256 5.313 0 1.825-.473 3.56-1.42 5.203-.946 1.606-2.385 2.92-4.315 3.943-1.893 1.022-4.278 1.533-7.155 1.533ZM172.42 70.81c-2.586 0-4.88-.584-6.882-1.752-2.003-1.205-3.587-2.867-4.752-4.984-1.129-2.118-1.694-4.619-1.694-7.503 0-2.848.565-5.331 1.694-7.449 1.128-2.154 2.694-3.815 4.697-4.983 2.039-1.205 4.388-1.808 7.046-1.808 2.622 0 4.879.603 6.773 1.807 1.93 1.169 3.404 2.72 4.424 4.656a13.201 13.201 0 0 1 1.529 6.243c0 .402-.018.803-.054 1.205v1.37h-21.575c.109 2.08.582 3.815 1.42 5.202.874 1.351 1.948 2.373 3.222 3.067a8.754 8.754 0 0 0 4.152 1.04c1.893 0 3.477-.437 4.751-1.314 1.275-.876 2.203-2.063 2.786-3.56h4.533c-.728 2.52-2.13 4.62-4.205 6.299-2.039 1.643-4.661 2.464-7.865 2.464Zm0-24.59c-2.185 0-4.133.675-5.845 2.026-1.675 1.314-2.64 3.25-2.895 5.805h17.042c-.11-2.446-.947-4.363-2.513-5.75-1.566-1.388-3.495-2.081-5.789-2.081ZM202.697 70.81c-2.585 0-4.916-.584-6.991-1.752-2.039-1.205-3.66-2.867-4.861-4.984-1.166-2.154-1.748-4.655-1.748-7.503s.582-5.331 1.748-7.449c1.201-2.154 2.822-3.815 4.861-4.983 2.075-1.205 4.406-1.808 6.991-1.808 3.204 0 5.899.84 8.084 2.52 2.221 1.679 3.623 3.924 4.206 6.736h-4.698c-.364-1.68-1.256-2.976-2.676-3.889-1.42-.949-3.077-1.424-4.97-1.424-1.53 0-2.968.384-4.315 1.15-1.348.767-2.44 1.917-3.278 3.45-.837 1.534-1.256 3.433-1.256 5.697 0 2.263.419 4.162 1.256 5.696.838 1.533 1.93 2.701 3.278 3.505a8.584 8.584 0 0 0 4.315 1.15c1.893 0 3.55-.457 4.97-1.37 1.42-.949 2.312-2.282 2.676-3.998h4.698c-.547 2.739-1.93 4.966-4.152 6.682-2.221 1.716-4.934 2.574-8.138 2.574ZM220.302 70.153V42.988h4.151l.382 5.203c.838-1.789 2.112-3.213 3.823-4.272 1.712-1.058 3.824-1.588 6.336-1.588v4.82h-1.256c-1.602 0-3.077.292-4.424.876-1.347.548-2.422 1.497-3.223 2.848-.801 1.35-1.201 3.213-1.201 5.586v13.692h-4.588ZM250.218 70.81c-2.585 0-4.879-.584-6.882-1.752-2.003-1.205-3.587-2.867-4.752-4.984-1.129-2.118-1.693-4.619-1.693-7.503 0-2.848.564-5.331 1.693-7.449 1.129-2.154 2.695-3.815 4.698-4.983 2.039-1.205 4.387-1.808 7.045-1.808 2.622 0 4.88.603 6.773 1.807 1.93 1.169 3.405 2.72 4.424 4.656 1.02 1.935 1.53 4.016 1.53 6.243 0 .402-.018.803-.055 1.205v1.37h-21.575c.11 2.08.583 3.815 1.421 5.202.874 1.351 1.948 2.373 3.222 3.067a8.753 8.753 0 0 0 4.151 1.04c1.894 0 3.478-.437 4.752-1.314 1.275-.876 2.203-2.063 2.786-3.56h4.533c-.728 2.52-2.13 4.62-4.206 6.299-2.039 1.643-4.66 2.464-7.865 2.464Zm0-24.59c-2.185 0-4.133.675-5.844 2.026-1.675 1.314-2.64 3.25-2.895 5.805h17.041c-.109-2.446-.946-4.363-2.512-5.75-1.566-1.388-3.496-2.081-5.79-2.081ZM277.841 70.153c-2.476 0-4.424-.603-5.844-1.807-1.42-1.205-2.13-3.378-2.13-6.518V46.877h-4.698v-3.889h4.698l.601-6.517h3.987v6.517h7.974v3.889h-7.974v14.951c0 1.716.346 2.885 1.038 3.505.691.585 1.911.877 3.659.877h2.84v3.943h-4.151ZM297.544 70.81c-3.241 0-5.936-.821-8.084-2.464-2.149-1.643-3.405-3.87-3.769-6.682h4.697c.292 1.424 1.038 2.665 2.24 3.724 1.238 1.022 2.895 1.534 4.97 1.534 1.93 0 3.35-.402 4.26-1.205.911-.84 1.366-1.826 1.366-2.958 0-1.643-.601-2.738-1.803-3.286-1.165-.547-2.822-1.04-4.97-1.478a28.114 28.114 0 0 1-4.369-1.26c-1.457-.548-2.677-1.315-3.66-2.3-.983-1.023-1.475-2.355-1.475-3.998 0-2.373.874-4.309 2.622-5.806 1.784-1.533 4.188-2.3 7.21-2.3 2.876 0 5.225.73 7.046 2.19 1.857 1.425 2.931 3.47 3.222 6.135h-4.533c-.182-1.388-.783-2.465-1.803-3.231-.983-.804-2.312-1.205-3.987-1.205-1.638 0-2.913.346-3.823 1.04-.874.694-1.311 1.607-1.311 2.739 0 1.095.564 1.953 1.693 2.574 1.165.62 2.731 1.15 4.697 1.588 1.675.365 3.259.821 4.752 1.37 1.53.51 2.768 1.295 3.714 2.354.984 1.022 1.475 2.52 1.475 4.491.037 2.446-.892 4.473-2.785 6.08-1.857 1.57-4.388 2.354-7.592 2.354ZM327.019 70.153V31.816h5.353l13.764 26.726 13.655-26.726h5.407v38.337h-4.588V40.031l-12.781 24.645h-3.441l-12.781-24.59v30.067h-4.588ZM380.911 70.81c-2.258 0-4.133-.383-5.626-1.15-1.493-.767-2.604-1.789-3.332-3.067a8.266 8.266 0 0 1-1.092-4.162c0-2.775 1.056-4.911 3.168-6.408 2.112-1.497 4.988-2.245 8.63-2.245h7.319v-.33c0-2.372-.619-4.161-1.857-5.366-1.238-1.242-2.895-1.862-4.971-1.862-1.784 0-3.332.456-4.642 1.369-1.275.876-2.076 2.172-2.404 3.888h-4.697c.182-1.971.838-3.633 1.966-4.983 1.166-1.352 2.604-2.374 4.315-3.068 1.712-.73 3.532-1.095 5.462-1.095 3.787 0 6.627 1.022 8.521 3.067 1.93 2.008 2.895 4.692 2.895 8.05v16.705h-4.097l-.273-4.874c-.765 1.533-1.893 2.848-3.386 3.943-1.457 1.059-3.423 1.588-5.899 1.588Zm.71-3.888c1.748 0 3.241-.457 4.479-1.37a8.66 8.66 0 0 0 2.895-3.56c.655-1.46.983-2.993.983-4.6v-.055h-6.937c-2.695 0-4.606.475-5.735 1.424-1.092.913-1.639 2.063-1.639 3.45 0 1.425.51 2.575 1.53 3.451 1.056.84 2.53 1.26 4.424 1.26ZM400.356 70.153V42.988h4.151l.273 4.875a9.86 9.86 0 0 1 3.769-4.053c1.639-.986 3.496-1.479 5.571-1.479 3.205 0 5.754.986 7.647 2.958 1.93 1.935 2.895 4.929 2.895 8.981v15.883h-4.588v-15.39c0-5.659-2.331-8.489-6.991-8.489-2.331 0-4.279.858-5.845 2.575-1.529 1.679-2.294 4.089-2.294 7.229v14.075h-4.588ZM439.533 70.81c-2.258 0-4.133-.383-5.626-1.15-1.493-.767-2.603-1.789-3.332-3.067a8.266 8.266 0 0 1-1.092-4.162c0-2.775 1.056-4.911 3.168-6.408 2.112-1.497 4.988-2.245 8.63-2.245h7.319v-.33c0-2.372-.619-4.161-1.857-5.366-1.238-1.242-2.895-1.862-4.971-1.862-1.784 0-3.331.456-4.642 1.369-1.275.876-2.076 2.172-2.404 3.888h-4.697c.182-1.971.838-3.633 1.966-4.983 1.166-1.352 2.604-2.374 4.315-3.068 1.712-.73 3.532-1.095 5.462-1.095 3.787 0 6.627 1.022 8.521 3.067 1.93 2.008 2.895 4.692 2.895 8.05v16.705h-4.097l-.273-4.874c-.764 1.533-1.893 2.848-3.386 3.943-1.457 1.059-3.423 1.588-5.899 1.588Zm.71-3.888c1.748 0 3.241-.457 4.479-1.37a8.66 8.66 0 0 0 2.895-3.56c.655-1.46.983-2.993.983-4.6v-.055h-6.937c-2.694 0-4.606.475-5.735 1.424-1.092.913-1.639 2.063-1.639 3.45 0 1.425.51 2.575 1.53 3.451 1.056.84 2.531 1.26 4.424 1.26ZM469.684 61.61c-1.53 0-2.931-.202-4.206-.603l-2.731 2.574c.401.292.892.548 1.475.767.619.182 1.493.365 2.622.547 1.128.146 2.712.31 4.751.493 3.642.256 6.245 1.096 7.811 2.52 1.566 1.424 2.349 3.286 2.349 5.586 0 1.57-.437 3.067-1.311 4.49-.838 1.425-2.149 2.593-3.933 3.506-1.748.913-4.005 1.369-6.773 1.369-2.439 0-4.606-.329-6.499-.986-1.894-.62-3.369-1.588-4.425-2.903-1.055-1.277-1.583-2.902-1.583-4.874 0-1.022.273-2.136.819-3.34.546-1.169 1.566-2.282 3.059-3.341a13.725 13.725 0 0 1-2.076-1.041 13.173 13.173 0 0 1-1.529-1.314V63.8l4.642-4.6c-2.148-1.826-3.222-4.236-3.222-7.23 0-1.789.418-3.414 1.256-4.874.837-1.46 2.057-2.61 3.66-3.45 1.602-.877 3.55-1.315 5.844-1.315 1.566 0 2.986.22 4.26.657h9.995v3.45l-5.079.22c1.056 1.533 1.584 3.304 1.584 5.312 0 1.79-.437 3.414-1.311 4.874-.838 1.461-2.057 2.63-3.66 3.506-1.565.84-3.495 1.26-5.789 1.26Zm0-3.78c1.93 0 3.459-.493 4.588-1.478 1.165-1.023 1.748-2.483 1.748-4.382 0-1.862-.583-3.286-1.748-4.272-1.129-1.022-2.658-1.533-4.588-1.533-1.967 0-3.532.511-4.698 1.533-1.128.986-1.693 2.41-1.693 4.272 0 1.899.565 3.36 1.693 4.382 1.166.985 2.731 1.478 4.698 1.478Zm-7.975 15.828c0 1.826.765 3.177 2.294 4.053 1.53.913 3.441 1.37 5.735 1.37 2.258 0 4.06-.494 5.408-1.48 1.383-.986 2.075-2.3 2.075-3.943 0-1.168-.473-2.19-1.42-3.067-.947-.84-2.694-1.332-5.243-1.479-2.003-.146-3.733-.328-5.189-.547-1.493.803-2.476 1.661-2.95 2.574-.473.95-.71 1.789-.71 2.52ZM499.136 70.81c-2.585 0-4.879-.584-6.882-1.752-2.003-1.205-3.587-2.867-4.752-4.984-1.129-2.118-1.693-4.619-1.693-7.503 0-2.848.564-5.331 1.693-7.449 1.129-2.154 2.695-3.815 4.697-4.983 2.04-1.205 4.388-1.808 7.046-1.808 2.622 0 4.88.603 6.773 1.807 1.93 1.169 3.405 2.72 4.424 4.656 1.02 1.935 1.53 4.016 1.53 6.243 0 .402-.019.803-.055 1.205v1.37h-21.575c.11 2.08.583 3.815 1.42 5.202.874 1.351 1.949 2.373 3.223 3.067a8.753 8.753 0 0 0 4.151 1.04c1.894 0 3.478-.437 4.752-1.314 1.274-.876 2.203-2.063 2.786-3.56h4.533c-.728 2.52-2.13 4.62-4.206 6.299-2.039 1.643-4.661 2.464-7.865 2.464Zm0-24.59c-2.185 0-4.133.675-5.844 2.026-1.675 1.314-2.64 3.25-2.895 5.805h17.041c-.109-2.446-.947-4.363-2.512-5.75-1.566-1.388-3.496-2.081-5.79-2.081ZM516.96 70.153V42.988h4.151l.383 5.203c.837-1.789 2.112-3.213 3.823-4.272 1.712-1.058 3.824-1.588 6.336-1.588v4.82h-1.256c-1.602 0-3.077.292-4.424.876-1.348.548-2.422 1.497-3.223 2.848-.801 1.35-1.202 3.213-1.202 5.586v13.692h-4.588Z"/></svg>
`;var c=i(85762),u=i(78627),d=i(28508),p=i(46246),h=i(81974),g=i(7172),f=i(24637),m=i(11512),v=i(75734),y=i(36179),w=i(44358),b=i(22221),U=i(28315),_=i(82933);function A(e,t){if(1&e&&(c.TgZ(0,"li"),c._uU(1),c.ALo(2,"i18n"),c.qZA()),2&e){const e=c.oxw(2);c.xp6(1),c.Oqu(c.xi3(2,1,"limitedUsers",e.maxUsers))}}function Z(e,t){if(1&e&&(c.TgZ(0,"li"),c._uU(1),c.ALo(2,"i18n"),c.qZA()),2&e){const e=c.oxw(2);c.xp6(1),c.hij("\n          ",c.xi3(2,1,"projectsIncluded",e.maxProjects),"\n        ")}}function x(e,t){1&e&&(c._uU(0,"\n          "),c.TgZ(1,"li"),c._uU(2),c.ALo(3,"i18n"),c.qZA(),c._uU(4,"\n        ")),2&e&&(c.xp6(2),c.Oqu(c.lcZ(3,1,"unlimitedProjects")))}function S(e,t){if(1&e&&(c.TgZ(0,"li"),c._uU(1),c.ALo(2,"i18n"),c.ALo(3,"currency"),c.qZA()),2&e){const e=c.oxw(2);c.xp6(1),c.hij("\n          ",c.xi3(2,1,"additionalMachineAccountCost",c.xi3(3,4,e.monthlyCostPerServiceAccount,"$")),"\n        ")}}function T(e,t){if(1&e&&(c.TgZ(0,"span"),c._uU(1),c.ALo(2,"i18n"),c.ALo(3,"currency"),c.ALo(4,"i18n"),c.qZA()),2&e){const e=c.oxw(2);c.xp6(1),c.AsE("\n        ",c.xi3(2,2,"costPerUser",c.xi3(3,5,e.monthlyCostPerUser,"$"))," /",c.lcZ(4,8,"month"),"\n      ")}}function C(e,t){1&e&&(c._uU(0,"\n        "),c.TgZ(1,"span"),c._uU(2),c.ALo(3,"i18n"),c.qZA(),c._uU(4,"\n      ")),2&e&&(c.xp6(2),c.Oqu(c.lcZ(3,1,"freeForever")))}function O(e,t){1&e&&(c.TgZ(0,"bit-hint"),c._uU(1),c.ALo(2,"i18n"),c.qZA()),2&e&&(c.xp6(1),c.Oqu(c.lcZ(2,1,"addSecretsManagerUpgradeDesc")))}function k(e,t){1&e&&(c.TgZ(0,"div",17),c._uU(1,"\n        "),c.TgZ(2,"bit-form-field"),c._uU(3,"\n          "),c.TgZ(4,"bit-label"),c._uU(5),c.ALo(6,"i18n"),c.qZA(),c._uU(7,"\n          "),c._UZ(8,"input",18),c._uU(9,"\n          "),c.TgZ(10,"bit-hint"),c._uU(11),c.ALo(12,"i18n"),c.qZA(),c._uU(13,"\n        "),c.qZA(),c._uU(14,"\n      "),c.qZA()),2&e&&(c.xp6(5),c.Oqu(c.lcZ(6,2,"userSeats")),c.xp6(6),c.Oqu(c.lcZ(12,4,"userSeatsHowManyDesc")))}function P(e,t){if(1&e&&(c.TgZ(0,"div",17),c._uU(1,"\n        "),c.TgZ(2,"bit-form-field"),c._uU(3,"\n          "),c.TgZ(4,"bit-label"),c._uU(5),c.ALo(6,"i18n"),c.qZA(),c._uU(7,"\n          "),c._UZ(8,"input",19),c._uU(9,"\n          "),c.TgZ(10,"bit-hint"),c._uU(11),c.ALo(12,"i18n"),c.ALo(13,"i18n"),c.ALo(14,"currency"),c.qZA(),c._uU(15,"\n        "),c.qZA(),c._uU(16,"\n      "),c.qZA()),2&e){const e=c.oxw(3);c.xp6(5),c.Oqu(c.lcZ(6,3,"additionalMachineAccounts")),c.xp6(6),c.AsE("\n            ",c.xi3(12,5,"includedMachineAccounts",e.serviceAccountsIncluded),"\n            ",c.xi3(13,8,"addAdditionalMachineAccounts",c.xi3(14,11,e.monthlyCostPerServiceAccount,"$")),"\n          ")}}function q(e,t){1&e&&(c.TgZ(0,"button",20),c._uU(1),c.ALo(2,"i18n"),c.qZA()),2&e&&(c.xp6(1),c.hij("\n        ",c.lcZ(2,1,"save"),"\n      "))}function I(e,t){if(1&e&&(c.ynx(0),c._uU(1,"\n      "),c.YNc(2,k,15,6,"div",15),c._uU(3,"\n      "),c.YNc(4,P,17,14,"div",15),c._uU(5,"\n\n      "),c.YNc(6,q,3,3,"button",16),c._uU(7,"\n    "),c.BQk()),2&e){const e=c.oxw(2);c.xp6(2),c.Q6J("ngIf",e.selectedPlan.SecretsManager.hasAdditionalSeatsOption),c.xp6(2),c.Q6J("ngIf",e.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption),c.xp6(2),c.Q6J("ngIf",e.showSubmitButton)}}function M(e,t){if(1&e&&(c.TgZ(0,"div",1),c._uU(1,"\n  "),c.TgZ(2,"h3",2),c._uU(3),c.ALo(4,"i18n"),c.qZA(),c._uU(5,"\n  "),c.TgZ(6,"div",3),c._uU(7,"\n    "),c.TgZ(8,"div",4),c._uU(9,"\n      "),c._UZ(10,"bit-icon",5),c._uU(11,"\n    "),c.qZA(),c._uU(12,"\n  "),c.qZA(),c._uU(13,"\n  "),c.TgZ(14,"div",6),c._uU(15,"\n    "),c.TgZ(16,"h4",7),c._uU(17),c.ALo(18,"i18n"),c.qZA(),c._uU(19,"\n    "),c.TgZ(20,"div",8),c._uU(21),c.ALo(22,"i18n"),c.TgZ(23,"ul"),c._uU(24,"\n        "),c.YNc(25,A,3,4,"li",9),c._uU(26,"\n        "),c.TgZ(27,"li"),c._uU(28),c.ALo(29,"i18n"),c.qZA(),c._uU(30,"\n        "),c.YNc(31,Z,3,4,"li",10),c._uU(32,"\n        "),c.YNc(33,x,5,3,"ng-template",null,11,c.W1O),c._uU(35,"\n        "),c.TgZ(36,"li"),c._uU(37),c.ALo(38,"i18n"),c.qZA(),c._uU(39,"\n        "),c.YNc(40,S,4,7,"li",9),c._uU(41,"\n      "),c.qZA(),c._uU(42,"\n    "),c.qZA(),c._uU(43,"\n\n    "),c.TgZ(44,"div",12),c._uU(45,"\n      "),c.YNc(46,T,5,10,"span",10),c._uU(47,"\n      "),c.YNc(48,C,5,3,"ng-template",null,13,c.W1O),c._uU(50,"\n    "),c.qZA(),c._uU(51,"\n\n    "),c.TgZ(52,"bit-form-control"),c._uU(53,"\n      "),c._UZ(54,"input",14),c._uU(55,"\n      "),c.TgZ(56,"bit-label"),c._uU(57),c.ALo(58,"i18n"),c.qZA(),c._uU(59,"\n      "),c.YNc(60,O,3,3,"bit-hint",9),c._uU(61,"\n    "),c.qZA(),c._uU(62,"\n\n    "),c.YNc(63,I,8,3,"ng-container",9),c._uU(64,"\n  "),c.qZA(),c._uU(65,"\n"),c.qZA()),2&e){const e=c.MAs(34),t=c.MAs(49),i=c.oxw();c.Q6J("formGroup",i.formGroup),c.xp6(3),c.Oqu(c.lcZ(4,16,"moreFromBitwarden")),c.xp6(7),c.Q6J("icon",i.logo),c.xp6(7),c.Oqu(c.xi3(18,18,"secretsManagerForPlan",i.planName)),c.xp6(4),c.hij("\n      ",c.lcZ(22,21,"secretsManagerForPlanDesc"),"\n      "),c.xp6(4),c.Q6J("ngIf",i.product==i.productTypes.Free),c.xp6(3),c.Oqu(c.lcZ(29,23,"unlimitedSecrets")),c.xp6(3),c.Q6J("ngIf",i.product==i.productTypes.Free)("ngIfElse",e),c.xp6(6),c.Oqu(c.xi3(38,25,"machineAccountsIncluded",i.serviceAccountsIncluded)),c.xp6(3),c.Q6J("ngIf",i.product!=i.productTypes.Free),c.xp6(6),c.Q6J("ngIf",i.product!=i.productTypes.Free)("ngIfElse",t),c.xp6(11),c.Oqu(c.lcZ(58,28,"subscribeToSecretsManager")),c.xp6(3),c.Q6J("ngIf",i.upgradeOrganization),c.xp6(3),c.Q6J("ngIf",i.formGroup.value.enabled)}}const N=e=>e.group({enabled:[!1],userSeats:[1,[n.kI.required,n.kI.min(1),n.kI.max(1e5)]],additionalServiceAccounts:[0,[n.kI.required,n.kI.min(0),n.kI.max(1e5)]]});class L{constructor(e){this.i18nService=e,this.showSubmitButton=!1,this.logo=l,this.productTypes=a.kv,this.destroy$=new s.x,this.discountPrice=e=>e-(this.customerDiscount&&this.customerDiscount.active?e*(this.customerDiscount.percentOff/100):0)}ngOnInit(){this.formGroup.controls.enabled.valueChanges.pipe((0,o.O)(this.formGroup.value.enabled),(0,r.R)(this.destroy$)).subscribe((e=>{e?(this.formGroup.controls.userSeats.enable(),this.formGroup.controls.additionalServiceAccounts.enable()):(this.formGroup.controls.userSeats.disable(),this.formGroup.controls.additionalServiceAccounts.disable())}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get product(){return this.selectedPlan.product}get planName(){switch(this.product){case a.kv.Free:return this.i18nService.t("free2PersonOrganization");case a.kv.Teams:case a.kv.TeamsStarter:return this.i18nService.t("planNameTeams");case a.kv.Enterprise:return this.i18nService.t("planNameEnterprise")}}get serviceAccountsIncluded(){return this.selectedPlan.SecretsManager.baseServiceAccount}get monthlyCostPerServiceAccount(){return this.selectedPlan.isAnnual?this.discountPrice(this.selectedPlan.SecretsManager.additionalPricePerServiceAccount)/12:this.discountPrice(this.selectedPlan.SecretsManager.additionalPricePerServiceAccount)}get maxUsers(){return this.selectedPlan.SecretsManager.maxSeats}get maxProjects(){return this.selectedPlan.SecretsManager.maxProjects}get monthlyCostPerUser(){return this.selectedPlan.isAnnual?this.discountPrice(this.selectedPlan.SecretsManager.seatPrice)/12:this.discountPrice(this.selectedPlan.SecretsManager.seatPrice)}}L.ɵfac=function(e){return new(e||L)(c.Y36(u.D))},L.ɵcmp=c.Xpm({type:L,selectors:[["sm-subscribe"]],inputs:{formGroup:"formGroup",upgradeOrganization:"upgradeOrganization",showSubmitButton:"showSubmitButton",selectedPlan:"selectedPlan",customerDiscount:"customerDiscount"},decls:2,vars:1,consts:[[3,"formGroup",4,"ngIf"],[3,"formGroup"],["bitTypography","h3"],[1,"tw-rounded-t","tw-bg-background-alt3","tw-p-5"],[1,"tw-w-72"],[3,"icon"],[1,"tw-rounded-b","tw-border-x","tw-border-b","tw-border-t-0","tw-border-solid","tw-border-secondary-300","tw-p-5"],["bitTypography","h4"],[1,"tw-text-muted"],[4,"ngIf"],[4,"ngIf","ngIfElse"],["unlimitedProjects",""],[1,"tw-mb-5"],["freeForever",""],["type","checkbox","bitCheckbox","","formControlName","enabled"],["class","tw-w-1/2",4,"ngIf"],["type","submit","bitButton","","buttonType","primary","bitFormButton","",4,"ngIf"],[1,"tw-w-1/2"],["bitInput","","formControlName","userSeats","type","number"],["bitInput","","formControlName","additionalServiceAccounts","type","number"],["type","submit","bitButton","","buttonType","primary","bitFormButton",""]],template:function(e,t){1&e&&(c.YNc(0,M,66,30,"div",0),c._uU(1,"\n")),2&e&&c.Q6J("ngIf",t.formGroup&&null!=t.selectedPlan)},dependencies:[d.O5,n.Fj,n.wV,n.Wl,n.JJ,n.JL,n.sg,n.u,p.b,h.r,g.b,f.d,m.G,v.A,y.u,w.M,b.G,U.t,d.H9,_.C],encapsulation:2})},34279:(e,t,i)=>{"use strict";i.d(t,{F:()=>y});var n=i(85762),s=i(16173),o=i(9571),r=i(71146),a=i(55602),l=i(8111),c=i(66459),u=i(97360),d=i(28508),p=i(37513),h=i(82933),g=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function f(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"div",260),n._uU(1,"\n    "),n.TgZ(2,"div",261),n._uU(3,"\n      "),n.TgZ(4,"input",262),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.taxInfo.includeTaxId=t)})),n.qZA(),n._uU(5,"\n      "),n.TgZ(6,"label",263),n._uU(7),n.ALo(8,"i18n"),n.qZA(),n._uU(9,"\n    "),n.qZA(),n._uU(10,"\n  "),n.qZA()}if(2&e){const e=n.oxw();n.xp6(4),n.Q6J("ngModel",e.taxInfo.includeTaxId),n.xp6(3),n.Oqu(n.lcZ(8,2,"includeVAT"))}}function m(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"div",0),n._uU(1,"\n  "),n.TgZ(2,"div",260),n._uU(3,"\n    "),n.TgZ(4,"div",2),n._uU(5,"\n      "),n.TgZ(6,"label",264),n._uU(7),n.ALo(8,"i18n"),n.qZA(),n._uU(9,"\n      "),n.TgZ(10,"input",265),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.taxInfo.taxId=t)})),n.qZA(),n._uU(11,"\n    "),n.qZA(),n._uU(12,"\n  "),n.qZA(),n._uU(13,"\n"),n.qZA()}if(2&e){const e=n.oxw();n.xp6(7),n.Oqu(n.lcZ(8,3,"taxIdNumber")),n.xp6(3),n.Q6J("ngModel",e.taxInfo.taxId)("required",e.taxInfo.includeTaxId)}}function v(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"div",0),n._uU(1,"\n  "),n.TgZ(2,"div",260),n._uU(3,"\n    "),n.TgZ(4,"div",2),n._uU(5,"\n      "),n.TgZ(6,"label",266),n._uU(7),n.ALo(8,"i18n"),n.qZA(),n._uU(9,"\n      "),n.TgZ(10,"input",267),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.taxInfo.line1=t)})),n.qZA(),n._uU(11,"\n    "),n.qZA(),n._uU(12,"\n  "),n.qZA(),n._uU(13,"\n  "),n.TgZ(14,"div",260),n._uU(15,"\n    "),n.TgZ(16,"div",2),n._uU(17,"\n      "),n.TgZ(18,"label",268),n._uU(19),n.ALo(20,"i18n"),n.qZA(),n._uU(21,"\n      "),n.TgZ(22,"input",269),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.taxInfo.line2=t)})),n.qZA(),n._uU(23,"\n    "),n.qZA(),n._uU(24,"\n  "),n.qZA(),n._uU(25,"\n  "),n.TgZ(26,"div",260),n._uU(27,"\n    "),n.TgZ(28,"div",2),n._uU(29,"\n      "),n.TgZ(30,"label",270),n._uU(31),n.ALo(32,"i18n"),n.qZA(),n._uU(33,"\n      "),n.TgZ(34,"input",271),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.taxInfo.city=t)})),n.qZA(),n._uU(35,"\n    "),n.qZA(),n._uU(36,"\n  "),n.qZA(),n._uU(37,"\n  "),n.TgZ(38,"div",260),n._uU(39,"\n    "),n.TgZ(40,"div",2),n._uU(41,"\n      "),n.TgZ(42,"label",272),n._uU(43),n.ALo(44,"i18n"),n.qZA(),n._uU(45,"\n      "),n.TgZ(46,"input",273),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.taxInfo.state=t)})),n.qZA(),n._uU(47,"\n    "),n.qZA(),n._uU(48,"\n  "),n.qZA(),n._uU(49,"\n"),n.qZA()}if(2&e){const e=n.oxw();n.xp6(7),n.Oqu(n.lcZ(8,8,"address1")),n.xp6(3),n.Q6J("ngModel",e.taxInfo.line1),n.xp6(9),n.Oqu(n.lcZ(20,10,"address2")),n.xp6(3),n.Q6J("ngModel",e.taxInfo.line2),n.xp6(9),n.Oqu(n.lcZ(32,12,"cityTown")),n.xp6(3),n.Q6J("ngModel",e.taxInfo.city),n.xp6(9),n.Oqu(n.lcZ(44,14,"stateProvince")),n.xp6(3),n.Q6J("ngModel",e.taxInfo.state)}}class y{constructor(e,t,i,s){this.apiService=e,this.route=t,this.logService=i,this.organizationApiService=s,this.trialFlow=!1,this.onCountryChanged=new n.vpe,this.loading=!0,this.taxInfo={taxId:null,line1:null,line2:null,city:null,state:null,postalCode:null,country:"US",includeTaxId:!1},this.pristine={taxId:null,line1:null,line2:null,city:null,state:null,postalCode:null,country:"US",includeTaxId:!1},this.taxSupportedCountryCodes=["CN","FR","DE","CA","GB","AU","IN","AD","AR","AT","BE","BO","BR","BG","CL","CO","CR","HR","CY","CZ","DK","DO","EC","EG","SV","EE","FI","GE","GR","HK","HU","IS","ID","IQ","IE","IL","IT","JP","KE","KR","LV","LI","LT","LU","MY","MT","MX","NL","NZ","NO","PE","PH","PL","PT","RO","RU","SA","RS","SG","SK","SI","ZA","ES","SE","CH","TW","TH","TR","UA","AE","UY","VE","VN"]}ngOnInit(){return g(this,void 0,void 0,(function*(){this.route.queryParams.subscribe((e=>{this.providerId=e.providerId})),this.route.parent.parent.params.subscribe((e=>g(this,void 0,void 0,(function*(){if(this.organizationId=e.organizationId,this.organizationId)try{const e=yield this.organizationApiService.getTaxInfo(this.organizationId);e&&(this.taxInfo.taxId=e.taxId,this.taxInfo.state=e.state,this.taxInfo.line1=e.line1,this.taxInfo.line2=e.line2,this.taxInfo.city=e.city,this.taxInfo.state=e.state,this.taxInfo.postalCode=e.postalCode,this.taxInfo.country=e.country||"US",this.taxInfo.includeTaxId=this.countrySupportsTax(this.taxInfo.country)&&(!!e.taxId||!!e.line1||!!e.line2||!!e.city||!!e.state))}catch(t){this.logService.error(t)}else try{const e=yield this.apiService.getTaxInfo();e&&(this.taxInfo.postalCode=e.postalCode,this.taxInfo.country=e.country||"US")}catch(t){this.logService.error(t)}this.pristine=Object.assign({},this.taxInfo),"US"!==this.taxInfo.country&&this.onCountryChanged.emit()}))));try{const e=yield this.apiService.getTaxRates();e&&(this.taxRates=e.data)}catch(e){this.logService.error(e)}finally{this.loading=!1}}))}get taxRate(){var e;if(null!=this.taxRates){const t=this.taxRates.find((e=>e.country===this.taxInfo.country&&e.postalCode===this.taxInfo.postalCode));return null!==(e=null==t?void 0:t.rate)&&void 0!==e?e:null}}get showTaxIdCheckbox(){return(this.organizationId||this.providerId)&&"US"!==this.taxInfo.country&&this.countrySupportsTax(this.taxInfo.country)}get showTaxIdFields(){return(this.organizationId||this.providerId)&&this.taxInfo.includeTaxId&&this.countrySupportsTax(this.taxInfo.country)}getTaxInfoRequest(){if(this.organizationId||this.providerId){const e=new s.i;return e.country=this.taxInfo.country,e.postalCode=this.taxInfo.postalCode,this.taxInfo.includeTaxId?(e.taxId=this.taxInfo.taxId,e.line1=this.taxInfo.line1,e.line2=this.taxInfo.line2,e.city=this.taxInfo.city,e.state=this.taxInfo.state):(e.taxId=null,e.line1=null,e.line2=null,e.city=null,e.state=null),e}{const e=new o.a;return e.postalCode=this.taxInfo.postalCode,e.country=this.taxInfo.country,e}}submitTaxInfo(){if(!this.hasChanged())return new Promise((e=>{e()}));const e=this.getTaxInfoRequest();return this.organizationId?this.organizationApiService.updateTaxInfo(this.organizationId,e):this.apiService.putTaxInfo(e)}changeCountry(){this.countrySupportsTax(this.taxInfo.country)||(this.taxInfo.includeTaxId=!1,this.taxInfo.taxId=null,this.taxInfo.line1=null,this.taxInfo.line2=null,this.taxInfo.city=null,this.taxInfo.state=null),this.onCountryChanged.emit()}countrySupportsTax(e){return this.taxSupportedCountryCodes.includes(e)}hasChanged(){for(const e in this.taxInfo)if(this.pristine.hasOwnProperty(e)&&this.pristine[e]!==this.taxInfo[e])return!0;return!1}}y.ɵfac=function(e){return new(e||y)(n.Y36(a.s),n.Y36(l.gz),n.Y36(c.$),n.Y36(u.M))},y.ɵcmp=n.Xpm({type:y,selectors:[["app-tax-info"]],inputs:{trialFlow:"trialFlow"},outputs:{onCountryChanged:"onCountryChanged"},standalone:!0,features:[n.jDz],decls:786,vars:14,consts:[[1,"row"],[3,"ngClass"],[1,"form-group"],["for","addressCountry"],["id","addressCountry","required","","name","addressCountry","autocomplete","country",1,"form-control",3,"ngModel","ngModelChange","change"],["value",""],["value","US"],["value","CN"],["value","FR"],["value","DE"],["value","CA"],["value","GB"],["value","AU"],["value","IN"],["value","-","disabled",""],["value","AF"],["value","AX"],["value","AL"],["value","DZ"],["value","AS"],["value","AD"],["value","AO"],["value","AI"],["value","AQ"],["value","AG"],["value","AR"],["value","AM"],["value","AW"],["value","AT"],["value","AZ"],["value","BS"],["value","BH"],["value","BD"],["value","BB"],["value","BY"],["value","BE"],["value","BZ"],["value","BJ"],["value","BM"],["value","BT"],["value","BO"],["value","BQ"],["value","BA"],["value","BW"],["value","BV"],["value","BR"],["value","IO"],["value","BN"],["value","BG"],["value","BF"],["value","BI"],["value","KH"],["value","CM"],["value","CV"],["value","KY"],["value","CF"],["value","TD"],["value","CL"],["value","CX"],["value","CC"],["value","CO"],["value","KM"],["value","CG"],["value","CD"],["value","CK"],["value","CR"],["value","CI"],["value","HR"],["value","CU"],["value","CW"],["value","CY"],["value","CZ"],["value","DK"],["value","DJ"],["value","DM"],["value","DO"],["value","EC"],["value","EG"],["value","SV"],["value","GQ"],["value","ER"],["value","EE"],["value","ET"],["value","FK"],["value","FO"],["value","FJ"],["value","FI"],["value","GF"],["value","PF"],["value","TF"],["value","GA"],["value","GM"],["value","GE"],["value","GH"],["value","GI"],["value","GR"],["value","GL"],["value","GD"],["value","GP"],["value","GU"],["value","GT"],["value","GG"],["value","GN"],["value","GW"],["value","GY"],["value","HT"],["value","HM"],["value","VA"],["value","HN"],["value","HK"],["value","HU"],["value","IS"],["value","ID"],["value","IR"],["value","IQ"],["value","IE"],["value","IM"],["value","IL"],["value","IT"],["value","JM"],["value","JP"],["value","JE"],["value","JO"],["value","KZ"],["value","KE"],["value","KI"],["value","KP"],["value","KR"],["value","KW"],["value","KG"],["value","LA"],["value","LV"],["value","LB"],["value","LS"],["value","LR"],["value","LY"],["value","LI"],["value","LT"],["value","LU"],["value","MO"],["value","MK"],["value","MG"],["value","MW"],["value","MY"],["value","MV"],["value","ML"],["value","MT"],["value","MH"],["value","MQ"],["value","MR"],["value","MU"],["value","YT"],["value","MX"],["value","FM"],["value","MD"],["value","MC"],["value","MN"],["value","ME"],["value","MS"],["value","MA"],["value","MZ"],["value","MM"],["value","NA"],["value","NR"],["value","NP"],["value","NL"],["value","NC"],["value","NZ"],["value","NI"],["value","NE"],["value","NG"],["value","NU"],["value","NF"],["value","MP"],["value","NO"],["value","OM"],["value","PK"],["value","PW"],["value","PS"],["value","PA"],["value","PG"],["value","PY"],["value","PE"],["value","PH"],["value","PN"],["value","PL"],["value","PT"],["value","PR"],["value","QA"],["value","RE"],["value","RO"],["value","RU"],["value","RW"],["value","BL"],["value","SH"],["value","KN"],["value","LC"],["value","MF"],["value","PM"],["value","VC"],["value","WS"],["value","SM"],["value","ST"],["value","SA"],["value","SN"],["value","RS"],["value","SC"],["value","SL"],["value","SG"],["value","SX"],["value","SK"],["value","SI"],["value","SB"],["value","SO"],["value","ZA"],["value","GS"],["value","SS"],["value","ES"],["value","LK"],["value","SD"],["value","SR"],["value","SJ"],["value","SZ"],["value","SE"],["value","CH"],["value","SY"],["value","TW"],["value","TJ"],["value","TZ"],["value","TH"],["value","TL"],["value","TG"],["value","TK"],["value","TO"],["value","TT"],["value","TN"],["value","TR"],["value","TM"],["value","TC"],["value","TV"],["value","UG"],["value","UA"],["value","AE"],["value","UM"],["value","UY"],["value","UZ"],["value","VU"],["value","VE"],["value","VN"],["value","VG"],["value","VI"],["value","WF"],["value","EH"],["value","YE"],["value","ZM"],["value","ZW"],["for","addressPostalCode"],["id","addressPostalCode","type","text","name","addressPostalCode","autocomplete","postal-code",1,"form-control",3,"ngModel","required","ngModelChange"],["class","col-6",4,"ngIf"],["class","row",4,"ngIf"],[1,"col-6"],[1,"form-group","form-check"],["id","addressIncludeTaxId","name","addressIncludeTaxId","type","checkbox",1,"form-check-input",3,"ngModel","ngModelChange"],["for","addressIncludeTaxId",1,"form-check-label"],["for","taxId"],["id","taxId","type","text","name","taxId",1,"form-control",3,"ngModel","required","ngModelChange"],["for","addressLine1"],["id","addressLine1","type","text","name","addressLine1","autocomplete","address-line1",1,"form-control",3,"ngModel","ngModelChange"],["for","addressLine2"],["id","addressLine2","type","text","name","addressLine2","autocomplete","address-line2",1,"form-control",3,"ngModel","ngModelChange"],["for","addressCity"],["id","addressCity","type","text","name","addressCity","autocomplete","address-level2",1,"form-control",3,"ngModel","ngModelChange"],["for","addressState"],["id","addressState","type","text","name","addressState","autocomplete","address-level1",1,"form-control",3,"ngModel","ngModelChange"]],template:function(e,t){if(1&e){n.TgZ(0,"div",0),n._uU(1,"\n  "),n.TgZ(2,"div",1),n._uU(3,"\n    "),n.TgZ(4,"div",2),n._uU(5,"\n      "),n.TgZ(6,"label",3),n._uU(7),n.ALo(8,"i18n"),n.qZA(),n._uU(9,"\n      "),n.TgZ(10,"select",4),n.NdJ("ngModelChange",(function(e){return t.taxInfo.country=e}))("change",(function(){return t.changeCountry()})),n._uU(11,"\n        "),n.TgZ(12,"option",5),n._uU(13,"-- Select --"),n.qZA(),n._uU(14,"\n        "),n.TgZ(15,"option",6),n._uU(16,"United States"),n.qZA(),n._uU(17,"\n        "),n.TgZ(18,"option",7),n._uU(19,"China"),n.qZA(),n._uU(20,"\n        "),n.TgZ(21,"option",8),n._uU(22,"France"),n.qZA(),n._uU(23,"\n        "),n.TgZ(24,"option",9),n._uU(25,"Germany"),n.qZA(),n._uU(26,"\n        "),n.TgZ(27,"option",10),n._uU(28,"Canada"),n.qZA(),n._uU(29,"\n        "),n.TgZ(30,"option",11),n._uU(31,"United Kingdom"),n.qZA(),n._uU(32,"\n        "),n.TgZ(33,"option",12),n._uU(34,"Australia"),n.qZA(),n._uU(35,"\n        "),n.TgZ(36,"option",13),n._uU(37,"India"),n.qZA(),n._uU(38,"\n        "),n._UZ(39,"option",14),n._uU(40,"\n        "),n.TgZ(41,"option",15),n._uU(42,"Afghanistan"),n.qZA(),n._uU(43,"\n        "),n.TgZ(44,"option",16),n._uU(45,"Åland Islands"),n.qZA(),n._uU(46,"\n        "),n.TgZ(47,"option",17),n._uU(48,"Albania"),n.qZA(),n._uU(49,"\n        "),n.TgZ(50,"option",18),n._uU(51,"Algeria"),n.qZA(),n._uU(52,"\n        "),n.TgZ(53,"option",19),n._uU(54,"American Samoa"),n.qZA(),n._uU(55,"\n        "),n.TgZ(56,"option",20),n._uU(57,"Andorra"),n.qZA(),n._uU(58,"\n        "),n.TgZ(59,"option",21),n._uU(60,"Angola"),n.qZA(),n._uU(61,"\n        "),n.TgZ(62,"option",22),n._uU(63,"Anguilla"),n.qZA(),n._uU(64,"\n        "),n.TgZ(65,"option",23),n._uU(66,"Antarctica"),n.qZA(),n._uU(67,"\n        "),n.TgZ(68,"option",24),n._uU(69,"Antigua and Barbuda"),n.qZA(),n._uU(70,"\n        "),n.TgZ(71,"option",25),n._uU(72,"Argentina"),n.qZA(),n._uU(73,"\n        "),n.TgZ(74,"option",26),n._uU(75,"Armenia"),n.qZA(),n._uU(76,"\n        "),n.TgZ(77,"option",27),n._uU(78,"Aruba"),n.qZA(),n._uU(79,"\n        "),n.TgZ(80,"option",28),n._uU(81,"Austria"),n.qZA(),n._uU(82,"\n        "),n.TgZ(83,"option",29),n._uU(84,"Azerbaijan"),n.qZA(),n._uU(85,"\n        "),n.TgZ(86,"option",30),n._uU(87,"Bahamas"),n.qZA(),n._uU(88,"\n        "),n.TgZ(89,"option",31),n._uU(90,"Bahrain"),n.qZA(),n._uU(91,"\n        "),n.TgZ(92,"option",32),n._uU(93,"Bangladesh"),n.qZA(),n._uU(94,"\n        "),n.TgZ(95,"option",33),n._uU(96,"Barbados"),n.qZA(),n._uU(97,"\n        "),n.TgZ(98,"option",34),n._uU(99,"Belarus"),n.qZA(),n._uU(100,"\n        "),n.TgZ(101,"option",35),n._uU(102,"Belgium"),n.qZA(),n._uU(103,"\n        "),n.TgZ(104,"option",36),n._uU(105,"Belize"),n.qZA(),n._uU(106,"\n        "),n.TgZ(107,"option",37),n._uU(108,"Benin"),n.qZA(),n._uU(109,"\n        "),n.TgZ(110,"option",38),n._uU(111,"Bermuda"),n.qZA(),n._uU(112,"\n        "),n.TgZ(113,"option",39),n._uU(114,"Bhutan"),n.qZA(),n._uU(115,"\n        "),n.TgZ(116,"option",40),n._uU(117,"Bolivia, Plurinational State of"),n.qZA(),n._uU(118,"\n        "),n.TgZ(119,"option",41),n._uU(120,"Bonaire, Sint Eustatius and Saba"),n.qZA(),n._uU(121,"\n        "),n.TgZ(122,"option",42),n._uU(123,"Bosnia and Herzegovina"),n.qZA(),n._uU(124,"\n        "),n.TgZ(125,"option",43),n._uU(126,"Botswana"),n.qZA(),n._uU(127,"\n        "),n.TgZ(128,"option",44),n._uU(129,"Bouvet Island"),n.qZA(),n._uU(130,"\n        "),n.TgZ(131,"option",45),n._uU(132,"Brazil"),n.qZA(),n._uU(133,"\n        "),n.TgZ(134,"option",46),n._uU(135,"British Indian Ocean Territory"),n.qZA(),n._uU(136,"\n        "),n.TgZ(137,"option",47),n._uU(138,"Brunei Darussalam"),n.qZA(),n._uU(139,"\n        "),n.TgZ(140,"option",48),n._uU(141,"Bulgaria"),n.qZA(),n._uU(142,"\n        "),n.TgZ(143,"option",49),n._uU(144,"Burkina Faso"),n.qZA(),n._uU(145,"\n        "),n.TgZ(146,"option",50),n._uU(147,"Burundi"),n.qZA(),n._uU(148,"\n        "),n.TgZ(149,"option",51),n._uU(150,"Cambodia"),n.qZA(),n._uU(151,"\n        "),n.TgZ(152,"option",52),n._uU(153,"Cameroon"),n.qZA(),n._uU(154,"\n        "),n.TgZ(155,"option",53),n._uU(156,"Cape Verde"),n.qZA(),n._uU(157,"\n        "),n.TgZ(158,"option",54),n._uU(159,"Cayman Islands"),n.qZA(),n._uU(160,"\n        "),n.TgZ(161,"option",55),n._uU(162,"Central African Republic"),n.qZA(),n._uU(163,"\n        "),n.TgZ(164,"option",56),n._uU(165,"Chad"),n.qZA(),n._uU(166,"\n        "),n.TgZ(167,"option",57),n._uU(168,"Chile"),n.qZA(),n._uU(169,"\n        "),n.TgZ(170,"option",58),n._uU(171,"Christmas Island"),n.qZA(),n._uU(172,"\n        "),n.TgZ(173,"option",59),n._uU(174,"Cocos (Keeling) Islands"),n.qZA(),n._uU(175,"\n        "),n.TgZ(176,"option",60),n._uU(177,"Colombia"),n.qZA(),n._uU(178,"\n        "),n.TgZ(179,"option",61),n._uU(180,"Comoros"),n.qZA(),n._uU(181,"\n        "),n.TgZ(182,"option",62),n._uU(183,"Congo"),n.qZA(),n._uU(184,"\n        "),n.TgZ(185,"option",63),n._uU(186,"Congo, the Democratic Republic of the"),n.qZA(),n._uU(187,"\n        "),n.TgZ(188,"option",64),n._uU(189,"Cook Islands"),n.qZA(),n._uU(190,"\n        "),n.TgZ(191,"option",65),n._uU(192,"Costa Rica"),n.qZA(),n._uU(193,"\n        "),n.TgZ(194,"option",66),n._uU(195,"Côte d'Ivoire"),n.qZA(),n._uU(196,"\n        "),n.TgZ(197,"option",67),n._uU(198,"Croatia"),n.qZA(),n._uU(199,"\n        "),n.TgZ(200,"option",68),n._uU(201,"Cuba"),n.qZA(),n._uU(202,"\n        "),n.TgZ(203,"option",69),n._uU(204,"Curaçao"),n.qZA(),n._uU(205,"\n        "),n.TgZ(206,"option",70),n._uU(207,"Cyprus"),n.qZA(),n._uU(208,"\n        "),n.TgZ(209,"option",71),n._uU(210,"Czech Republic"),n.qZA(),n._uU(211,"\n        "),n.TgZ(212,"option",72),n._uU(213,"Denmark"),n.qZA(),n._uU(214,"\n        "),n.TgZ(215,"option",73),n._uU(216,"Djibouti"),n.qZA(),n._uU(217,"\n        "),n.TgZ(218,"option",74),n._uU(219,"Dominica"),n.qZA(),n._uU(220,"\n        "),n.TgZ(221,"option",75),n._uU(222,"Dominican Republic"),n.qZA(),n._uU(223,"\n        "),n.TgZ(224,"option",76),n._uU(225,"Ecuador"),n.qZA(),n._uU(226,"\n        "),n.TgZ(227,"option",77),n._uU(228,"Egypt"),n.qZA(),n._uU(229,"\n        "),n.TgZ(230,"option",78),n._uU(231,"El Salvador"),n.qZA(),n._uU(232,"\n        "),n.TgZ(233,"option",79),n._uU(234,"Equatorial Guinea"),n.qZA(),n._uU(235,"\n        "),n.TgZ(236,"option",80),n._uU(237,"Eritrea"),n.qZA(),n._uU(238,"\n        "),n.TgZ(239,"option",81),n._uU(240,"Estonia"),n.qZA(),n._uU(241,"\n        "),n.TgZ(242,"option",82),n._uU(243,"Ethiopia"),n.qZA(),n._uU(244,"\n        "),n.TgZ(245,"option",83),n._uU(246,"Falkland Islands (Malvinas)"),n.qZA(),n._uU(247,"\n        "),n.TgZ(248,"option",84),n._uU(249,"Faroe Islands"),n.qZA(),n._uU(250,"\n        "),n.TgZ(251,"option",85),n._uU(252,"Fiji"),n.qZA(),n._uU(253,"\n        "),n.TgZ(254,"option",86),n._uU(255,"Finland"),n.qZA(),n._uU(256,"\n        "),n.TgZ(257,"option",87),n._uU(258,"French Guiana"),n.qZA(),n._uU(259,"\n        "),n.TgZ(260,"option",88),n._uU(261,"French Polynesia"),n.qZA(),n._uU(262,"\n        "),n.TgZ(263,"option",89),n._uU(264,"French Southern Territories"),n.qZA(),n._uU(265,"\n        "),n.TgZ(266,"option",90),n._uU(267,"Gabon"),n.qZA(),n._uU(268,"\n        "),n.TgZ(269,"option",91),n._uU(270,"Gambia"),n.qZA(),n._uU(271,"\n        "),n.TgZ(272,"option",92),n._uU(273,"Georgia"),n.qZA(),n._uU(274,"\n        "),n.TgZ(275,"option",93),n._uU(276,"Ghana"),n.qZA(),n._uU(277,"\n        "),n.TgZ(278,"option",94),n._uU(279,"Gibraltar"),n.qZA(),n._uU(280,"\n        "),n.TgZ(281,"option",95),n._uU(282,"Greece"),n.qZA(),n._uU(283,"\n        "),n.TgZ(284,"option",96),n._uU(285,"Greenland"),n.qZA(),n._uU(286,"\n        "),n.TgZ(287,"option",97),n._uU(288,"Grenada"),n.qZA(),n._uU(289,"\n        "),n.TgZ(290,"option",98),n._uU(291,"Guadeloupe"),n.qZA(),n._uU(292,"\n        "),n.TgZ(293,"option",99),n._uU(294,"Guam"),n.qZA(),n._uU(295,"\n        "),n.TgZ(296,"option",100),n._uU(297,"Guatemala"),n.qZA(),n._uU(298,"\n        "),n.TgZ(299,"option",101),n._uU(300,"Guernsey"),n.qZA(),n._uU(301,"\n        "),n.TgZ(302,"option",102),n._uU(303,"Guinea"),n.qZA(),n._uU(304,"\n        "),n.TgZ(305,"option",103),n._uU(306,"Guinea-Bissau"),n.qZA(),n._uU(307,"\n        "),n.TgZ(308,"option",104),n._uU(309,"Guyana"),n.qZA(),n._uU(310,"\n        "),n.TgZ(311,"option",105),n._uU(312,"Haiti"),n.qZA(),n._uU(313,"\n        "),n.TgZ(314,"option",106),n._uU(315,"Heard Island and McDonald Islands"),n.qZA(),n._uU(316,"\n        "),n.TgZ(317,"option",107),n._uU(318,"Holy See (Vatican City State)"),n.qZA(),n._uU(319,"\n        "),n.TgZ(320,"option",108),n._uU(321,"Honduras"),n.qZA(),n._uU(322,"\n        "),n.TgZ(323,"option",109),n._uU(324,"Hong Kong"),n.qZA(),n._uU(325,"\n        "),n.TgZ(326,"option",110),n._uU(327,"Hungary"),n.qZA(),n._uU(328,"\n        "),n.TgZ(329,"option",111),n._uU(330,"Iceland"),n.qZA(),n._uU(331,"\n        "),n.TgZ(332,"option",112),n._uU(333,"Indonesia"),n.qZA(),n._uU(334,"\n        "),n.TgZ(335,"option",113),n._uU(336,"Iran, Islamic Republic of"),n.qZA(),n._uU(337,"\n        "),n.TgZ(338,"option",114),n._uU(339,"Iraq"),n.qZA(),n._uU(340,"\n        "),n.TgZ(341,"option",115),n._uU(342,"Ireland"),n.qZA(),n._uU(343,"\n        "),n.TgZ(344,"option",116),n._uU(345,"Isle of Man"),n.qZA(),n._uU(346,"\n        "),n.TgZ(347,"option",117),n._uU(348,"Israel"),n.qZA(),n._uU(349,"\n        "),n.TgZ(350,"option",118),n._uU(351,"Italy"),n.qZA(),n._uU(352,"\n        "),n.TgZ(353,"option",119),n._uU(354,"Jamaica"),n.qZA(),n._uU(355,"\n        "),n.TgZ(356,"option",120),n._uU(357,"Japan"),n.qZA(),n._uU(358,"\n        "),n.TgZ(359,"option",121),n._uU(360,"Jersey"),n.qZA(),n._uU(361,"\n        "),n.TgZ(362,"option",122),n._uU(363,"Jordan"),n.qZA(),n._uU(364,"\n        "),n.TgZ(365,"option",123),n._uU(366,"Kazakhstan"),n.qZA(),n._uU(367,"\n        "),n.TgZ(368,"option",124),n._uU(369,"Kenya"),n.qZA(),n._uU(370,"\n        "),n.TgZ(371,"option",125),n._uU(372,"Kiribati"),n.qZA(),n._uU(373,"\n        "),n.TgZ(374,"option",126),n._uU(375,"Korea, Democratic People's Republic of"),n.qZA(),n._uU(376,"\n        "),n.TgZ(377,"option",127),n._uU(378,"Korea, Republic of"),n.qZA(),n._uU(379,"\n        "),n.TgZ(380,"option",128),n._uU(381,"Kuwait"),n.qZA(),n._uU(382,"\n        "),n.TgZ(383,"option",129),n._uU(384,"Kyrgyzstan"),n.qZA(),n._uU(385,"\n        "),n.TgZ(386,"option",130),n._uU(387,"Lao People's Democratic Republic"),n.qZA(),n._uU(388,"\n        "),n.TgZ(389,"option",131),n._uU(390,"Latvia"),n.qZA(),n._uU(391,"\n        "),n.TgZ(392,"option",132),n._uU(393,"Lebanon"),n.qZA(),n._uU(394,"\n        "),n.TgZ(395,"option",133),n._uU(396,"Lesotho"),n.qZA(),n._uU(397,"\n        "),n.TgZ(398,"option",134),n._uU(399,"Liberia"),n.qZA(),n._uU(400,"\n        "),n.TgZ(401,"option",135),n._uU(402,"Libya"),n.qZA(),n._uU(403,"\n        "),n.TgZ(404,"option",136),n._uU(405,"Liechtenstein"),n.qZA(),n._uU(406,"\n        "),n.TgZ(407,"option",137),n._uU(408,"Lithuania"),n.qZA(),n._uU(409,"\n        "),n.TgZ(410,"option",138),n._uU(411,"Luxembourg"),n.qZA(),n._uU(412,"\n        "),n.TgZ(413,"option",139),n._uU(414,"Macao"),n.qZA(),n._uU(415,"\n        "),n.TgZ(416,"option",140),n._uU(417,"Macedonia, the former Yugoslav Republic of"),n.qZA(),n._uU(418,"\n        "),n.TgZ(419,"option",141),n._uU(420,"Madagascar"),n.qZA(),n._uU(421,"\n        "),n.TgZ(422,"option",142),n._uU(423,"Malawi"),n.qZA(),n._uU(424,"\n        "),n.TgZ(425,"option",143),n._uU(426,"Malaysia"),n.qZA(),n._uU(427,"\n        "),n.TgZ(428,"option",144),n._uU(429,"Maldives"),n.qZA(),n._uU(430,"\n        "),n.TgZ(431,"option",145),n._uU(432,"Mali"),n.qZA(),n._uU(433,"\n        "),n.TgZ(434,"option",146),n._uU(435,"Malta"),n.qZA(),n._uU(436,"\n        "),n.TgZ(437,"option",147),n._uU(438,"Marshall Islands"),n.qZA(),n._uU(439,"\n        "),n.TgZ(440,"option",148),n._uU(441,"Martinique"),n.qZA(),n._uU(442,"\n        "),n.TgZ(443,"option",149),n._uU(444,"Mauritania"),n.qZA(),n._uU(445,"\n        "),n.TgZ(446,"option",150),n._uU(447,"Mauritius"),n.qZA(),n._uU(448,"\n        "),n.TgZ(449,"option",151),n._uU(450,"Mayotte"),n.qZA(),n._uU(451,"\n        "),n.TgZ(452,"option",152),n._uU(453,"Mexico"),n.qZA(),n._uU(454,"\n        "),n.TgZ(455,"option",153),n._uU(456,"Micronesia, Federated States of"),n.qZA(),n._uU(457,"\n        "),n.TgZ(458,"option",154),n._uU(459,"Moldova, Republic of"),n.qZA(),n._uU(460,"\n        "),n.TgZ(461,"option",155),n._uU(462,"Monaco"),n.qZA(),n._uU(463,"\n        "),n.TgZ(464,"option",156),n._uU(465,"Mongolia"),n.qZA(),n._uU(466,"\n        "),n.TgZ(467,"option",157),n._uU(468,"Montenegro"),n.qZA(),n._uU(469,"\n        "),n.TgZ(470,"option",158),n._uU(471,"Montserrat"),n.qZA(),n._uU(472,"\n        "),n.TgZ(473,"option",159),n._uU(474,"Morocco"),n.qZA(),n._uU(475,"\n        "),n.TgZ(476,"option",160),n._uU(477,"Mozambique"),n.qZA(),n._uU(478,"\n        "),n.TgZ(479,"option",161),n._uU(480,"Myanmar"),n.qZA(),n._uU(481,"\n        "),n.TgZ(482,"option",162),n._uU(483,"Namibia"),n.qZA(),n._uU(484,"\n        "),n.TgZ(485,"option",163),n._uU(486,"Nauru"),n.qZA(),n._uU(487,"\n        "),n.TgZ(488,"option",164),n._uU(489,"Nepal"),n.qZA(),n._uU(490,"\n        "),n.TgZ(491,"option",165),n._uU(492,"Netherlands"),n.qZA(),n._uU(493,"\n        "),n.TgZ(494,"option",166),n._uU(495,"New Caledonia"),n.qZA(),n._uU(496,"\n        "),n.TgZ(497,"option",167),n._uU(498,"New Zealand"),n.qZA(),n._uU(499,"\n        "),n.TgZ(500,"option",168),n._uU(501,"Nicaragua"),n.qZA(),n._uU(502,"\n        "),n.TgZ(503,"option",169),n._uU(504,"Niger"),n.qZA(),n._uU(505,"\n        "),n.TgZ(506,"option",170),n._uU(507,"Nigeria"),n.qZA(),n._uU(508,"\n        "),n.TgZ(509,"option",171),n._uU(510,"Niue"),n.qZA(),n._uU(511,"\n        "),n.TgZ(512,"option",172),n._uU(513,"Norfolk Island"),n.qZA(),n._uU(514,"\n        "),n.TgZ(515,"option",173),n._uU(516,"Northern Mariana Islands"),n.qZA(),n._uU(517,"\n        "),n.TgZ(518,"option",174),n._uU(519,"Norway"),n.qZA(),n._uU(520,"\n        "),n.TgZ(521,"option",175),n._uU(522,"Oman"),n.qZA(),n._uU(523,"\n        "),n.TgZ(524,"option",176),n._uU(525,"Pakistan"),n.qZA(),n._uU(526,"\n        "),n.TgZ(527,"option",177),n._uU(528,"Palau"),n.qZA(),n._uU(529,"\n        "),n.TgZ(530,"option",178),n._uU(531,"Palestinian Territory, Occupied"),n.qZA(),n._uU(532,"\n        "),n.TgZ(533,"option",179),n._uU(534,"Panama"),n.qZA(),n._uU(535,"\n        "),n.TgZ(536,"option",180),n._uU(537,"Papua New Guinea"),n.qZA(),n._uU(538,"\n        "),n.TgZ(539,"option",181),n._uU(540,"Paraguay"),n.qZA(),n._uU(541,"\n        "),n.TgZ(542,"option",182),n._uU(543,"Peru"),n.qZA(),n._uU(544,"\n        "),n.TgZ(545,"option",183),n._uU(546,"Philippines"),n.qZA(),n._uU(547,"\n        "),n.TgZ(548,"option",184),n._uU(549,"Pitcairn"),n.qZA(),n._uU(550,"\n        "),n.TgZ(551,"option",185),n._uU(552,"Poland"),n.qZA(),n._uU(553,"\n        "),n.TgZ(554,"option",186),n._uU(555,"Portugal"),n.qZA(),n._uU(556,"\n        "),n.TgZ(557,"option",187),n._uU(558,"Puerto Rico"),n.qZA(),n._uU(559,"\n        "),n.TgZ(560,"option",188),n._uU(561,"Qatar"),n.qZA(),n._uU(562,"\n        "),n.TgZ(563,"option",189),n._uU(564,"Réunion"),n.qZA(),n._uU(565,"\n        "),n.TgZ(566,"option",190),n._uU(567,"Romania"),n.qZA(),n._uU(568,"\n        "),n.TgZ(569,"option",191),n._uU(570,"Russian Federation"),n.qZA(),n._uU(571,"\n        "),n.TgZ(572,"option",192),n._uU(573,"Rwanda"),n.qZA(),n._uU(574,"\n        "),n.TgZ(575,"option",193),n._uU(576,"Saint Barthélemy"),n.qZA(),n._uU(577,"\n        "),n.TgZ(578,"option",194),n._uU(579,"Saint Helena, Ascension and Tristan da Cunha"),n.qZA(),n._uU(580,"\n        "),n.TgZ(581,"option",195),n._uU(582,"Saint Kitts and Nevis"),n.qZA(),n._uU(583,"\n        "),n.TgZ(584,"option",196),n._uU(585,"Saint Lucia"),n.qZA(),n._uU(586,"\n        "),n.TgZ(587,"option",197),n._uU(588,"Saint Martin (French part)"),n.qZA(),n._uU(589,"\n        "),n.TgZ(590,"option",198),n._uU(591,"Saint Pierre and Miquelon"),n.qZA(),n._uU(592,"\n        "),n.TgZ(593,"option",199),n._uU(594,"Saint Vincent and the Grenadines"),n.qZA(),n._uU(595,"\n        "),n.TgZ(596,"option",200),n._uU(597,"Samoa"),n.qZA(),n._uU(598,"\n        "),n.TgZ(599,"option",201),n._uU(600,"San Marino"),n.qZA(),n._uU(601,"\n        ");n.TgZ(602,"option",202),n._uU(603,"Sao Tome and Principe"),n.qZA(),n._uU(604,"\n        "),n.TgZ(605,"option",203),n._uU(606,"Saudi Arabia"),n.qZA(),n._uU(607,"\n        "),n.TgZ(608,"option",204),n._uU(609,"Senegal"),n.qZA(),n._uU(610,"\n        "),n.TgZ(611,"option",205),n._uU(612,"Serbia"),n.qZA(),n._uU(613,"\n        "),n.TgZ(614,"option",206),n._uU(615,"Seychelles"),n.qZA(),n._uU(616,"\n        "),n.TgZ(617,"option",207),n._uU(618,"Sierra Leone"),n.qZA(),n._uU(619,"\n        "),n.TgZ(620,"option",208),n._uU(621,"Singapore"),n.qZA(),n._uU(622,"\n        "),n.TgZ(623,"option",209),n._uU(624,"Sint Maarten (Dutch part)"),n.qZA(),n._uU(625,"\n        "),n.TgZ(626,"option",210),n._uU(627,"Slovakia"),n.qZA(),n._uU(628,"\n        "),n.TgZ(629,"option",211),n._uU(630,"Slovenia"),n.qZA(),n._uU(631,"\n        "),n.TgZ(632,"option",212),n._uU(633,"Solomon Islands"),n.qZA(),n._uU(634,"\n        "),n.TgZ(635,"option",213),n._uU(636,"Somalia"),n.qZA(),n._uU(637,"\n        "),n.TgZ(638,"option",214),n._uU(639,"South Africa"),n.qZA(),n._uU(640,"\n        "),n.TgZ(641,"option",215),n._uU(642,"South Georgia and the South Sandwich Islands"),n.qZA(),n._uU(643,"\n        "),n.TgZ(644,"option",216),n._uU(645,"South Sudan"),n.qZA(),n._uU(646,"\n        "),n.TgZ(647,"option",217),n._uU(648,"Spain"),n.qZA(),n._uU(649,"\n        "),n.TgZ(650,"option",218),n._uU(651,"Sri Lanka"),n.qZA(),n._uU(652,"\n        "),n.TgZ(653,"option",219),n._uU(654,"Sudan"),n.qZA(),n._uU(655,"\n        "),n.TgZ(656,"option",220),n._uU(657,"Suriname"),n.qZA(),n._uU(658,"\n        "),n.TgZ(659,"option",221),n._uU(660,"Svalbard and Jan Mayen"),n.qZA(),n._uU(661,"\n        "),n.TgZ(662,"option",222),n._uU(663,"Swaziland"),n.qZA(),n._uU(664,"\n        "),n.TgZ(665,"option",223),n._uU(666,"Sweden"),n.qZA(),n._uU(667,"\n        "),n.TgZ(668,"option",224),n._uU(669,"Switzerland"),n.qZA(),n._uU(670,"\n        "),n.TgZ(671,"option",225),n._uU(672,"Syrian Arab Republic"),n.qZA(),n._uU(673,"\n        "),n.TgZ(674,"option",226),n._uU(675,"Taiwan"),n.qZA(),n._uU(676,"\n        "),n.TgZ(677,"option",227),n._uU(678,"Tajikistan"),n.qZA(),n._uU(679,"\n        "),n.TgZ(680,"option",228),n._uU(681,"Tanzania, United Republic of"),n.qZA(),n._uU(682,"\n        "),n.TgZ(683,"option",229),n._uU(684,"Thailand"),n.qZA(),n._uU(685,"\n        "),n.TgZ(686,"option",230),n._uU(687,"Timor-Leste"),n.qZA(),n._uU(688,"\n        "),n.TgZ(689,"option",231),n._uU(690,"Togo"),n.qZA(),n._uU(691,"\n        "),n.TgZ(692,"option",232),n._uU(693,"Tokelau"),n.qZA(),n._uU(694,"\n        "),n.TgZ(695,"option",233),n._uU(696,"Tonga"),n.qZA(),n._uU(697,"\n        "),n.TgZ(698,"option",234),n._uU(699,"Trinidad and Tobago"),n.qZA(),n._uU(700,"\n        "),n.TgZ(701,"option",235),n._uU(702,"Tunisia"),n.qZA(),n._uU(703,"\n        "),n.TgZ(704,"option",236),n._uU(705,"Turkey"),n.qZA(),n._uU(706,"\n        "),n.TgZ(707,"option",237),n._uU(708,"Turkmenistan"),n.qZA(),n._uU(709,"\n        "),n.TgZ(710,"option",238),n._uU(711,"Turks and Caicos Islands"),n.qZA(),n._uU(712,"\n        "),n.TgZ(713,"option",239),n._uU(714,"Tuvalu"),n.qZA(),n._uU(715,"\n        "),n.TgZ(716,"option",240),n._uU(717,"Uganda"),n.qZA(),n._uU(718,"\n        "),n.TgZ(719,"option",241),n._uU(720,"Ukraine"),n.qZA(),n._uU(721,"\n        "),n.TgZ(722,"option",242),n._uU(723,"United Arab Emirates"),n.qZA(),n._uU(724,"\n        "),n.TgZ(725,"option",243),n._uU(726,"United States Minor Outlying Islands"),n.qZA(),n._uU(727,"\n        "),n.TgZ(728,"option",244),n._uU(729,"Uruguay"),n.qZA(),n._uU(730,"\n        "),n.TgZ(731,"option",245),n._uU(732,"Uzbekistan"),n.qZA(),n._uU(733,"\n        "),n.TgZ(734,"option",246),n._uU(735,"Vanuatu"),n.qZA(),n._uU(736,"\n        "),n.TgZ(737,"option",247),n._uU(738,"Venezuela, Bolivarian Republic of"),n.qZA(),n._uU(739,"\n        "),n.TgZ(740,"option",248),n._uU(741,"Viet Nam"),n.qZA(),n._uU(742,"\n        "),n.TgZ(743,"option",249),n._uU(744,"Virgin Islands, British"),n.qZA(),n._uU(745,"\n        "),n.TgZ(746,"option",250),n._uU(747,"Virgin Islands, U.S."),n.qZA(),n._uU(748,"\n        "),n.TgZ(749,"option",251),n._uU(750,"Wallis and Futuna"),n.qZA(),n._uU(751,"\n        "),n.TgZ(752,"option",252),n._uU(753,"Western Sahara"),n.qZA(),n._uU(754,"\n        "),n.TgZ(755,"option",253),n._uU(756,"Yemen"),n.qZA(),n._uU(757,"\n        "),n.TgZ(758,"option",254),n._uU(759,"Zambia"),n.qZA(),n._uU(760,"\n        "),n.TgZ(761,"option",255),n._uU(762,"Zimbabwe"),n.qZA(),n._uU(763,"\n      "),n.qZA(),n._uU(764,"\n    "),n.qZA(),n._uU(765,"\n  "),n.qZA(),n._uU(766,"\n  "),n.TgZ(767,"div",1),n._uU(768,"\n    "),n.TgZ(769,"div",2),n._uU(770,"\n      "),n.TgZ(771,"label",256),n._uU(772),n.ALo(773,"i18n"),n.qZA(),n._uU(774,"\n      "),n.TgZ(775,"input",257),n.NdJ("ngModelChange",(function(e){return t.taxInfo.postalCode=e})),n.qZA(),n._uU(776,"\n    "),n.qZA(),n._uU(777,"\n  "),n.qZA(),n._uU(778,"\n  "),n.YNc(779,f,11,4,"div",258),n._uU(780,"\n"),n.qZA(),n._uU(781,"\n"),n.YNc(782,m,14,5,"div",259),n._uU(783,"\n"),n.YNc(784,v,50,16,"div",259),n._uU(785,"\n")}2&e&&(n.xp6(2),n.Q6J("ngClass",t.trialFlow?"col-7":"col-6"),n.xp6(5),n.Oqu(n.lcZ(8,10,"country")),n.xp6(3),n.Q6J("ngModel",t.taxInfo.country),n.xp6(757),n.Q6J("ngClass",t.trialFlow?"col-5":"col-3"),n.xp6(5),n.Oqu(n.lcZ(773,12,"zipPostalCode")),n.xp6(3),n.Q6J("ngModel",t.taxInfo.postalCode)("required","US"===t.taxInfo.country),n.xp6(4),n.Q6J("ngIf",t.showTaxIdCheckbox),n.xp6(3),n.Q6J("ngIf",t.showTaxIdFields),n.xp6(2),n.Q6J("ngIf",t.showTaxIdFields))},dependencies:[r.m,d.mk,d.O5,p.YN,p.Kr,p.Fj,p.Wl,p.EJ,p.JJ,p.Q7,p.On,h.C],encapsulation:2})},23306:(e,t,i)=>{"use strict";i.d(t,{o:()=>h});var n=i(54019),s=i(19887),o=i(30359),r=i(68362),a=i(85762),l=i(8111),c=i(99721),u=i(78627),d=i(58172),p=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class h{constructor(e,t,i,s,o){this.router=e,this.platformUtilService=t,this.i18nService=i,this.route=s,this.stateService=o,this.loading=!0,this.authed=!1,this.requiredParameters=[],this.failedShortMessage="inviteAcceptFailedShort",this.failedMessage="inviteAcceptFailed",this.destroy$=new n.x}ngOnInit(){this.route.queryParams.pipe((0,s.P)(),(0,o.w)((e=>p(this,void 0,void 0,(function*(){let t=this.requiredParameters.some((t=>null==(null==e?void 0:e[t])||""===e[t])),i=null;if(!t)if(this.authed=yield this.stateService.getIsAuthenticated(),this.email=e.email,this.authed)try{yield this.authedHandler(e)}catch(n){t=!0,i=n.message}else yield this.unauthedHandler(e);if(t){const e=null!=i?this.i18nService.t(this.failedShortMessage,i):this.i18nService.t(this.failedMessage);this.platformUtilService.showToast("error",null,e,{timeout:1e4}),this.router.navigate(["/"])}this.loading=!1})))),(0,r.R)(this.destroy$)).subscribe()}}h.ɵfac=function(e){return new(e||h)(a.Y36(l.F0),a.Y36(c.P),a.Y36(u.D),a.Y36(l.gz),a.Y36(d.b))},h.ɵdir=a.lG2({type:h})},782:(e,t,i)=>{"use strict";i.d(t,{D:()=>d});var n=i(54019),s=i(71146),o=i(85762),r=i(44647),a=i(2051),l=i(14970),c=i(28508),u=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class d{constructor(e){this.avatarService=e,this.border=!1,this.size="default",this.destroy$=new n.x,this.color$=this.avatarService.avatarColor$,this.text&&(this.text=this.text.toUpperCase())}ngOnDestroy(){return u(this,void 0,void 0,(function*(){this.destroy$.next(),this.destroy$.complete()}))}}d.ɵfac=function(e){return new(e||d)(o.Y36(r.o))},d.ɵcmp=o.Xpm({type:d,selectors:[["dynamic-avatar"]],inputs:{border:"border",id:"id",text:"text",title:"title",size:"size"},standalone:!0,features:[o.jDz],decls:6,vars:9,consts:[[3,"title"],["appStopClick","",3,"text","size","color","border","id","title"]],template:function(e,t){1&e&&(o.TgZ(0,"span",0),o._uU(1,"\n    "),o.TgZ(2,"bit-avatar",1),o.ALo(3,"async"),o._uU(4,"\n    "),o.qZA(),o._uU(5,"\n  "),o.qZA()),2&e&&(o.Q6J("title",t.title),o.xp6(2),o.Q6J("text",t.text)("size",t.size)("color",o.lcZ(3,7,t.color$))("border",t.border)("id",t.id)("title",t.title))},dependencies:[s.m,a.O,l.A,c.Ov],encapsulation:2})},59784:(e,t,i)=>{"use strict";i.d(t,{I:()=>o});var n=i(71146),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.m]})},6841:(e,t,i)=>{"use strict";i.d(t,{IR:()=>Yg,PO:()=>xg,cw:()=>Ig.c,b2:()=>Dg});var n=i(28508),s=i(85762);var o=i(44609),r=i(54019),a=i(78243),l=i(55602),c=i(98438),u=i(87483),d=i(54538),p=i(46226),h=i(51430),g=i(7203),f=i(52297),m=i(97360),v=i(58691),y=i(5351);class w{}class b extends w{}var U,_,A,Z,x,S,T=i(1113),C=i(47244),O=i(50137),k=i(83924),P=i(31361),q=i(5959),I=i(58043);class M extends I.c{constructor(e){super(e),this.apiKey=this.getResponseProperty("ApiKey"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}!function(e){e[e.None=0]="None",e[e.OpenIdConnect=1]="OpenIdConnect",e[e.Saml2=2]="Saml2"}(U||(U={})),function(e){e[e.MasterPassword=0]="MasterPassword",e[e.KeyConnector=1]="KeyConnector",e[e.TrustedDeviceEncryption=2]="TrustedDeviceEncryption"}(_||(_={})),function(e){e[e.RedirectGet=0]="RedirectGet",e[e.FormPost=1]="FormPost"}(A||(A={})),function(e){e[e.HttpRedirect=1]="HttpRedirect",e[e.HttpPost=2]="HttpPost"}(Z||(Z={})),function(e){e[e.NotConfigured=0]="NotConfigured",e[e.Unspecified=1]="Unspecified",e[e.EmailAddress=2]="EmailAddress",e[e.X509SubjectName=3]="X509SubjectName",e[e.WindowsDomainQualifiedName=4]="WindowsDomainQualifiedName",e[e.KerberosPrincipalName=5]="KerberosPrincipalName",e[e.EntityIdentifier=6]="EntityIdentifier",e[e.Persistent=7]="Persistent",e[e.Transient=8]="Transient"}(x||(x={})),function(e){e[e.IfIdpWantAuthnRequestsSigned=0]="IfIdpWantAuthnRequestsSigned",e[e.Always=1]="Always",e[e.Never=3]="Never"}(S||(S={}));class N extends I.c{static fromView(e,t=new N){return t.configType=e.configType,t.memberDecryptionType=e.memberDecryptionType,t.keyConnectorUrl=e.keyConnectorUrl,t.configType===U.OpenIdConnect?(t.authority=e.openId.authority,t.clientId=e.openId.clientId,t.clientSecret=e.openId.clientSecret,t.metadataAddress=e.openId.metadataAddress,t.redirectBehavior=e.openId.redirectBehavior,t.getClaimsFromUserInfoEndpoint=e.openId.getClaimsFromUserInfoEndpoint,t.additionalScopes=e.openId.additionalScopes,t.additionalUserIdClaimTypes=e.openId.additionalUserIdClaimTypes,t.additionalEmailClaimTypes=e.openId.additionalEmailClaimTypes,t.additionalNameClaimTypes=e.openId.additionalNameClaimTypes,t.acrValues=e.openId.acrValues,t.expectedReturnAcrValue=e.openId.expectedReturnAcrValue):t.configType===U.Saml2&&(t.spUniqueEntityId=e.saml.spUniqueEntityId,t.spNameIdFormat=e.saml.spNameIdFormat,t.spOutboundSigningAlgorithm=e.saml.spOutboundSigningAlgorithm,t.spSigningBehavior=e.saml.spSigningBehavior,t.spMinIncomingSigningAlgorithm=e.saml.spMinIncomingSigningAlgorithm,t.spWantAssertionsSigned=e.saml.spWantAssertionsSigned,t.spValidateCertificates=e.saml.spValidateCertificates,t.idpEntityId=e.saml.idpEntityId,t.idpBindingType=e.saml.idpBindingType,t.idpSingleSignOnServiceUrl=e.saml.idpSingleSignOnServiceUrl,t.idpSingleLogoutServiceUrl=e.saml.idpSingleLogoutServiceUrl,t.idpX509PublicCert=e.saml.idpX509PublicCert,t.idpOutboundSigningAlgorithm=e.saml.idpOutboundSigningAlgorithm,t.idpAllowUnsolicitedAuthnResponse=e.saml.idpAllowUnsolicitedAuthnResponse,t.idpWantAuthnRequestsSigned=e.saml.idpWantAuthnRequestsSigned,t.idpDisableOutboundLogoutRequests=!e.saml.idpAllowOutboundLogoutRequests),t}constructor(e=null){super(e),null!=e&&(this.configType=this.getResponseProperty("ConfigType"),this.memberDecryptionType=this.getResponseProperty("MemberDecryptionType"),this.keyConnectorUrl=this.getResponseProperty("KeyConnectorUrl"),this.authority=this.getResponseProperty("Authority"),this.clientId=this.getResponseProperty("ClientId"),this.clientSecret=this.getResponseProperty("ClientSecret"),this.metadataAddress=this.getResponseProperty("MetadataAddress"),this.redirectBehavior=this.getResponseProperty("RedirectBehavior"),this.getClaimsFromUserInfoEndpoint=this.getResponseProperty("GetClaimsFromUserInfoEndpoint"),this.additionalScopes=this.getResponseProperty("AdditionalScopes"),this.additionalUserIdClaimTypes=this.getResponseProperty("AdditionalUserIdClaimTypes"),this.additionalEmailClaimTypes=this.getResponseProperty("AdditionalEmailClaimTypes"),this.additionalNameClaimTypes=this.getResponseProperty("AdditionalNameClaimTypes"),this.acrValues=this.getResponseProperty("AcrValues"),this.expectedReturnAcrValue=this.getResponseProperty("ExpectedReturnAcrValue"),this.spUniqueEntityId=this.getResponseProperty("SpUniqueEntityId"),this.spNameIdFormat=this.getResponseProperty("SpNameIdFormat"),this.spOutboundSigningAlgorithm=this.getResponseProperty("SpOutboundSigningAlgorithm"),this.spSigningBehavior=this.getResponseProperty("SpSigningBehavior"),this.spMinIncomingSigningAlgorithm=this.getResponseProperty("SpMinIncomingSigningAlgorithm"),this.spWantAssertionsSigned=this.getResponseProperty("SpWantAssertionsSigned"),this.spValidateCertificates=this.getResponseProperty("SpValidateCertificates"),this.idpEntityId=this.getResponseProperty("IdpEntityId"),this.idpBindingType=this.getResponseProperty("IdpBindingType"),this.idpSingleSignOnServiceUrl=this.getResponseProperty("IdpSingleSignOnServiceUrl"),this.idpSingleLogoutServiceUrl=this.getResponseProperty("IdpSingleLogoutServiceUrl"),this.idpX509PublicCert=this.getResponseProperty("IdpX509PublicCert"),this.idpOutboundSigningAlgorithm=this.getResponseProperty("IdpOutboundSigningAlgorithm"),this.idpAllowUnsolicitedAuthnResponse=this.getResponseProperty("IdpAllowUnsolicitedAuthnResponse"),this.idpDisableOutboundLogoutRequests=this.getResponseProperty("IdpDisableOutboundLogoutRequests"),this.idpWantAuthnRequestsSigned=this.getResponseProperty("IdpWantAuthnRequestsSigned"))}}class L extends I.c{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.identifier=this.getResponseProperty("Identifier"),this.data=null!=this.getResponseProperty("Data")?new N(this.getResponseProperty("Data")):null,this.urls=new D(this.getResponseProperty("Urls"))}}class D extends I.c{constructor(e){super(e),this.callbackPath=this.getResponseProperty("CallbackPath"),this.signedOutCallbackPath=this.getResponseProperty("SignedOutCallbackPath"),this.spEntityId=this.getResponseProperty("SpEntityId"),this.spEntityIdStatic=this.getResponseProperty("SpEntityIdStatic"),this.spMetadataUrl=this.getResponseProperty("SpMetadataUrl"),this.spAcsUrl=this.getResponseProperty("SpAcsUrl")}}class E extends I.c{constructor(e){super(e),this.invoices=[],this.transactions=[],this.balance=this.getResponseProperty("Balance");const t=this.getResponseProperty("PaymentSource"),i=this.getResponseProperty("Transactions"),n=this.getResponseProperty("Invoices");this.paymentSource=null==t?null:new F(t),null!=i&&(this.transactions=i.map((e=>new J(e)))),null!=n&&(this.invoices=n.map((e=>new R(e))))}get hasNoHistory(){return 0==this.invoices.length&&0==this.transactions.length}}class F extends I.c{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.cardBrand=this.getResponseProperty("CardBrand"),this.description=this.getResponseProperty("Description"),this.needsVerification=this.getResponseProperty("NeedsVerification")}}class R extends I.c{constructor(e){super(e),this.url=this.getResponseProperty("Url"),this.pdfUrl=this.getResponseProperty("PdfUrl"),this.number=this.getResponseProperty("Number"),this.paid=this.getResponseProperty("Paid"),this.date=this.getResponseProperty("Date"),this.amount=this.getResponseProperty("Amount")}}class J extends I.c{constructor(e){super(e),this.createdDate=this.getResponseProperty("CreatedDate"),this.amount=this.getResponseProperty("Amount"),this.refunded=this.getResponseProperty("Refunded"),this.partiallyRefunded=this.getResponseProperty("PartiallyRefunded"),this.refundedAmount=this.getResponseProperty("RefundedAmount"),this.type=this.getResponseProperty("Type"),this.paymentMethodType=this.getResponseProperty("PaymentMethodType"),this.details=this.getResponseProperty("Details")}}class z extends I.c{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.product=this.getResponseProperty("Product"),this.name=this.getResponseProperty("Name"),this.isAnnual=this.getResponseProperty("IsAnnual"),this.nameLocalizationKey=this.getResponseProperty("NameLocalizationKey"),this.descriptionLocalizationKey=this.getResponseProperty("DescriptionLocalizationKey"),this.canBeUsedByBusiness=this.getResponseProperty("CanBeUsedByBusiness"),this.trialPeriodDays=this.getResponseProperty("TrialPeriodDays"),this.hasSelfHost=this.getResponseProperty("HasSelfHost"),this.hasPolicies=this.getResponseProperty("HasPolicies"),this.hasGroups=this.getResponseProperty("HasGroups"),this.hasDirectory=this.getResponseProperty("HasDirectory"),this.hasEvents=this.getResponseProperty("HasEvents"),this.hasTotp=this.getResponseProperty("HasTotp"),this.has2fa=this.getResponseProperty("Has2fa"),this.hasApi=this.getResponseProperty("HasApi"),this.hasSso=this.getResponseProperty("HasSso"),this.hasResetPassword=this.getResponseProperty("HasResetPassword"),this.usersGetPremium=this.getResponseProperty("UsersGetPremium"),this.upgradeSortOrder=this.getResponseProperty("UpgradeSortOrder"),this.displaySortOrder=this.getResponseProperty("DisplaySortOrder"),this.legacyYear=this.getResponseProperty("LegacyYear"),this.disabled=this.getResponseProperty("Disabled");const t=this.getResponseProperty("PasswordManager"),i=this.getResponseProperty("SecretsManager");this.PasswordManager=null==t?null:new K(t),this.SecretsManager=null==i?null:new Y(i)}}class Y extends I.c{constructor(e){super(e),this.stripeSeatPlanId=this.getResponseProperty("StripeSeatPlanId"),this.baseSeats=this.getResponseProperty("BaseSeats"),this.basePrice=this.getResponseProperty("BasePrice"),this.seatPrice=this.getResponseProperty("SeatPrice"),this.hasAdditionalSeatsOption=this.getResponseProperty("HasAdditionalSeatsOption"),this.maxAdditionalSeats=this.getResponseProperty("MaxAdditionalSeats"),this.maxSeats=this.getResponseProperty("MaxSeats"),this.stripeServiceAccountPlanId=this.getResponseProperty("StripeServiceAccountPlanId"),this.additionalPricePerServiceAccount=this.getResponseProperty("AdditionalPricePerServiceAccount"),this.baseServiceAccount=this.getResponseProperty("BaseServiceAccount"),this.maxServiceAccount=this.getResponseProperty("MaxServiceAccount"),this.hasAdditionalServiceAccountOption=this.getResponseProperty("HasAdditionalServiceAccountOption"),this.maxAdditionalServiceAccounts=this.getResponseProperty("MaxAdditionalServiceAccounts"),this.maxProjects=this.getResponseProperty("MaxProjects")}}class K extends I.c{constructor(e){super(e),this.stripePlanId=this.getResponseProperty("StripePlanId"),this.stripeSeatPlanId=this.getResponseProperty("StripeSeatPlanId"),this.stripeStoragePlanId=this.getResponseProperty("StripeStoragePlanId"),this.stripePremiumAccessPlanId=this.getResponseProperty("StripePremiumAccessPlanId"),this.basePrice=this.getResponseProperty("BasePrice"),this.seatPrice=this.getResponseProperty("SeatPrice"),this.baseSeats=this.getResponseProperty("BaseSeats"),this.maxAdditionalSeats=this.getResponseProperty("MaxAdditionalSeats"),this.premiumAccessOptionPrice=this.getResponseProperty("PremiumAccessOptionPrice"),this.maxSeats=this.getResponseProperty("MaxSeats"),this.additionalStoragePricePerGb=this.getResponseProperty("AdditionalStoragePricePerGb"),this.hasAdditionalSeatsOption=this.getResponseProperty("HasAdditionalSeatsOption"),this.baseStorageGb=this.getResponseProperty("BaseStorageGb"),this.maxCollections=this.getResponseProperty("MaxCollections"),this.hasAdditionalStorageOption=this.getResponseProperty("HasAdditionalStorageOption"),this.maxAdditionalStorage=this.getResponseProperty("MaxAdditionalStorage"),this.hasPremiumAccessOption=this.getResponseProperty("HasPremiumAccessOption")}}class B extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.businessName=this.getResponseProperty("BusinessName"),this.businessAddress1=this.getResponseProperty("BusinessAddress1"),this.businessAddress2=this.getResponseProperty("BusinessAddress2"),this.businessAddress3=this.getResponseProperty("BusinessAddress3"),this.businessCountry=this.getResponseProperty("BusinessCountry"),this.businessTaxNumber=this.getResponseProperty("BusinessTaxNumber"),this.billingEmail=this.getResponseProperty("BillingEmail");const t=this.getResponseProperty("Plan");this.plan=null==t?null:new z(t),this.planType=this.getResponseProperty("PlanType"),this.seats=this.getResponseProperty("Seats"),this.maxAutoscaleSeats=this.getResponseProperty("MaxAutoscaleSeats"),this.maxCollections=this.getResponseProperty("MaxCollections"),this.maxStorageGb=this.getResponseProperty("MaxStorageGb"),this.useGroups=this.getResponseProperty("UseGroups"),this.useDirectory=this.getResponseProperty("UseDirectory"),this.useEvents=this.getResponseProperty("UseEvents"),this.useTotp=this.getResponseProperty("UseTotp"),this.use2fa=this.getResponseProperty("Use2fa"),this.useApi=this.getResponseProperty("UseApi"),this.useResetPassword=this.getResponseProperty("UseResetPassword"),this.useSecretsManager=this.getResponseProperty("UseSecretsManager"),this.hasPublicAndPrivateKeys=this.getResponseProperty("HasPublicAndPrivateKeys"),this.usePasswordManager=this.getResponseProperty("UsePasswordManager"),this.smSeats=this.getResponseProperty("SmSeats"),this.smServiceAccounts=this.getResponseProperty("SmServiceAccounts"),this.maxAutoscaleSmSeats=this.getResponseProperty("MaxAutoscaleSmSeats"),this.maxAutoscaleSmServiceAccounts=this.getResponseProperty("MaxAutoscaleSmServiceAccounts"),this.limitCollectionCreationDeletion=this.getResponseProperty("LimitCollectionCreationDeletion"),this.allowAdminAccessToAllCollectionItems=this.getResponseProperty("AllowAdminAccessToAllCollectionItems"),this.flexibleCollections=this.getResponseProperty("FlexibleCollections")}}class Q extends I.c{constructor(e){super(e),this.storageName=this.getResponseProperty("StorageName"),this.storageGb=this.getResponseProperty("StorageGb"),this.maxStorageGb=this.getResponseProperty("MaxStorageGb"),this.license=this.getResponseProperty("License"),this.expiration=this.getResponseProperty("Expiration");const t=this.getResponseProperty("Subscription"),i=this.getResponseProperty("UpcomingInvoice");this.subscription=null==t?null:new G(t),this.upcomingInvoice=null==i?null:new V(i)}}class G extends I.c{constructor(e){super(e),this.items=[],this.trialStartDate=this.getResponseProperty("TrialStartDate"),this.trialEndDate=this.getResponseProperty("TrialEndDate"),this.periodStartDate=this.getResponseProperty("PeriodStartDate"),this.periodEndDate=this.getResponseProperty("PeriodEndDate"),this.cancelledDate=this.getResponseProperty("CancelledDate"),this.cancelAtEndDate=this.getResponseProperty("CancelAtEndDate"),this.status=this.getResponseProperty("Status"),this.cancelled=this.getResponseProperty("Cancelled");const t=this.getResponseProperty("Items");null!=t&&(this.items=t.map((e=>new j(e)))),this.collectionMethod=this.getResponseProperty("CollectionMethod"),this.suspensionDate=this.getResponseProperty("SuspensionDate"),this.unpaidPeriodEndDate=this.getResponseProperty("unpaidPeriodEndDate"),this.gracePeriod=this.getResponseProperty("GracePeriod")}}class j extends I.c{constructor(e){super(e),this.productId=this.getResponseProperty("ProductId"),this.name=this.getResponseProperty("Name"),this.amount=this.getResponseProperty("Amount"),this.quantity=this.getResponseProperty("Quantity"),this.interval=this.getResponseProperty("Interval"),this.sponsoredSubscriptionItem=this.getResponseProperty("SponsoredSubscriptionItem"),this.addonSubscriptionItem=this.getResponseProperty("AddonSubscriptionItem")}}class V extends I.c{constructor(e){super(e),this.date=this.getResponseProperty("Date"),this.amount=this.getResponseProperty("Amount")}}class $ extends B{constructor(e){super(e),this.storageName=this.getResponseProperty("StorageName"),this.storageGb=this.getResponseProperty("StorageGb");const t=this.getResponseProperty("Subscription");this.subscription=null==t?null:new G(t);const i=this.getResponseProperty("UpcomingInvoice");this.upcomingInvoice=null==i?null:new V(i);const n=this.getResponseProperty("CustomerDiscount");this.customerDiscount=null==n?null:new H(n),this.expiration=this.getResponseProperty("Expiration"),this.expirationWithoutGracePeriod=this.getResponseProperty("ExpirationWithoutGracePeriod")}}class H extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.active=this.getResponseProperty("Active"),this.percentOff=this.getResponseProperty("PercentOff"),this.appliesTo=this.getResponseProperty("AppliesTo")}}var W=i(20698);class X extends I.c{constructor(e){var t,i,n,s;super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.usePolicies=this.getResponseProperty("UsePolicies"),this.useGroups=this.getResponseProperty("UseGroups"),this.useDirectory=this.getResponseProperty("UseDirectory"),this.useEvents=this.getResponseProperty("UseEvents"),this.useTotp=this.getResponseProperty("UseTotp"),this.use2fa=this.getResponseProperty("Use2fa"),this.useApi=this.getResponseProperty("UseApi"),this.useSso=this.getResponseProperty("UseSso"),this.useKeyConnector=null!==(t=this.getResponseProperty("UseKeyConnector"))&&void 0!==t&&t,this.useScim=null!==(i=this.getResponseProperty("UseScim"))&&void 0!==i&&i,this.useCustomPermissions=null!==(n=this.getResponseProperty("UseCustomPermissions"))&&void 0!==n&&n,this.useResetPassword=this.getResponseProperty("UseResetPassword"),this.useSecretsManager=this.getResponseProperty("UseSecretsManager"),this.usePasswordManager=this.getResponseProperty("UsePasswordManager"),this.useActivateAutofillPolicy=this.getResponseProperty("UseActivateAutofillPolicy"),this.selfHost=this.getResponseProperty("SelfHost"),this.usersGetPremium=this.getResponseProperty("UsersGetPremium"),this.seats=this.getResponseProperty("Seats"),this.maxCollections=this.getResponseProperty("MaxCollections"),this.maxStorageGb=this.getResponseProperty("MaxStorageGb"),this.key=this.getResponseProperty("Key"),this.hasPublicAndPrivateKeys=this.getResponseProperty("HasPublicAndPrivateKeys"),this.status=this.getResponseProperty("Status"),this.type=this.getResponseProperty("Type"),this.enabled=this.getResponseProperty("Enabled"),this.ssoBound=this.getResponseProperty("SsoBound"),this.identifier=this.getResponseProperty("Identifier"),this.permissions=new W.Q(this.getResponseProperty("permissions")),this.resetPasswordEnrolled=this.getResponseProperty("ResetPasswordEnrolled"),this.userId=this.getResponseProperty("UserId"),this.providerId=this.getResponseProperty("ProviderId"),this.providerName=this.getResponseProperty("ProviderName"),this.providerType=this.getResponseProperty("ProviderType"),this.familySponsorshipFriendlyName=this.getResponseProperty("FamilySponsorshipFriendlyName"),this.familySponsorshipAvailable=this.getResponseProperty("FamilySponsorshipAvailable"),this.planProductType=this.getResponseProperty("PlanProductType"),this.keyConnectorEnabled=null!==(s=this.getResponseProperty("KeyConnectorEnabled"))&&void 0!==s&&s,this.keyConnectorUrl=this.getResponseProperty("KeyConnectorUrl");const o=this.getResponseProperty("FamilySponsorshipLastSyncDate");o&&(this.familySponsorshipLastSyncDate=new Date(o));const r=this.getResponseProperty("FamilySponsorshipValidUntil");r&&(this.familySponsorshipValidUntil=new Date(r)),this.familySponsorshipToDelete=this.getResponseProperty("FamilySponsorshipToDelete"),this.accessSecretsManager=this.getResponseProperty("AccessSecretsManager"),this.limitCollectionCreationDeletion=this.getResponseProperty("LimitCollectionCreationDeletion"),this.allowAdminAccessToAllCollectionItems=this.getResponseProperty("AllowAdminAccessToAllCollectionItems"),this.flexibleCollections=this.getResponseProperty("FlexibleCollections")}}class ee extends X{constructor(e){super(e),this.keyConnectorEnabled=!1}}class te extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.key=this.getResponseProperty("Key"),this.status=this.getResponseProperty("Status"),this.type=this.getResponseProperty("Type"),this.enabled=this.getResponseProperty("Enabled"),this.permissions=new W.Q(this.getResponseProperty("permissions")),this.userId=this.getResponseProperty("UserId"),this.useEvents=this.getResponseProperty("UseEvents"),this.providerStatus=this.getResponseProperty("ProviderStatus")}}class ie extends I.c{constructor(e){var t,i;super(e),this.organizations=[],this.providers=[],this.providerOrganizations=[],this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email"),this.emailVerified=this.getResponseProperty("EmailVerified"),this.masterPasswordHint=this.getResponseProperty("MasterPasswordHint"),this.premiumPersonally=this.getResponseProperty("Premium"),this.premiumFromOrganization=this.getResponseProperty("PremiumFromOrganization"),this.culture=this.getResponseProperty("Culture"),this.twoFactorEnabled=this.getResponseProperty("TwoFactorEnabled"),this.key=this.getResponseProperty("Key"),this.avatarColor=this.getResponseProperty("AvatarColor"),this.creationDate=this.getResponseProperty("CreationDate"),this.privateKey=this.getResponseProperty("PrivateKey"),this.securityStamp=this.getResponseProperty("SecurityStamp"),this.forcePasswordReset=null!==(t=this.getResponseProperty("ForcePasswordReset"))&&void 0!==t&&t,this.usesKeyConnector=null!==(i=this.getResponseProperty("UsesKeyConnector"))&&void 0!==i&&i;const n=this.getResponseProperty("Organizations");null!=n&&(this.organizations=n.map((e=>new X(e))));const s=this.getResponseProperty("Providers");null!=s&&(this.providers=s.map((e=>new te(e))));const o=this.getResponseProperty("ProviderOrganizations");null!=o&&(this.providerOrganizations=o.map((e=>new ee(e))))}}class ne extends I.c{constructor(e){super(e);const t=this.getResponseProperty("UserProfile");null!=t&&(this.userProfile=new ie(t)),this.paymentIntentClientSecret=this.getResponseProperty("PaymentIntentClientSecret"),this.success=this.getResponseProperty("Success")}}class se extends I.c{constructor(e){super(e),this.taxId=this.getResponseProperty("TaxIdNumber"),this.taxIdType=this.getResponseProperty("TaxIdType"),this.line1=this.getResponseProperty("Line1"),this.line2=this.getResponseProperty("Line2"),this.city=this.getResponseProperty("City"),this.state=this.getResponseProperty("State"),this.postalCode=this.getResponseProperty("PostalCode"),this.country=this.getResponseProperty("Country")}}var oe=i(42844);class re extends I.c{constructor(e){super(e),this.keyType=this.getResponseProperty("KeyType")}}class ae extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.resetPasswordEnabled=this.getResponseProperty("ResetPasswordEnabled")}}class le extends I.c{constructor(e){super(e),this.privateKey=this.getResponseProperty("PrivateKey"),this.publicKey=this.getResponseProperty("PublicKey")}}class ce extends le{constructor(e){super(e)}}var ue=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var de=i(92786),pe=i(99042),he=i(36957);class ge{constructor(e,t){null!=e&&(this.id=e.id,this.name=e.name,this.status=e.status,this.type=e.type,this.enabled=e.enabled,this.usePolicies=e.usePolicies,this.useGroups=e.useGroups,this.useDirectory=e.useDirectory,this.useEvents=e.useEvents,this.useTotp=e.useTotp,this.use2fa=e.use2fa,this.useApi=e.useApi,this.useSso=e.useSso,this.useKeyConnector=e.useKeyConnector,this.useScim=e.useScim,this.useCustomPermissions=e.useCustomPermissions,this.useResetPassword=e.useResetPassword,this.useSecretsManager=e.useSecretsManager,this.usePasswordManager=e.usePasswordManager,this.useActivateAutofillPolicy=e.useActivateAutofillPolicy,this.selfHost=e.selfHost,this.usersGetPremium=e.usersGetPremium,this.seats=e.seats,this.maxCollections=e.maxCollections,this.maxStorageGb=e.maxStorageGb,this.ssoBound=e.ssoBound,this.identifier=e.identifier,this.permissions=e.permissions,this.resetPasswordEnrolled=e.resetPasswordEnrolled,this.userId=e.userId,this.hasPublicAndPrivateKeys=e.hasPublicAndPrivateKeys,this.providerId=e.providerId,this.providerName=e.providerName,this.providerType=e.providerType,this.familySponsorshipFriendlyName=e.familySponsorshipFriendlyName,this.familySponsorshipAvailable=e.familySponsorshipAvailable,this.planProductType=e.planProductType,this.keyConnectorEnabled=e.keyConnectorEnabled,this.keyConnectorUrl=e.keyConnectorUrl,this.familySponsorshipLastSyncDate=e.familySponsorshipLastSyncDate,this.familySponsorshipValidUntil=e.familySponsorshipValidUntil,this.familySponsorshipToDelete=e.familySponsorshipToDelete,this.accessSecretsManager=e.accessSecretsManager,this.limitCollectionCreationDeletion=e.limitCollectionCreationDeletion,this.allowAdminAccessToAllCollectionItems=e.allowAdminAccessToAllCollectionItems,this.flexibleCollections=e.flexibleCollections,this.isMember=t.isMember,this.isProviderUser=t.isProviderUser)}static fromJSON(e){return Object.assign(new ge,e,{familySponsorshipLastSyncDate:null!=e.familySponsorshipLastSyncDate?new Date(e.familySponsorshipLastSyncDate):e.familySponsorshipLastSyncDate,familySponsorshipValidUntil:null!=e.familySponsorshipValidUntil?new Date(e.familySponsorshipValidUntil):e.familySponsorshipValidUntil})}}var fe=i(27263),me=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ve=he.fX.record(he.Dk,"organizations",{deserializer:e=>ge.fromJSON(e),clearOn:["logout"]});function ye(){return(0,de.U)((e=>e.length>0))}function we(e){return(0,de.U)((t=>null==t?void 0:t.find((t=>t.id===e))))}class be extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("id"),this.organizationIdentifier=this.getResponseProperty("organizationIdentifier"),this.ssoAvailable=this.getResponseProperty("ssoAvailable"),this.domainName=this.getResponseProperty("domainName"),this.verifiedDate=this.getResponseProperty("verifiedDate")}}class Ue extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("id"),this.organizationId=this.getResponseProperty("organizationId"),this.txt=this.getResponseProperty("txt"),this.domainName=this.getResponseProperty("domainName"),this.creationDate=this.getResponseProperty("creationDate"),this.nextRunDate=this.getResponseProperty("nextRunDate"),this.jobRunCount=this.getResponseProperty("jobRunCount"),this.verifiedDate=this.getResponseProperty("verifiedDate"),this.lastCheckedDate=this.getResponseProperty("lastCheckedDate")}}class _e{constructor(e){this.email=e}}var Ae=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Ze=i(59554);var xe=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Se=(Te="autoConfirmFingerPrints",new he.fX(he.yL,Te,{deserializer:e=>e,clearOn:["logout"]}));var Te;var Ce=i(88652);class Oe extends I.c{constructor(e){super(e),this.collections=[],this.groups=[],this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.type=this.getResponseProperty("Type"),this.status=this.getResponseProperty("Status"),this.permissions=new W.Q(this.getResponseProperty("Permissions")),this.externalId=this.getResponseProperty("ExternalId"),this.accessAll=this.getResponseProperty("AccessAll"),this.accessSecretsManager=this.getResponseProperty("AccessSecretsManager"),this.resetPasswordEnrolled=this.getResponseProperty("ResetPasswordEnrolled"),this.hasMasterPassword=this.getResponseProperty("HasMasterPassword");const t=this.getResponseProperty("Collections");null!=t&&(this.collections=t.map((e=>new Ce.Y(e))));const i=this.getResponseProperty("Groups");null!=i&&(this.groups=i)}}class ke extends Oe{constructor(e){var t;super(e),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email"),this.avatarColor=this.getResponseProperty("AvatarColor"),this.twoFactorEnabled=this.getResponseProperty("TwoFactorEnabled"),this.usesKeyConnector=null!==(t=this.getResponseProperty("UsesKeyConnector"))&&void 0!==t&&t}}class Pe extends Oe{constructor(e){super(e)}}class qe extends I.c{constructor(e){super(e),this.kdf=this.getResponseProperty("Kdf"),this.kdfIterations=this.getResponseProperty("KdfIterations"),this.kdfMemory=this.getResponseProperty("KdfMemory"),this.kdfParallelism=this.getResponseProperty("KdfParallelism"),this.resetPasswordKey=this.getResponseProperty("ResetPasswordKey"),this.encryptedPrivateKey=this.getResponseProperty("EncryptedPrivateKey")}}class Ie extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.error=this.getResponseProperty("Error")}}class Me extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.key=this.getResponseProperty("Key")}}class Ne{constructor(e){this.ids=null==e?[]:e}}var Le=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var De=i(51303),Ee=i(25679),Fe=i(27646),Re=i(63700),Je=i(90692),ze=i(41489),Ye=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Ke=i(33031),Be=i(92716),Qe=i(92614),Ge=i(85623),je=i(40160);class Ve extends je.Z{constructor(){super(...arguments),this.autoEnrollEnabled=!1}}var $e=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const He=e=>Object.values(e||{}).map((e=>new Je.G(e))),We=he.fX.record(he.km,"policies",{deserializer:e=>e,clearOn:["logout"]});class Xe extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.businessName=this.getResponseProperty("BusinessName"),this.billingEmail=this.getResponseProperty("BillingEmail"),this.creationDate=this.getResponseProperty("CreationDate"),this.type=this.getResponseProperty("Type")}}var et=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var tt=i(2097),it=i(30359);class nt{constructor(e){null!=e&&(this.id=e.id,this.name=e.name,this.status=e.status,this.type=e.type,this.enabled=e.enabled,this.userId=e.userId,this.useEvents=e.useEvents,this.providerStatus=e.providerStatus)}get canAccess(){return!!this.isProviderAdmin||this.enabled&&this.status===Qe.a3.Confirmed}get canCreateOrganizations(){return this.enabled&&this.isProviderAdmin}get canManageUsers(){return this.isProviderAdmin}get canAccessEventLogs(){return this.isProviderAdmin}get isProviderAdmin(){return this.type===Qe.D2.ProviderAdmin}}var st=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ot=he.fX.record(he.NP,"providers",{deserializer:e=>e,clearOn:["logout"]});function rt(e){return(0,de.U)((t=>null==t?void 0:t.find((t=>t.id===e))))}var at=i(37408),lt=i(47724),ct=i(29491),ut=i(2184),dt=i(44647),pt=i(51651),ht=i(19326),gt=i(4423),ft=i(85420),mt=i(1008),vt=i(42842),yt=i(77685),wt=i(1153),bt=i(77097),Ut=i(14921);class _t{}var At=i(42304);class Zt{}var xt=i(77442),St=i(21452),Tt=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Ct=i(37260),Ot=i(72591),kt=i(84598),Pt=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const qt=he.vh.record(he.fK,"accounts",{deserializer:e=>e}),It=new he.vh(he.fK,"activeAccountId",{deserializer:e=>e}),Mt=he.vh.record(he.fK,"activity",{deserializer:e=>new Date(e)}),Nt={email:"",emailVerified:!1,name:void 0};var Lt=i(84002),Dt=i(63195),Et=i(30325);class Ft extends I.c{constructor(e){super(e),this.contextId=this.getResponseProperty("ContextId"),this.type=this.getResponseProperty("Type");const t=this.getResponseProperty("Payload");switch(this.type){case De.k$.SyncCipherCreate:case De.k$.SyncCipherDelete:case De.k$.SyncCipherUpdate:case De.k$.SyncLoginDelete:this.payload=new Rt(t);break;case De.k$.SyncFolderCreate:case De.k$.SyncFolderDelete:case De.k$.SyncFolderUpdate:this.payload=new Jt(t);break;case De.k$.SyncVault:case De.k$.SyncCiphers:case De.k$.SyncOrganizations:case De.k$.SyncOrgKeys:case De.k$.SyncSettings:case De.k$.LogOut:this.payload=new zt(t);break;case De.k$.SyncSendCreate:case De.k$.SyncSendUpdate:case De.k$.SyncSendDelete:this.payload=new Yt(t);break;case De.k$.AuthRequest:case De.k$.AuthRequestResponse:this.payload=new Kt(t)}}}class Rt extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.organizationId=this.getResponseProperty("OrganizationId"),this.collectionIds=this.getResponseProperty("CollectionIds"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}class Jt extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}class zt extends I.c{constructor(e){super(e),this.userId=this.getResponseProperty("UserId"),this.date=new Date(this.getResponseProperty("Date"))}}class Yt extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}class Kt extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId")}}var Bt=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Qt=i(67855),Gt=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class jt{constructor(e){this.avatarColor=e}}var Vt=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const $t=new he.fX(he.jK,"avatarColor",{deserializer:e=>e,clearOn:[]});var Ht=i(44879),Wt=i(55637),Xt=i(91667);class ei extends Xt.Y{}class ti{}var ii=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ni=new he.fX(he.d,"deviceKey",{deserializer:e=>Wt.N.fromJSON(e),clearOn:[]}),si=new he.fX(he.d,"shouldTrustDevice",{deserializer:e=>e,clearOn:[]});var oi=i(8241);class ri{constructor(e){Object.assign(this,e)}}class ai extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.name=this.getResponseProperty("Name"),this.identifier=this.getResponseProperty("Identifier"),this.type=this.getResponseProperty("Type"),this.creationDate=this.getResponseProperty("CreationDate"),this.revisionDate=this.getResponseProperty("RevisionDate")}}var li=i(70427);class ci extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("id"),this.name=this.getResponseProperty("name"),this.identifier=this.getResponseProperty("identifier"),this.type=this.getResponseProperty("type"),this.creationDate=new Date(this.getResponseProperty("creationDate")),e.encryptedUserKey&&(this.encryptedUserKey=new li._(this.getResponseProperty("encryptedUserKey"))),e.encryptedPublicKey&&(this.encryptedPublicKey=new li._(this.getResponseProperty("encryptedPublicKey")))}}class ui{constructor(e,t,i){this.encryptedUserKey=e,this.encryptedPublicKey=t,this.encryptedPrivateKey=i}}var di=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var pi=i(21032),hi=i(88160),gi=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const fi=new he.fX(he.l1,"kdfConfig",{deserializer:e=>null==e?null:e.kdfType===pi.G3.PBKDF2_SHA256?hi.S.fromJSON(e):hi.H.fromJSON(e),clearOn:["logout"]});var mi=i(98405);class vi{constructor(e){this.key=e}}class yi{constructor(e,t,i,n){this.key=e,this.kdf=t.kdfType,this.kdfIterations=t.iterations,t.kdfType===Ht.G3.Argon2id&&(this.kdfMemory=t.memory,this.kdfParallelism=t.parallelism),this.orgIdentifier=i,this.keys=n}}var wi=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const bi=new he.fX(he.YP,"usesKeyConnector",{deserializer:e=>e,clearOn:["logout"]}),Ui=new he.fX(he.YP,"convertAccountToKeyConnector",{deserializer:e=>e,clearOn:["logout"]});var _i=i(36788),Ai=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Zi=new he.fX(he.GB,"masterKey",{deserializer:e=>Wt.N.fromJSON(e),clearOn:["lock","logout"]}),xi=new he.fX(he.C7,"masterKeyHash",{deserializer:e=>e,clearOn:["logout"]}),Si=new he.fX(he.C7,"masterKeyEncryptedUserKey",{deserializer:e=>e,clearOn:["logout"]}),Ti=new he.fX(he.C7,"forceSetPasswordReason",{deserializer:e=>e,clearOn:["logout"]});var Ci=i(82558),Oi=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var ki=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Pi=new he.vh(he.Nz,"ssoCodeVerifier",{deserializer:e=>e}),qi=new he.vh(he.Nz,"ssoState",{deserializer:e=>e}),Ii=new he.fX(he.Nz,"organizationSsoIdentifier",{deserializer:e=>e,clearOn:["logout"]}),Mi=new he.vh(he.Nz,"organizationSsoIdentifier",{deserializer:e=>e}),Ni=new he.vh(he.Nz,"ssoEmail",{deserializer:e=>e});var Li=i(27059);const Di=new he.fX(he.wQ,"accessToken",{deserializer:e=>e,clearOn:[]}),Ei=new he.fX(he.jc,"accessToken",{deserializer:e=>e,clearOn:[]}),Fi=new he.fX(he.wQ,"refreshToken",{deserializer:e=>e,clearOn:[]}),Ri=new he.fX(he.jc,"refreshToken",{deserializer:e=>e,clearOn:[]}),Ji=he.vh.record(he.ix,"emailTwoFactorTokenRecord",{deserializer:e=>e}),zi=new he.fX(he.wQ,"apiKeyClientId",{deserializer:e=>e,clearOn:[]}),Yi=new he.fX(he.jc,"apiKeyClientId",{deserializer:e=>e,clearOn:[]}),Ki=new he.fX(he.wQ,"apiKeyClientSecret",{deserializer:e=>e,clearOn:[]}),Bi=new he.fX(he.jc,"apiKeyClientSecret",{deserializer:e=>e,clearOn:[]}),Qi=new he.fX(he.jc,"securityStamp",{deserializer:e=>e,clearOn:["logout"]});var Gi,ji=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e.Disk="disk",e.SecureStorage="secureStorage",e.Memory="memory"}(Gi||(Gi={}));var Vi=i(66990),$i=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Hi=i(34452),Wi=i(70138);class Xi{constructor(e){this.OTP=e}}var en=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var tn=i(16284),nn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var sn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var on=i(49831);class rn{constructor(e,t,i){this.token=e,this.deviceResponse=t,this.prfKey=i}}var an=i(10064),ln=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const cn=null,un=0;var dn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const pn=new he.fX(he.su,"autofillOnPageLoad",{deserializer:e=>null!=e&&e,clearOn:[]}),hn=new he.fX(he.su,"autofillOnPageLoadDefault",{deserializer:e=>null!=e&&e,clearOn:[]}),gn=new he.fX(he.su,"autofillOnPageLoadCalloutIsDismissed",{deserializer:e=>null!=e&&e,clearOn:[]}),fn=new he.fX(he.su,"autofillOnPageLoadPolicyToastHasDisplayed",{deserializer:e=>null!=e&&e,clearOn:[]}),mn=new he.fX(he.su,"autoCopyTotp",{deserializer:e=>null==e||e,clearOn:[]}),vn=new he.vh(he.SA,"inlineMenuVisibility",{deserializer:e=>null!=e?e:un}),yn=new he.vh(he.su,"enableContextMenu",{deserializer:e=>null==e||e}),wn=new he.fX(he.SA,"clearClipboardDelay",{deserializer:e=>null!=e?e:cn,clearOn:[]});class bn{}var Un=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const _n=new he.fX(he.Gz,"enableBadgeCounter",{deserializer:e=>null==e||e,clearOn:[]});var An=i(30933),Zn=i(384),xn=i(6677),Sn=i(83376),Tn=i(28004),Cn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const On=new he.fX(he.ag,"accountProfile",{deserializer:e=>e,clearOn:["logout"]});class kn extends I.c{constructor(e){super(e),this.isOnSecretsManagerStandalone=this.getResponseProperty("IsOnSecretsManagerStandalone")}}class Pn extends I.c{constructor(e){super(e),this.organizationId=this.getResponseProperty("OrganizationId"),this.organizationName=this.getResponseProperty("OrganizationName"),this.risksSubscriptionFailure=this.getResponseProperty("RisksSubscriptionFailure")}}class qn extends I.c{constructor(e){super(e),this.plans=[],this.status=this.getResponseProperty("status"),this.currentPeriodEndDate=new Date(this.getResponseProperty("currentPeriodEndDate")),this.discountPercentage=this.getResponseProperty("discountPercentage");const t=this.getResponseProperty("plans");null!=t&&(this.plans=t.map((e=>new In(e))))}}class In extends I.c{constructor(e){super(e),this.planName=this.getResponseProperty("PlanName"),this.seatMinimum=this.getResponseProperty("SeatMinimum"),this.assignedSeats=this.getResponseProperty("AssignedSeats"),this.purchasedSeats=this.getResponseProperty("PurchasedSeats"),this.cost=this.getResponseProperty("Cost"),this.cadence=this.getResponseProperty("Cadence")}}var Mn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Nn=i(36076),Ln=i(44882),Dn=i(69485),En=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Fn=he.fX.record(he.ag,"paymentMethodWarnings",{deserializer:e=>Object.assign(Object.assign({},e),{savedAt:new Date(e.savedAt)}),clearOn:["logout"]});var Rn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Jn=i(13973),zn=i(7323);class Yn{}var Kn=i(65254),Bn=i(79865),Qn=i(76528),Gn=i(85540),jn=i(56934);class Vn{}var $n=i(78627);class Hn{}var Wn=i(66459),Xn=i(34961),es=i(99721),ts=i(58172);class is{}class ns extends is{constructor(){super(...arguments),this.type=ns.TYPE}}ns.TYPE="MemoryStorageService";var ss=i(14494),os=i(37017);class rs{constructor(e){this.accountConstructor=e}create(e){return new this.accountConstructor(e)}}class as{constructor(e){this.globalStateConstructor=e}create(e){return new this.globalStateConstructor(e)}}class ls{constructor(e,t){this.globalStateFactory=new as(e),this.accountFactory=new rs(t)}createGlobal(e){return this.globalStateFactory.create(e)}createAccount(e){return this.accountFactory.create(e)}}var cs=i(67775),us=i(83464);class ds{constructor(e){this.messageStream=e,this.allMessages$=this.messageStream}messages$(e){return this.allMessages$.pipe((0,cs.h)((t=>(null==t?void 0:t.command)===e.command)))}}ds.EMPTY=new ds(us.E);var ps=i(70734);const hs=Symbol("externalSource");(0,de.U)((e=>Object.assign(e,{[hs]:!0})));class gs{constructor(e){this.messagesSubject=e}send(e,t={}){const i=(e=>"string"==typeof e?e:e.command)(e);this.messagesSubject.next(Object.assign(null!=t?t:{},{command:i}))}}var fs=i(16494),ms=i(487);class vs{}var ys=i(80060),ws=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const bs=new he.vh(he.Wi,"appId",{deserializer:e=>e}),Us=new he.vh(he.Wi,"anonymousAppId",{deserializer:e=>e});class _s extends I.c{constructor(e){super(e),this.featureStates={},null!=e&&(this.version=this.getResponseProperty("Version"),this.gitHash=this.getResponseProperty("GitHash"),this.server=new Zs(this.getResponseProperty("Server")),this.environment=new As(this.getResponseProperty("Environment")),this.featureStates=this.getResponseProperty("FeatureStates"))}}class As extends I.c{constructor(e=null){super(e),null!=e&&(this.cloudRegion=this.getResponseProperty("CloudRegion"),this.vault=this.getResponseProperty("Vault"),this.api=this.getResponseProperty("Api"),this.identity=this.getResponseProperty("Identity"),this.notifications=this.getResponseProperty("Notifications"),this.sso=this.getResponseProperty("Sso"))}}class Zs extends I.c{constructor(e=null){super(e),null!=e&&(this.name=this.getResponseProperty("Name"),this.url=this.getResponseProperty("Url"))}}var xs=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Ss=i(8429),Ts=i(85139),Cs=i(82783),Os=i(59281);class ks{constructor(e){var t,i;this.featureStates={},this.version=e.version,this.gitHash=e.gitHash,this.server=e.server,this.utcDate=new Date(e.utcDate),this.environment=e.environment,this.featureStates=e.featureStates,null==(null===(t=this.server)||void 0===t?void 0:t.name)&&null==(null===(i=this.server)||void 0===i?void 0:i.url)&&(this.server=null)}getAgeInMilliseconds(){var e;return(new Date).getTime()-(null===(e=this.utcDate)||void 0===e?void 0:e.getTime())}isValid(){return this.getAgeInMilliseconds()<=864e5}static fromJSON(e){return null==e?null:new ks(e)}}class Ps{constructor(e){this.featureStates={},this.version=null==e?void 0:e.version,this.gitHash=null==e?void 0:e.gitHash,this.server=(null==e?void 0:e.server)?new qs(e.server):null,this.utcDate=(new Date).toISOString(),this.environment=(null==e?void 0:e.environment)?new Is(e.environment):null,this.featureStates=null==e?void 0:e.featureStates}static fromJSON(e){return Object.assign(new Ps({}),e,{server:(null==e?void 0:e.server)?qs.fromJSON(e.server):null,environment:(null==e?void 0:e.environment)?Is.fromJSON(e.environment):null})}}class qs{constructor(e){this.name=e.name,this.url=e.url}static fromJSON(e){return Object.assign(new qs({}),e)}}class Is{constructor(e){this.cloudRegion=e.cloudRegion,this.vault=e.vault,this.api=e.api,this.identity=e.identity,this.notifications=e.notifications,this.sso=e.sso}static fromJSON(e){return Object.assign(new Is({}),e)}}var Ms=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Ns=new he.fX(he.oc,"serverConfig",{deserializer:e=>null==e?null:ks.fromJSON(e),clearOn:["logout"]}),Ls=he.vh.record(he.oc,"byServer",{deserializer:e=>null==e?null:ks.fromJSON(e)});class Ds{constructor(e,t,i,n){this.configApiService=e,this.environmentService=t,this.logService=i,this.stateProvider=n,this.failedFetchFallbackSubject=new r.x;const s=this.environmentService.environment$.pipe((0,de.U)((e=>e.getApiUrl())));this.serverConfig$=(0,Ke.a)([this.stateProvider.activeUserId$,s]).pipe((0,it.w)((([e,t])=>(null==e?this.globalConfigFor$(t):this.userConfigFor$(e)).pipe((0,de.U)((i=>[i,e,t]))))),(0,ys.b)((e=>Ms(this,void 0,void 0,(function*(){const[t,i,n]=e;t&&!this.olderThanRetrievalInterval(t.utcDate)||(yield this.renewConfig(t,i,n))})))),(0,it.w)((([e])=>!e||this.olderThanRetrievalInterval(e.utcDate)?Ss.C:(0,Be.of)(e))),(0,Ts.b)(this.failedFetchFallbackSubject),(0,kt.d)({refCount:!0,bufferSize:1})),this.cloudRegion$=this.serverConfig$.pipe((0,de.U)((e=>{var t,i;return null!==(i=null===(t=null==e?void 0:e.environment)||void 0===t?void 0:t.cloudRegion)&&void 0!==i?i:jn.y.US})))}getFeatureFlag$(e){return this.serverConfig$.pipe((0,de.U)((t=>null==(null==t?void 0:t.featureStates)||null==t.featureStates[e]?Os.h[e]:t.featureStates[e])))}getFeatureFlag(e){return Ms(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.getFeatureFlag$(e))}))}checkServerMeetsVersionRequirement$(e){return this.serverConfig$.pipe((0,de.U)((t=>{if(null==t)return!1;return new Cs.SemVer(t.version).compare(e)>=0})))}ensureConfigFetched(){return Ms(this,void 0,void 0,(function*(){yield(0,pe.z)(this.serverConfig$)}))}olderThanRetrievalInterval(e){return(new Date).getTime()-e.getTime()>36e5}renewConfig(e,t,i){var n,s,o;return Ms(this,void 0,void 0,(function*(){try{const r=yield this.configApiService.get(t),a=new ks(new Ps(r));null!=(null===(n=null==a?void 0:a.environment)||void 0===n?void 0:n.cloudRegion)&&(null===(s=null==e?void 0:e.environment)||void 0===s?void 0:s.cloudRegion)!=a.environment.cloudRegion&&(yield this.environmentService.setCloudRegion(t,null===(o=null==a?void 0:a.environment)||void 0===o?void 0:o.cloudRegion)),null==t?yield this.stateProvider.getGlobal(Ls).update((e=>Object.assign(Object.assign({},e),{[i]:a}))):yield this.stateProvider.setUserState(Ns,a,t)}catch(r){this.logService.error(`Unable to fetch ServerConfig from ${i}: ${null==r?void 0:r.message}`),this.failedFetchFallbackSubject.next(e)}}))}globalConfigFor$(e){return this.stateProvider.getGlobal(Ls).state$.pipe((0,de.U)((t=>null==t?void 0:t[e])))}userConfigFor$(e){return this.stateProvider.getUser(e,Ns).state$}}var Es=i(12481),Fs=i(19583);function Rs(e){return(t,i,n)=>{const s=n.value,o=new Map;return{value:function(...t){const i=(e=>{let t=o.get(e);return null!=t||(t=new Map,o.set(e,t)),t})(this),n=e(t);let r=i.get(n);if(null!=r)return r;const a=()=>{i.delete(n),0===i.size&&o.delete(this)};return r=s.apply(this,t).then((e=>(a(),e))).catch((e=>{throw a(),e})),i.set(n,r),r}}}}var Js=i(90428),zs=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ys{static fromData(e){switch(e.type){case"organization":return new Ks(e.key);case"provider":return new Bs(e.key,e.providerId);default:return null}}}class Ks{constructor(e){this.key=e}decrypt(e){return zs(this,void 0,void 0,(function*(){const t=yield e.getPrivateKey();if(null==t)throw new Error("Active user does not have a private key, cannot decrypt organization key.");const i=yield e.rsaDecrypt(this.key,t);return new Wt.N(i)}))}toData(){return{type:"organization",key:this.key}}}class Bs{constructor(e,t){this.key=e,this.providerId=t}decrypt(e){return zs(this,void 0,void 0,(function*(){const t=yield e.getProviderKey(this.providerId),i=yield e.decryptToBytes(new li._(this.key),t);return new Wt.N(i)}))}toData(){return{type:"provider",key:this.key,providerId:this.providerId}}}var Qs=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Gs=he.fX.record(he.lJ,"organizationKeys",{deserializer:e=>e,clearOn:["logout"]}),js=he.dT.from(Gs,{deserializer:e=>{const t={};for(const i of Object.keys(null!=e?e:{}))t[i]=Wt.N.fromJSON(e[i]);return t},derive:(e,{cryptoService:t})=>Qs(void 0,void 0,void 0,(function*(){const i={};for(const n of Object.keys(null!=e?e:{})){if(null!=i[n])continue;const s=Ys.fromData(e[n]),o=yield s.decrypt(t);i[n]=o}return i}))});var Vs=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const $s=he.fX.record(he.lJ,"providerKeys",{deserializer:e=>e,clearOn:["logout"]}),Hs=he.dT.from($s,{deserializer:e=>{const t={};for(const i of Object.keys(null!=e?e:{}))t[i]=Wt.N.fromJSON(e[i]);return t},derive:(e,{encryptService:t,cryptoService:i})=>Vs(void 0,void 0,void 0,(function*(){const n={};for(const s of Object.keys(null!=e?e:{})){if(null!=n[s])continue;const o=new li._(e[s]),r=yield i.getPrivateKey(),a=yield t.rsaDecrypt(o,r),l=new Wt.N(a);n[s]=l}return n}))});var Ws=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Xs=new he.fX(he.lJ,"everHadUserKey",{deserializer:e=>e,clearOn:["logout"]}),eo=new he.fX(he.lJ,"privateKey",{deserializer:e=>e,clearOn:["logout"]}),to=he.dT.fromWithUserId(eo,{deserializer:e=>new Uint8Array(Object.values(e)),derive:([e,t],{encryptService:i,getUserKey:n})=>Ws(void 0,void 0,void 0,(function*(){if(null==t)return null;const s=yield n(e);if(null==s)return null;const o=new li._(t);return yield i.decryptToBytes(o,s)}))}),io=he.dT.from([to,"publicKey"],{deserializer:e=>new Uint8Array(Object.values(e)),derive:(e,{cryptoFunctionService:t})=>Ws(void 0,void 0,void 0,(function*(){return null==e?null:yield t.rsaExtractPublicKey(e)}))}),no=new he.fX(he.$8,"userKey",{deserializer:e=>Wt.N.fromJSON(e),clearOn:["logout","lock"]});var so=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},oo=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},ro=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ao{constructor(e,t,i,n,s,o,r,a,l,c){this.masterPasswordService=e,this.keyGenerationService=t,this.cryptoFunctionService=i,this.encryptService=n,this.platformUtilService=s,this.logService=o,this.stateService=r,this.accountService=a,this.stateProvider=l,this.kdfConfigService=c,this.activeUserKeyState=l.getActive(no),this.activeUserKey$=this.activeUserKeyState.state$,this.activeUserEverHadUserKey=l.getActive(Xs),this.everHadUserKey$=this.activeUserEverHadUserKey.state$.pipe((0,de.U)((e=>null!=e&&e))),this.activeUserEncryptedPrivateKeyState=l.getActive(eo),this.activeUserPrivateKeyState=l.getDerived(this.activeUserEncryptedPrivateKeyState.combinedState$.pipe((0,cs.h)((([e,t])=>null!=t))),to,{encryptService:this.encryptService,getUserKey:e=>this.getUserKey(e)}),this.activeUserPrivateKey$=this.activeUserPrivateKeyState.state$,this.activeUserPublicKeyState=l.getDerived(this.activeUserPrivateKey$.pipe((0,cs.h)((e=>null!=e))),io,{cryptoFunctionService:this.cryptoFunctionService}),this.activeUserPublicKey$=this.activeUserPublicKeyState.state$,this.activeUserEncryptedOrgKeysState=l.getActive(Gs),this.activeUserOrgKeysState=l.getDerived(this.activeUserEncryptedOrgKeysState.state$.pipe((0,cs.h)((e=>null!=e))),js,{cryptoService:this}),this.activeUserOrgKeys$=this.activeUserOrgKeysState.state$,this.activeUserEncryptedProviderKeysState=l.getActive($s),this.activeUserProviderKeysState=l.getDerived(this.activeUserEncryptedProviderKeysState.state$.pipe((0,cs.h)((e=>null!=e))),Hs,{encryptService:this.encryptService,cryptoService:this}),this.activeUserProviderKeys$=this.activeUserProviderKeysState.state$}setUserKey(e,t){return ro(this,void 0,void 0,(function*(){if(null==e)throw new Error("No key provided. Lock the user to clear the key");[t,e]=yield this.stateProvider.setUserState(no,e,t),yield this.stateProvider.setUserState(Xs,!0,t),yield this.storeAdditionalKeys(e,t)}))}refreshAdditionalKeys(){return ro(this,void 0,void 0,(function*(){const e=yield this.getUserKey();yield this.setUserKey(e)}))}getInMemoryUserKeyFor$(e){return this.stateProvider.getUserState$(no,e)}getUserKey(e){return ro(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.stateProvider.getUserState$(no,e))}))}isLegacyUser(e,t){return ro(this,void 0,void 0,(function*(){return null!=t||(t=yield(0,pe.z)(this.stateProvider.activeUserId$)),null!=e||(e=yield(0,pe.z)(this.masterPasswordService.masterKey$(t))),yield this.validateUserKey(e)}))}getUserKeyWithLegacySupport(e){return ro(this,void 0,void 0,(function*(){null!=e||(e=yield(0,pe.z)(this.stateProvider.activeUserId$));const t=yield this.getUserKey(e);if(t)return t;return yield(0,pe.z)(this.masterPasswordService.masterKey$(e))}))}getUserKeyFromStorage(e,t){return ro(this,void 0,void 0,(function*(){const i=yield this.getKeyFromStorage(e,t);if(i)return(yield this.validateUserKey(i))||(this.logService.warning("Invalid key, throwing away stored keys"),yield this.clearAllStoredUserKeys(t)),i}))}hasUserKey(e){return ro(this,void 0,void 0,(function*(){return null!=e||(e=yield(0,pe.z)(this.stateProvider.activeUserId$)),null!=e&&(yield this.hasUserKeyInMemory(e))}))}hasUserKeyInMemory(e){return ro(this,void 0,void 0,(function*(){return null!=e||(e=yield(0,pe.z)(this.stateProvider.activeUserId$)),null!=e&&null!=(yield(0,pe.z)(this.stateProvider.getUserState$(no,e)))}))}hasUserKeyStored(e,t){return ro(this,void 0,void 0,(function*(){return null!=(yield this.getKeyFromStorage(e,t))}))}makeUserKey(e){return ro(this,void 0,void 0,(function*(){if(!e){const t=yield(0,pe.z)(this.stateProvider.activeUserId$);e=yield(0,pe.z)(this.masterPasswordService.masterKey$(t))}if(null==e)throw new Error("No Master Key found.");const t=yield this.keyGenerationService.createKey(512);return this.buildProtectedSymmetricKey(e,t.key)}))}clearUserKey(e){return ro(this,void 0,void 0,(function*(){null!=e&&(yield this.stateProvider.setUserState(no,null,e),yield this.clearAllStoredUserKeys(e))}))}clearStoredUserKey(e,t){return ro(this,void 0,void 0,(function*(){e===Ht.l1.Auto&&(this.stateService.setUserKeyAutoUnlock(null,{userId:t}),this.clearDeprecatedKeys(Ht.l1.Auto,t)),e===Ht.l1.Pin&&(this.stateService.setPinKeyEncryptedUserKeyEphemeral(null,{userId:t}),this.clearDeprecatedKeys(Ht.l1.Pin,t))}))}setMasterKeyEncryptedUserKey(e,t){return ro(this,void 0,void 0,(function*(){null!=t||(t=yield(0,pe.z)(this.stateProvider.activeUserId$)),yield this.masterPasswordService.setMasterKeyEncryptedUserKey(new li._(e),t)}))}getOrDeriveMasterKey(e,t){return ro(this,void 0,void 0,(function*(){null!=t||(t=yield(0,pe.z)(this.stateProvider.activeUserId$));let i=yield(0,pe.z)(this.masterPasswordService.masterKey$(t));return i||(yield this.makeMasterKey(e,yield this.stateService.getEmail({userId:t}),yield this.kdfConfigService.getKdfConfig()))}))}makeMasterKey(e,t,i){return ro(this,void 0,void 0,(function*(){return yield this.keyGenerationService.deriveKeyFromPassword(e,t,i)}))}encryptUserKeyWithMasterKey(e,t){return ro(this,void 0,void 0,(function*(){return t||(t=yield this.getUserKey()),yield this.buildProtectedSymmetricKey(e,t.key)}))}decryptUserKeyWithMasterKey(e,t,i){return ro(this,void 0,void 0,(function*(){if(null!=i||(i=yield(0,pe.z)(this.stateProvider.activeUserId$)),null!=t||(t=yield this.masterPasswordService.getMasterKeyEncryptedUserKey(i)),null!=e||(e=yield(0,pe.z)(this.masterPasswordService.masterKey$(i))),null==e)throw new Error("No master key found.");if(null==t){const e=yield this.stateService.getEncryptedCryptoSymmetricKey({userId:i});if(null==e)throw new Error("No encrypted user key found.");t=new li._(e)}let n;if(t.encryptionType===Ht.Fs.AesCbc256_B64)n=yield this.encryptService.decryptToBytes(t,e);else{if(t.encryptionType!==Ht.Fs.AesCbc256_HmacSha256_B64)throw new Error("Unsupported encryption type.");{const i=yield this.stretchKey(e);n=yield this.encryptService.decryptToBytes(t,i)}}return null==n?null:new Wt.N(n)}))}hashMasterKey(e,t,i){return ro(this,void 0,void 0,(function*(){if(!t){const e=yield(0,pe.z)(this.stateProvider.activeUserId$);t=yield(0,pe.z)(this.masterPasswordService.masterKey$(e))}if(null==e||null==t)throw new Error("Invalid parameters.");const n=i===Ht.RR.LocalAuthorization?2:1,s=yield this.cryptoFunctionService.pbkdf2(t.key,e,"sha256",n);return Fe.c.fromBufferToB64(s)}))}compareAndUpdateKeyHash(e,t){return ro(this,void 0,void 0,(function*(){const i=yield(0,pe.z)(this.stateProvider.activeUserId$),n=yield(0,pe.z)(this.masterPasswordService.masterKeyHash$(i));if(null!=e&&null!=n){const s=yield this.hashMasterKey(e,t,Ht.RR.LocalAuthorization);if(null!=s&&n===s)return!0;const o=yield this.hashMasterKey(e,t,Ht.RR.ServerAuthorization);if(null!=o&&n===o)return yield this.masterPasswordService.setMasterKeyHash(s,i),!0}return!1}))}setOrgKeys(e,t,i){return ro(this,void 0,void 0,(function*(){yield this.stateProvider.getUser(i,Gs).update((()=>{const i={};return e.forEach((e=>{i[e.id]={type:"organization",key:e.key}})),t.forEach((e=>{i[e.id]={type:"provider",providerId:e.providerId,key:e.key}})),i}))}))}getOrgKey(e){return ro(this,void 0,void 0,(function*(){return(yield(0,pe.z)(this.activeUserOrgKeys$))[e]}))}getOrgKeys(){return ro(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.activeUserOrgKeys$)}))}makeDataEncKey(e){return ro(this,void 0,void 0,(function*(){if(null==e)throw new Error("No key provided");const t=yield this.keyGenerationService.createKey(512);return this.buildProtectedSymmetricKey(e,t.key)}))}clearOrgKeys(e){return ro(this,void 0,void 0,(function*(){null!=e&&(yield this.stateProvider.setUserState(Gs,null,e))}))}setProviderKeys(e,t){return ro(this,void 0,void 0,(function*(){yield this.stateProvider.getUser(t,$s).update((()=>{const t={};return e.forEach((e=>{t[e.id]=e.key})),t}))}))}getProviderKey(e){var t;return ro(this,void 0,void 0,(function*(){return null==e?null:null!==(t=(yield(0,pe.z)(this.activeUserProviderKeys$))[e])&&void 0!==t?t:null}))}getProviderKeys(){return ro(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.activeUserProviderKeys$)}))}clearProviderKeys(e){return ro(this,void 0,void 0,(function*(){null!=e&&(yield this.stateProvider.setUserState($s,null,e))}))}getPublicKey(){return ro(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.activeUserPublicKey$)}))}makeOrgKey(){return ro(this,void 0,void 0,(function*(){const e=yield this.keyGenerationService.createKey(512),t=yield this.getPublicKey();return[yield this.rsaEncrypt(e.key,t),e]}))}setPrivateKey(e,t){return ro(this,void 0,void 0,(function*(){null!=e&&(yield this.stateProvider.getUser(t,eo).update((()=>e)))}))}getPrivateKey(){return ro(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.activeUserPrivateKey$)}))}getFingerprint(e,t){return ro(this,void 0,void 0,(function*(){if(null==t&&(t=yield this.getPublicKey()),null===t)throw new Error("No public key available.");const i=yield this.cryptoFunctionService.hash(t,"sha256"),n=yield this.cryptoFunctionService.hkdfExpand(i,e,32,"sha256");return this.hashPhrase(n)}))}makeKeyPair(e){return ro(this,void 0,void 0,(function*(){if(null==e)throw new Error("'key' is a required parameter and must be non-null.");const t=yield this.cryptoFunctionService.rsaGenerateKeyPair(2048);return[Fe.c.fromBufferToB64(t[0]),yield this.encryptService.encrypt(t[1],e)]}))}clearKeyPair(e){return ro(this,void 0,void 0,(function*(){null!=e&&(yield this.stateProvider.setUserState(eo,null,e))}))}makePinKey(e,t,i){return ro(this,void 0,void 0,(function*(){const n=yield this.keyGenerationService.deriveKeyFromPassword(e,t,i);return yield this.stretchKey(n)}))}clearPinKeys(e){return ro(this,void 0,void 0,(function*(){yield this.stateService.setPinKeyEncryptedUserKey(null,{userId:e}),yield this.stateService.setPinKeyEncryptedUserKeyEphemeral(null,{userId:e}),yield this.stateService.setProtectedPin(null,{userId:e}),yield this.clearDeprecatedKeys(Ht.l1.Pin,e)}))}decryptUserKeyWithPin(e,t,i,n){return ro(this,void 0,void 0,(function*(){if(n||(n=yield this.stateService.getPinKeyEncryptedUserKey()),n||(n=yield this.stateService.getPinKeyEncryptedUserKeyEphemeral()),!n)throw new Error("No PIN protected key found.");const s=yield this.makePinKey(e,t,i),o=yield this.encryptService.decryptToBytes(n,s);return new Wt.N(o)}))}decryptMasterKeyWithPin(e,t,i,n){return ro(this,void 0,void 0,(function*(){if(!n){const e=yield this.stateService.getEncryptedPinProtected();if(null==e)throw new Error("No PIN protected key found.");n=new li._(e)}const s=yield this.makePinKey(e,t,i),o=yield this.encryptService.decryptToBytes(n,s);return new Wt.N(o)}))}makeSendKey(e){return ro(this,void 0,void 0,(function*(){return yield this.keyGenerationService.deriveKeyFromMaterial(e,"bitwarden-send","send")}))}makeCipherKey(){return ro(this,void 0,void 0,(function*(){return yield this.keyGenerationService.createKey(512)}))}clearKeys(e){return ro(this,void 0,void 0,(function*(){if(null!=e||(e=yield(0,pe.z)(this.stateProvider.activeUserId$)),null==e)throw new Error("Cannot clear keys, no user Id resolved.");yield this.masterPasswordService.clearMasterKeyHash(e),yield this.clearUserKey(e),yield this.clearOrgKeys(e),yield this.clearProviderKeys(e),yield this.clearKeyPair(e),yield this.clearPinKeys(e),yield this.stateProvider.setUserState(Xs,null,e)}))}rsaEncrypt(e,t){return ro(this,void 0,void 0,(function*(){if(null==t)throw new Error("'publicKey' is a required parameter and must be non-null");const i=yield this.cryptoFunctionService.rsaEncrypt(e,t,"sha1");return new li._(Ht.Fs.Rsa2048_OaepSha1_B64,Fe.c.fromBufferToB64(i))}))}rsaDecrypt(e,t){return ro(this,void 0,void 0,(function*(){if(null==t)throw new Error("'privateKey' is a required parameter and must be non-null");const i=e.split(".");let n,s=null;if(1===i.length)s=Ht.Fs.Rsa2048_OaepSha256_B64,n=[i[0]];else if(2===i.length)try{s=parseInt(i[0],null),n=i[1].split("|")}catch(a){this.logService.error(a)}switch(s){case Ht.Fs.Rsa2048_OaepSha256_B64:case Ht.Fs.Rsa2048_OaepSha1_B64:case Ht.Fs.Rsa2048_OaepSha256_HmacSha256_B64:case Ht.Fs.Rsa2048_OaepSha1_HmacSha256_B64:break;default:throw new Error("encType unavailable.")}if(null==n||n.length<=0)throw new Error("encPieces unavailable.");const o=Fe.c.fromB64ToArray(n[0]);let r="sha1";switch(s){case Ht.Fs.Rsa2048_OaepSha256_B64:case Ht.Fs.Rsa2048_OaepSha256_HmacSha256_B64:r="sha256";break;case Ht.Fs.Rsa2048_OaepSha1_B64:case Ht.Fs.Rsa2048_OaepSha1_HmacSha256_B64:break;default:throw new Error("encType unavailable.")}return this.cryptoFunctionService.rsaDecrypt(o,t,r)}))}randomNumber(e,t){return ro(this,void 0,void 0,(function*(){let i=0;const n=t-e+1,s=Math.ceil(Math.log2(n));if(s>53)throw new Error("We cannot generate numbers larger than 53 bits.");const o=Math.ceil(s/8),r=Math.pow(2,s)-1,a=new Uint8Array(yield this.cryptoFunctionService.randomBytes(o));let l=8*(o-1);for(let e=0;e<o;e++)i+=a[e]*Math.pow(2,l),l-=8;return i&=r,i>=n?this.randomNumber(e,t):e+i}))}validateUserKey(e){return ro(this,void 0,void 0,(function*(){if(!e)return!1;try{const[t,i]=yield(0,pe.z)(this.activeUserEncryptedPrivateKeyState.combinedState$);if(null==i)return!1;const n=yield to.derive([t,i],{encryptService:this.encryptService,getUserKey:()=>Promise.resolve(e)});if(null==n)return!1;if(null==(yield io.derive(n,{cryptoFunctionService:this.cryptoFunctionService})))return!1}catch(t){return!1}return!0}))}initAccount(){return ro(this,void 0,void 0,(function*(){if(null!=(yield this.getUserKey()))throw this.logService.error("Tried to initialize account with existing user key."),new Error("Cannot initialize account, keys already exist.");const e=yield this.keyGenerationService.createKey(512),[t,i]=yield this.makeKeyPair(e);return yield this.setUserKey(e),yield this.activeUserEncryptedPrivateKeyState.update((()=>i.encryptedString)),{userKey:e,publicKey:t,privateKey:i}}))}storeAdditionalKeys(e,t){return ro(this,void 0,void 0,(function*(){(yield this.shouldStoreKey(Ht.l1.Auto,t))?yield this.stateService.setUserKeyAutoUnlock(e.keyB64,{userId:t}):yield this.stateService.setUserKeyAutoUnlock(null,{userId:t}),yield this.clearDeprecatedKeys(Ht.l1.Auto,t);(yield this.shouldStoreKey(Ht.l1.Pin,t))?(yield this.storePinKey(e,t),yield this.clearDeprecatedKeys(Ht.l1.Pin,t)):(yield this.stateService.setPinKeyEncryptedUserKey(null,{userId:t}),yield this.stateService.setPinKeyEncryptedUserKeyEphemeral(null,{userId:t}))}))}storePinKey(e,t){return ro(this,void 0,void 0,(function*(){const i=yield this.encryptService.decryptToUtf8(new li._(yield this.stateService.getProtectedPin({userId:t})),e),n=yield this.makePinKey(i,yield this.stateService.getEmail({userId:t}),yield this.kdfConfigService.getKdfConfig()),s=yield this.encryptService.encrypt(e.key,n);null!=(yield this.stateService.getPinKeyEncryptedUserKey({userId:t}))?yield this.stateService.setPinKeyEncryptedUserKey(s,{userId:t}):yield this.stateService.setPinKeyEncryptedUserKeyEphemeral(s,{userId:t})}))}shouldStoreKey(e,t){return ro(this,void 0,void 0,(function*(){let i=!1;switch(e){case Ht.l1.Auto:i=null==(yield this.stateService.getVaultTimeout({userId:t}));break;case Ht.l1.Pin:i=!!(yield this.stateService.getProtectedPin({userId:t}));break}return i}))}getKeyFromStorage(e,t){return ro(this,void 0,void 0,(function*(){if(e===Ht.l1.Auto){const e=yield this.stateService.getUserKeyAutoUnlock({userId:t});if(e)return new Wt.N(Fe.c.fromB64ToArray(e))}return null}))}clearAllStoredUserKeys(e){return ro(this,void 0,void 0,(function*(){yield this.stateService.setUserKeyAutoUnlock(null,{userId:e}),yield this.stateService.setPinKeyEncryptedUserKeyEphemeral(null,{userId:e})}))}stretchKey(e){return ro(this,void 0,void 0,(function*(){const t=new Uint8Array(64),i=yield this.cryptoFunctionService.hkdfExpand(e.key,"enc",32,"sha256"),n=yield this.cryptoFunctionService.hkdfExpand(e.key,"mac",32,"sha256");return t.set(new Uint8Array(i)),t.set(new Uint8Array(n),32),new Wt.N(t)}))}hashPhrase(e,t=64){return ro(this,void 0,void 0,(function*(){const i=Math.log(Js.V.length)/Math.log(2);let n=Math.ceil(t/i);const s=Array.from(new Uint8Array(e));if(n*i>4*s.length)throw new Error("Output entropy of hash function is too small");const o=[];let r=Fs.fromArray(s,256);for(;n--;){const e=r.mod(Js.V.length);r=r.divide(Js.V.length),o.push(Js.V[e])}return o}))}buildProtectedSymmetricKey(e,t){return ro(this,void 0,void 0,(function*(){let i=null;if(32===e.key.byteLength){const n=yield this.stretchKey(e);i=yield this.encryptService.encrypt(t,n)}else{if(64!==e.key.byteLength)throw new Error("Invalid key size.");i=yield this.encryptService.encrypt(t,e)}return[new Wt.N(t),i]}))}clearDeprecatedKeys(e,t){return ro(this,void 0,void 0,(function*(){e===Ht.l1.Auto?yield this.stateService.setCryptoMasterKeyAuto(null,{userId:t}):e===Ht.l1.Pin&&(yield this.stateService.setEncryptedPinProtected(null,{userId:t}),yield this.stateService.setDecryptedPinProtected(null,{userId:t}))}))}decryptAndMigrateOldPinKey(e,t,i,n,s){return ro(this,void 0,void 0,(function*(){const o=yield this.decryptMasterKeyWithPin(t,i,n,s),r=yield this.stateService.getEncryptedCryptoSymmetricKey(),a=yield this.decryptUserKeyWithMasterKey(o,new li._(r)),l=yield this.makePinKey(t,i,n),c=yield this.encryptService.encrypt(a.key,l);if(e)yield this.stateService.setDecryptedPinProtected(null),yield this.stateService.setPinKeyEncryptedUserKeyEphemeral(c);else{yield this.stateService.setEncryptedPinProtected(null),yield this.stateService.setPinKeyEncryptedUserKey(c);const e=yield this.encryptService.encrypt(t,a);yield this.stateService.setProtectedPin(e.encryptedString)}return yield this.stateService.setCryptoMasterKeyBiometric(null),a}))}encrypt(e,t){return ro(this,void 0,void 0,(function*(){return t||(t=yield this.getUserKeyWithLegacySupport()),yield this.encryptService.encrypt(e,t)}))}encryptToBytes(e,t){return ro(this,void 0,void 0,(function*(){return t||(t=yield this.getUserKeyWithLegacySupport()),this.encryptService.encryptToBytes(e,t)}))}decryptToBytes(e,t){return ro(this,void 0,void 0,(function*(){return t||(t=yield this.getUserKeyWithLegacySupport()),this.encryptService.decryptToBytes(e,t)}))}decryptToUtf8(e,t){return ro(this,void 0,void 0,(function*(){return t||(t=yield this.getUserKeyWithLegacySupport()),yield this.encryptService.decryptToUtf8(e,t)}))}decryptFromBytes(e,t){return ro(this,void 0,void 0,(function*(){if(null==e)throw new Error("No buffer provided for decryption.");return t||(t=yield this.getUserKeyWithLegacySupport()),this.encryptService.decryptToBytes(e,t)}))}}so([Rs((()=>"getOrgKeys")),oo("design:type",Function),oo("design:paramtypes",[]),oo("design:returntype",Promise)],ao.prototype,"getOrgKeys",null),so([Rs((()=>"getProviderKeys")),oo("design:type",Function),oo("design:paramtypes",[]),oo("design:returntype",Promise)],ao.prototype,"getProviderKeys",null);var lo=i(65901);class co{}var uo=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class po{constructor(e,t,i){this.cryptoFunctionService=e,this.logService=t,this.logMacFailures=i}encrypt(e,t){return uo(this,void 0,void 0,(function*(){if(null==t)throw new Error("No encryption key provided.");if(null==e)return Promise.resolve(null);let i;i="string"==typeof e?Fe.c.fromUtf8ToArray(e):e;const n=yield this.aesEncrypt(i,t),s=Fe.c.fromBufferToB64(n.iv),o=Fe.c.fromBufferToB64(n.data),r=null!=n.mac?Fe.c.fromBufferToB64(n.mac):null;return new li._(n.key.encType,o,s,r)}))}encryptToBytes(e,t){return uo(this,void 0,void 0,(function*(){if(null==t)throw new Error("No encryption key provided.");const i=yield this.aesEncrypt(e,t);let n=0;null!=i.mac&&(n=i.mac.byteLength);const s=new Uint8Array(1+i.iv.byteLength+n+i.data.byteLength);return s.set([i.key.encType]),s.set(new Uint8Array(i.iv),1),null!=i.mac&&s.set(new Uint8Array(i.mac),1+i.iv.byteLength),s.set(new Uint8Array(i.data),1+i.iv.byteLength+n),new lo.j(s)}))}decryptToUtf8(e,t){return uo(this,void 0,void 0,(function*(){if(null==t)throw new Error("No key provided for decryption.");if(null!=(t=this.resolveLegacyKey(t,e)).macKey&&null==(null==e?void 0:e.mac))return this.logService.error("mac required."),null;if(t.encType!==e.encryptionType)return this.logService.error("encType unavailable."),null;const i=this.cryptoFunctionService.aesDecryptFastParameters(e.data,e.iv,e.mac,t);if(null!=i.macKey&&null!=i.mac){const e=yield this.cryptoFunctionService.hmacFast(i.macData,i.macKey,"sha256");if(!(yield this.cryptoFunctionService.compareFast(i.mac,e)))return this.logMacFailed("mac failed."),null}return yield this.cryptoFunctionService.aesDecryptFast(i,"cbc")}))}decryptToBytes(e,t){return uo(this,void 0,void 0,(function*(){if(null==t)throw new Error("No encryption key provided.");if(null==e)throw new Error("Nothing provided for decryption.");if(null!=(t=this.resolveLegacyKey(t,e)).macKey&&null==e.macBytes)return null;if(t.encType!==e.encryptionType)return null;if(null!=t.macKey&&null!=e.macBytes){const i=new Uint8Array(e.ivBytes.byteLength+e.dataBytes.byteLength);i.set(new Uint8Array(e.ivBytes),0),i.set(new Uint8Array(e.dataBytes),e.ivBytes.byteLength);const n=yield this.cryptoFunctionService.hmac(i,t.macKey,"sha256");if(null===n)return null;if(!(yield this.cryptoFunctionService.compare(e.macBytes,n)))return this.logMacFailed("mac failed."),null}const i=yield this.cryptoFunctionService.aesDecrypt(e.dataBytes,e.ivBytes,t.encKey,"cbc");return null!=i?i:null}))}rsaEncrypt(e,t){return uo(this,void 0,void 0,(function*(){if(null==e)throw new Error("No data provided for encryption.");if(null==t)throw new Error("No public key provided for encryption.");const i=yield this.cryptoFunctionService.rsaEncrypt(e,t,"sha1");return new li._(Ht.Fs.Rsa2048_OaepSha1_B64,Fe.c.fromBufferToB64(i))}))}rsaDecrypt(e,t){return uo(this,void 0,void 0,(function*(){if(null==e)throw new Error("No data provided for decryption.");let i;switch(e.encryptionType){case Ht.Fs.Rsa2048_OaepSha1_B64:case Ht.Fs.Rsa2048_OaepSha1_HmacSha256_B64:i="sha1";break;case Ht.Fs.Rsa2048_OaepSha256_B64:case Ht.Fs.Rsa2048_OaepSha256_HmacSha256_B64:i="sha256";break;default:throw new Error("Invalid encryption type.")}if(null==t)throw new Error("No private key provided for decryption.");return this.cryptoFunctionService.rsaDecrypt(e.dataBytes,t,i)}))}decryptItems(e,t){return uo(this,void 0,void 0,(function*(){if(null==e||e.length<1)return[];const i=[];for(let n=0;n<e.length;n++)i.push(yield e[n].decrypt(t));return i}))}hash(e,t){return uo(this,void 0,void 0,(function*(){const i=yield this.cryptoFunctionService.hash(e,t);return Fe.c.fromBufferToB64(i)}))}aesEncrypt(e,t){return uo(this,void 0,void 0,(function*(){const i=new co;if(i.key=t,i.iv=yield this.cryptoFunctionService.randomBytes(16),i.data=yield this.cryptoFunctionService.aesEncrypt(e,i.iv,i.key.encKey),null!=i.key.macKey){const e=new Uint8Array(i.iv.byteLength+i.data.byteLength);e.set(new Uint8Array(i.iv),0),e.set(new Uint8Array(i.data),i.iv.byteLength),i.mac=yield this.cryptoFunctionService.hmac(e,i.key.macKey,"sha256")}return i}))}logMacFailed(e){this.logMacFailures&&this.logService.error(e)}resolveLegacyKey(e,t){return t.encryptionType===Ht.Fs.AesCbc128_HmacSha256_B64&&e.encType===Ht.Fs.AesCbc256_B64?new Wt.N(e.key,Ht.Fs.AesCbc128_HmacSha256_B64):e}}var ho=i(62017),go=i(68362),fo=i(62522),mo=i(19572),vo=i(53061),yo=i(82570);const wo={[yo.n.Cipher]:mo.t.fromJSON,[yo.n.CipherView]:vo.$.fromJSON};var bo=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Uo extends po{constructor(){super(...arguments),this.clear$=new r.x}decryptItems(e,t){const i=Object.create(null,{decryptItems:{get:()=>super.decryptItems}});return bo(this,void 0,void 0,(function*(){if("undefined"==typeof window)return i.decryptItems.call(this,e,t);if(null==e||e.length<1)return[];const n=yield this.getDecryptedItemsFromWorker(e,t),s=JSON.parse(n);return this.initializeItems(s)}))}getDecryptedItemsFromWorker(e,t){var n;return bo(this,void 0,void 0,(function*(){this.logService.info("Starting decryption using multithreading"),null!==(n=this.worker)&&void 0!==n||(this.worker=new Worker(new URL(i.p+i.u(768),i.b))),this.restartTimeout();const s={id:Fe.c.newGuid(),items:e,key:t};return this.worker.postMessage(JSON.stringify(s)),yield(0,pe.z)((0,ho.R)(this.worker,"message").pipe((0,cs.h)((e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.id)===s.id})),(0,de.U)((e=>e.data.items)),(0,go.R)(this.clear$),(0,fo.d)("[]")))}))}initializeItems(e){return e.map((e=>{var t;return(t=e.initializerKey,wo[t])(e)}))}clear(){var e;this.clear$.next(),null===(e=this.worker)||void 0===e||e.terminate(),this.worker=null,this.clearTimeout()}restartTimeout(){this.clearTimeout(),this.timeout=setTimeout((()=>this.clear()),18e4)}clearTimeout(){null!=this.timeout&&clearTimeout(this.timeout)}}var _o=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ao{static fromJSON(e){return Object.assign(new Ao,e)}}const Zo=new he.vh(he.O0,"environment",{deserializer:Ao.fromJSON}),xo=new he.fX(he.O0,"environment",{deserializer:Ao.fromJSON,clearOn:["logout"]}),So=new he.vh(he.fk,"cloudRegion",{deserializer:e=>e}),To=new he.fX(he.fk,"cloudRegion",{deserializer:e=>e,clearOn:["logout"]}),Co=[{key:jn.y.US,domain:"bitwarden.com",urls:{base:null,api:"https://api.bitwarden.com",identity:"https://identity.bitwarden.com",icons:"https://icons.bitwarden.net",webVault:"https://vault.bitwarden.com",notifications:"https://notifications.bitwarden.com",events:"https://events.bitwarden.com",scim:"https://scim.bitwarden.com"}},{key:jn.y.EU,domain:"bitwarden.eu",urls:{base:null,api:"https://api.bitwarden.eu",identity:"https://identity.bitwarden.eu",icons:"https://icons.bitwarden.eu",webVault:"https://vault.bitwarden.eu",notifications:"https://notifications.bitwarden.eu",events:"https://events.bitwarden.eu",scim:"https://scim.bitwarden.eu"}}],Oo=jn.y.US,ko=Co.find((e=>e.key===Oo));class Po{constructor(e,t){this.stateProvider=e,this.accountService=t,this.activeAccountId$=this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id))),this.globalState=this.stateProvider.getGlobal(Zo),this.globalCloudRegionState=this.stateProvider.getGlobal(So);const i=this.activeAccountId$.pipe((0,Ot.x)(((e,t)=>e==t)));this.environment$=i.pipe((0,it.w)((e=>e?this.stateProvider.getUser(e,xo).state$:this.stateProvider.getGlobal(Zo).state$)),(0,de.U)((e=>this.buildEnvironment(null==e?void 0:e.region,null==e?void 0:e.urls)))),this.cloudWebVaultUrl$=i.pipe((0,it.w)((e=>e?this.stateProvider.getUser(e,To).state$:this.stateProvider.getGlobal(So).state$)),(0,de.U)((e=>{if(null!=e){const t=this.getRegionConfig(e);if(null!=t)return t.urls.webVault}return ko.urls.webVault})))}availableRegions(){var e;const t=null!==(e=[])&&void 0!==e?e:[];return Co.concat(t)}getRegionConfig(e){return this.availableRegions().find((t=>t.key===e))}setEnvironment(e,t){return _o(this,void 0,void 0,(function*(){return null==this.getRegionConfig(e)&&(e=jn.y.SelfHosted),e==jn.y.SelfHosted&&Io(t)&&(e=Oo),e!=jn.y.SelfHosted?(yield this.globalState.update((()=>({region:e,urls:null}))),null):(t.base=qo(t.base),t.webVault=qo(t.webVault),t.api=qo(t.api),t.identity=qo(t.identity),t.icons=qo(t.icons),t.notifications=qo(t.notifications),t.events=qo(t.events),t.keyConnector=qo(t.keyConnector),t.scim=null,yield this.globalState.update((()=>({region:e,urls:{base:t.base,api:t.api,identity:t.identity,webVault:t.webVault,icons:t.icons,notifications:t.notifications,events:t.events,keyConnector:t.keyConnector}}))),t)}))}buildEnvironment(e,t){if(null==this.getRegionConfig(e)&&(e=jn.y.SelfHosted),e==jn.y.SelfHosted&&Io(t)&&(e=Oo),e!=jn.y.SelfHosted){const t=this.getRegionConfig(e);if(null!=t)return new No(t)}return new Lo(t)}setCloudRegion(e,t){return _o(this,void 0,void 0,(function*(){null==e?yield this.globalCloudRegionState.update((()=>t)):yield this.stateProvider.getUser(e,To).update((()=>t))}))}getEnvironment(e){return _o(this,void 0,void 0,(function*(){if(null==e)return yield(0,pe.z)(this.environment$);const t=yield this.getEnvironmentState(e);return this.buildEnvironment(t.region,t.urls)}))}getEnvironmentState(e){return _o(this,void 0,void 0,(function*(){const t=yield(0,pe.z)(this.activeAccountId$);return null==t?yield(0,pe.z)(this.globalState.state$):yield(0,pe.z)(this.stateProvider.getUser(null!=e?e:t,xo).state$)}))}seedUserEnvironment(e){return _o(this,void 0,void 0,(function*(){const t=yield(0,pe.z)(this.globalState.state$);yield this.stateProvider.getUser(e,xo).update((()=>t))}))}}function qo(e){return null==e||""===e?null:((e=e.replace(/\/+$/g,"")).startsWith("http://")||e.startsWith("https://")||(e="https://"+e),e.trim())}function Io(e){return null==e||null==e.base&&null==e.webVault&&null==e.api&&null==e.identity&&null==e.icons&&null==e.notifications&&null==e.events}class Mo{constructor(e,t){this.region=e,this.urls=t,e==jn.y.SelfHosted&&(this.urls.scim=null)}getRegion(){return this.region}getUrls(){return{base:this.urls.base,webVault:this.urls.webVault,api:this.urls.api,identity:this.urls.identity,icons:this.urls.icons,notifications:this.urls.notifications,events:this.urls.events,keyConnector:this.urls.keyConnector,scim:this.urls.scim}}hasBaseUrl(){return null!=this.urls.base}getWebVaultUrl(){return this.getUrl("webVault","")}getApiUrl(){return this.getUrl("api","/api")}getEventsUrl(){return this.getUrl("events","/events")}getIconsUrl(){return this.getUrl("icons","/icons")}getIdentityUrl(){return this.getUrl("identity","/identity")}getKeyConnectorUrl(){return this.urls.keyConnector}getNotificationsUrl(){return this.getUrl("notifications","/notifications")}getScimUrl(){return null!=this.urls.scim?this.urls.scim+"/v2":"https://vault.bitwarden.com"===this.getWebVaultUrl()?"https://scim.bitwarden.com/v2":this.getWebVaultUrl()+"/scim/v2"}getSendUrl(){return"https://vault.bitwarden.com"===this.getWebVaultUrl()?"https://send.bitwarden.com/#":this.getWebVaultUrl()+"/#/send/"}isCloud(){return this.region!==jn.y.SelfHosted}getUrl(e,t){return null!=this.urls[e]?this.urls[e]:this.urls.base?this.urls.base+t:ko.urls[e]}}class No extends Mo{constructor(e){super(e.key,e.urls),this.config=e}getHostname(){return this.config.domain}}class Lo extends Mo{constructor(e){super(jn.y.SelfHosted,e)}getHostname(){return Fe.c.getHost(this.getWebVaultUrl())}}var Do=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Eo{constructor(e){this.logService=e}upload(e,t,i){return Do(this,void 0,void 0,(function*(){return t.buffer.byteLength<=268435456?yield this.azureUploadBlob(e,t):yield this.azureUploadBlocks(e,t,i)}))}azureUploadBlob(e,t){return Do(this,void 0,void 0,(function*(){const i=Fe.c.getUrl(e),n=new Headers({"x-ms-date":(new Date).toUTCString(),"x-ms-version":i.searchParams.get("sv"),"Content-Length":t.buffer.byteLength.toString(),"x-ms-blob-type":"BlockBlob"}),s=new Request(e,{body:t.buffer,cache:"no-store",method:"PUT",headers:n}),o=yield fetch(s);if(201!==o.status)throw new Error(`Failed to create Azure blob: ${o.status}`)}))}azureUploadBlocks(e,t,i){return Do(this,void 0,void 0,(function*(){const n=Fe.c.getUrl(e),s=this.getMaxBlockSize(n.searchParams.get("sv"));let o=0;const r=Math.ceil(t.buffer.byteLength/s),a=[];if(r>5e4)throw new Error("Cannot upload file, exceeds maximum size of "+5e4*s);try{for(;o<r;){e=yield this.renewUrlIfNecessary(e,i);const n=Fe.c.getUrl(e),r=this.encodedBlockId(o);n.searchParams.append("comp","block"),n.searchParams.append("blockid",r);const l=o*s,c=t.buffer.slice(l,l+s),u=new Headers({"x-ms-date":(new Date).toUTCString(),"x-ms-version":n.searchParams.get("sv"),"Content-Length":c.byteLength.toString()}),d=new Request(n.toString(),{body:c,cache:"no-store",method:"PUT",headers:u}),p=yield fetch(d);if(201!==p.status){const e=`Unsuccessful block PUT. Received status ${p.status}`;throw this.logService.error(e+"\n"+(yield p.json())),new Error(e)}a.push(r),o++}e=yield this.renewUrlIfNecessary(e,i);const n=Fe.c.getUrl(e),l=this.blockListXml(a);n.searchParams.append("comp","blocklist");const c=new Headers({"x-ms-date":(new Date).toUTCString(),"x-ms-version":n.searchParams.get("sv"),"Content-Length":l.length.toString()}),u=new Request(n.toString(),{body:l,cache:"no-store",method:"PUT",headers:c}),d=yield fetch(u);if(201!==d.status){const e=`Unsuccessful block list PUT. Received status ${d.status}`;throw this.logService.error(e+"\n"+(yield d.json())),new Error(e)}}catch(l){throw l}}))}renewUrlIfNecessary(e,t){var i;return Do(this,void 0,void 0,(function*(){const n=Fe.c.getUrl(e),s=new Date(null!==(i=n.searchParams.get("se"))&&void 0!==i?i:"");return isNaN(s.getTime())&&s.setTime(Date.now()+36e5),s.getTime()<Date.now()+1e3?yield t():e}))}encodedBlockId(e){const t=("000000000000000000000000000000000000000000000000"+e.toString()).slice(-48);return Fe.c.fromUtf8ToB64(t)}blockListXml(e){let t='<?xml version="1.0" encoding="utf-8"?><BlockList>';return e.forEach((e=>{t+=`<Latest>${e}</Latest>`})),t+="</BlockList>",t}getMaxBlockSize(e){return Fo.compare(e,"2019-12-12")>=0?4194304e3:Fo.compare(e,"2016-05-31")>=0?104857600:4194304}}class Fo{static compare(e,t){return"string"==typeof e&&(e=new Fo(e)),"string"==typeof t&&(t=new Fo(t)),e.year!==t.year?e.year-t.year:e.month!==t.month?e.month-t.month:e.day!==t.day?e.day-t.day:0}constructor(e){this.year=0,this.month=0,this.day=0;try{const t=e.split("-").map((e=>Number.parseInt(e,10)));this.year=t[0],this.month=t[1],this.day=t[2]}catch(t){}}compare(e){return Fo.compare(this,e)}}var Ro=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Jo{upload(e,t,i){return Ro(this,void 0,void 0,(function*(){const n=new FormData;try{const i=new Blob([t.buffer],{type:"application/octet-stream"});n.append("data",i,e)}catch(s){if(!Fe.c.isNode||Fe.c.isBrowser)throw s;n.append("data",Buffer.from(t.buffer),{filepath:e,contentType:"application/octet-stream"})}yield i(n)}))}}var zo=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Yo=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Ko=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Bo{static create(){return new Bo([])}constructor(e){this.migrations=e}with(...e){return this.addMigrator(e,"up")}rollback(...e){return 3===e.length&&(e=[e[0],e[2],e[1]]),this.addMigrator(e,"down")}migrate(e){return this.migrations.reduce(((t,i)=>t.then((()=>Ko(this,void 0,void 0,(function*(){yield this.runMigrator(i.migrator,e,i.direction)}))))),Promise.resolve())}addMigrator(e,t="up"){const i=1===e.length?{migrator:new e[0],direction:t}:{migrator:new e[0](e[1],e[2]),direction:t};return new Bo([...this.migrations,i])}runMigrator(e,t,i){return Ko(this,void 0,void 0,(function*(){const n=yield e.shouldMigrate(t,i);if(t.info(`Migrator ${e.constructor.name} (to version ${e.toVersion}) should migrate: ${n} - ${i}`),n){const n="up"===i?e.migrate:e.rollback;yield n.bind(e)(t),t.info(`Migrator ${e.constructor.name} (to version ${e.toVersion}) migrated - ${i}`),yield e.updateVersion(t,i),t.info(`Migrator ${e.constructor.name} (to version ${e.toVersion}) updated version - ${i}`)}}))}}var Qo=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Go=new Error("Irreversible migration");class jo{constructor(e,t){if(this.fromVersion=e,this.toVersion=t,null==e||null==t)throw new Error("Invalid migration");if(e>t)throw new Error("Invalid migration")}shouldMigrate(e,t){const i="up"===t?this.fromVersion:this.toVersion;return Promise.resolve(e.currentVersion===i)}updateVersion(e,t){return Qo(this,void 0,void 0,(function*(){const i="up"===t?this.toVersion:this.fromVersion;e.currentVersion=i,yield e.set("stateVersion",i)}))}}var Vo=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const $o={key:"everHadUserKey",stateDefinition:{name:"crypto"}};class Ho extends jo{migrate(e){return Vo(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Vo(this,void 0,void 0,(function*(){const s=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.everHadUserKey;yield e.setToUser(t,$o,null!=s&&s),null!=s&&delete i.profile.everHadUserKey,yield e.set(t,i)}))}(t,i)))])}))}rollback(e){return Vo(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Vo(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,$o);i&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{everHadUserKey:s}),yield e.set(t,i)),yield e.setToUser(t,$o,null)}))}(t,i)))])}))}}var Wo=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Xo={key:"organizationKeys",stateDefinition:{name:"crypto"}};class er extends jo{migrate(e){return Wo(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n,s;return Wo(this,void 0,void 0,(function*(){const o=null===(s=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.organizationKeys)||void 0===s?void 0:s.encrypted;null!=o&&(yield e.setToUser(t,Xo,o),delete i.keys.organizationKeys,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return Wo(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Wo(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,Xo);i&&s&&(i.keys=Object.assign(null!==(n=i.keys)&&void 0!==n?n:{},{organizationKeys:{encrypted:s}}),yield e.set(t,i)),yield e.setToUser(t,Xo,null)}))}(t,i)))])}))}}var tr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ir={name:"environment"},nr={key:"region",stateDefinition:ir},sr={key:"urls",stateDefinition:ir};class or extends jo{migrate(e){return tr(this,void 0,void 0,(function*(){const t=yield e.get("global");null!=(null==t?void 0:t.region)&&(yield e.setToGlobal(nr,t.region)),null!=(null==t?void 0:t.environmentUrls)&&(yield e.setToGlobal(sr,t.environmentUrls));const i=yield e.getAccounts();yield Promise.all(i.map((({userId:t,account:i})=>tr(this,void 0,void 0,(function*(){var n,s,o,r;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.region)&&(yield e.setToUser(t,nr,i.settings.region)),null!=(null===(s=null==i?void 0:i.settings)||void 0===s?void 0:s.environmentUrls)&&(yield e.setToUser(t,sr,i.settings.environmentUrls)),null===(o=null==i?void 0:i.settings)||void 0===o||delete o.region,null===(r=null==i?void 0:i.settings)||void 0===r||delete r.environmentUrls,yield e.set(t,i)}))))),null==t||delete t.region,null==t||delete t.environmentUrls,yield e.set("global",t)}))}rollback(e){return tr(this,void 0,void 0,(function*(){let t=yield e.get("global"),i=!1;const n=yield e.getFromGlobal(nr);n&&(t||(t={}),i=!0,t.region=n,yield e.setToGlobal(nr,null));const s=yield e.getFromGlobal(sr);s&&(t||(t={}),i=!0,t.environmentUrls=s,yield e.setToGlobal(sr,null)),i&&(yield e.set("global",t));const o=yield e.getAccounts();yield Promise.all(o.map((({userId:t,account:i})=>function(t,i){return tr(this,void 0,void 0,(function*(){let n=!1;const s=yield e.getFromUser(t,nr);s&&(i||(i={}),i.settings||(i.settings={}),n=!0,i.settings.region=s,yield e.setToUser(t,nr,null));const o=yield e.getFromUser(t,sr);o&&(i||(i={}),i.settings||(i.settings={}),n=!0,i.settings.environmentUrls=o,yield e.setToUser(t,sr,null)),n&&(yield e.set(t,i))}))}(t,i))))}))}}var rr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ar={key:"providerKeys",stateDefinition:{name:"crypto"}};class lr extends jo{migrate(e){return rr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n,s;return rr(this,void 0,void 0,(function*(){const o=null===(s=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.providerKeys)||void 0===s?void 0:s.encrypted;null!=o&&(yield e.setToUser(t,ar,o),delete i.keys.providerKeys,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return rr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return rr(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,ar);i&&s&&(i.keys=Object.assign(null!==(n=i.keys)&&void 0!==n?n:{},{providerKeys:{encrypted:s}}),yield e.set(t,i)),yield e.setToUser(t,ar,null)}))}(t,i)))])}))}}var cr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ur={key:"clientKeyHalf",stateDefinition:{name:"biometricSettings"}};class dr extends jo{migrate(e){return cr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>cr(this,void 0,void 0,(function*(){var n,s;null!=(null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.biometricEncryptionClientKeyHalf)&&(yield e.setToUser(t,ur,i.keys.biometricEncryptionClientKeyHalf),null===(s=null==i?void 0:i.keys)||void 0===s||delete s.biometricEncryptionClientKeyHalf,yield e.set(t,i))})))))}))}rollback(e){return cr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>function(t,i){var n;return cr(this,void 0,void 0,(function*(){let s=!1;const o=yield e.getFromUser(t,ur);o&&(null!=i||(i={}),null!==(n=i.keys)&&void 0!==n||(i.keys={}),s=!0,i.keys.biometricEncryptionClientKeyHalf=o,yield e.setToUser(t,ur,null)),s&&(yield e.set(t,i))}))}(t,i))))}))}}var pr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const hr={key:"folders",stateDefinition:{name:"folder"}};class gr extends jo{migrate(e){return pr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n,s;return pr(this,void 0,void 0,(function*(){const o=null===(s=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.folders)||void 0===s?void 0:s.encrypted;null!=o&&(yield e.setToUser(t,hr,o),delete i.data.folders,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return pr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return pr(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,hr);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{folders:{encrypted:s}}),yield e.set(t,i)),yield e.setToUser(t,hr,null)}))}(t,i)))])}))}}var fr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const mr={key:"lastSync",stateDefinition:{name:"sync"}};class vr extends jo{migrate(e){return fr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return fr(this,void 0,void 0,(function*(){const s=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.lastSync;yield e.setToUser(t,mr,null!=s?s:null),null!=s&&(delete i.profile.lastSync,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return fr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return fr(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,mr);i&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{lastSync:s}),yield e.set(t,i)),yield e.setToUser(t,mr,null)}))}(t,i)))])}))}}var yr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const wr={key:"enablePasskeys",stateDefinition:{name:"vaultSettings"}};class br extends jo{migrate(e){return yr(this,void 0,void 0,(function*(){const t=yield e.get("global");null!=(null==t?void 0:t.enablePasskeys)&&(yield e.setToGlobal(wr,t.enablePasskeys),null==t||delete t.enablePasskeys,yield e.set("global",t))}))}rollback(e){return yr(this,void 0,void 0,(function*(){let t=yield e.get("global");const i=yield e.getFromGlobal(wr);null!=i&&(t=Object.assign(null!=t?t:{},{enablePasskeys:i}),yield e.set("global",t),yield e.setToGlobal(wr,void 0))}))}}var Ur=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const _r={stateDefinition:{name:"autofillSettings"}};class Ar extends jo{migrate(e){return Ur(this,void 0,void 0,(function*(){const t=yield e.get("global");null!=(null==t?void 0:t.autoFillOverlayVisibility)&&(yield e.setToGlobal({stateDefinition:{name:"autofillSettingsLocal"},key:"inlineMenuVisibility"},t.autoFillOverlayVisibility),delete t.autoFillOverlayVisibility,yield e.set("global",t));const i=yield e.getAccounts();yield Promise.all([...i.map((({userId:t,account:i})=>function(t,i){return Ur(this,void 0,void 0,(function*(){let n=!1;const s=null==i?void 0:i.settings;null!=(null==s?void 0:s.autoFillOnPageLoadDefault)&&(yield e.setToUser(t,Object.assign(Object.assign({},_r),{key:"autofillOnPageLoadDefault"}),s.autoFillOnPageLoadDefault),delete i.settings.autoFillOnPageLoadDefault,n=!0),null!=(null==s?void 0:s.enableAutoFillOnPageLoad)&&(yield e.setToUser(t,Object.assign(Object.assign({},_r),{key:"autofillOnPageLoad"}),null==s?void 0:s.enableAutoFillOnPageLoad),delete i.settings.enableAutoFillOnPageLoad,n=!0),null!=(null==s?void 0:s.dismissedAutoFillOnPageLoadCallout)&&(yield e.setToUser(t,Object.assign(Object.assign({},_r),{key:"autofillOnPageLoadCalloutIsDismissed"}),null==s?void 0:s.dismissedAutoFillOnPageLoadCallout),delete i.settings.dismissedAutoFillOnPageLoadCallout,n=!0),null!=(null==s?void 0:s.disableAutoTotpCopy)&&(yield e.setToUser(t,Object.assign(Object.assign({},_r),{key:"autoCopyTotp"}),!(null==s?void 0:s.disableAutoTotpCopy)),delete i.settings.disableAutoTotpCopy,n=!0),null!=(null==s?void 0:s.activateAutoFillOnPageLoadFromPolicy)&&(yield e.setToUser(t,{stateDefinition:{name:"autofillSettingsLocal"},key:"activateAutofillOnPageLoadFromPolicy"},null==s?void 0:s.activateAutoFillOnPageLoadFromPolicy),delete i.settings.activateAutoFillOnPageLoadFromPolicy,n=!0),n&&(yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return Ur(this,void 0,void 0,(function*(){const t=(yield e.get("global"))||{},i=yield e.getFromGlobal({stateDefinition:{name:"autofillSettingsLocal"},key:"inlineMenuVisibility"});i&&(yield e.set("global",Object.assign(Object.assign({},t),{autoFillOverlayVisibility:i})),yield e.setToGlobal({stateDefinition:{name:"autofillSettingsLocal"},key:"inlineMenuVisibility"},null));const n=yield e.getAccounts();yield Promise.all([...n.map((({userId:t,account:i})=>function(t,i){return Ur(this,void 0,void 0,(function*(){let n=!1,s=(null==i?void 0:i.settings)||{};const o=yield e.getFromUser(t,Object.assign(Object.assign({},_r),{key:"autofillOnPageLoadDefault"})),r=yield e.getFromUser(t,Object.assign(Object.assign({},_r),{key:"autofillOnPageLoad"})),a=yield e.getFromUser(t,Object.assign(Object.assign({},_r),{key:"autofillOnPageLoadCalloutIsDismissed"})),l=yield e.getFromUser(t,Object.assign(Object.assign({},_r),{key:"autoCopyTotp"})),c=yield e.getFromUser(t,{stateDefinition:{name:"autofillSettingsLocal"},key:"activateAutofillOnPageLoadFromPolicy"});null!=o&&(s=Object.assign(Object.assign({},s),{autoFillOnPageLoadDefault:o}),yield e.setToUser(t,Object.assign(Object.assign({},_r),{key:"autofillOnPageLoadDefault"}),null),n=!0),null!=r&&(s=Object.assign(Object.assign({},s),{enableAutoFillOnPageLoad:r}),yield e.setToUser(t,Object.assign(Object.assign({},_r),{key:"autofillOnPageLoad"}),null),n=!0),null!=a&&(s=Object.assign(Object.assign({},s),{dismissedAutoFillOnPageLoadCallout:a}),yield e.setToUser(t,Object.assign(Object.assign({},_r),{key:"autofillOnPageLoadCalloutIsDismissed"}),null),n=!0),null!=l&&(s=Object.assign(Object.assign({},s),{disableAutoTotpCopy:!l}),yield e.setToUser(t,Object.assign(Object.assign({},_r),{key:"autoCopyTotp"}),null),n=!0),null!=c&&(s=Object.assign(Object.assign({},s),{activateAutoFillOnPageLoadFromPolicy:c}),yield e.setToUser(t,{stateDefinition:{name:"autofillSettingsLocal"},key:"activateAutofillOnPageLoadFromPolicy"},null),n=!0),n&&(yield e.set(t,Object.assign(Object.assign({},i),{settings:s})))}))}(t,i)))])}))}}var Zr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const xr={key:"requirePasswordOnStart",stateDefinition:{name:"biometricSettings"}};class Sr extends jo{migrate(e){return Zr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>Zr(this,void 0,void 0,(function*(){var n;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.requirePasswordOnStart)&&(yield e.setToUser(t,xr,i.settings.requirePasswordOnStart),delete i.settings.requirePasswordOnStart,yield e.set(t,i))})))))}))}rollback(e){return Zr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>function(t,i){var n;return Zr(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,xr);s&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),i.settings.requirePasswordOnStart=s,yield e.setToUser(t,xr,null),yield e.set(t,i))}))}(t,i))))}))}}var Tr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Cr={key:"privateKey",stateDefinition:{name:"crypto"}};class Or extends jo{migrate(e){return Tr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n,s;return Tr(this,void 0,void 0,(function*(){const o=null===(s=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.privateKey)||void 0===s?void 0:s.encrypted;null!=o&&(yield e.setToUser(t,Cr,o),delete i.keys.privateKey,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return Tr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Tr(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,Cr);i&&s&&(i.keys=Object.assign(null!==(n=i.keys)&&void 0!==n?n:{},{privateKey:{encrypted:s}}),yield e.set(t,i)),yield e.setToUser(t,Cr,null)}))}(t,i)))])}))}}var kr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Pr={key:"collections",stateDefinition:{name:"collection"}};class qr extends jo{migrate(e){return kr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n,s;return kr(this,void 0,void 0,(function*(){const o=null===(s=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.collections)||void 0===s?void 0:s.encrypted;null!=o&&(yield e.setToUser(t,Pr,o),delete i.data.collections,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return kr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return kr(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,Pr);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{collections:{encrypted:s}}),yield e.set(t,i)),yield e.setToUser(t,Pr,null)}))}(t,i)))])}))}}var Ir=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Mr={key:"collapsedGroupings",stateDefinition:{name:"vaultFilter"}};class Nr extends jo{migrate(e){return Ir(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Ir(this,void 0,void 0,(function*(){const s=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.collapsedGroupings;null!=s&&(yield e.setToUser(t,Mr,s),delete i.settings.collapsedGroupings,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return Ir(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Ir(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,Mr);i&&(i.settings=Object.assign(null!==(n=i.settings)&&void 0!==n?n:{},{collapsedGroupings:s}),yield e.set(t,i)),yield e.setToUser(t,Mr,null)}))}(t,i)))])}))}}var Lr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Dr={key:"dismissedBiometricRequirePasswordOnStartCallout",stateDefinition:{name:"biometricSettings"}},Er={key:"promptAutomatically",stateDefinition:{name:"biometricSettings"}};class Fr extends jo{migrate(e){return Lr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>Lr(this,void 0,void 0,(function*(){var n,s,o,r;null!=i&&(null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.dismissedBiometricRequirePasswordOnStartCallout)&&(yield e.setToUser(t,Dr,i.settings.dismissedBiometricRequirePasswordOnStartCallout)),null!=(null===(s=null==i?void 0:i.settings)||void 0===s?void 0:s.disableAutoBiometricsPrompt)&&(yield e.setToUser(t,Er,!i.settings.disableAutoBiometricsPrompt)),null===(o=null==i?void 0:i.settings)||void 0===o||delete o.dismissedBiometricRequirePasswordOnStartCallout,null===(r=null==i?void 0:i.settings)||void 0===r||delete r.disableAutoBiometricsPrompt,yield e.set(t,i))})))))}))}rollback(e){return Lr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>function(t,i){var n,s;return Lr(this,void 0,void 0,(function*(){let o=!1;const r=yield e.getFromUser(t,Dr);r&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),o=!0,i.settings.dismissedBiometricRequirePasswordOnStartCallout=r,yield e.setToUser(t,Dr,null));const a=yield e.getFromUser(t,Er);null!=a&&(null!=i||(i={}),null!==(s=i.settings)&&void 0!==s||(i.settings={}),o=!0,i.settings.disableAutoBiometricsPrompt=!a,yield e.setToUser(t,Er,null)),o&&(yield e.set(t,i))}))}(t,i))))}))}}var Rr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Jr={key:"tasks",stateDefinition:{name:"smOnboarding"}};class zr extends jo{migrate(e){return Rr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>Rr(this,void 0,void 0,(function*(){var n;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.smOnboardingTasks)&&(yield e.setToUser(t,Jr,i.settings.smOnboardingTasks),delete i.settings.smOnboardingTasks,yield e.set(t,i))})))))}))}rollback(e){return Rr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>function(t,i){var n;return Rr(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,Jr);s&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),i.settings.smOnboardingTasks=s,yield e.setToUser(t,Jr,null),yield e.set(t,i))}))}(t,i))))}))}}var Yr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Kr={stateDefinition:{name:"autofillSettingsLocal"}};class Br extends jo{migrate(e){return Yr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return Yr(this,void 0,void 0,(function*(){const n=null==i?void 0:i.settings;void 0!==(null==n?void 0:n.clearClipboard)&&(yield e.setToUser(t,Object.assign(Object.assign({},Kr),{key:"clearClipboardDelay"}),n.clearClipboard),delete i.settings.clearClipboard,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return Yr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return Yr(this,void 0,void 0,(function*(){let n=(null==i?void 0:i.settings)||{};const s=yield e.getFromUser(t,Object.assign(Object.assign({},Kr),{key:"clearClipboardDelay"}));void 0!==s&&(n=Object.assign(Object.assign({},n),{clearClipboard:s}),yield e.setToUser(t,Object.assign(Object.assign({},Kr),{key:"clearClipboardDelay"}),null),yield e.set(t,Object.assign(Object.assign({},i),{settings:n})))}))}(t,i)))])}))}}var Qr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Gr={key:"lastSync",stateDefinition:{name:"sync"}};class jr extends jo{rollback(e){return Qr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Qr(this,void 0,void 0,(function*(){const s=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.lastSync;yield e.setToUser(t,Gr,null!=s?s:null),null!=s&&(delete i.profile.lastSync,yield e.set(t,i))}))}(t,i)))])}))}migrate(e){return Qr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Qr(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,Gr);i&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{lastSync:s}),yield e.set(t,i)),yield e.setToUser(t,Gr,null)}))}(t,i)))])}))}}var Vr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const $r={stateDefinition:{name:"badgeSettings"},key:"enableBadgeCounter"};class Hr extends jo{migrate(e){return Vr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return Vr(this,void 0,void 0,(function*(){const n=null==i?void 0:i.settings;null!=(null==n?void 0:n.disableBadgeCounter)&&(yield e.setToUser(t,$r,!n.disableBadgeCounter),delete i.settings.disableBadgeCounter,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return Vr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return Vr(this,void 0,void 0,(function*(){let n=(null==i?void 0:i.settings)||{};const s=yield e.getFromUser(t,$r);null!=s&&(n=Object.assign(Object.assign({},n),{disableBadgeCounter:!s}),yield e.setToUser(t,$r,null),yield e.set(t,Object.assign(Object.assign({},i),{settings:n})))}))}(t,i)))])}))}}var Wr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Xr={key:"biometricUnlockEnabled",stateDefinition:{name:"biometricSettings"}};class ea extends jo{migrate(e){return Wr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>Wr(this,void 0,void 0,(function*(){var n,s;null!=i&&(null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.biometricUnlock)&&(yield e.setToUser(t,Xr,i.settings.biometricUnlock)),null===(s=null==i?void 0:i.settings)||void 0===s||delete s.biometricUnlock,yield e.set(t,i))})))))}))}rollback(e){return Wr(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>function(t,i){var n;return Wr(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,Xr);null!=s&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),i.settings.biometricUnlock=s,yield e.setToUser(t,Xr,null),yield e.set(t,i))}))}(t,i))))}))}}var ta=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ia extends jo{migrate(e){return ta(this,void 0,void 0,(function*(){const t=yield e.get("global");null!=(null==t?void 0:t.disableAddLoginNotification)&&(yield e.setToGlobal({stateDefinition:{name:"userNotificationSettings"},key:"enableAddedLoginPrompt"},!t.disableAddLoginNotification),delete t.disableAddLoginNotification,yield e.set("global",t)),null!=(null==t?void 0:t.disableChangedPasswordNotification)&&(yield e.setToGlobal({stateDefinition:{name:"userNotificationSettings"},key:"enableChangedPasswordPrompt"},!t.disableChangedPasswordNotification),delete t.disableChangedPasswordNotification,yield e.set("global",t))}))}rollback(e){return ta(this,void 0,void 0,(function*(){const t=(yield e.get("global"))||{},i=yield e.getFromGlobal({stateDefinition:{name:"userNotificationSettings"},key:"enableAddedLoginPrompt"}),n=yield e.getFromGlobal({stateDefinition:{name:"userNotificationSettings"},key:"enableChangedPasswordPrompt"});i&&(yield e.set("global",Object.assign(Object.assign({},t),{disableAddLoginNotification:!i})),yield e.setToGlobal({stateDefinition:{name:"userNotificationSettings"},key:"enableAddedLoginPrompt"},null)),n&&(yield e.set("global",Object.assign(Object.assign({},t),{disableChangedPasswordNotification:!n})),yield e.setToGlobal({stateDefinition:{name:"userNotificationSettings"},key:"enableChangedPasswordPrompt"},null))}))}}var na,sa=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.TwoFactorAuthentication=0]="TwoFactorAuthentication",e[e.MasterPassword=1]="MasterPassword",e[e.PasswordGenerator=2]="PasswordGenerator",e[e.SingleOrg=3]="SingleOrg",e[e.RequireSso=4]="RequireSso",e[e.PersonalOwnership=5]="PersonalOwnership",e[e.DisableSend=6]="DisableSend",e[e.SendOptions=7]="SendOptions",e[e.ResetPassword=8]="ResetPassword",e[e.MaximumVaultTimeout=9]="MaximumVaultTimeout",e[e.DisablePersonalVaultExport=10]="DisablePersonalVaultExport",e[e.ActivateAutofill=11]="ActivateAutofill"}(na||(na={}));const oa={key:"policies",stateDefinition:{name:"policies"}};class ra extends jo{migrate(e){return sa(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>function(t,i){var n,s;return sa(this,void 0,void 0,(function*(){const o=null===(s=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.policies)||void 0===s?void 0:s.encrypted;null!=o&&(yield e.setToUser(t,oa,o),delete i.data.policies,yield e.set(t,i))}))}(t,i))))}))}rollback(e){return sa(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>function(t,i){var n;return sa(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,oa);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{policies:{encrypted:s}}),yield e.set(t,i)),yield e.setToUser(t,oa,null)}))}(t,i))))}))}}var aa=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const la={stateDefinition:{name:"autofillSettings"},key:"enableContextMenu"};class ca extends jo{migrate(e){return aa(this,void 0,void 0,(function*(){const t=yield e.get("global");null!=(null==t?void 0:t.disableContextMenuItem)&&(yield e.setToGlobal(la,!t.disableContextMenuItem),delete t.disableContextMenuItem,yield e.set("global",t))}))}rollback(e){return aa(this,void 0,void 0,(function*(){const t=(yield e.get("global"))||{},i=yield e.getFromGlobal(la);null!=i&&(yield e.set("global",Object.assign(Object.assign({},t),{disableContextMenuItem:!i})),yield e.setToGlobal(la,null))}))}}var ua=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const da={key:"locale",stateDefinition:{name:"translation"}};class pa extends jo{migrate(e){return ua(this,void 0,void 0,(function*(){const t=yield e.get("global");(null==t?void 0:t.locale)&&(yield e.setToGlobal(da,t.locale),delete t.locale,yield e.set("global",t))}))}rollback(e){var t;return ua(this,void 0,void 0,(function*(){const i=yield e.getFromGlobal(da);if(!i)return;const n=null!==(t=yield e.get("global"))&&void 0!==t?t:{};n.locale=i,yield e.set("global",n),yield e.setToGlobal(da,null)}))}}var ha=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ga="appId",fa="anonymousAppId",ma={key:ga,stateDefinition:{name:"applicationId"}},va={key:fa,stateDefinition:{name:"applicationId"}};class ya extends jo{migrate(e){return ha(this,void 0,void 0,(function*(){const t=yield e.get(ga),i=yield e.get(fa);null!=t&&(yield e.setToGlobal(ma,t),yield e.set(ga,null)),null!=i&&(yield e.setToGlobal(va,i),yield e.set(fa,null))}))}rollback(e){return ha(this,void 0,void 0,(function*(){const t=yield e.getFromGlobal(ma),i=yield e.getFromGlobal(va);null!=t&&(yield e.set(ga,t),yield e.setToGlobal(ma,null)),null!=i&&(yield e.set(fa,i),yield e.setToGlobal(va,null))}))}}var wa=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ba={stateDefinition:{name:"domainSettings"},key:"defaultUriMatchStrategy"},Ua={stateDefinition:{name:"domainSettings"},key:"equivalentDomains"},_a={stateDefinition:{name:"domainSettings"},key:"neverDomains"};class Aa extends jo{migrate(e){return wa(this,void 0,void 0,(function*(){let t=!1;const i=yield e.get("global");null!=(null==i?void 0:i.neverDomains)&&(yield e.setToGlobal(_a,i.neverDomains),delete i.neverDomains,yield e.set("global",i));const n=yield e.getAccounts();yield Promise.all([...n.map((({userId:i,account:n})=>function(i,n){var s;return wa(this,void 0,void 0,(function*(){const o=null==n?void 0:n.settings;null!=(null==o?void 0:o.defaultUriMatch)&&(yield e.setToUser(i,ba,o.defaultUriMatch),delete n.settings.defaultUriMatch,t=!0),null!=(null===(s=null==o?void 0:o.settings)||void 0===s?void 0:s.equivalentDomains)&&(yield e.setToUser(i,Ua,o.settings.equivalentDomains),delete n.settings.settings.equivalentDomains,delete n.settings.settings,t=!0),t&&(yield e.set(i,n))}))}(i,n)))])}))}rollback(e){return wa(this,void 0,void 0,(function*(){let t=!1;const i=(yield e.get("global"))||{},n=yield e.getFromGlobal(_a);null!=n&&(yield e.set("global",Object.assign(Object.assign({},i),{neverDomains:n})),yield e.setToGlobal(_a,null));const s=yield e.getAccounts();yield Promise.all([...s.map((({userId:i,account:n})=>function(i,n){return wa(this,void 0,void 0,(function*(){let s=(null==n?void 0:n.settings)||{};const o=yield e.getFromUser(i,ba),r=yield e.getFromUser(i,Ua);null!=o&&(s=Object.assign(Object.assign({},s),{defaultUriMatch:o}),yield e.setToUser(i,ba,null),t=!0),null!=r&&(s=Object.assign(Object.assign({},s),{settings:{equivalentDomains:r}}),yield e.setToUser(i,Ua,null),t=!0),t&&(yield e.set(i,Object.assign(Object.assign({},n),{settings:s})))}))}(i,n)))])}))}}var Za=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const xa={key:"selection",stateDefinition:{name:"theming"}};class Sa extends jo{migrate(e){return Za(this,void 0,void 0,(function*(){const t=yield e.get("global"),i=null==t?void 0:t.theme;null!=i&&(yield e.setToGlobal(xa,i),delete t.theme,yield e.set("global",t))}))}rollback(e){var t;return Za(this,void 0,void 0,(function*(){const i=yield e.getFromGlobal(xa);if(null!=i){const n=null!==(t=yield e.get("global"))&&void 0!==t?t:{};n.theme=i,yield e.set("global",n),yield e.removeFromGlobal(xa)}}))}}var Ta=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Ca={stateDefinition:{name:"vaultSettings"}};class Oa extends jo{migrate(e){return Ta(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return Ta(this,void 0,void 0,(function*(){let n=!1;const s=null==i?void 0:i.settings;null!=(null==s?void 0:s.dontShowCardsCurrentTab)&&(yield e.setToUser(t,Object.assign(Object.assign({},Ca),{key:"showCardsCurrentTab"}),!s.dontShowCardsCurrentTab),delete i.settings.dontShowCardsCurrentTab,n=!0),null!=(null==s?void 0:s.dontShowIdentitiesCurrentTab)&&(yield e.setToUser(t,Object.assign(Object.assign({},Ca),{key:"showIdentitiesCurrentTab"}),!s.dontShowIdentitiesCurrentTab),delete i.settings.dontShowIdentitiesCurrentTab,n=!0),n&&(yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return Ta(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Ta(this,void 0,void 0,(function*(){let s=!1,o=null!==(n=null==i?void 0:i.settings)&&void 0!==n?n:{};const r=yield e.getFromUser(t,Object.assign(Object.assign({},Ca),{key:"showCardsCurrentTab"})),a=yield e.getFromUser(t,Object.assign(Object.assign({},Ca),{key:"showIdentitiesCurrentTab"}));null!=r&&(o=Object.assign(Object.assign({},o),{dontShowCardsCurrentTab:!r}),yield e.setToUser(t,Object.assign(Object.assign({},Ca),{key:"showCardsCurrentTab"}),null),s=!0),null!=a&&(o=Object.assign(Object.assign({},o),{dontShowIdentitiesCurrentTab:!a}),yield e.setToUser(t,Object.assign(Object.assign({},Ca),{key:"showIdentitiesCurrentTab"}),null),s=!0),s&&(yield e.set(t,Object.assign(Object.assign({},i),{settings:o})))}))}(t,i)))])}))}}var ka=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Pa={key:"avatarColor",stateDefinition:{name:"avatar"}};class qa extends jo{migrate(e){return ka(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>ka(this,void 0,void 0,(function*(){var n,s;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.avatarColor)&&(yield e.setToUser(t,Pa,i.settings.avatarColor),null===(s=null==i?void 0:i.settings)||void 0===s||delete s.avatarColor,yield e.set(t,i))})))))}))}rollback(e){return ka(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>function(t,i){return ka(this,void 0,void 0,(function*(){let n=!1;const s=yield e.getFromUser(t,Pa);s&&(i||(i={}),n=!0,i.settings.avatarColor=s,yield e.setToUser(t,Pa,null)),n&&(yield e.set(t,i))}))}(t,i))))}))}}var Ia=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Ma={key:"emailTwoFactorTokenRecord",stateDefinition:{name:"tokenDiskLocal"}},Na={name:"token"},La={key:"accessToken",stateDefinition:Na},Da={key:"refreshToken",stateDefinition:Na},Ea={key:"apiKeyClientId",stateDefinition:Na},Fa={key:"apiKeyClientSecret",stateDefinition:Na};class Ra extends jo{migrate(e){return Ia(this,void 0,void 0,(function*(){const t=yield e.get("global"),i={},n=yield e.getAccounts();yield Promise.all([...n.map((({userId:n,account:s})=>function(t,i,n,s){var o,r,a,l,c;return Ia(this,void 0,void 0,(function*(){let u=!1;const d=null===(o=null==i?void 0:i.profile)||void 0===o?void 0:o.email;null!=n&&null!=i&&null!=d&&(s[d]=n);const p=null===(r=null==i?void 0:i.tokens)||void 0===r?void 0:r.accessToken;null!=p&&("web-disk-local"!==e.type&&(yield e.setToUser(t,La,p)),delete i.tokens.accessToken,u=!0);const h=null===(a=null==i?void 0:i.tokens)||void 0===a?void 0:a.refreshToken;null!=h&&("web-disk-local"!==e.type&&(yield e.setToUser(t,Da,h)),delete i.tokens.refreshToken,u=!0);const g=null===(l=null==i?void 0:i.profile)||void 0===l?void 0:l.apiKeyClientId;null!=g&&("web-disk-local"!==e.type&&(yield e.setToUser(t,Ea,g)),delete i.profile.apiKeyClientId,u=!0);const f=null===(c=null==i?void 0:i.keys)||void 0===c?void 0:c.apiKeyClientSecret;null!=f&&("web-disk-local"!==e.type&&(yield e.setToUser(t,Fa,f)),delete i.keys.apiKeyClientSecret,u=!0),u&&(yield e.set(t,i))}))}(n,s,null==t?void 0:t.twoFactorToken,i)))]),yield e.setToGlobal(Ma,i),null==t||delete t.twoFactorToken,yield e.set("global",t)}))}rollback(e){var t;return Ia(this,void 0,void 0,(function*(){const i=yield e.getAccounts();let n=null;for(const{account:s}of i){const i=null===(t=null==s?void 0:s.profile)||void 0===t?void 0:t.email;if(null==i)continue;if(n=(yield e.getFromGlobal(Ma))[i],null!=n)break}if(null!=n){let t=yield e.get("global");t||(t={}),t.twoFactorToken=n,yield e.set("global",t)}yield e.setToGlobal(Ma,null),yield Promise.all([...i.map((({userId:t,account:i})=>function(t,i){return Ia(this,void 0,void 0,(function*(){let n=!1;const s=yield e.getFromUser(t,La);(null==i?void 0:i.tokens)&&null!=s&&(i.tokens.accessToken=s,n=!0),yield e.setToUser(t,La,null);const o=yield e.getFromUser(t,Da);(null==i?void 0:i.tokens)&&null!=o&&(i.tokens.refreshToken=o,n=!0),yield e.setToUser(t,Da,null);const r=yield e.getFromUser(t,Ea);(null==i?void 0:i.profile)&&null!=r&&(i.profile.apiKeyClientId=r,n=!0),yield e.setToUser(t,Ea,null);const a=yield e.getFromUser(t,Fa);(null==i?void 0:i.keys)&&null!=a&&(i.keys.apiKeyClientSecret=a,n=!0),yield e.setToUser(t,Fa,null),n&&(yield e.set(t,i))}))}(t,i)))])}))}}var Ja=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const za={key:"accountProfile",stateDefinition:{name:"billing"}};class Ya extends jo{migrate(e){return Ja(this,void 0,void 0,(function*(){const t=yield e.getAccounts(),i=(t,i)=>Ja(this,void 0,void 0,(function*(){var n,s,o,r;const a=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.hasPremiumPersonally,l=null===(s=null==i?void 0:i.profile)||void 0===s?void 0:s.hasPremiumFromOrganization;null==a&&null==l||(yield e.setToUser(t,za,{hasPremiumPersonally:a,hasPremiumFromOrganization:l}),null===(o=null==i?void 0:i.profile)||void 0===o||delete o.hasPremiumPersonally,null===(r=null==i?void 0:i.profile)||void 0===r||delete r.hasPremiumFromOrganization,yield e.set(t,i))}));yield Promise.all([...t.map((({userId:e,account:t})=>i(e,t)))])}))}rollback(e){return Ja(this,void 0,void 0,(function*(){const t=yield e.getAccounts(),i=(t,i)=>Ja(this,void 0,void 0,(function*(){var n;const s=yield e.getFromUser(t,za);i&&s&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{hasPremiumPersonally:null==s?void 0:s.hasPremiumPersonally,hasPremiumFromOrganization:null==s?void 0:s.hasPremiumFromOrganization}),yield e.set(t,i)),yield e.setToUser(t,za,null)}));yield Promise.all([...t.map((({userId:e,account:t})=>i(e,t)))])}))}}var Ka=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ba extends jo{migrate(e){return Ka(this,void 0,void 0,(function*(){const t=yield e.getAccounts();Promise.all(t.map((({userId:t,account:i})=>function(t,i){var n;return Ka(this,void 0,void 0,(function*(){if(null!=(null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.everBeenUnlocked))return delete i.profile.everBeenUnlocked,e.set(t,i)}))}(t,i))))}))}rollback(e){throw Go}updateVersion(e,t){return Ka(this,void 0,void 0,(function*(){const i="up"===t?this.toVersion:this.fromVersion;e.currentVersion=i;const n=(yield e.get("global"))||{};yield e.set("global",Object.assign(Object.assign({},n),{stateVersion:i}))}))}}var Qa,Ga,ja,Va,$a=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed",e[e.Revoked=-1]="Revoked"}(Qa||(Qa={})),function(e){e[e.Owner=0]="Owner",e[e.Admin=1]="Admin",e[e.User=2]="User",e[e.Manager=3]="Manager",e[e.Custom=4]="Custom"}(Ga||(Ga={})),function(e){e[e.Msp=0]="Msp",e[e.Reseller=1]="Reseller"}(ja||(ja={})),function(e){e[e.Free=0]="Free",e[e.Families=1]="Families",e[e.Teams=2]="Teams",e[e.Enterprise=3]="Enterprise",e[e.TeamsStarter=4]="TeamsStarter"}(Va||(Va={}));const Ha={key:"organizations",stateDefinition:{name:"organizations"}};class Wa extends jo{migrate(e){return $a(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>function(t,i){var n;return $a(this,void 0,void 0,(function*(){const s=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.organizations;null!=s&&(yield e.setToUser(t,Ha,s),delete i.data.organizations,yield e.set(t,i))}))}(t,i))))}))}rollback(e){return $a(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>function(t,i){var n;return $a(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,Ha);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{organizations:s}),yield e.set(t,i)),yield e.setToUser(t,Ha,null)}))}(t,i))))}))}}var Xa=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const el={stateDefinition:{name:"eventCollection"},key:"eventCollection"};class tl extends jo{migrate(e){return Xa(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Xa(this,void 0,void 0,(function*(){const s=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.eventCollection;null!=s&&(yield e.setToUser(t,el,s),delete i.data.eventCollection,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return Xa(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Xa(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,el);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{eventCollection:s}),yield e.set(t,i)),yield e.setToUser(t,el,null)}))}(t,i)))])}))}}var il=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const nl={stateDefinition:{name:"domainSettings"},key:"showFavicons"};class sl extends jo{migrate(e){return il(this,void 0,void 0,(function*(){const t=yield e.get("global");null!=(null==t?void 0:t.disableFavicon)&&(yield e.setToGlobal(nl,!t.disableFavicon),delete t.disableFavicon,yield e.set("global",t))}))}rollback(e){return il(this,void 0,void 0,(function*(){const t=(yield e.get("global"))||{},i=yield e.getFromGlobal(nl);null!=i&&(yield e.set("global",Object.assign(Object.assign({},t),{disableFavicon:!i})),yield e.setToGlobal(nl,null))}))}}var ol=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const rl={key:"autoConfirmFingerPrints",stateDefinition:{name:"organizationManagementPreferences"}};class al extends jo{migrate(e){return ol(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>ol(this,void 0,void 0,(function*(){var n,s;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.autoConfirmFingerPrints)&&(yield e.setToUser(t,rl,i.settings.autoConfirmFingerPrints),null===(s=null==i?void 0:i.settings)||void 0===s||delete s.autoConfirmFingerPrints,yield e.set(t,i))})))))}))}rollback(e){return ol(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>function(t,i){return ol(this,void 0,void 0,(function*(){let n=!1;const s=yield e.getFromUser(t,rl);s&&(i||(i={}),n=!0,i.settings.autoConfirmFingerPrints=s,yield e.setToUser(t,rl,null)),n&&(yield e.set(t,i))}))}(t,i))))}))}}var ll=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const cl={key:"decryptionOptions",stateDefinition:{name:"userDecryptionOptions"}};class ul extends jo{migrate(e){return ll(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return ll(this,void 0,void 0,(function*(){const n=null==i?void 0:i.decryptionOptions;null!=n&&(yield e.setToUser(t,cl,n),delete i.decryptionOptions,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return ll(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return ll(this,void 0,void 0,(function*(){const n=yield e.getFromUser(t,cl);i&&(i.decryptionOptions=Object.assign(i.decryptionOptions,n),yield e.set(t,i)),yield e.setToUser(t,cl,null)}))}(t,i)))])}))}}var dl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const pl={name:"environment"},hl={key:"region",stateDefinition:pl},gl={key:"urls",stateDefinition:pl},fl={key:"environment",stateDefinition:pl};class ml extends jo{migrate(e){return dl(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return dl(this,void 0,void 0,(function*(){const i=yield e.getFromUser(t,hl),n=yield e.getFromUser(t,gl);null==i&&null==n||(yield e.setToUser(t,fl,{region:i,urls:n}),yield e.removeFromUser(t,hl),yield e.removeFromUser(t,gl))}))}(t)))]);const i=yield e.getFromGlobal(hl),n=yield e.getFromGlobal(gl);null==i&&null==n||(yield e.setToGlobal(fl,{region:i,urls:n}),yield e.removeFromGlobal(hl),yield e.removeFromGlobal(gl))}))}rollback(e){return dl(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return dl(this,void 0,void 0,(function*(){const i=yield e.getFromUser(t,fl);yield e.setToUser(t,hl,null==i?void 0:i.region),yield e.setToUser(t,gl,null==i?void 0:i.urls),yield e.removeFromUser(t,fl)}))}(t)))]);const i=yield e.getFromGlobal(fl);yield e.setToGlobal(hl,null==i?void 0:i.region),yield e.setToGlobal(gl,null==i?void 0:i.urls),yield e.removeFromGlobal(fl)}))}}var vl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const yl={key:"promptCancelled",stateDefinition:{name:"biometricSettings"}};class wl extends jo{migrate(e){return vl(this,void 0,void 0,(function*(){yield Promise.all((yield e.getAccounts()).map((({userId:t})=>vl(this,void 0,void 0,(function*(){null!=e.getFromUser(t,yl)&&(yield e.removeFromUser(t,yl))})))))}))}rollback(e){return vl(this,void 0,void 0,(function*(){throw Go}))}}var bl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Ul={name:"desktopSettings"},_l={key:"window",stateDefinition:Ul},Al={key:"closeToTray",stateDefinition:Ul},Zl={key:"minimizeToTray",stateDefinition:Ul},xl={key:"startToTray",stateDefinition:Ul},Sl={key:"trayEnabled",stateDefinition:Ul},Tl={key:"openAtLogin",stateDefinition:Ul},Cl={key:"alwaysShowDock",stateDefinition:Ul},Ol={key:"alwaysOnTop",stateDefinition:Ul};class kl extends jo{migrate(e){return bl(this,void 0,void 0,(function*(){const t=yield e.get("global");let i=!1;void 0!==(null==t?void 0:t.window)&&(yield e.setToGlobal(_l,t.window),i=!0,delete t.window),null!=(null==t?void 0:t.enableCloseToTray)&&(yield e.setToGlobal(Al,t.enableCloseToTray),i=!0,delete t.enableCloseToTray),null!=(null==t?void 0:t.enableMinimizeToTray)&&(yield e.setToGlobal(Zl,t.enableMinimizeToTray),i=!0,delete t.enableMinimizeToTray),null!=(null==t?void 0:t.enableStartToTray)&&(yield e.setToGlobal(xl,t.enableStartToTray),i=!0,delete t.enableStartToTray),null!=(null==t?void 0:t.enableTray)&&(yield e.setToGlobal(Sl,t.enableTray),i=!0,delete t.enableTray),null!=(null==t?void 0:t.openAtLogin)&&(yield e.setToGlobal(Tl,t.openAtLogin),i=!0,delete t.openAtLogin),null!=(null==t?void 0:t.alwaysShowDock)&&(yield e.setToGlobal(Cl,t.alwaysShowDock),i=!0,delete t.alwaysShowDock),null!=(null==t?void 0:t.enableAlwaysOnTop)&&(yield e.setToGlobal(Ol,t.enableAlwaysOnTop),i=!0,delete t.enableAlwaysOnTop),i&&(yield e.set("global",t));const n=yield e.getAccounts();yield Promise.all(n.map((({userId:t,account:i})=>function(t,i){var n;return bl(this,void 0,void 0,(function*(){null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.enableAlwaysOnTop)&&(delete i.settings.enableAlwaysOnTop,yield e.set(t,i))}))}(t,i))))}))}rollback(e){throw Go}}var Pl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ql={key:"enableDuckDuckGoBrowserIntegration",stateDefinition:{name:"autofillSettings"}};class Il extends jo{migrate(e){return Pl(this,void 0,void 0,(function*(){const t=yield e.get("global");null!=(null==t?void 0:t.enableDuckDuckGoBrowserIntegration)&&(yield e.setToGlobal(ql,t.enableDuckDuckGoBrowserIntegration),delete t.enableDuckDuckGoBrowserIntegration,yield e.set("global",t))}))}rollback(e){var t;return Pl(this,void 0,void 0,(function*(){const i=yield e.getFromGlobal(ql);if(!i)return;const n=null!==(t=yield e.get("global"))&&void 0!==t?t:{};n.enableDuckDuckGoBrowserIntegration=i,yield e.set("global",n),yield e.removeFromGlobal(ql)}))}}var Ml=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Nl={stateDefinition:{name:"config"},key:"serverConfig"};class Ll extends jo{migrate(e){return Ml(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Ml(this,void 0,void 0,(function*(){null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.serverConfig)&&(yield e.setToUser(t,Nl,i.settings.serverConfig),delete i.settings.serverConfig,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return Ml(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Ml(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,Nl);s&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),i.settings.serverConfig=s,yield e.setToUser(t,Nl,null),yield e.set(t,i))}))}(t,i)))])}))}}var Dl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class El extends jo{migrate(e){return Dl(this,void 0,void 0,(function*(){const t=yield e.getAccounts();Promise.all(t.map((({userId:t,account:i})=>function(t,i){var n,s;return Dl(this,void 0,void 0,(function*(){const o=null===(s=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.organizationKeys)||void 0===s?void 0:s.encrypted;if(null==o)return;const r={};Object.entries(o).forEach((([e,t])=>{r[e]={type:"organization",key:t}})),i.keys.organizationKeys.encrypted=r,yield e.set(t,i)}))}(t,i))))}))}rollback(e){return Dl(this,void 0,void 0,(function*(){const t=yield e.getAccounts();Promise.all(t.map((({userId:t,account:i})=>Dl(this,void 0,void 0,(function*(){return function(t,i){var n,s;return Dl(this,void 0,void 0,(function*(){const o=null===(s=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.organizationKeys)||void 0===s?void 0:s.encrypted;if(null==o)return;const r={};Object.entries(o).forEach((([e,t])=>{r[e]=t.key})),i.keys.organizationKeys.encrypted=r,yield e.set(t,i)}))}(t,i)})))))}))}updateVersion(e,t){return Dl(this,void 0,void 0,(function*(){const i="up"===t?this.toVersion:this.fromVersion;e.currentVersion=i;const n=(yield e.get("global"))||{};yield e.set("global",Object.assign(Object.assign({},n),{stateVersion:i}))}))}}var Fl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Rl={key:"usesKeyConnector",stateDefinition:{name:"keyConnector"}},Jl={key:"convertAccountToKeyConnector",stateDefinition:{name:"keyConnector"}};class zl extends jo{migrate(e){return Fl(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n,s;return Fl(this,void 0,void 0,(function*(){const o=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.usesKeyConnector,r=null===(s=null==i?void 0:i.profile)||void 0===s?void 0:s.convertAccountToKeyConnector;null==o&&null==r||(null!=o&&(yield e.setToUser(t,Rl,o),delete i.profile.usesKeyConnector),null!=r&&(yield e.setToUser(t,Jl,r),delete i.profile.convertAccountToKeyConnector),yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return Fl(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return Fl(this,void 0,void 0,(function*(){const n=yield e.getFromUser(t,Rl),s=yield e.getFromUser(t,Jl);null==n&&null==s||(null!=n&&(i.profile.usesKeyConnector=n,yield e.setToUser(t,Rl,null)),null!=s&&(i.profile.convertAccountToKeyConnector=s,yield e.setToUser(t,Jl,null)),yield e.set(t,i))}))}(t,i)))])}))}}var Yl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Kl={key:"storedEmail",stateDefinition:{name:"loginEmail"}};class Bl extends jo{migrate(e){return Yl(this,void 0,void 0,(function*(){const t=yield e.get("global");null!=(null==t?void 0:t.rememberedEmail)&&(yield e.setToGlobal(Kl,t.rememberedEmail)),null==t||delete t.rememberedEmail,yield e.set("global",t)}))}rollback(e){return Yl(this,void 0,void 0,(function*(){let t=yield e.get("global"),i=!1;const n=yield e.getFromGlobal(Kl);n&&(t||(t={}),i=!0,t.rememberedEmail=n,yield e.setToGlobal(Kl,null)),i&&(yield e.set("global",t))}))}}var Ql=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Gl extends jo{migrate(e){return Ql(this,void 0,void 0,(function*(){const t=yield e.get("global");null!=(null==t?void 0:t.installedVersion)&&(delete t.installedVersion,yield e.set("global",t))}))}rollback(e){throw Go}}var jl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Vl={key:"deviceKey",stateDefinition:{name:"deviceTrust"}},$l={key:"shouldTrustDevice",stateDefinition:{name:"deviceTrust"}};class Hl extends jo{migrate(e){return jl(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n,s;return jl(this,void 0,void 0,(function*(){let o=!1;const r=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.deviceKey;null!=r&&(yield e.setToUser(t,Vl,r),delete i.keys.deviceKey,o=!0);const a=null===(s=null==i?void 0:i.settings)||void 0===s?void 0:s.trustDeviceChoiceForDecryption;null!=a&&(yield e.setToUser(t,$l,a),delete i.settings.trustDeviceChoiceForDecryption,o=!0),o&&(yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return jl(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return jl(this,void 0,void 0,(function*(){const n=yield e.getFromUser(t,Vl);(null==i?void 0:i.keys)&&null!=n&&(i.keys.deviceKey=n,yield e.set(t,i)),yield e.setToUser(t,Vl,null);const s=yield e.getFromUser(t,$l);(null==i?void 0:i.settings)&&null!=s&&(i.settings.trustDeviceChoiceForDecryption=s,yield e.set(t,i)),yield e.setToUser(t,$l,null)}))}(t,i)))])}))}}var Wl,Xl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.Text=0]="Text",e[e.File=1]="File"}(Wl||(Wl={}));const ec={stateDefinition:{name:"send"},key:"sends"};class tc extends jo{migrate(e){return Xl(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n,s;return Xl(this,void 0,void 0,(function*(){const o=null===(s=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.sends)||void 0===s?void 0:s.encrypted;null!=o&&(yield e.setToUser(t,ec,o),delete i.data.sends,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return Xl(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return Xl(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,ec);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{sends:{encrypted:s}}),yield e.set(t,i)),yield e.setToUser(t,ec,null)}))}(t,i)))])}))}}var ic=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const nc={key:"forceSetPasswordReason",stateDefinition:{name:"masterPassword"}},sc={key:"masterKeyHash",stateDefinition:{name:"masterPassword"}},oc={key:"masterKeyEncryptedUserKey",stateDefinition:{name:"masterPassword"}};class rc extends jo{migrate(e){return ic(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n,s,o;return ic(this,void 0,void 0,(function*(){const r=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.forceSetPasswordReason;null!=r&&(yield e.setToUser(t,nc,r),delete i.profile.forceSetPasswordReason,yield e.set(t,i));const a=null===(s=null==i?void 0:i.profile)||void 0===s?void 0:s.keyHash;null!=a&&(yield e.setToUser(t,sc,a),delete i.profile.keyHash,yield e.set(t,i));const l=null===(o=null==i?void 0:i.keys)||void 0===o?void 0:o.masterKeyEncryptedUserKey;null!=l&&(yield e.setToUser(t,oc,l),delete i.keys.masterKeyEncryptedUserKey,yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return ic(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n,s,o;return ic(this,void 0,void 0,(function*(){const r=yield e.getFromUser(t,nc),a=yield e.getFromUser(t,sc),l=yield e.getFromUser(t,oc);null!=i&&(null!=r&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{forceSetPasswordReason:r})),null!=a&&(i.profile=Object.assign(null!==(s=i.profile)&&void 0!==s?s:{},{keyHash:a})),null!=l&&(i.keys=Object.assign(null!==(o=i.keys)&&void 0!==o?o:{},{masterKeyEncryptedUserKey:l})),yield e.set(t,i)),yield e.setToUser(t,nc,null),yield e.setToUser(t,sc,null)}))}(t,i)))])}))}}var ac=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const lc={stateDefinition:{name:"authRequestLocal"},key:"adminAuthRequest"},cc={stateDefinition:{name:"authRequestLocal"},key:"acceptAuthRequests"};class uc extends jo{migrate(e){return ac(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return ac(this,void 0,void 0,(function*(){let s=!1;const o=null==i?void 0:i.adminAuthRequest;null!=o&&(yield e.setToUser(t,lc,o),delete i.adminAuthRequest,s=!0);const r=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.approveLoginRequests;null!=r&&(yield e.setToUser(t,cc,r),delete i.settings.approveLoginRequests,s=!0),s&&(yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return ac(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return ac(this,void 0,void 0,(function*(){let s=!1;const o=yield e.getFromUser(t,lc);null!=o&&(i.adminAuthRequest=o,s=!0),yield e.setToUser(t,lc,null);const r=yield e.getFromUser(t,cc);null!=r&&(i.settings=Object.assign(null!==(n=i.settings)&&void 0!==n?n:{},{approveLoginRequests:r}),s=!0),yield e.setToUser(t,cc,null),s&&(yield e.set(t,i))}))}(t,i)))])}))}}var dc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const pc={key:"localData",stateDefinition:{name:"ciphersLocal"}},hc={key:"ciphers",stateDefinition:{name:"ciphers"}};class gc extends jo{migrate(e){return dc(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n,s,o;return dc(this,void 0,void 0,(function*(){let r=!1;const a=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.localData;null!=a&&(yield e.setToUser(t,pc,a),delete i.data.localData,r=!0);const l=null===(o=null===(s=null==i?void 0:i.data)||void 0===s?void 0:s.ciphers)||void 0===o?void 0:o.encrypted;null!=l&&(yield e.setToUser(t,hc,l),delete i.data.ciphers,r=!0),r&&(yield e.set(t,i))}))}(t,i)))])}))}rollback(e){return dc(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n;return dc(this,void 0,void 0,(function*(){const s=yield e.getFromUser(t,pc);i.data&&null!=s&&(i.data.localData=s,yield e.set(t,i)),yield e.setToUser(t,pc,null);const o=yield e.getFromUser(t,hc);i.data&&null!=o&&((n=i.data).ciphers||(n.ciphers={encrypted:null}),i.data.ciphers.encrypted=o,yield e.set(t,i)),yield e.setToUser(t,hc,null)}))}(t,i)))])}))}}var fc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const mc={key:"refreshTokenMigratedToSecureStorage",stateDefinition:{name:"token"}};class vc extends jo{migrate(e){return fc(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return fc(this,void 0,void 0,(function*(){null!=(yield e.getFromUser(t,mc))&&(yield e.removeFromUser(t,mc))}))}(t)))])}))}rollback(e){return fc(this,void 0,void 0,(function*(){throw Go}))}}var yc,wc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.PBKDF2_SHA256=0]="PBKDF2_SHA256",e[e.Argon2id=1]="Argon2id"}(yc||(yc={}));const bc={key:"kdfConfig",stateDefinition:{name:"kdfConfig"}};class Uc extends jo{migrate(e){return wc(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){var n,s,o,r,a,l,c,u;return wc(this,void 0,void 0,(function*(){const d={iterations:null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.kdfIterations,kdfType:null===(s=null==i?void 0:i.profile)||void 0===s?void 0:s.kdfType,memory:null===(o=null==i?void 0:i.profile)||void 0===o?void 0:o.kdfMemory,parallelism:null===(r=null==i?void 0:i.profile)||void 0===r?void 0:r.kdfParallelism};null!=d&&(yield e.setToUser(t,bc,d),null===(a=null==i?void 0:i.profile)||void 0===a||delete a.kdfIterations,null===(l=null==i?void 0:i.profile)||void 0===l||delete l.kdfType,null===(c=null==i?void 0:i.profile)||void 0===c||delete c.kdfMemory,null===(u=null==i?void 0:i.profile)||void 0===u||delete u.kdfParallelism),yield e.set(t,i)}))}(t,i)))])}))}rollback(e){return wc(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all([...t.map((({userId:t,account:i})=>function(t,i){return wc(this,void 0,void 0,(function*(){const n=yield e.getFromUser(t,bc);null!=n&&(i.profile.kdfIterations=n.iterations,i.profile.kdfType=n.kdfType,i.profile.kdfMemory=n.memory,i.profile.kdfParallelism=n.parallelism,yield e.setToUser(t,bc,null)),yield e.set(t,i)}))}(t,i)))])}))}}var _c=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ac extends jo{migrate(e){return _c(this,void 0,void 0,(function*(){const t=yield e.getAccounts();yield Promise.all(t.map((({userId:t,account:i})=>function(t,i){var n;return _c(this,void 0,void 0,(function*(){(null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.legacyEtmKey)&&(delete i.keys.legacyEtmKey,yield e.set(t,i))}))}(t,i))))}))}rollback(e){return _c(this,void 0,void 0,(function*(){throw Go}))}updateVersion(e,t){return _c(this,void 0,void 0,(function*(){const i="up"===t?this.toVersion:this.fromVersion;e.currentVersion=i;const n=(yield e.get("global"))||{};yield e.set("global",Object.assign(Object.assign({},n),{stateVersion:i}))}))}}var Zc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const xc={stateDefinition:{name:"account"},key:"accounts"},Sc={stateDefinition:{name:"account"},key:"activeAccountId"},Tc={stateDefinition:{name:"account"},key:"activity"};class Cc extends jo{migrate(e){return Zc(this,void 0,void 0,(function*(){yield this.migrateAuthenticatedAccounts(e),yield this.migrateActiveAccountId(e),yield this.migrateAccountActivity(e)}))}rollback(e){var t;return Zc(this,void 0,void 0,(function*(){const i=null!==(t=yield e.getKnownUserIds())&&void 0!==t?t:[];yield e.set("authenticatedAccounts",i),yield e.removeFromGlobal(xc);const n=yield e.getFromGlobal(Sc);n&&(yield e.set("activeUserId",n)),yield e.removeFromGlobal(Sc);const s=yield e.getFromGlobal(Tc);if(s){const t=Object.entries(s).reduce(((e,[t,i])=>(e[t]=new Date(i).getTime(),e)),{});yield e.set("accountActivity",t)}yield e.removeFromGlobal(Tc)}))}migrateAuthenticatedAccounts(e){var t;return Zc(this,void 0,void 0,(function*(){const i=null!==(t=yield e.get("authenticatedAccounts"))&&void 0!==t?t:[],n=yield Promise.all(i.map((t=>Zc(this,void 0,void 0,(function*(){const i=yield e.get(t);return{userId:t,account:i}}))))),s=n.reduce(((e,{userId:t,account:i})=>{var n,s;return(null==i?void 0:i.profile)&&(e[t]={email:null!==(n=i.profile.email)&&void 0!==n?n:"",emailVerified:null!==(s=i.profile.emailVerified)&&void 0!==s&&s,name:i.profile.name}),e}),{});yield e.setToGlobal(xc,s),yield e.remove("authenticatedAccounts")}))}migrateAccountActivity(e){return Zc(this,void 0,void 0,(function*(){const t=yield e.get("accountActivity"),i=Object.entries(null!=t?t:{}).reduce(((e,[t,i])=>(e[t]=JSON.stringify(new Date(i)),e)),{});yield e.setToGlobal(Tc,i),yield e.remove("accountActivity")}))}migrateActiveAccountId(e){return Zc(this,void 0,void 0,(function*(){const t=yield e.get("activeUserId");yield e.setToGlobal(Sc,t),yield e.remove("activeUserId")}))}}var Oc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class kc extends jo{migrate(e){var t;return Oc(this,void 0,void 0,(function*(){const i=yield e.get("global"),n=null!==(t=null==i?void 0:i.noAutoPromptBiometrics)&&void 0!==t&&t,s=yield e.getAccounts();delete i.noAutoPromptBiometrics,yield Promise.all([...s.map((({userId:t,account:i})=>function(t,i){var s;return Oc(this,void 0,void 0,(function*(){null!=i&&n&&(i.settings=Object.assign(null!==(s=null==i?void 0:i.settings)&&void 0!==s?s:{},{disableAutoBiometricsPrompt:!0}),yield e.set(t,i))}))}(t,i))),e.set("global",i)])}))}rollback(e){return Oc(this,void 0,void 0,(function*(){throw Go}))}updateVersion(e,t){return Oc(this,void 0,void 0,(function*(){const i="up"===t?this.toVersion:this.fromVersion;e.currentVersion=i;const n=(yield e.get("global"))||{};yield e.set("global",Object.assign(Object.assign({},n),{stateVersion:i}))}))}}var Pc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class qc extends jo{migrate(e){return Pc(this,void 0,void 0,(function*(){const t=yield e.get("global");if(!t.stateVersion)throw new Error("Migration failed, state version not found");yield e.set("stateVersion",t.stateVersion),delete t.stateVersion,yield e.set("global",t)}))}rollback(e){return Pc(this,void 0,void 0,(function*(){const t=yield e.get("stateVersion"),i=yield e.get("global");yield e.set("global",Object.assign(Object.assign({},i),{stateVersion:t})),yield e.set("stateVersion",void 0)}))}updateVersion(e,t){return Pc(this,void 0,void 0,(function*(){const i="up"===t?this.toVersion:this.fromVersion;if(e.currentVersion=i,"up"===t)yield e.set("stateVersion",i);else{const t=(yield e.get("global"))||{};yield e.set("global",Object.assign(Object.assign({},t),{stateVersion:i}))}}))}}var Ic=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Mc extends jo{tryAddSetting(e,t,i){const n=e.some((({account:e})=>void 0!==t(e)));if(n){const n=!e.some((({account:e})=>{var i;return!1===(null!==(i=t(e))&&void 0!==i&&i)}));i(n)}}migrate(e){return Ic(this,void 0,void 0,(function*(){const t=yield e.get("global"),i=yield e.getAccounts(),n=i.reduce(((e,{account:t})=>{var i,n;const s=null!==(n=null===(i=t.settings)||void 0===i?void 0:i.neverDomains)&&void 0!==n?n:{};for(const[o,r]of Object.entries(s))null!=e||(e={}),e[o]=r;return e}),void 0),s={};null!=n&&(s.neverDomains=n),this.tryAddSetting(i,(e=>{var t;return null===(t=e.settings)||void 0===t?void 0:t.disableAddLoginNotification}),(e=>s.disableAddLoginNotification=e)),this.tryAddSetting(i,(e=>{var t;return null===(t=e.settings)||void 0===t?void 0:t.disableChangedPasswordNotification}),(e=>s.disableChangedPasswordNotification=e)),this.tryAddSetting(i,(e=>{var t;return null===(t=e.settings)||void 0===t?void 0:t.disableContextMenuItem}),(e=>s.disableContextMenuItem=e)),yield e.set("global",Object.assign(Object.assign({},t),s)),yield Promise.all(i.map((({userId:t,account:i})=>Ic(this,void 0,void 0,(function*(){var n,s,o,r;null===(n=i.settings)||void 0===n||delete n.disableAddLoginNotification,null===(s=i.settings)||void 0===s||delete s.disableChangedPasswordNotification,null===(o=i.settings)||void 0===o||delete o.disableContextMenuItem,null===(r=i.settings)||void 0===r||delete r.neverDomains,yield e.set(t,i)})))))}))}rollback(e){throw new Error("Method not implemented.")}}var Nc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Lc extends jo{constructor(){super(0,Ec)}shouldMigrate(e){return Promise.resolve(e.currentVersion<Ec)}migrate(e){return Nc(this,void 0,void 0,(function*(){if(e.currentVersion<Ec)throw new Error(`Your local data is too old to be migrated. Your current state version is ${e.currentVersion}, but minimum version is ${Ec}.`)}))}rollback(e){return Nc(this,void 0,void 0,(function*(){throw Go}))}}var Dc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Ec=3;function Fc(e,t){var i;return Dc(this,void 0,void 0,(function*(){let n=yield e.get("stateVersion");return null==n&&(n=null===(i=yield e.get("global"))||void 0===i?void 0:i.stateVersion),null==n?(t.info("No state version found, assuming empty state."),-1):(t.info(`State version: ${n}`),n)}))}class Rc{build(){var e;return null!==(e=this.migrationBuilderCache)&&void 0!==e?e:this.migrationBuilderCache=Bo.create().with(Lc).with(Ba,3,4).with(El,4,5).with(Ac,5,6).with(kc,6,7).with(qc,7,8).with(Mc,8,9).with(Ho,9,10).with(er,10,11).with(or,11,12).with(lr,12,13).with(dr,13,14).with(gr,14,15).with(vr,15,16).with(br,16,17).with(Ar,17,18).with(Sr,18,19).with(Or,19,20).with(qr,20,21).with(Nr,21,22).with(Fr,22,23).with(zr,23,24).with(Br,24,25).with(jr,25,26).with(Hr,26,27).with(ea,27,28).with(ia,28,29).with(ra,29,30).with(ca,30,31).with(pa,31,32).with(ya,32,33).with(Aa,33,34).with(Sa,34,35).with(Oa,35,36).with(qa,36,37).with(Ra,37,38).with(Ya,38,39).with(Wa,39,40).with(tl,40,41).with(sl,41,42).with(al,42,43).with(ul,43,44).with(ml,44,45).with(wl,45,46).with(kl,46,47).with(Il,47,48).with(Ll,48,49).with(zl,49,50).with(Bl,50,51).with(Gl,51,52).with(Hl,52,53).with(tc,53,54).with(rc,54,55).with(uc,55,56).with(gc,56,57).with(vc,57,58).with(Uc,58,59).with(Cc,59,60)}}var Jc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class zc{constructor(e,t,i,n,s){this.currentVersion=e,this.storageService=t,this.logService=i,this.clientType=s,this.type=n}get(e){return this.storageService.get(e)}set(e,t){return this.logService.info(`Setting ${e}`),this.storageService.save(e,t)}remove(e){return this.logService.info(`Removing ${e}`),this.storageService.remove(e)}getFromGlobal(e){return this.get(this.getGlobalKey(e))}setToGlobal(e,t){return this.set(this.getGlobalKey(e),t)}removeFromGlobal(e){return this.remove(this.getGlobalKey(e))}getFromUser(e,t){return this.get(this.getUserKey(e,t))}setToUser(e,t,i){return this.set(this.getUserKey(e,t),i)}removeFromUser(e,t){return this.remove(this.getUserKey(e,t))}info(e){this.logService.info(e)}getAccounts(){return Jc(this,void 0,void 0,(function*(){const e=yield this.getKnownUserIds();return Promise.all(e.map((e=>Jc(this,void 0,void 0,(function*(){return{userId:e,account:yield this.get(e)}})))))}))}getKnownUserIds(){return Jc(this,void 0,void 0,(function*(){return this.currentVersion<60?function(e){var t;return Jc(this,void 0,void 0,(function*(){return null!==(t=yield e.get("authenticatedAccounts"))&&void 0!==t?t:[]}))}(this.storageService):function(e){return Jc(this,void 0,void 0,(function*(){const t=yield e.get(Yc({stateDefinition:{name:"account"},key:"accounts"}));return Object.keys(null!=t?t:{})}))}(this.storageService)}))}getUserKey(e,t){return this.currentVersion<9?function(){throw Error("No key builder should be used for versions prior to 9.")}():function(e,t){return`user_${e}_${t.stateDefinition.name}_${t.key}`}(e,t)}getGlobalKey(e){return this.currentVersion<9?function(){throw Error("No key builder should be used for versions prior to 9.")}():Yc(e)}}function Yc(e){return`global_${e.stateDefinition.name}_${e.key}`}var Kc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Bc{constructor(e,t,i,n){this.diskStorage=e,this.logService=t,this.migrationBuilderService=i,this.clientType=n}run(){return Kc(this,void 0,void 0,(function*(){const e=new zc(yield Fc(this.diskStorage,this.logService),this.diskStorage,this.logService,"general",this.clientType);if(e.currentVersion<0)return void(yield this.diskStorage.save("stateVersion",60));const t=this.migrationBuilderService.build();yield t.migrate(e)}))}waitForCompletion(){return Kc(this,void 0,void 0,(function*(){yield function(e,t){return Dc(this,void 0,void 0,(function*(){const i=()=>Dc(this,void 0,void 0,(function*(){return(yield Fc(e,t))>=60})),n=e=>Dc(this,void 0,void 0,(function*(){const s=2*e;if(!(s>8192))return new Promise((o=>{setTimeout((()=>Dc(this,void 0,void 0,(function*(){(yield i())||(t.info(`Waiting for migrations to finish, waiting for ${s}ms`),yield n(s)),o()}))),e)}))}));(yield i())||(yield n(2))}))}(this.diskStorage,this.logService)}))}}var Qc=i(39553);class Gc{constructor(e){this.accounts={},this.globals=e}static fromJSON(e,t){return null==e?null:Object.assign(new Gc(null),e,{accounts:Gc.buildAccountMapFromJSON(null==e?void 0:e.accounts,t)})}static buildAccountMapFromJSON(e,t){if(!e)return{};const i={};for(const n in e)i[n]=t(e[n]);return i}}var jc=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Vc=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},$c=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Hc="state",Wc="global",Xc="tempAccountSettings",eu="_user_auto",tu="_user_biometric",iu="_masterkey_auto",nu="_masterkey_biometric",su="_masterkey",ou="DuckDuckGoSharedKey";class ru{constructor(e,t,i,n,s,o,r,a,l){this.storageService=e,this.secureStorageService=t,this.memoryStorageService=i,this.logService=n,this.stateFactory=s,this.accountService=o,this.environmentService=r,this.tokenService=a,this.migrationRunner=l,this.hasBeenInited=!1,this.isRecoveredSession=!1,this.accountDeserializer=ms.mR.fromJSON}init(e={}){return $c(this,void 0,void 0,(function*(){const{runMigrations:t=!0}=e;this.hasBeenInited||(t?yield this.migrationRunner.run():yield this.migrationRunner.waitForCompletion(),yield this.state().then((e=>$c(this,void 0,void 0,(function*(){null==e?yield this.setState(new Gc(this.createGlobals())):this.isRecoveredSession=!0})))),yield this.initAccountState(),this.hasBeenInited=!0)}))}initAccountState(){return $c(this,void 0,void 0,(function*(){if(this.isRecoveredSession)return;const e=yield(0,pe.z)(this.accountService.accounts$.pipe((0,de.U)((e=>Object.keys(e)))));yield this.updateState((t=>$c(this,void 0,void 0,(function*(){for(const i in e)t=yield this.syncAccountFromDisk(e[i]);return t}))))}))}syncAccountFromDisk(e){return $c(this,void 0,void 0,(function*(){if(null==e)return;const t=yield this.getAccountFromDisk({userId:e});return yield this.updateState((i=>$c(this,void 0,void 0,(function*(){return null==i.accounts&&(i.accounts={}),i.accounts[e]=this.createAccount(),i.accounts[e].profile=t.profile,i}))))}))}addAccount(e){return $c(this,void 0,void 0,(function*(){yield this.environmentService.seedUserEnvironment(e.profile.userId),yield this.updateState((t=>$c(this,void 0,void 0,(function*(){return t.accounts[e.profile.userId]=e,t})))),yield this.scaffoldNewAccountStorage(e)}))}clean(e){return $c(this,void 0,void 0,(function*(){e=this.reconcileOptions(e,yield this.defaultInMemoryOptions()),yield this.deAuthenticateAccount(e.userId),yield this.removeAccountFromDisk(null==e?void 0:e.userId),yield this.removeAccountFromMemory(null==e?void 0:e.userId)}))}getUserKeyAutoUnlock(e){return $c(this,void 0,void 0,(function*(){return null==(null==(e=this.reconcileOptions(this.reconcileOptions(e,{keySuffix:"auto"}),yield this.defaultSecureStorageOptions()))?void 0:e.userId)?null:yield this.secureStorageService.get(`${e.userId}${eu}`,e)}))}setUserKeyAutoUnlock(e,t){return $c(this,void 0,void 0,(function*(){null!=(null==(t=this.reconcileOptions(this.reconcileOptions(t,{keySuffix:"auto"}),yield this.defaultSecureStorageOptions()))?void 0:t.userId)&&(yield this.saveSecureStorageKey(eu,e,t))}))}getUserKeyBiometric(e){return $c(this,void 0,void 0,(function*(){return null==(null==(e=this.reconcileOptions(this.reconcileOptions(e,{keySuffix:"biometric"}),yield this.defaultSecureStorageOptions()))?void 0:e.userId)?null:yield this.secureStorageService.get(`${e.userId}${tu}`,e)}))}hasUserKeyBiometric(e){return $c(this,void 0,void 0,(function*(){return null!=(null==(e=this.reconcileOptions(this.reconcileOptions(e,{keySuffix:"biometric"}),yield this.defaultSecureStorageOptions()))?void 0:e.userId)&&(yield this.secureStorageService.has(`${e.userId}${tu}`,e))}))}setUserKeyBiometric(e,t){return $c(this,void 0,void 0,(function*(){null!=(null==(t=this.reconcileOptions(this.reconcileOptions(t,{keySuffix:"biometric"}),yield this.defaultSecureStorageOptions()))?void 0:t.userId)&&(yield this.saveSecureStorageKey(tu,e,t))}))}getPinKeyEncryptedUserKey(e){var t,i;return $c(this,void 0,void 0,(function*(){return li._.fromJSON(null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.pinKeyEncryptedUserKey)}))}setPinKeyEncryptedUserKey(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.pinKeyEncryptedUserKey=null==e?void 0:e.encryptedString,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getPinKeyEncryptedUserKeyEphemeral(e){var t,i;return $c(this,void 0,void 0,(function*(){return li._.fromJSON(null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.pinKeyEncryptedUserKeyEphemeral)}))}setPinKeyEncryptedUserKeyEphemeral(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.settings.pinKeyEncryptedUserKeyEphemeral=null==e?void 0:e.encryptedString,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}setCryptoMasterKeyAuto(e,t){return $c(this,void 0,void 0,(function*(){null!=(null==(t=this.reconcileOptions(this.reconcileOptions(t,{keySuffix:"auto"}),yield this.defaultSecureStorageOptions()))?void 0:t.userId)&&(yield this.saveSecureStorageKey(iu,e,t))}))}getCryptoMasterKeyB64(e){return $c(this,void 0,void 0,(function*(){return null==(null==(e=this.reconcileOptions(e,yield this.defaultSecureStorageOptions()))?void 0:e.userId)?null:yield this.secureStorageService.get(`${null==e?void 0:e.userId}${su}`,e)}))}setCryptoMasterKeyB64(e,t){return $c(this,void 0,void 0,(function*(){null!=(null==(t=this.reconcileOptions(t,yield this.defaultSecureStorageOptions()))?void 0:t.userId)&&(yield this.saveSecureStorageKey(su,e,t))}))}getCryptoMasterKeyBiometric(e){return $c(this,void 0,void 0,(function*(){return null==(null==(e=this.reconcileOptions(this.reconcileOptions(e,{keySuffix:"biometric"}),yield this.defaultSecureStorageOptions()))?void 0:e.userId)?null:yield this.secureStorageService.get(`${e.userId}${nu}`,e)}))}hasCryptoMasterKeyBiometric(e){return $c(this,void 0,void 0,(function*(){return null!=(null==(e=this.reconcileOptions(this.reconcileOptions(e,{keySuffix:"biometric"}),yield this.defaultSecureStorageOptions()))?void 0:e.userId)&&(yield this.secureStorageService.has(`${e.userId}${nu}`,e))}))}setCryptoMasterKeyBiometric(e,t){return $c(this,void 0,void 0,(function*(){null!=(null==(t=this.reconcileOptions(this.reconcileOptions(t,{keySuffix:"biometric"}),yield this.defaultSecureStorageOptions()))?void 0:t.userId)&&(yield this.saveSecureStorageKey(nu,e,t))}))}getDecryptedPasswordGenerationHistory(e){var t,i,n;return $c(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.passwordGenerationHistory)||void 0===n?void 0:n.decrypted}))}setDecryptedPasswordGenerationHistory(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.data.passwordGenerationHistory.decrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getDecryptedPinProtected(e){var t,i,n;return $c(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.pinProtected)||void 0===n?void 0:n.decrypted}))}setDecryptedPinProtected(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.settings.pinProtected.decrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getDuckDuckGoSharedKey(e){return $c(this,void 0,void 0,(function*(){return null==(null==(e=this.reconcileOptions(e,yield this.defaultSecureStorageOptions()))?void 0:e.userId)?null:yield this.secureStorageService.get(ou,e)}))}setDuckDuckGoSharedKey(e,t){return $c(this,void 0,void 0,(function*(){null!=(null==(t=this.reconcileOptions(t,yield this.defaultSecureStorageOptions()))?void 0:t.userId)&&(null==e?yield this.secureStorageService.remove(ou,t):yield this.secureStorageService.save(ou,e,t))}))}getEmail(e){var t,i;return $c(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.email}))}setEmail(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.profile.email=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getEnableBrowserIntegration(e){var t,i;return $c(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.enableBrowserIntegration)&&void 0!==i&&i}))}setEnableBrowserIntegration(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.enableBrowserIntegration=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEnableBrowserIntegrationFingerprint(e){var t,i;return $c(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.enableBrowserIntegrationFingerprint)&&void 0!==i&&i}))}setEnableBrowserIntegrationFingerprint(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.enableBrowserIntegrationFingerprint=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}setEnableDuckDuckGoBrowserIntegration(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.enableDuckDuckGoBrowserIntegration=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEncryptedCryptoSymmetricKey(e){var t;return $c(this,void 0,void 0,(function*(){return null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.keys.cryptoSymmetricKey.encrypted}))}getEncryptedPasswordGenerationHistory(e){var t,i,n;return $c(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.passwordGenerationHistory)||void 0===n?void 0:n.encrypted}))}setEncryptedPasswordGenerationHistory(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.data.passwordGenerationHistory.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEncryptedPinProtected(e){var t,i,n;return $c(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.pinProtected)||void 0===n?void 0:n.encrypted}))}setEncryptedPinProtected(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.pinProtected.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getIsAuthenticated(e){return $c(this,void 0,void 0,(function*(){return null!=(yield this.tokenService.getAccessToken(null==e?void 0:e.userId))&&null!=(yield this.getUserId(e))}))}getLastSync(e){var t,i;return $c(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskMemoryOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.lastSync}))}setLastSync(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()));i.profile.lastSync=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()))}))}getMinimizeOnCopyToClipboard(e){var t,i,n;return $c(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.minimizeOnCopyToClipboard)&&void 0!==n&&n}))}setMinimizeOnCopyToClipboard(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.minimizeOnCopyToClipboard=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getOrganizationInvitation(e){var t;return $c(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.organizationInvitation}))}setOrganizationInvitation(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.organizationInvitation=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getPasswordGenerationOptions(e){var t,i;return $c(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.passwordGenerationOptions}))}setPasswordGenerationOptions(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.passwordGenerationOptions=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getUsernameGenerationOptions(e){var t,i;return $c(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.usernameGenerationOptions}))}setUsernameGenerationOptions(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.usernameGenerationOptions=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getGeneratorOptions(e){var t,i;return $c(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.generatorOptions}))}setGeneratorOptions(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.generatorOptions=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getProtectedPin(e){var t,i;return $c(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.protectedPin}))}setProtectedPin(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.protectedPin=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getUserId(e){var t,i;return $c(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.userId}))}getVaultTimeout(e){var t,i;return $c(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.vaultTimeout}))}setVaultTimeout(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.vaultTimeout=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getVaultTimeoutAction(e){var t,i,n;return $c(this,void 0,void 0,(function*(){const s=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.vaultTimeoutAction;return null!=s?s:null===(n=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===n?void 0:n.vaultTimeoutAction}))}setVaultTimeoutAction(e,t){return $c(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.vaultTimeoutAction=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getGlobals(e){return $c(this,void 0,void 0,(function*(){let t;return this.useMemory(e.storageLocation)&&(t=yield this.getGlobalsFromMemory()),this.useDisk&&null==t&&(t=yield this.getGlobalsFromDisk(e)),null==t&&(t=this.createGlobals()),t}))}saveGlobals(e,t){return $c(this,void 0,void 0,(function*(){return this.useMemory(t.storageLocation)?this.saveGlobalsToMemory(e):yield this.saveGlobalsToDisk(e,t)}))}getGlobalsFromMemory(){return $c(this,void 0,void 0,(function*(){return(yield this.state()).globals}))}getGlobalsFromDisk(e){return $c(this,void 0,void 0,(function*(){return yield this.storageService.get(Wc,e)}))}saveGlobalsToMemory(e){return $c(this,void 0,void 0,(function*(){yield this.updateState((t=>$c(this,void 0,void 0,(function*(){return t.globals=e,t}))))}))}saveGlobalsToDisk(e,t){return $c(this,void 0,void 0,(function*(){t.useSecureStorage?yield this.secureStorageService.save(Wc,e,t):yield this.storageService.save(Wc,e,t)}))}getAccount(e){return $c(this,void 0,void 0,(function*(){try{let t;return this.useMemory(e.storageLocation)&&(t=yield this.getAccountFromMemory(e)),this.useDisk(e.storageLocation)&&null==t&&(t=yield this.getAccountFromDisk(e)),t}catch(t){this.logService.error(t)}}))}getAccountFromMemory(e){var t;return $c(this,void 0,void 0,(function*(){const i=null!==(t=e.userId)&&void 0!==t?t:yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id))));return yield this.state().then((e=>$c(this,void 0,void 0,(function*(){return null==e.accounts?null:e.accounts[i]}))))}))}getAccountFromDisk(e){var t,i;return $c(this,void 0,void 0,(function*(){const n=null!==(t=e.userId)&&void 0!==t?t:yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id))));if(null==n)return null;return(null==e?void 0:e.useSecureStorage)?null!==(i=yield this.secureStorageService.get(e.userId,e))&&void 0!==i?i:yield this.storageService.get(e.userId,this.reconcileOptions(e,{htmlStorageLocation:Ht.CR.Local})):yield this.storageService.get(e.userId,e)}))}useMemory(e){return e===Ht.Ac.Memory||e===Ht.Ac.Both}useDisk(e){return e===Ht.Ac.Disk||e===Ht.Ac.Both}saveAccount(e,t={storageLocation:Ht.Ac.Both,useSecureStorage:!1}){return $c(this,void 0,void 0,(function*(){return this.useMemory(t.storageLocation)?yield this.saveAccountToMemory(e):yield this.saveAccountToDisk(e,t)}))}saveAccountToDisk(e,t){return $c(this,void 0,void 0,(function*(){const i=t.useSecureStorage?this.secureStorageService:this.storageService;yield i.save(`${t.userId}`,e,t)}))}saveAccountToMemory(e){return $c(this,void 0,void 0,(function*(){null!==(yield this.getAccountFromMemory({userId:e.profile.userId}))&&(yield this.updateState((t=>new Promise((i=>{t.accounts[e.profile.userId]=e,i(t)})))))}))}scaffoldNewAccountStorage(e){return $c(this,void 0,void 0,(function*(){const t=JSON.parse(JSON.stringify(e));yield this.scaffoldNewAccountLocalStorage(t),yield this.scaffoldNewAccountSessionStorage(t),yield this.scaffoldNewAccountMemoryStorage(t)}))}scaffoldNewAccountLocalStorage(e){return $c(this,void 0,void 0,(function*(){const t=yield this.getAccount(this.reconcileOptions({userId:e.profile.userId},yield this.defaultOnDiskLocalOptions()));null!=(null==t?void 0:t.settings)?e.settings=t.settings:(yield this.storageService.has(Xc))&&(e.settings=yield this.storageService.get(Xc),yield this.storageService.remove(Xc)),yield this.saveAccount(e,this.reconcileOptions({userId:e.profile.userId},yield this.defaultOnDiskLocalOptions()))}))}scaffoldNewAccountMemoryStorage(e){return $c(this,void 0,void 0,(function*(){const t=yield this.getAccount(this.reconcileOptions({userId:e.profile.userId},yield this.defaultOnDiskMemoryOptions()));null!=(null==t?void 0:t.settings)&&(e.settings=t.settings),yield this.storageService.save(e.profile.userId,e,yield this.defaultOnDiskMemoryOptions()),yield this.saveAccount(e,this.reconcileOptions({userId:e.profile.userId},yield this.defaultOnDiskMemoryOptions()))}))}scaffoldNewAccountSessionStorage(e){return $c(this,void 0,void 0,(function*(){const t=yield this.getAccount(this.reconcileOptions({userId:e.profile.userId},yield this.defaultOnDiskOptions()));null!=(null==t?void 0:t.settings)&&(e.settings=t.settings),yield this.storageService.save(e.profile.userId,e,yield this.defaultOnDiskMemoryOptions()),yield this.saveAccount(e,this.reconcileOptions({userId:e.profile.userId},yield this.defaultOnDiskOptions()))}))}reconcileOptions(e,t){var i,n,s,o,r;return null==e?t:(e.userId=null!==(i=null==e?void 0:e.userId)&&void 0!==i?i:t.userId,e.storageLocation=null!==(n=null==e?void 0:e.storageLocation)&&void 0!==n?n:t.storageLocation,e.useSecureStorage=null!==(s=null==e?void 0:e.useSecureStorage)&&void 0!==s?s:t.useSecureStorage,e.htmlStorageLocation=null!==(o=null==e?void 0:e.htmlStorageLocation)&&void 0!==o?o:t.htmlStorageLocation,e.keySuffix=null!==(r=null==e?void 0:e.keySuffix)&&void 0!==r?r:t.keySuffix,e)}defaultInMemoryOptions(){return $c(this,void 0,void 0,(function*(){const e=yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id))));return{storageLocation:Ht.Ac.Memory,userId:e}}))}defaultOnDiskOptions(){return $c(this,void 0,void 0,(function*(){const e=yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id))));return{storageLocation:Ht.Ac.Disk,htmlStorageLocation:Ht.CR.Session,userId:e,useSecureStorage:!1}}))}defaultOnDiskLocalOptions(){return $c(this,void 0,void 0,(function*(){const e=yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id))));return{storageLocation:Ht.Ac.Disk,htmlStorageLocation:Ht.CR.Local,userId:e,useSecureStorage:!1}}))}defaultOnDiskMemoryOptions(){return $c(this,void 0,void 0,(function*(){const e=yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id))));return{storageLocation:Ht.Ac.Disk,htmlStorageLocation:Ht.CR.Memory,userId:e,useSecureStorage:!1}}))}defaultSecureStorageOptions(){return $c(this,void 0,void 0,(function*(){const e=yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id))));return{storageLocation:Ht.Ac.Disk,useSecureStorage:!0,userId:e}}))}getActiveUserIdFromStorage(){return $c(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id))))}))}removeAccountFromLocalStorage(e=null){return $c(this,void 0,void 0,(function*(){null!=e||(e=yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id)))));const t=yield this.getAccount(this.reconcileOptions({userId:e},yield this.defaultOnDiskLocalOptions()));yield this.saveAccount(this.resetAccount(t),this.reconcileOptions({userId:e},yield this.defaultOnDiskLocalOptions()))}))}removeAccountFromSessionStorage(e=null){return $c(this,void 0,void 0,(function*(){null!=e||(e=yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id)))));const t=yield this.getAccount(this.reconcileOptions({userId:e},yield this.defaultOnDiskOptions()));yield this.saveAccount(this.resetAccount(t),this.reconcileOptions({userId:e},yield this.defaultOnDiskOptions()))}))}removeAccountFromSecureStorage(e=null){return $c(this,void 0,void 0,(function*(){null!=e||(e=yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id))))),yield this.setUserKeyAutoUnlock(null,{userId:e}),yield this.setUserKeyBiometric(null,{userId:e}),yield this.setCryptoMasterKeyAuto(null,{userId:e}),yield this.setCryptoMasterKeyBiometric(null,{userId:e}),yield this.setCryptoMasterKeyB64(null,{userId:e})}))}removeAccountFromMemory(e=null){return $c(this,void 0,void 0,(function*(){null!=e||(e=yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id))))),yield this.updateState((t=>$c(this,void 0,void 0,(function*(){return delete t.accounts[e],t}))))}))}resetAccount(e){const t={settings:e.settings};return Object.assign(this.createAccount(),t)}clearDecryptedData(e){return $c(this,void 0,void 0,(function*(){yield this.updateState((t=>$c(this,void 0,void 0,(function*(){var i;return null!=e&&null!=(null===(i=null==t?void 0:t.accounts[e])||void 0===i?void 0:i.data)&&(t.accounts[e].data=new ms.jK),t}))))}))}createAccount(e=null){return this.stateFactory.createAccount(e)}createGlobals(e=null){return this.stateFactory.createGlobal(e)}deAuthenticateAccount(e){return $c(this,void 0,void 0,(function*(){yield this.tokenService.clearTokens(e)}))}removeAccountFromDisk(e){return $c(this,void 0,void 0,(function*(){yield this.removeAccountFromSessionStorage(e),yield this.removeAccountFromLocalStorage(e),yield this.removeAccountFromSecureStorage(e)}))}saveSecureStorageKey(e,t,i){return $c(this,void 0,void 0,(function*(){return null==t?yield this.secureStorageService.remove(`${i.userId}${e}`,i):yield this.secureStorageService.save(`${i.userId}${e}`,t,i)}))}state(){return $c(this,void 0,void 0,(function*(){return yield this.memoryStorageService.get(Hc,{deserializer:e=>Gc.fromJSON(e,this.accountDeserializer)})}))}setState(e){return $c(this,void 0,void 0,(function*(){return yield this.memoryStorageService.save(Hc,e),e}))}updateState(e){return $c(this,void 0,void 0,(function*(){return yield this.state().then((t=>$c(this,void 0,void 0,(function*(){const i=yield e(t);if(null==i)throw new Error("Attempted to update state to null value");return yield this.setState(i)}))))}))}}function au(e,t=(e=>e)){return(i,n,s)=>{const o=s.value;return{value:function(...i){const s=o.apply(this,i);if(!Fe.c.isPromise(s))throw new Error(`Error applying prototype to stored value -- result is not a promise for method ${String(n)}`);return s.then((i=>{if(null==i)return null;if(i instanceof Array)return i.map((i=>null==i||i.constructor.name===e.prototype.constructor.name?i:t(Object.create(e.prototype,Object.getOwnPropertyDescriptors(i)))));throw new Error(`Attempted to retrieve non array type from state as an array for method ${String(n)}`)}))}}}}jc([au(Qc.ZU),Vc("design:type",Function),Vc("design:paramtypes",[Object]),Vc("design:returntype",Promise)],ru.prototype,"getDecryptedPasswordGenerationHistory",null),jc([au(Qc.ZU),Vc("design:type",Function),Vc("design:paramtypes",[Object]),Vc("design:returntype",Promise)],ru.prototype,"getEncryptedPasswordGenerationHistory",null);class lu{constructor(e,t){this.diskStorageService=e,this.memoryStorageService=t}get(e,t){switch(e){case"disk":return[e,this.diskStorageService];case"memory":return[e,this.memoryStorageService];default:throw new Error(`Unexpected location: ${e}`)}}}var cu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class uu{constructor(e){this.cryptoService=e}setUserKeyInMemoryIfAutoUserKeySet(e){return cu(this,void 0,void 0,(function*(){if(null==e)return;const t=yield this.cryptoService.getUserKeyFromStorage(Ht.l1.Auto,e);null!=t&&(yield this.cryptoService.setUserKey(t,e))}))}}var du=i(99405),pu=i(86268);class hu{}var gu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var fu=i(96672),mu=i(91246),vu=i(92936);Symbol("active");var yu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class wu{constructor(e,t,i){this.keyDefinition=e,this.activeUserId$=t,this.singleUserStateProvider=i,this.combinedState$=this.activeUserId$.pipe((0,it.w)((e=>null!=e?this.singleUserStateProvider.get(e,this.keyDefinition).combinedState$:Ss.C))),this.state$=this.combinedState$.pipe((0,de.U)((([e,t])=>t)))}update(e,t={}){return yu(this,void 0,void 0,(function*(){const i=yield(0,pe.z)(this.activeUserId$.pipe((0,mu.V)({first:1e3,with:()=>(0,vu._)((()=>new Error(`Timeout while retrieving active user for key ${this.keyDefinition.fullName}.`)))})));if(null==i)throw new Error(`Error storing ${this.keyDefinition.fullName} for the active user: No active user at this time.`);return[i,yield this.singleUserStateProvider.get(i,this.keyDefinition).update(e,t)]}))}}var bu=i(59157),Uu=i(62324),_u=i(12294),Au=i(56110),Zu=i(66966),xu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Su{constructor(e,t,i){this.parentState$=e,this.deriveDefinition=t,this.dependencies=i,this.forcedValueSubject=new r.x,this.storageKey=t.storageKey;const n=this.parentState$.pipe((0,bu.b)((e=>xu(this,void 0,void 0,(function*(){let t=this.deriveDefinition.derive(e,this.dependencies);t instanceof Promise&&(t=yield t);return t})))));this.state$=(0,Uu.T)(this.forcedValueSubject,n).pipe((0,_u.B)({connector:()=>new Au.t(1),resetOnRefCountZero:()=>(0,Zu.H)(this.deriveDefinition.cleanupDelayMs)}))}forceValue(e){return xu(this,void 0,void 0,(function*(){return this.forcedValueSubject.next(e),e}))}}var Tu=i(16722);const Cu={shouldUpdate:()=>!0,combineLatestWith:null,msTimeout:1e3};var Ou=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function ku(e,t,i){return Ou(this,void 0,void 0,(function*(){if(t.valuesRequireDeserialization){const n=yield t.get(e);return i(n)}{const i=yield t.get(e);return null!=i?i:null}}))}var Pu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class qu{constructor(e,t,i){this.key=e,this.storageService=t,this.keyDefinition=i;const n=t.updates$.pipe((0,cs.h)((t=>t.key===e)),(0,it.w)((n=>Pu(this,void 0,void 0,(function*(){return"remove"===n.updateType?null:yield ku(e,t,i.deserializer)})))));this.state$=(0,Uu.T)((0,oi.P)((()=>ku(e,t,i.deserializer))),n).pipe((0,_u.B)({connector:()=>new Au.t(1),resetOnRefCountZero:()=>(0,Zu.H)(i.cleanupDelayMs)}))}update(e,t={}){return Pu(this,void 0,void 0,(function*(){t=function(e){return Object.assign(Object.assign({},Cu),e)}(t),null!=this.updatePromise&&(yield this.updatePromise);try{this.updatePromise=this.internalUpdate(e,t);return yield this.updatePromise}finally{this.updatePromise=null}}))}internalUpdate(e,t){return Pu(this,void 0,void 0,(function*(){const i=yield this.getStateForUpdate(),n=null!=t.combineLatestWith?yield(0,pe.z)(t.combineLatestWith.pipe((0,mu.V)(t.msTimeout))):null;if(!t.shouldUpdate(i,n))return i;const s=e(i,n);return yield this.doStorageSave(s,i),s}))}doStorageSave(e,t){return Pu(this,void 0,void 0,(function*(){yield this.storageService.save(this.key,e)}))}getStateForUpdate(){return Pu(this,void 0,void 0,(function*(){return yield ku(this.key,this.storageService,this.keyDefinition.deserializer)}))}}class Iu extends qu{constructor(e,t){super((0,Tu.p)(e),t,e)}}var Mu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Nu extends qu{constructor(e,t,i,n){super(t.buildKey(e),i,t),this.userId=e,this.stateEventRegistrarService=n,this.combinedState$=(0,Ke.a)([(0,Be.of)(e),this.state$])}doStorageSave(e,t){const i=Object.create(null,{doStorageSave:{get:()=>super.doStorageSave}});return Mu(this,void 0,void 0,(function*(){yield i.doStorageSave.call(this,e,t),null!=e&&null==t&&(yield this.stateEventRegistrarService.registerEvents(this.keyDefinition))}))}}var Lu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Du=i(87218),Eu=i(15851),Fu=i(89770);class Ru extends I.c{constructor(e,t){super(e),this.id=this.getResponseProperty("Id"),this.type=this.getResponseProperty("Type"),this.organizationId=this.getResponseProperty("OrganizationId"),this.enabled=this.getResponseProperty("Enabled");const i=this.getResponseProperty("Config");this.config=null==i?null:new t(i)}}var Ju=i(5094),zu=i(81687);class Yu extends I.c{constructor(e){super(e);const t=this.getResponseProperty("Collections");null!=t&&(this.collections=t.map((e=>new zu.sy(e))));const i=this.getResponseProperty("Ciphers");null!=i&&(this.ciphers=i.map((e=>new Ju.r(e))))}}class Ku extends I.c{constructor(e){super(e);const t=this.getResponseProperty("LastSyncDate");t&&(this.lastSyncDate=new Date(t))}}class Bu extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.providerId=this.getResponseProperty("ProviderId"),this.organizationId=this.getResponseProperty("OrganizationId"),this.key=this.getResponseProperty("Key"),this.settings=this.getResponseProperty("Settings"),this.creationDate=this.getResponseProperty("CreationDate"),this.revisionDate=this.getResponseProperty("RevisionDate"),this.userCount=this.getResponseProperty("UserCount"),this.seats=this.getResponseProperty("Seats"),this.plan=this.getResponseProperty("Plan")}}class Qu extends Bu{constructor(e){super(e),this.organizationName=this.getResponseProperty("OrganizationName")}}class Gu extends Me{}class ju extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.error=this.getResponseProperty("Error")}}class Vu extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.type=this.getResponseProperty("Type"),this.status=this.getResponseProperty("Status"),this.permissions=new W.Q(this.getResponseProperty("Permissions"))}}class $u extends Vu{constructor(e){super(e),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email")}}var Hu=i(65193),Wu=i(71916),Xu=i(38889);class ed extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.publicKey=this.getResponseProperty("PublicKey"),this.requestDeviceType=this.getResponseProperty("RequestDeviceType"),this.requestIpAddress=this.getResponseProperty("RequestIpAddress"),this.key=this.getResponseProperty("Key"),this.masterPasswordHash=this.getResponseProperty("MasterPasswordHash"),this.creationDate=this.getResponseProperty("CreationDate"),this.requestApproved=this.getResponseProperty("RequestApproved"),this.responseDate=this.getResponseProperty("ResponseDate");const t=new Date(this.creationDate),i=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()),n=new Date(Date.now()),s=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds());this.isExpired=s-i>=9e5,this.isAnswered=null!=this.requestApproved&&null!=this.responseDate}}class td extends I.c{constructor(e){super(e),this.isDeviceVerificationSectionEnabled=this.getResponseProperty("IsDeviceVerificationSectionEnabled"),this.unknownDeviceVerificationEnabled=this.getResponseProperty("UnknownDeviceVerificationEnabled")}}var id=i(55793),nd=i(88674),sd=i(4502);class od extends I.c{constructor(e){super(e),this.key=this.getResponseProperty("Key")}}class rd extends I.c{constructor(e){super(e),this.kdf=this.getResponseProperty("Kdf"),this.kdfIterations=this.getResponseProperty("KdfIterations"),this.kdfMemory=this.getResponseProperty("KdfMemory"),this.kdfParallelism=this.getResponseProperty("KdfParallelism")}}class ad extends I.c{constructor(e){super(e),this.captchaBypassToken=this.getResponseProperty("CaptchaBypassToken")}}class ld extends I.c{constructor(e){super(e),this.token=this.getResponseProperty("Token")}}class cd extends I.c{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.key=this.getResponseProperty("Key")}}class ud extends I.c{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.host=this.getResponseProperty("Host"),this.secretKey=this.getResponseProperty("SecretKey"),this.integrationKey=this.getResponseProperty("IntegrationKey")}}class dd extends I.c{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.email=this.getResponseProperty("Email")}}class pd extends I.c{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.type=this.getResponseProperty("Type")}}class hd extends I.c{constructor(e){super(e),this.code=this.getResponseProperty("Code")}}var gd=i(70908);class fd extends I.c{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.key1=this.getResponseProperty("Key1"),this.key2=this.getResponseProperty("Key2"),this.key3=this.getResponseProperty("Key3"),this.key4=this.getResponseProperty("Key4"),this.key5=this.getResponseProperty("Key5"),this.nfc=this.getResponseProperty("Nfc")}}class md extends I.c{constructor(e){super(e),this.invoices=[],this.transactions=[];const t=this.getResponseProperty("Transactions"),i=this.getResponseProperty("Invoices");null!=t&&(this.transactions=t.map((e=>new J(e)))),null!=i&&(this.invoices=i.map((e=>new R(e))))}get hasNoHistory(){return 0==this.invoices.length&&0==this.transactions.length}}class vd extends I.c{constructor(e){super(e),this.balance=this.getResponseProperty("Balance");const t=this.getResponseProperty("PaymentSource");this.paymentSource=null==t?null:new F(t)}}class yd extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.country=this.getResponseProperty("Country"),this.state=this.getResponseProperty("State"),this.postalCode=this.getResponseProperty("PostalCode"),this.rate=this.getResponseProperty("Rate")}}class wd{constructor(e){this.ids=null==e?[]:e}}class bd extends I.c{constructor(e){super(e),this.addedDate=this.getResponseProperty("AddedDate"),this.breachDate=this.getResponseProperty("BreachDate"),this.dataClasses=this.getResponseProperty("DataClasses"),this.description=this.getResponseProperty("Description"),this.domain=this.getResponseProperty("Domain"),this.isActive=this.getResponseProperty("IsActive"),this.isVerified=this.getResponseProperty("IsVerified"),this.logoPath=this.getResponseProperty("LogoPath"),this.modifiedDate=this.getResponseProperty("ModifiedDate"),this.name=this.getResponseProperty("Name"),this.pwnCount=this.getResponseProperty("PwnCount"),this.title=this.getResponseProperty("Title")}}class Ud extends I.c{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.domains=this.getResponseProperty("Domains"),this.excluded=this.getResponseProperty("Excluded")}}class _d extends I.c{constructor(e){super(e),this.globalEquivalentDomains=[],this.equivalentDomains=this.getResponseProperty("EquivalentDomains");const t=this.getResponseProperty("GlobalEquivalentDomains");this.globalEquivalentDomains=null!=t?t.map((e=>new Ud(e))):[]}}class Ad extends I.c{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.userId=this.getResponseProperty("UserId"),this.organizationId=this.getResponseProperty("OrganizationId"),this.providerId=this.getResponseProperty("ProviderId"),this.cipherId=this.getResponseProperty("CipherId"),this.collectionId=this.getResponseProperty("CollectionId"),this.groupId=this.getResponseProperty("GroupId"),this.policyId=this.getResponseProperty("PolicyId"),this.organizationUserId=this.getResponseProperty("OrganizationUserId"),this.providerUserId=this.getResponseProperty("ProviderUserId"),this.providerOrganizationId=this.getResponseProperty("ProviderOrganizationId"),this.actingUserId=this.getResponseProperty("ActingUserId"),this.date=this.getResponseProperty("Date"),this.deviceType=this.getResponseProperty("DeviceType"),this.ipAddress=this.getResponseProperty("IpAddress"),this.installationId=this.getResponseProperty("InstallationId"),this.systemUser=this.getResponseProperty("SystemUser"),this.domainName=this.getResponseProperty("DomainName"),this.secretId=this.getResponseProperty("SecretId"),this.serviceAccountId=this.getResponseProperty("ServiceAccountId")}}class Zd extends I.c{constructor(e){super(e),this.userId=this.getResponseProperty("UserId"),this.publicKey=this.getResponseProperty("PublicKey")}}class xd extends I.c{constructor(e){super(e),this.url=null,this.attachmentId=this.getResponseProperty("AttachmentId"),this.fileUploadType=this.getResponseProperty("FileUploadType");const t=this.getResponseProperty("CipherResponse"),i=this.getResponseProperty("CipherMiniResponse");this.cipherResponse=null==t?null:new Ju.r(t),this.cipherMiniResponse=null==i?null:new Ju.r(i),this.url=this.getResponseProperty("Url")}}var Sd=i(74854);class Td extends I.c{constructor(e=null){super(e),null!=e&&(this.id=this.getResponseProperty("Id"),this.fileName=this.getResponseProperty("FileName"),this.size=this.getResponseProperty("Size"),this.sizeName=this.getResponseProperty("SizeName"))}}class Cd extends I.c{constructor(e=null){super(e),null!=e&&(this.text=this.getResponseProperty("Text"),this.hidden=this.getResponseProperty("Hidden")||!1)}}class Od extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.accessId=this.getResponseProperty("AccessId"),this.type=this.getResponseProperty("Type"),this.name=this.getResponseProperty("Name"),this.notes=this.getResponseProperty("Notes"),this.key=this.getResponseProperty("Key"),this.maxAccessCount=this.getResponseProperty("MaxAccessCount"),this.accessCount=this.getResponseProperty("AccessCount"),this.revisionDate=this.getResponseProperty("RevisionDate"),this.expirationDate=this.getResponseProperty("ExpirationDate"),this.deletionDate=this.getResponseProperty("DeletionDate"),this.password=this.getResponseProperty("Password"),this.disable=this.getResponseProperty("Disabled")||!1,this.hideEmail=this.getResponseProperty("HideEmail")||!1;const t=this.getResponseProperty("Text");null!=t&&(this.text=new Cd(t));const i=this.getResponseProperty("File");null!=i&&(this.file=new Td(i))}}class kd extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.revisionDate=this.getResponseProperty("RevisionDate")}}class Pd extends I.c{constructor(e){super(e),this.folders=[],this.collections=[],this.ciphers=[],this.policies=[],this.sends=[];const t=this.getResponseProperty("Profile");null!=t&&(this.profile=new ie(t));const i=this.getResponseProperty("Folders");null!=i&&(this.folders=i.map((e=>new kd(e))));const n=this.getResponseProperty("Collections");null!=n&&(this.collections=n.map((e=>new zu.TO(e))));const s=this.getResponseProperty("Ciphers");null!=s&&(this.ciphers=s.map((e=>new Ju.r(e))));const o=this.getResponseProperty("Domains");null!=o&&(this.domains=new _d(o));const r=this.getResponseProperty("Policies");null!=r&&(this.policies=r.map((e=>new ze.j(e))));const a=this.getResponseProperty("Sends");null!=a&&(this.sends=a.map((e=>new Od(e))))}}var qd=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Id=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Md=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Nd=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ld{constructor(e,t){this.cryptoFunctionService=e,this.apiService=t}passwordLeaked(e){return Nd(this,void 0,void 0,(function*(){const t=yield this.cryptoFunctionService.hash(e,"sha1"),i=Fe.c.fromBufferToHex(t).toUpperCase(),n=i.substr(0,5),s=i.substr(5),o=yield this.apiService.nativeFetch(new Request("https://api.pwnedpasswords.com/range/"+n)),r=(yield o.text()).split(/\r?\n/).find((e=>e.split(":")[0]===s));return null!=r?parseInt(r.split(":")[1],10):0}))}breachedAccounts(e){return Nd(this,void 0,void 0,(function*(){try{return yield this.apiService.getHibpBreach(e)}catch(t){if(404===t.statusCode)return[];throw new Error}}))}}var Dd,Ed;Id([(Dd=100,Ed=()=>"passwordLeaked",(e,t,i)=>{const n=i.value,s=new Map;return{value:function(...e){const t=(e=>{let t=s.get(e);return null!=t||(t=new Map,s.set(e,t)),t})(this),i=Ed(e);let o=t.get(i);return null==o&&(o=[],t.set(i,o)),new Promise(((r,a)=>{const l=()=>{const c=()=>{o.splice(o.indexOf(l),1),o.length>=Dd?o[Dd-1]():0===o.length&&(t.delete(i),0===t.size&&s.delete(this))};n.apply(this,e).then((e=>(c(),e))).catch((e=>{throw c(),e})).then(r,a)};o.push(l),o.length<=Dd&&l()}))}}}),Md("design:type",Function),Md("design:paramtypes",[String]),Md("design:returntype",Promise)],Ld.prototype,"passwordLeaked",null);var Fd=i(59260),Rd=i(99566);class Jd{static fromJSON(e){return Object.assign(new Jd,e)}}const zd=he.fX.array(he.ql,"events",{deserializer:e=>Jd.fromJSON(e),clearOn:["logout"]});var Yd=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Kd{}var Bd=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Qd=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Gd=i(56118),jd=i(66469),Vd=i(89474),$d=i(31182),Hd=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Wd=new he.fX(he.w6,"searchIndex",{deserializer:e=>e,clearOn:["lock","logout"]}),Xd=new he.fX(he.w6,"searchIndexedEntityId",{deserializer:e=>e,clearOn:["lock","logout"]}),ep=new he.fX(he.w6,"isIndexing",{deserializer:e=>e,clearOn:["lock","logout"]});class tp{constructor(e,t,i){this.logService=e,this.i18nService=t,this.stateProvider=i,this.searchIndexState=this.stateProvider.getActive(Wd),this.index$=this.searchIndexState.state$.pipe((0,de.U)((e=>e?Gd.Index.load(e):null))),this.searchIndexEntityIdState=this.stateProvider.getActive(Xd),this.indexedEntityId$=this.searchIndexEntityIdState.state$.pipe((0,de.U)((e=>e))),this.searchIsIndexingState=this.stateProvider.getActive(ep),this.searchIsIndexing$=this.searchIsIndexingState.state$.pipe((0,de.U)((e=>null!=e&&e))),this.immediateSearchLocales=["zh-CN","zh-TW","ja","ko","vi"],this.defaultSearchableMinLength=2,this.searchableMinLength=this.defaultSearchableMinLength,this.i18nService.locale$.subscribe((e=>{-1!==this.immediateSearchLocales.indexOf(e)?this.searchableMinLength=1:this.searchableMinLength=this.defaultSearchableMinLength})),tp.registeredPipeline||(tp.registeredPipeline=!0,Gd.Pipeline.registerFunction(this.normalizeAccentsPipelineFunction,"normalizeAccents"))}clearIndex(){return Hd(this,void 0,void 0,(function*(){yield this.searchIndexEntityIdState.update((()=>null)),yield this.searchIndexState.update((()=>null)),yield this.searchIsIndexingState.update((()=>null))}))}isSearchable(e){return Hd(this,void 0,void 0,(function*(){e=tp.normalizeSearchQuery(e);const t=yield this.getIndexForSearch();return!(null==e||null==t&&e.length<this.searchableMinLength||null!=t&&e.length<this.searchableMinLength&&0!==e.indexOf(">"))}))}indexCiphers(e,t){return Hd(this,void 0,void 0,(function*(){if(yield this.getIsIndexing())return;yield this.setIsIndexing(!0),yield this.setIndexedEntityIdForSearch(t);const i=new Gd.Builder;i.pipeline.add(this.normalizeAccentsPipelineFunction),i.ref("id"),i.field("shortid",{boost:100,extractor:e=>e.id.substr(0,8)}),i.field("name",{boost:10}),i.field("subtitle",{boost:5,extractor:e=>null!=e.subTitle&&e.type===$d.O.Card?e.subTitle.replace(/\*/g,""):e.subTitle}),i.field("notes"),i.field("login.username",{extractor:e=>e.type===$d.O.Login&&null!=e.login?e.login.username:null}),i.field("login.uris",{boost:2,extractor:e=>this.uriExtractor(e)}),i.field("fields",{extractor:e=>this.fieldExtractor(e,!1)}),i.field("fields_joined",{extractor:e=>this.fieldExtractor(e,!0)}),i.field("attachments",{extractor:e=>this.attachmentExtractor(e,!1)}),i.field("attachments_joined",{extractor:e=>this.attachmentExtractor(e,!0)}),i.field("organizationid",{extractor:e=>e.organizationId}),(e=e||[]).forEach((e=>i.add(e)));const n=i.build();yield this.setIndexForSearch(n.toJSON()),yield this.setIsIndexing(!1),this.logService.info("Finished search indexing")}))}searchCiphers(e,t=null,i){return Hd(this,void 0,void 0,(function*(){const n=[];if(null!=e&&(e=tp.normalizeSearchQuery(e.trim().toLowerCase())),""===e&&(e=null),null==i&&(i=[]),null!=t&&Array.isArray(t)&&t.length>0?i=i.filter((e=>t.every((t=>null==t||t(e))))):null!=t&&(i=i.filter(t)),!(yield this.isSearchable(e)))return i;(yield this.getIsIndexing())&&(yield new Promise((e=>setTimeout(e,250))),(yield this.getIsIndexing())&&(yield new Promise((e=>setTimeout(e,500)))));const s=yield this.getIndexForSearch();if(null==s)return this.searchCiphersBasic(i,e);const o=new Map;i.forEach((e=>o.set(e.id,e)));let r=null;if(null!=e&&e.length>1&&0===e.indexOf(">"))try{r=s.search(e.substr(1).trim())}catch(a){this.logService.error(a)}else{const t=Gd.Query.wildcard.LEADING|Gd.Query.wildcard.TRAILING;r=s.query((i=>{Gd.tokenizer(e).forEach((e=>{const n=e.toString();i.term(n,{fields:["name"],wildcard:t}),i.term(n,{fields:["subtitle"],wildcard:t}),i.term(n,{fields:["login.uris"],wildcard:t}),i.term(n,{})}))}))}return null!=r&&r.forEach((e=>{o.has(e.ref)&&n.push(o.get(e.ref))})),n}))}searchCiphersBasic(e,t,i=!1){return t=tp.normalizeSearchQuery(t.trim().toLowerCase()),e.filter((e=>i===e.isDeleted&&(null!=e.name&&e.name.toLowerCase().indexOf(t)>-1||(!!(t.length>=8&&e.id.startsWith(t))||(null!=e.subTitle&&e.subTitle.toLowerCase().indexOf(t)>-1||!!(e.login&&e.login.hasUris&&e.login.uris.some((e=>{var i;return(null===(i=null==e?void 0:e.uri)||void 0===i?void 0:i.toLowerCase().indexOf(t))>-1}))))))))}searchSends(e,t){if(null===(t=tp.normalizeSearchQuery(t.trim().toLocaleLowerCase())))return e;const i=[],n=[];return e.forEach((e=>{var s,o,r;null!=e.name&&e.name.toLowerCase().indexOf(t)>-1?i.push(e):(t.length>=8&&(e.id.startsWith(t)||e.accessId.toLocaleLowerCase().startsWith(t)||null!=(null===(s=e.file)||void 0===s?void 0:s.id)&&e.file.id.startsWith(t))||null!=e.notes&&e.notes.toLowerCase().indexOf(t)>-1||null!=(null===(o=e.text)||void 0===o?void 0:o.text)&&e.text.text.toLowerCase().indexOf(t)>-1||null!=(null===(r=e.file)||void 0===r?void 0:r.fileName)&&e.file.fileName.toLowerCase().indexOf(t)>-1)&&n.push(e)})),i.concat(n)}getIndexForSearch(){return Hd(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.index$)}))}setIndexForSearch(e){return Hd(this,void 0,void 0,(function*(){yield this.searchIndexState.update((()=>e))}))}setIndexedEntityIdForSearch(e){return Hd(this,void 0,void 0,(function*(){yield this.searchIndexEntityIdState.update((()=>e))}))}setIsIndexing(e){return Hd(this,void 0,void 0,(function*(){yield this.searchIsIndexingState.update((()=>e))}))}getIsIndexing(){return Hd(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.searchIsIndexing$)}))}fieldExtractor(e,t){if(!e.hasFields)return null;let i=[];return e.fields.forEach((e=>{null!=e.name&&i.push(e.name),e.type===Vd.fS.Text&&null!=e.value&&i.push(e.value)})),i=i.filter((e=>""!==e.trim())),0===i.length?null:t?i.join(" "):i}attachmentExtractor(e,t){if(!e.hasAttachments)return null;let i=[];return e.attachments.forEach((e=>{null!=e&&null!=e.fileName&&(t&&e.fileName.indexOf(".")>-1?i.push(e.fileName.substr(0,e.fileName.lastIndexOf("."))):i.push(e.fileName))})),i=i.filter((e=>""!==e.trim())),0===i.length?null:t?i.join(" "):i}uriExtractor(e){if(e.type!==$d.O.Login||null==e.login||!e.login.hasUris)return null;const t=[];return e.login.uris.forEach((e=>{if(null==e.uri||""===e.uri)return;if(null!=e.hostname)return void t.push(e.hostname);let i=e.uri;if(e.match!==jd.s.RegularExpression){const e=i.indexOf("://");e>-1&&(i=i.substr(e+3));const t=i.search(/\?|&|#/);t>-1&&(i=i.substring(0,t))}t.push(i)})),t.length>0?t:null}normalizeAccentsPipelineFunction(e){const t=["name","login.username","subtitle","notes"];return e.metadata.fields.every((e=>t.includes(e)))?tp.normalizeSearchQuery(e.toString()):e}static normalizeSearchQuery(e){return null==e?void 0:e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}}tp.registeredPipeline=!1;var ip=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var np=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class sp{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p=null,h=null){this.accountService=e,this.masterPasswordService=t,this.cipherService=i,this.folderService=n,this.collectionService=s,this.platformUtilsService=o,this.messagingService=r,this.searchService=a,this.stateService=l,this.authService=c,this.vaultTimeoutSettingsService=u,this.stateEventRunnerService=d,this.lockedCallback=p,this.loggedOutCallback=h,this.inited=!1}init(e){return np(this,void 0,void 0,(function*(){this.inited||(this.inited=!0,e&&this.startCheck())}))}startCheck(){this.checkVaultTimeout(),setInterval((()=>this.checkVaultTimeout()),1e4)}checkVaultTimeout(){return np(this,void 0,void 0,(function*(){const e=yield this.platformUtilsService.isViewOpen();yield(0,pe.z)((0,Ke.a)([this.accountService.activeAccount$,this.accountService.accountActivity$]).pipe((0,it.w)((([t,i])=>np(this,void 0,void 0,(function*(){const n=null==t?void 0:t.id;for(const t in i){const s=t;null!=s&&(yield this.shouldLock(s,i[s],n,e))&&(yield this.executeTimeoutAction(s))}}))))))}))}lock(e){return np(this,void 0,void 0,(function*(){if(!(yield this.stateService.getIsAuthenticated({userId:e})))return;(yield(0,pe.z)(this.vaultTimeoutSettingsService.availableVaultTimeoutActions$(e))).includes(Li.B.Lock)||(yield this.logOut(e));const t=yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id)))),i=null!=e?e:t,n=(0,pe.z)(this.authService.authStatusFor$(i).pipe((0,cs.h)((e=>e===Qt.y.Locked)),(0,mu.V)({first:5e3,with:()=>{throw new Error("The lock process did not complete in a reasonable amount of time.")}})));null!=e&&e!==t||(yield this.searchService.clearIndex(),yield this.folderService.clearCache(),yield this.collectionService.clearActiveUserCache()),yield this.masterPasswordService.clearMasterKey(i),yield this.stateService.setUserKeyAutoUnlock(null,{userId:i}),yield this.stateService.setCryptoMasterKeyAuto(null,{userId:i}),yield this.cipherService.clearCache(i),yield this.stateEventRunnerService.handleEvent("lock",i),yield n,this.messagingService.send("locked",{userId:i}),null!=this.lockedCallback&&(yield this.lockedCallback(e))}))}logOut(e){return np(this,void 0,void 0,(function*(){null!=this.loggedOutCallback&&(yield this.loggedOutCallback(!1,e))}))}shouldLock(e,t,i,n){return np(this,void 0,void 0,(function*(){if(n&&e===i)return!1;const s=yield this.authService.getAuthStatus(e);if(s===Qt.y.Locked||s===Qt.y.LoggedOut)return!1;const o=yield this.vaultTimeoutSettingsService.getVaultTimeout(e);if(null==o||o<0)return!1;if(null==t)return!1;const r=60*o;return((new Date).getTime()-t.getTime())/1e3>=r}))}executeTimeoutAction(e){return np(this,void 0,void 0,(function*(){(yield(0,pe.z)(this.vaultTimeoutSettingsService.vaultTimeoutAction$(e)))===Li.B.LogOut?yield this.logOut(e):yield this.lock(e)}))}}var op=i(8257),rp=i(51453),ap=i(41399);class lp{constructor(e){null!=e&&(this.id=e.id,this.fileName=e.fileName,this.size=e.size,this.sizeName=e.sizeName)}}class cp{constructor(e){null!=e&&(this.text=e.text,this.hidden=e.hidden)}}class up{constructor(e){if(null!=e)switch(this.id=e.id,this.accessId=e.accessId,this.type=e.type,this.name=e.name,this.notes=e.notes,this.key=e.key,this.maxAccessCount=e.maxAccessCount,this.accessCount=e.accessCount,this.revisionDate=e.revisionDate,this.expirationDate=e.expirationDate,this.deletionDate=e.deletionDate,this.password=e.password,this.disabled=e.disable,this.hideEmail=e.hideEmail,this.type){case ap.n.Text:this.text=new cp(e.text);break;case ap.n.File:this.file=new lp(e.file)}}}class dp{constructor(e,t){switch(this.type=e.type,this.fileLength=t,this.name=e.name?e.name.encryptedString:null,this.notes=e.notes?e.notes.encryptedString:null,this.maxAccessCount=e.maxAccessCount,this.expirationDate=null!=e.expirationDate?e.expirationDate.toISOString():null,this.deletionDate=null!=e.deletionDate?e.deletionDate.toISOString():null,this.key=null!=e.key?e.key.encryptedString:null,this.password=e.password,this.disabled=e.disabled,this.hideEmail=e.hideEmail,this.type){case ap.n.Text:this.text=new Cd,this.text.text=null!=e.text.text?e.text.text.encryptedString:null,this.text.hidden=e.text.hidden;break;case ap.n.File:this.file=new Td,this.file.fileName=null!=e.file.fileName?e.file.fileName.encryptedString:null}}}class pp extends I.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.type=this.getResponseProperty("Type"),this.name=this.getResponseProperty("Name");const t=this.getResponseProperty("Text");null!=t&&(this.text=new Cd(t));const i=this.getResponseProperty("File");null!=i&&(this.file=new Td(i)),this.expirationDate=this.getResponseProperty("ExpirationDate"),this.creatorIdentifier=this.getResponseProperty("CreatorIdentifier")}}class hp extends I.c{constructor(e){super(e),this.id=null,this.url=null,this.id=this.getResponseProperty("Id"),this.url=this.getResponseProperty("Url")}}class gp extends I.c{constructor(e){super(e),this.url=null,this.fileUploadType=this.getResponseProperty("FileUploadType");const t=this.getResponseProperty("SendResponse");this.sendResponse=null==t?null:new Od(t),this.url=this.getResponseProperty("Url")}}var fp=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var mp=i(88701);const vp=he.fX.record(he.qj,"sendUserEncrypted",{deserializer:e=>e,clearOn:["logout"]}),yp=new he.fX(he.Lg,"sendUserDecrypted",{deserializer:e=>e,clearOn:["lock"]});var wp=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class bp{}var Up=i(69255),_p=i(94312),Ap=i(22850);class Zp extends dp{constructor(e){super(e),this.id=e.id}}var xp=i(67381),Sp=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Tp=i(92649),Cp=i(92236),Op=i(31754);class kp{}var Pp=i(22492),qp=i(23031);var Ip=i(4871),Mp=i(8067);var Np=i(95104),Lp=i(61265),Dp=i(19553),Ep=i(15727),Fp=i(6137),Rp=i(52870),Jp=i(34754),zp=i(82702),Yp=i(20364),Kp=i(19051),Bp=i(99896);class Qp{constructor(e){this.comparator=e,this.sortedCiphersByUrl=new Map,this.timeouts=new Map}isCached(e){return this.sortedCiphersByUrl.has(e)}addCiphers(e,t){t.sort(this.comparator),this.sortedCiphersByUrl.set(e,new Gp(t)),this.resetTimer(e)}getLastUsed(e){return this.resetTimer(e),this.isCached(e)?this.sortedCiphersByUrl.get(e).getLastUsed():null}getLastLaunched(e){return this.isCached(e)?this.sortedCiphersByUrl.get(e).getLastLaunched():null}getNext(e){return this.resetTimer(e),this.isCached(e)?this.sortedCiphersByUrl.get(e).getNext():null}updateLastUsedIndex(e){this.isCached(e)&&this.sortedCiphersByUrl.get(e).updateLastUsedIndex()}clear(){this.sortedCiphersByUrl.clear(),this.timeouts.clear()}resetTimer(e){clearTimeout(this.timeouts.get(e)),this.timeouts.set(e,setTimeout((()=>{this.sortedCiphersByUrl.delete(e),this.timeouts.delete(e)}),3e3))}}class Gp{constructor(e){this.ciphers=e,this.lastUsedIndex=-1}getLastUsed(){return this.lastUsedIndex=Math.max(this.lastUsedIndex,0),this.ciphers[this.lastUsedIndex]}getLastLaunched(){return this.ciphers.filter((e=>{var t;return null===(t=e.localData)||void 0===t?void 0:t.lastLaunched})).sort(((e,t)=>t.localData.lastLaunched.valueOf()-e.localData.lastLaunched.valueOf()))[0]}getNextIndex(){return(this.lastUsedIndex+1)%this.ciphers.length}getNext(){return this.ciphers[this.getNextIndex()]}updateLastUsedIndex(){this.lastUsedIndex=this.getNextIndex()}}var jp=i(97466);class Vp{constructor(e,t){this.ids=null==e?[]:e,this.folderId=t}}class $p{constructor(e,t){this.ids=null==e?[]:e,this.organizationId=t}}var Hp=i(41412);class Wp{constructor(e,t){null!=e&&(this.ciphers=[],e.forEach((e=>{this.ciphers.push(new Hp.K(e))}))),this.collectionIds=t}}class Xp{constructor(e,t,i,n=!1){this.organizationId=e,this.cipherIds=t,this.collectionIds=i,this.removeCollections=n}}var eh=i(43898),th=i(29918);class ih{constructor(e){this.cipher=new th.a(e),this.collectionIds=e.collectionIds}}class nh{constructor(e){this.folderId=e.folderId,this.favorite=e.favorite}}class sh{constructor(e){this.cipher=new th.a(e),this.collectionIds=e.collectionIds}}var oh=i(42937);const rh=he.vh.record(he.KD,"ciphers",{deserializer:e=>Lp.O.fromJSON(e)}),ah=he.vh.record(he.E8,"decryptedCiphers",{deserializer:e=>vo.$.fromJSON(e)}),lh=new he.vh(he.hY,"localData",{deserializer:e=>e}),ch=new he.vh(he.E8,"addEditCipherInfo",{deserializer:e=>{if(null==e)return null;return{cipher:null!=(null==e?void 0:e.cipher.toJSON)?e.cipher:vo.$.fromJSON(null==e?void 0:e.cipher),collectionIds:e.collectionIds}}});var uh=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},dh=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},ph=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const hh=new Cs.SemVer("2024.2.0");class gh{viewFor$(e){return this.cipherViews$.pipe((0,de.U)((t=>t[e])))}constructor(e,t,i,n,s,o,r,a,l,c,u){this.cryptoService=e,this.domainSettingsService=t,this.apiService=i,this.i18nService=n,this.searchService=s,this.stateService=o,this.autofillSettingsService=r,this.encryptService=a,this.cipherFileUploadService=l,this.configService=c,this.stateProvider=u,this.sortedCiphersCache=new Qp(this.sortCiphersByLastUsed),this.localDataState=this.stateProvider.getActive(lh),this.encryptedCiphersState=this.stateProvider.getActive(rh),this.decryptedCiphersState=this.stateProvider.getActive(ah),this.addEditCipherInfoState=this.stateProvider.getActive(ch),this.ciphersExpectingUpdate=this.stateProvider.getDerived(this.encryptedCiphersState.state$,new he.dT(he.E8,"ciphersExpectingUpdate",{derive:e=>!1,deserializer:e=>e}),{}),this.localData$=this.localDataState.state$.pipe((0,de.U)((e=>null!=e?e:{}))),this.ciphers$=this.ciphersExpectingUpdate.state$.pipe((0,Np.n)((e=>e)),(0,it.w)((()=>this.encryptedCiphersState.state$)),(0,de.U)((e=>null!=e?e:{}))),this.cipherViews$=this.decryptedCiphersState.state$.pipe((0,de.U)((e=>null!=e?e:{})),(0,_u.B)({resetOnRefCountZero:!0})),this.addEditCipherInfo$=this.addEditCipherInfoState.state$}setDecryptedCipherCache(e){return ph(this,void 0,void 0,(function*(){null!=e&&0===e.length||(yield this.setDecryptedCiphers(e)),null!=this.searchService&&(null==e?yield this.searchService.clearIndex():yield this.searchService.indexCiphers(e))}))}setDecryptedCiphers(e){return ph(this,void 0,void 0,(function*(){const t={};null==e||e.forEach((e=>{t[e.id]=e})),yield this.decryptedCiphersState.update((()=>t))}))}clearCache(e){return ph(this,void 0,void 0,(function*(){yield this.clearDecryptedCiphersState(e)}))}encrypt(e,t,i,n=null){var s;return ph(this,void 0,void 0,(function*(){null!=e.id&&(null==n&&(n=yield this.get(e.id)),null!=n&&(yield this.updateModelfromExistingCipher(e,n)),this.adjustPasswordHistoryLength(e));const o=new mo.t;if(o.id=e.id,o.folderId=e.folderId,o.favorite=e.favorite,o.organizationId=e.organizationId,o.type=e.type,o.collectionIds=e.collectionIds,o.revisionDate=e.revisionDate,o.reprompt=e.reprompt,o.edit=e.edit,yield this.getCipherKeyEncryptionEnabled()){o.key=null!==(s=null==n?void 0:n.key)&&void 0!==s?s:null;const r=yield this.getKeyForCipherKeyDecryption(o);return t||(t=r),i||(i=r),this.encryptCipherWithCipherKey(e,o,t,i)}if(null==t&&null!=o.organizationId&&null==(t=yield this.cryptoService.getOrgKey(o.organizationId)))throw new Error("Cannot encrypt cipher for organization. No key.");return o.key=null,this.encryptCipher(e,o,t)}))}encryptAttachments(e,t){return ph(this,void 0,void 0,(function*(){if(null==e||0===e.length)return null;const i=[],n=[];return e.forEach((e=>ph(this,void 0,void 0,(function*(){const s=new Dp.P;s.id=e.id,s.size=e.size,s.sizeName=e.sizeName,s.url=e.url;const o=this.encryptObjProperty(e,s,{fileName:null},t).then((()=>ph(this,void 0,void 0,(function*(){null!=e.key&&(s.key=yield this.cryptoService.encrypt(e.key.key,t)),n.push(s)}))));i.push(o)})))),yield Promise.all(i),n}))}encryptFields(e,t){return ph(this,void 0,void 0,(function*(){if(!e||!e.length)return null;const i=this,n=[];return yield e.reduce(((e,s)=>ph(this,void 0,void 0,(function*(){yield e;const o=yield i.encryptField(s,t);n.push(o)}))),Promise.resolve()),n}))}encryptField(e,t){return ph(this,void 0,void 0,(function*(){const i=new Rp.g;return i.type=e.type,i.linkedId=e.linkedId,e.type===Vd.fS.Boolean&&"true"!==e.value&&(e.value="false"),yield this.encryptObjProperty(e,i,{name:null,value:null},t),i}))}encryptPasswordHistories(e,t){return ph(this,void 0,void 0,(function*(){if(!e||!e.length)return null;const i=this,n=[];return yield e.reduce(((e,s)=>ph(this,void 0,void 0,(function*(){yield e;const o=yield i.encryptPasswordHistory(s,t);n.push(o)}))),Promise.resolve()),n}))}encryptPasswordHistory(e,t){return ph(this,void 0,void 0,(function*(){const i=new Kp.r;return i.lastUsedDate=e.lastUsedDate,yield this.encryptObjProperty(e,i,{password:null},t),i}))}get(e){return ph(this,void 0,void 0,(function*(){const t=yield(0,pe.z)(this.ciphers$);if(null==t||!t.hasOwnProperty(e))return null;const i=yield(0,pe.z)(this.localData$),n=e;return new mo.t(t[n],i?i[n]:null)}))}getAll(){return ph(this,void 0,void 0,(function*(){const e=yield(0,pe.z)(this.localData$),t=yield(0,pe.z)(this.ciphers$),i=[];for(const n in t)if(t.hasOwnProperty(n)){const s=n;i.push(new mo.t(t[s],e?e[s]:null))}return i}))}getAllDecrypted(){return ph(this,void 0,void 0,(function*(){let e=yield this.getDecryptedCiphers();return null!=e&&0!==e.length?(yield this.reindexCiphers(),yield this.getDecryptedCiphers()):(e=yield this.decryptCiphers(yield this.getAll()),yield this.setDecryptedCipherCache(e),e)}))}getDecryptedCiphers(){return ph(this,void 0,void 0,(function*(){return Object.values(yield(0,pe.z)(this.cipherViews$))}))}decryptCiphers(e){return ph(this,void 0,void 0,(function*(){const t=yield this.cryptoService.getOrgKeys(),i=yield this.cryptoService.getUserKeyWithLegacySupport();if(0===Object.keys(t).length&&null==i)return;const n=e.reduce(((e,t)=>{var i,n;return null!==(i=e[n=t.organizationId])&&void 0!==i||(e[n]=[]),e[t.organizationId].push(t),e}),{});return(yield Promise.all(Object.entries(n).map((([e,n])=>{var s;return this.encryptService.decryptItems(n,null!==(s=t[e])&&void 0!==s?s:i)})))).flat().sort(this.getLocaleSortingFunction())}))}reindexCiphers(){var e;return ph(this,void 0,void 0,(function*(){const t=yield this.stateService.getUserId();null!=this.searchService&&(null!==(e=yield(0,pe.z)(this.searchService.indexedEntityId$))&&void 0!==e?e:t)!==t&&(yield this.searchService.indexCiphers(yield this.getDecryptedCiphers(),t))}))}getAllDecryptedForGrouping(e,t=!0){return ph(this,void 0,void 0,(function*(){return(yield this.getAllDecrypted()).filter((i=>!i.isDeleted&&(!(!t||i.folderId!==e)||!t&&null!=i.collectionIds&&i.collectionIds.indexOf(e)>-1)))}))}getAllDecryptedForUrl(e,t,i=null){return ph(this,void 0,void 0,(function*(){if(null==e&&null==t)return Promise.resolve([]);const n=yield(0,pe.z)(this.domainSettingsService.getUrlEquivalentDomains(e)),s=yield this.getAllDecrypted();return null!=i||(i=yield(0,pe.z)(this.domainSettingsService.defaultUriMatchStrategy$)),s.filter((s=>{const o=s.type===$d.O.Login&&null!==s.login;return null===s.deletedDate&&(!(!Array.isArray(t)||!t.includes(s.type)||o)||!!o&&s.login.matchesUri(e,n,i))}))}))}getAllFromApiForOrganization(e){return ph(this,void 0,void 0,(function*(){const t=yield this.apiService.getCiphersOrganization(e);return yield this.decryptOrganizationCiphersResponse(t,e)}))}getManyFromApiForOrganization(e){return ph(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/ciphers/organization-details/assigned?organizationId="+e,null,!0,!0);return this.decryptOrganizationCiphersResponse(t,e)}))}decryptOrganizationCiphersResponse(e,t){return ph(this,void 0,void 0,(function*(){if(null==(null==e?void 0:e.data)||e.data.length<1)return[];const i=e.data.map((e=>new mo.t(new Lp.O(e)))),n=yield this.cryptoService.getOrgKey(t),s=yield this.encryptService.decryptItems(i,n);return s.sort(this.getLocaleSortingFunction()),s}))}getLastUsedForUrl(e,t=!1){return ph(this,void 0,void 0,(function*(){return this.getCipherForUrl(e,!0,!1,t)}))}getLastLaunchedForUrl(e,t=!1){return ph(this,void 0,void 0,(function*(){return this.getCipherForUrl(e,!1,!0,t)}))}getNextCipherForUrl(e){return ph(this,void 0,void 0,(function*(){return this.getCipherForUrl(e,!1,!1,!1)}))}updateLastUsedIndexForUrl(e){this.sortedCiphersCache.updateLastUsedIndex(e)}updateLastUsedDate(e){return ph(this,void 0,void 0,(function*(){let t=yield(0,pe.z)(this.localData$);t||(t={});const i=e;t[i]?t[i].lastUsedDate=(new Date).getTime():t[i]={lastUsedDate:(new Date).getTime()},yield this.localDataState.update((()=>t));const n=yield this.getDecryptedCiphers();if(n){for(let i=0;i<n.length;i++){const s=n[i];if(s.id===e){s.localData=t[e];break}}yield this.setDecryptedCiphers(n)}}))}updateLastLaunchedDate(e){return ph(this,void 0,void 0,(function*(){let t=yield(0,pe.z)(this.localData$);t||(t={});const i=e;t[i]?t[i].lastLaunched=(new Date).getTime():t[i]={lastUsedDate:(new Date).getTime()},yield this.localDataState.update((()=>t));const n=yield this.getDecryptedCiphers();if(n){for(let i=0;i<n.length;i++){const s=n[i];if(s.id===e){s.localData=t[e];break}}yield this.setDecryptedCiphers(n)}}))}saveNeverDomain(e){return ph(this,void 0,void 0,(function*(){if(null==e)return;let t=yield(0,pe.z)(this.domainSettingsService.neverDomains$);t||(t={}),t[e]=null,yield this.domainSettingsService.setNeverDomains(t)}))}createWithServer(e,t){return ph(this,void 0,void 0,(function*(){let i;if(t&&null!=e.organizationId){const t=new ih(e);i=yield this.apiService.postCipherAdmin(t)}else if(null!=e.collectionIds){const t=new ih(e);i=yield this.apiService.postCipherCreate(t)}else{const t=new th.a(e);i=yield this.apiService.postCipher(t)}e.id=i.id;const n=new Lp.O(i,e.collectionIds),s=yield this.upsert(n);return new mo.t(s[e.id])}))}updateWithServer(e,t,i){return ph(this,void 0,void 0,(function*(){let n;if(t&&i){const t=new th.a(e);n=yield this.apiService.putCipherAdmin(e.id,t)}else if(e.edit){const t=new th.a(e);n=yield this.apiService.putCipher(e.id,t)}else{const t=new nh(e);n=yield this.apiService.putPartialCipher(e.id,t)}const s=new Lp.O(n,e.collectionIds),o=yield this.upsert(s);return new mo.t(o[e.id],e.localData)}))}shareWithServer(e,t,i){return ph(this,void 0,void 0,(function*(){const n=[];null!=e.attachments&&e.attachments.forEach((i=>{null==i.key&&n.push(this.shareAttachmentWithServer(i,e.id,t))})),yield Promise.all(n),e.organizationId=t,e.collectionIds=i;const s=yield this.encryptSharedCipher(e),o=new sh(s),r=yield this.apiService.putShareCipher(e.id,o),a=new Lp.O(r,i);yield this.upsert(a)}))}shareManyWithServer(e,t,i){return ph(this,void 0,void 0,(function*(){const n=[],s=[];for(const a of e)a.organizationId=t,a.collectionIds=i,n.push(this.encryptSharedCipher(a).then((e=>{s.push(e)})));yield Promise.all(n);const o=new Wp(s,i);try{yield this.apiService.putShareCiphers(o)}catch(r){for(const t of e)t.organizationId=null,t.collectionIds=null;throw r}yield this.upsert(s.map((e=>e.toCipherData())))}))}saveAttachmentWithServer(e,t,i=!1){return new Promise(((n,s)=>{const o=new FileReader;o.readAsArrayBuffer(t),o.onload=o=>ph(this,void 0,void 0,(function*(){try{const s=yield this.saveAttachmentRawWithServer(e,t.name,o.target.result,i);n(s)}catch(r){s(r)}})),o.onerror=()=>{s("Error reading file.")}}))}saveAttachmentRawWithServer(e,t,i,n=!1){return ph(this,void 0,void 0,(function*(){const s=yield this.getKeyForCipherKeyDecryption(e),o=yield this.getCipherKeyEncryptionEnabled(),r=o&&null!=e.key?new Wt.N(yield this.encryptService.decryptToBytes(e.key,s)):s;if(null!=e.key&&!o){const t=yield e.decrypt(yield this.getKeyForCipherKeyDecryption(e));e=yield this.encrypt(t),yield this.updateWithServer(e)}const a=yield this.encryptService.encrypt(t,r),l=yield this.cryptoService.makeDataEncKey(r),c=yield this.encryptService.encryptToBytes(new Uint8Array(i),l[0]),u=yield this.cipherFileUploadService.upload(e,a,c,n,l),d=new Lp.O(u,e.collectionIds);return n||(yield this.upsert(d)),new mo.t(d)}))}saveCollectionsWithServer(e){return ph(this,void 0,void 0,(function*(){const t=new eh.L(e.collectionIds),i=yield this.apiService.putCipherCollections(e.id,t),n=new Lp.O(i),s=yield this.upsert(n);return new mo.t(s[e.id],e.localData)}))}bulkUpdateCollectionsWithServer(e,t,i,n=!1){var s,o;return ph(this,void 0,void 0,(function*(){const r=new Xp(e,t,i,n);yield this.apiService.send("POST","/ciphers/bulk-collections",r,!0,!1);const a=yield(0,pe.z)(this.ciphers$);for(const e of t){const t=a[e];t&&(t.collectionIds=n?null===(s=t.collectionIds)||void 0===s?void 0:s.filter((e=>!i.includes(e))):[...new Set([...null!==(o=t.collectionIds)&&void 0!==o?o:[],...i])])}yield this.clearCache(),yield this.encryptedCiphersState.update((()=>a))}))}upsert(e){return ph(this,void 0,void 0,(function*(){const t=e instanceof Lp.O?[e]:e;return yield this.updateEncryptedCipherState((e=>(t.forEach((t=>e[t.id]=t)),e)))}))}replace(e){return ph(this,void 0,void 0,(function*(){yield this.updateEncryptedCipherState((()=>e))}))}updateEncryptedCipherState(e){return ph(this,void 0,void 0,(function*(){yield this.ciphersExpectingUpdate.forceValue(!0),yield this.clearDecryptedCiphersState();const[,t]=yield this.encryptedCiphersState.update((t=>e(null!=t?t:{})));return t}))}clear(e){return ph(this,void 0,void 0,(function*(){yield this.clearEncryptedCiphersState(e),yield this.clearCache(e)}))}moveManyWithServer(e,t){return ph(this,void 0,void 0,(function*(){yield this.apiService.putMoveCiphers(new Vp(e,t));let i=yield(0,pe.z)(this.ciphers$);null==i&&(i={}),e.forEach((e=>{i.hasOwnProperty(e)&&(i[e].folderId=t)})),yield this.clearCache(),yield this.encryptedCiphersState.update((()=>i))}))}delete(e){return ph(this,void 0,void 0,(function*(){const t=yield(0,pe.z)(this.ciphers$);if(null!=t){if("string"==typeof e){const i=e;if(null==t[i])return;delete t[i]}else e.forEach((e=>{delete t[e]}));yield this.clearCache(),yield this.encryptedCiphersState.update((()=>t))}}))}deleteWithServer(e,t=!1){return ph(this,void 0,void 0,(function*(){t?yield this.apiService.deleteCipherAdmin(e):yield this.apiService.deleteCipher(e),yield this.delete(e)}))}deleteManyWithServer(e,t=!1){return ph(this,void 0,void 0,(function*(){const i=new jp.c(e);t?yield this.apiService.deleteManyCiphersAdmin(i):yield this.apiService.deleteManyCiphers(i),yield this.delete(e)}))}deleteAttachment(e,t){return ph(this,void 0,void 0,(function*(){let i=yield(0,pe.z)(this.ciphers$);const n=e;if(null!=i&&i.hasOwnProperty(e)&&null!=i[n].attachments){for(let e=0;e<i[n].attachments.length;e++)i[n].attachments[e].id===t&&i[n].attachments.splice(e,1);yield this.clearCache(),yield this.encryptedCiphersState.update((()=>(null==i&&(i={}),i)))}}))}deleteAttachmentWithServer(e,t){return ph(this,void 0,void 0,(function*(){try{yield this.apiService.deleteCipherAttachment(e,t)}catch(i){return Promise.reject(i.getSingleMessage())}yield this.deleteAttachment(e,t)}))}sortCiphersByLastUsed(e,t){const i=e.localData&&e.localData.lastUsedDate?e.localData.lastUsedDate:null,n=t.localData&&t.localData.lastUsedDate?t.localData.lastUsedDate:null,s=null!=i&&null!=n;return s&&i<n?1:null!=i&&null==n||s&&i>n?-1:null!=n&&null==i?1:0}sortCiphersByLastUsedThenName(e,t){const i=this.sortCiphersByLastUsed(e,t);return 0!==i?i:this.getLocaleSortingFunction()(e,t)}getLocaleSortingFunction(){return(e,t)=>{let i=e.name,n=t.name;if(null==i&&null!=n)return-1;if(null!=i&&null==n)return 1;if(null==i&&null==n)return 0;const s=this.i18nService.collator?this.i18nService.collator.compare(i,n):i.localeCompare(n);return 0!==s||e.type!==$d.O.Login||t.type!==$d.O.Login?s:(null!=e.login.username&&(i+=e.login.username),null!=t.login.username&&(n+=t.login.username),this.i18nService.collator?this.i18nService.collator.compare(i,n):i.localeCompare(n))}}softDelete(e){return ph(this,void 0,void 0,(function*(){let t=yield(0,pe.z)(this.ciphers$);if(null==t)return;const i=e=>{null!=t[e]&&(t[e].deletedDate=(new Date).toISOString())};"string"==typeof e?i(e):e.forEach(i),yield this.clearCache(),yield this.encryptedCiphersState.update((()=>(null==t&&(t={}),t)))}))}softDeleteWithServer(e,t=!1){return ph(this,void 0,void 0,(function*(){t?yield this.apiService.putDeleteCipherAdmin(e):yield this.apiService.putDeleteCipher(e),yield this.softDelete(e)}))}softDeleteManyWithServer(e,t=!1){return ph(this,void 0,void 0,(function*(){const i=new jp.c(e);t?yield this.apiService.putDeleteManyCiphersAdmin(i):yield this.apiService.putDeleteManyCiphers(i),yield this.softDelete(e)}))}restore(e){return ph(this,void 0,void 0,(function*(){let t=yield(0,pe.z)(this.ciphers$);if(null==t)return;const i=e=>{const i=e.id;null!=t[i]&&(t[i].deletedDate=null,t[i].revisionDate=e.revisionDate)};e.constructor.name===Array.name?e.forEach(i):i(e),yield this.clearCache(),yield this.encryptedCiphersState.update((()=>(null==t&&(t={}),t)))}))}restoreWithServer(e,t=!1){return ph(this,void 0,void 0,(function*(){let i;i=t?yield this.apiService.putRestoreCipherAdmin(e):yield this.apiService.putRestoreCipher(e),yield this.restore({id:e,revisionDate:i.revisionDate})}))}restoreManyWithServer(e,t=null,i=!1){return ph(this,void 0,void 0,(function*(){let n;if(i){const i=new $p(e,t);n=yield this.apiService.putRestoreManyCiphersAdmin(i)}else{const t=new $p(e);n=yield this.apiService.putRestoreManyCiphers(t)}const s=[];for(const e of n.data)s.push({id:e.id,revisionDate:e.revisionDate});yield this.restore(s)}))}getKeyForCipherKeyDecryption(e){return ph(this,void 0,void 0,(function*(){return(yield this.cryptoService.getOrgKey(e.organizationId))||(yield this.cryptoService.getUserKeyWithLegacySupport())}))}setAddEditCipherInfo(e){return ph(this,void 0,void 0,(function*(){yield this.addEditCipherInfoState.update((()=>e),{shouldUpdate:t=>!(null==t&&null==e)})}))}encryptSharedCipher(e){return ph(this,void 0,void 0,(function*(){const t=yield this.cryptoService.getUserKeyWithLegacySupport();return yield this.encrypt(e,null,t)}))}updateModelfromExistingCipher(e,t){return ph(this,void 0,void 0,(function*(){const i=yield t.decrypt(yield this.getKeyForCipherKeyDecryption(t));if(e.passwordHistory=i.passwordHistory||[],e.type===$d.O.Login&&i.type===$d.O.Login)if(null!=i.login.password&&""!==i.login.password&&i.login.password!==e.login.password){const t=new oh.i;t.password=i.login.password,t.lastUsedDate=e.login.passwordRevisionDate=new Date,e.passwordHistory.splice(0,0,t)}else e.login.passwordRevisionDate=i.login.passwordRevisionDate;if(i.hasFields){const t=i.fields.filter((e=>e.type===Vd.fS.Hidden&&null!=e.name&&""!==e.name&&null!=e.value&&""!==e.value)),n=null==e.fields?[]:e.fields.filter((e=>e.type===Vd.fS.Hidden&&null!=e.name&&""!==e.name));t.forEach((t=>{const i=n.find((e=>e.name===t.name));if(null==i||i.value!==t.value){const i=new oh.i;i.password=t.name+": "+t.value,i.lastUsedDate=new Date,e.passwordHistory.splice(0,0,i)}}))}}))}adjustPasswordHistoryLength(e){null!=e.passwordHistory&&0===e.passwordHistory.length?e.passwordHistory=null:null!=e.passwordHistory&&e.passwordHistory.length>5&&(e.passwordHistory=e.passwordHistory.slice(0,5))}shareAttachmentWithServer(e,t,i){return ph(this,void 0,void 0,(function*(){const n=yield this.apiService.nativeFetch(new Request(e.url,{cache:"no-store"}));if(200!==n.status)throw Error("Failed to download attachment: "+n.status.toString());const s=yield lo.j.fromResponse(n),o=yield this.cryptoService.decryptFromBytes(s,null);let r;r=yield this.cryptoService.getOrgKey(i),r||(r=yield this.cryptoService.getUserKeyWithLegacySupport());const a=yield this.cryptoService.makeDataEncKey(r),l=yield this.encryptService.encrypt(e.fileName,r),c=yield this.encryptService.encryptToBytes(new Uint8Array(o),a[0]),u=new FormData;try{const e=new Blob([c.buffer],{type:"application/octet-stream"});u.append("key",a[1].encryptedString),u.append("data",e,l.encryptedString)}catch(d){if(!Fe.c.isNode||Fe.c.isBrowser)throw d;u.append("key",a[1].encryptedString),u.append("data",Buffer.from(c.buffer),{filepath:l.encryptedString,contentType:"application/octet-stream"})}try{yield this.apiService.postShareCipherAttachment(t,e.id,u,i)}catch(d){throw new Error(d.getSingleMessage())}}))}encryptObjProperty(e,t,i,n){return ph(this,void 0,void 0,(function*(){const s=[],o=this;for(const r in i)i.hasOwnProperty(r)&&function(t,r){const a=Promise.resolve().then((()=>{const s=e[i[t]||t];return s&&""!==s?o.cryptoService.encrypt(s,n):null})).then((e=>{r[t]=e}));s.push(a)}(r,t);yield Promise.all(s)}))}encryptCipherData(e,t,i){return ph(this,void 0,void 0,(function*(){switch(e.type){case $d.O.Login:if(e.login=new zp.m,e.login.passwordRevisionDate=t.login.passwordRevisionDate,e.login.autofillOnPageLoad=t.login.autofillOnPageLoad,yield this.encryptObjProperty(t.login,e.login,{username:null,password:null,totp:null},i),null!=t.login.uris){e.login.uris=[],t.login.uris=t.login.uris.filter((e=>null!=e.uri));for(let n=0;n<t.login.uris.length;n++){const s=new Yp.c;s.match=t.login.uris[n].match,yield this.encryptObjProperty(t.login.uris[n],s,{uri:null},i);const o=yield this.encryptService.hash(t.login.uris[n].uri,"sha256");s.uriChecksum=yield this.cryptoService.encrypt(o,i),e.login.uris.push(s)}}return void(null!=t.login.fido2Credentials&&(e.login.fido2Credentials=yield Promise.all(t.login.fido2Credentials.map((e=>ph(this,void 0,void 0,(function*(){const t=new Fp.m;return yield this.encryptObjProperty(e,t,{credentialId:null,keyType:null,keyAlgorithm:null,keyCurve:null,keyValue:null,rpId:null,rpName:null,userHandle:null,userName:null,userDisplayName:null,origin:null},i),t.counter=yield this.cryptoService.encrypt(String(e.counter),i),t.discoverable=yield this.cryptoService.encrypt(String(e.discoverable),i),t.creationDate=e.creationDate,t})))))));case $d.O.SecureNote:return e.secureNote=new Bp.k,void(e.secureNote.type=t.secureNote.type);case $d.O.Card:return e.card=new Ep.Z,void(yield this.encryptObjProperty(t.card,e.card,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},i));case $d.O.Identity:return e.identity=new Jp.i,void(yield this.encryptObjProperty(t.identity,e.identity,{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null},i));default:throw new Error("Unknown cipher type.")}}))}getAutofillOnPageLoadDefault(){return ph(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.autofillSettingsService.autofillOnPageLoadDefault$)}))}getCipherForUrl(e,t,i,n){return ph(this,void 0,void 0,(function*(){const s=n?"autofillOnPageLoad-"+e:e;if(!this.sortedCiphersCache.isCached(s)){let t=yield this.getAllDecryptedForUrl(e);if(!t)return null;if(n){const e=yield this.getAutofillOnPageLoadDefault();if(t=t.filter((t=>t.login.autofillOnPageLoad||null==t.login.autofillOnPageLoad&&!1!==e)),0===t.length)return null}this.sortedCiphersCache.addCiphers(s,t)}return i?this.sortedCiphersCache.getLastLaunched(s):t?this.sortedCiphersCache.getLastUsed(s):this.sortedCiphersCache.getNext(s)}))}clearEncryptedCiphersState(e){return ph(this,void 0,void 0,(function*(){yield this.encryptedCiphersState.update((()=>({})))}))}clearDecryptedCiphersState(e){return ph(this,void 0,void 0,(function*(){yield this.setDecryptedCiphers(null),this.clearSortedCiphers()}))}clearSortedCiphers(){this.sortedCiphersCache.clear()}encryptCipher(e,t,i){return ph(this,void 0,void 0,(function*(){return yield Promise.all([this.encryptObjProperty(e,t,{name:null,notes:null},i),this.encryptCipherData(t,e,i),this.encryptFields(e.fields,i).then((e=>{t.fields=e})),this.encryptPasswordHistories(e.passwordHistory,i).then((e=>{t.passwordHistory=e})),this.encryptAttachments(e.attachments,i).then((e=>{t.attachments=e}))]),t}))}encryptCipherWithCipherKey(e,t,i,n){return ph(this,void 0,void 0,(function*(){let s;return s=null==t.key?yield this.cryptoService.makeCipherKey():new Wt.N(yield this.encryptService.decryptToBytes(t.key,n)),t.key=yield this.encryptService.encrypt(s.key,i),this.encryptCipher(e,t,s)}))}getCipherKeyEncryptionEnabled(){return ph(this,void 0,void 0,(function*(){return(0,fs.Sp)("enableCipherKeyEncryption")&&(yield(0,pe.z)(this.configService.checkServerMeetsVersionRequirement$(hh)))}))}}uh([Rs((()=>"getAllDecrypted")),dh("design:type",Function),dh("design:paramtypes",[]),dh("design:returntype",Promise)],gh.prototype,"getAllDecrypted",null);var fh=i(68134),mh=i(54193),vh=i(23666),yh=i(39194),wh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const bh=he.vh.record(he.SD,"collections",{deserializer:e=>fh.Z.fromJSON(e)}),Uh=he.dT.from(bh,{deserializer:e=>e.map((e=>vh.n.fromJSON(e))),derive:(e,{collectionService:t})=>wh(void 0,void 0,void 0,(function*(){const i=[];for(const t in null!=e?e:{}){const n=t;i.push(new mh.F(e[n]))}return yield t.decryptMany(i)}))});var _h=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ah{constructor(e){this.name=null==e?void 0:e.name,this.id=null==e?void 0:e.id,this.revisionDate=null==e?void 0:e.revisionDate}static fromJSON(e){return Object.assign(new Ah({}),e)}}var Zh=i(47910),xh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Sh=i(10256),Th=i(90364),Ch=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Oh=he.vh.record(he.fo,"folders",{deserializer:e=>Ah.fromJSON(e)}),kh=he.dT.from(Oh,{deserializer:e=>e.map((e=>Th.a.fromJSON(e))),derive:(e,{folderService:t,cryptoService:i})=>Ch(void 0,void 0,void 0,(function*(){const n=Object.values(e||{}).map((e=>new Sh.g(e)));return(yield i.hasUserKey())?yield t.decryptFolders(n):[]}))});var Ph=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class qh{constructor(e){this.id=e.id,this.name=e.name,this.status=e.status,this.type=e.type,this.enabled=e.enabled,this.userId=e.userId,this.useEvents=e.useEvents,this.providerStatus=e.providerStatus}}var Ih=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Mh=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Nh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Lh{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v,y,w,b,U,_){this.masterPasswordService=e,this.accountService=t,this.apiService=i,this.domainSettingsService=n,this.folderService=s,this.cipherService=o,this.cryptoService=r,this.collectionService=a,this.messagingService=l,this.policyService=c,this.sendService=u,this.logService=d,this.keyConnectorService=p,this.stateService=h,this.providerService=g,this.folderApiService=f,this.organizationService=m,this.sendApiService=v,this.userDecryptionOptionsService=y,this.avatarService=w,this.logoutCallback=b,this.billingAccountProfileStateService=U,this.tokenService=_,this.syncInProgress=!1}getLastSync(){return Nh(this,void 0,void 0,(function*(){if(null==(yield this.stateService.getUserId()))return null;const e=yield this.stateService.getLastSync();return e?new Date(e):null}))}setLastSync(e,t){return Nh(this,void 0,void 0,(function*(){yield this.stateService.setLastSync(e.toJSON(),{userId:t})}))}fullSync(e,t=!1){return Nh(this,void 0,void 0,(function*(){this.syncStarted();if(!(yield this.stateService.getIsAuthenticated()))return this.syncCompleted(!1);const i=new Date;let n=!1;try{n=yield this.needsSyncing(e)}catch(s){if(t)throw s}if(!n)return yield this.setLastSync(i),this.syncCompleted(!1);try{yield this.apiService.refreshIdentityToken();const e=yield this.apiService.getSync();return yield this.syncProfile(e.profile),yield this.syncFolders(e.folders),yield this.syncCollections(e.collections),yield this.syncCiphers(e.ciphers),yield this.syncSends(e.sends),yield this.syncSettings(e.domains),yield this.syncPolicies(e.policies),yield this.setLastSync(i),this.syncCompleted(!0)}catch(s){if(t)throw s;return this.syncCompleted(!1)}}))}syncUpsertFolder(e,t){return Nh(this,void 0,void 0,(function*(){if(this.syncStarted(),yield this.stateService.getIsAuthenticated())try{const i=yield this.folderService.get(e.id);if(!t&&null==i||t&&null!=i&&i.revisionDate<e.revisionDate){const t=yield this.folderApiService.get(e.id);if(null!=t)return yield this.folderService.upsert(new Ah(t)),this.messagingService.send("syncedUpsertedFolder",{folderId:e.id}),this.syncCompleted(!0)}}catch(i){this.logService.error(i)}return this.syncCompleted(!1)}))}syncDeleteFolder(e){return Nh(this,void 0,void 0,(function*(){return this.syncStarted(),(yield this.stateService.getIsAuthenticated())?(yield this.folderService.delete(e.id),this.messagingService.send("syncedDeletedFolder",{folderId:e.id}),this.syncCompleted(!0),!0):this.syncCompleted(!1)}))}syncUpsertCipher(e,t){return Nh(this,void 0,void 0,(function*(){if(this.syncStarted(),yield this.stateService.getIsAuthenticated())try{let i=!0;const n=yield this.cipherService.get(e.id);null!=n&&n.revisionDate>=e.revisionDate&&(i=!1);let s=!1;if(i&&(t?(i=null!=n,s=!0):null==e.collectionIds||null==e.organizationId?i=null==n:(i=!1,s=!0)),!i&&s&&null!=e.organizationId&&null!=e.collectionIds&&e.collectionIds.length>0){const t=yield this.collectionService.getAll();if(null!=t)for(let n=0;n<t.length;n++)if(e.collectionIds.indexOf(t[n].id)>-1){i=!0;break}}if(i){const t=yield this.apiService.getFullCipherDetails(e.id);if(null!=t)return yield this.cipherService.upsert(new Lp.O(t)),this.messagingService.send("syncedUpsertedCipher",{cipherId:e.id}),this.syncCompleted(!0)}}catch(i){if(null!=i&&404===i.statusCode&&t)return yield this.cipherService.delete(e.id),this.messagingService.send("syncedDeletedCipher",{cipherId:e.id}),this.syncCompleted(!0)}return this.syncCompleted(!1)}))}syncDeleteCipher(e){return Nh(this,void 0,void 0,(function*(){return this.syncStarted(),(yield this.stateService.getIsAuthenticated())?(yield this.cipherService.delete(e.id),this.messagingService.send("syncedDeletedCipher",{cipherId:e.id}),this.syncCompleted(!0)):this.syncCompleted(!1)}))}syncUpsertSend(e,t){return Nh(this,void 0,void 0,(function*(){if(this.syncStarted(),yield this.stateService.getIsAuthenticated())try{const i=yield(0,pe.z)(this.sendService.get$(e.id));if(!t&&null==i||t&&null!=i&&i.revisionDate<e.revisionDate){const t=yield this.sendApiService.getSend(e.id);if(null!=t)return yield this.sendService.upsert(new up(t)),this.messagingService.send("syncedUpsertedSend",{sendId:e.id}),this.syncCompleted(!0)}}catch(i){this.logService.error(i)}return this.syncCompleted(!1)}))}syncDeleteSend(e){return Nh(this,void 0,void 0,(function*(){return this.syncStarted(),(yield this.stateService.getIsAuthenticated())?(yield this.sendService.delete(e.id),this.messagingService.send("syncedDeletedSend",{sendId:e.id}),this.syncCompleted(!0),!0):this.syncCompleted(!1)}))}syncStarted(){this.syncInProgress=!0,this.messagingService.send("syncStarted")}syncCompleted(e){return this.syncInProgress=!1,this.messagingService.send("syncCompleted",{successfully:e}),e}needsSyncing(e){return Nh(this,void 0,void 0,(function*(){if(e)return!0;const t=yield this.getLastSync();if(null==t||0===t.getTime())return!0;const i=yield this.apiService.getAccountRevisionDate();return!(new Date(i)<=t)}))}syncProfile(e){return Nh(this,void 0,void 0,(function*(){const t=yield this.tokenService.getSecurityStamp(e.id);if(null!=t&&t!==e.securityStamp)throw null!=this.logoutCallback&&(yield this.logoutCallback(!0)),new Error("Stamp has changed");yield this.cryptoService.setMasterKeyEncryptedUserKey(e.key),yield this.cryptoService.setPrivateKey(e.privateKey,e.id),yield this.cryptoService.setProviderKeys(e.providers,e.id),yield this.cryptoService.setOrgKeys(e.organizations,e.providerOrganizations,e.id),yield this.avatarService.setSyncAvatarColor(e.id,e.avatarColor),yield this.tokenService.setSecurityStamp(e.securityStamp,e.id),yield this.accountService.setAccountEmailVerified(e.id,e.emailVerified),yield this.billingAccountProfileStateService.setHasPremium(e.premiumPersonally,e.premiumFromOrganization),yield this.keyConnectorService.setUsesKeyConnector(e.usesKeyConnector),yield this.setForceSetPasswordReasonIfNeeded(e);const i={};e.providers.forEach((e=>{i[e.id]=new qh(e)})),yield this.providerService.save(i),yield this.syncProfileOrganizations(e),(yield this.keyConnectorService.userNeedsMigration())?(yield this.keyConnectorService.setConvertAccountRequired(!0),this.messagingService.send("convertAccountToKeyConnector")):this.keyConnectorService.removeConvertAccountRequired()}))}setForceSetPasswordReasonIfNeeded(e){var t,i;return Nh(this,void 0,void 0,(function*(){if(e.forcePasswordReset){const e=null===(t=yield(0,pe.z)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;yield this.masterPasswordService.setForceSetPasswordReason(_i.w.AdminForcePasswordReset,e)}const n=yield(0,pe.z)(this.userDecryptionOptionsService.userDecryptionOptions$);null==n&&this.logService.error("Sync: Account decryption options are null or undefined.");let s=!1;for(const t of e.organizations){const e=t.type===Qe.je.Admin,i=t.type===Qe.je.Owner;if(e||i||t.permissions&&t.permissions.manageResetPassword){s=!0;break}}if(void 0!==n.trustedDeviceOption&&!n.hasMasterPassword&&s){const e=null===(i=yield(0,pe.z)(this.accountService.activeAccount$))||void 0===i?void 0:i.id;yield this.masterPasswordService.setForceSetPasswordReason(_i.w.TdeUserWithoutPasswordHasPasswordResetPermission,e)}}))}syncProfileOrganizations(e){return Nh(this,void 0,void 0,(function*(){const t={};e.organizations.forEach((e=>{t[e.id]=new ge(e,{isMember:!0,isProviderUser:!1})})),e.providerOrganizations.forEach((e=>{null==t[e.id]?t[e.id]=new ge(e,{isMember:!1,isProviderUser:!0}):t[e.id].isProviderUser=!0})),yield this.organizationService.replace(t)}))}syncFolders(e){return Nh(this,void 0,void 0,(function*(){const t={};return e.forEach((e=>{t[e.id]=new Ah(e)})),yield this.folderService.replace(t)}))}syncCollections(e){return Nh(this,void 0,void 0,(function*(){const t={};return e.forEach((e=>{t[e.id]=new fh.Z(e)})),yield this.collectionService.replace(t)}))}syncCiphers(e){return Nh(this,void 0,void 0,(function*(){const t={};return e.forEach((e=>{t[e.id]=new Lp.O(e)})),yield this.cipherService.replace(t)}))}syncSends(e){return Nh(this,void 0,void 0,(function*(){const t={};return e.forEach((e=>{t[e.id]=new up(e)})),yield this.sendService.replace(t)}))}syncSettings(e){return Nh(this,void 0,void 0,(function*(){let t=[];return null!=e&&null!=e.equivalentDomains&&(t=t.concat(e.equivalentDomains)),null!=e&&null!=e.globalEquivalentDomains&&e.globalEquivalentDomains.forEach((e=>{e.domains.length>0&&t.push(e.domains)})),this.domainSettingsService.setEquivalentDomains(t)}))}syncPolicies(e){return Nh(this,void 0,void 0,(function*(){const t={};return null!=e&&e.forEach((e=>{t[e.id]=new Re.n(e)})),yield this.policyService.replace(t)}))}}Ih([Rs((()=>"fullSync")),Mh("design:type",Function),Mh("design:paramtypes",[Boolean,Object]),Mh("design:returntype",Promise)],Lh.prototype,"fullSync",null);var Dh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Eh="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Fh="23456789BCDFGHJKMNPQRTVWXY";const Rh=new he.vh(he.z3,"enablePasskeys",{deserializer:e=>e}),Jh=new he.vh(he.z3,"showCardsCurrentTab",{deserializer:e=>e}),zh=new he.vh(he.z3,"showIdentitiesCurrentTab",{deserializer:e=>e});var Yh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Kh=i(86583),Bh=i(25406),Qh=i(72407),Gh=i(78493),jh=i(70979),Vh=i(69842),$h=i(37513);class Hh extends s.qLn{constructor(){super(...arguments),this.injector=(0,s.f3M)(s.zs3)}handleError(e){try{this.injector.get(Wn.$,null).error("Unhandled error in angular",e)}catch(t){super.handleError(e)}}}Hh.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(Hh)))(t||Hh)}}(),Hh.ɵprov=s.Yz7({token:Hh,factory:Hh.ɵfac});class Wh{static createSystemThemeFromWindow(e){return(0,Uu.T)((0,Be.of)(e.matchMedia("(prefers-color-scheme: dark)").matches?Ht.f8.Dark:Ht.f8.Light),(0,ho.R)(e.matchMedia("(prefers-color-scheme: dark)"),"change").pipe((0,de.U)((e=>e.matches?Ht.f8.Dark:Ht.f8.Light))))}constructor(e,t){this.themeStateService=e,this.systemTheme$=t,this.theme$=this.themeStateService.selectedTheme$.pipe((0,it.w)((e=>e===Ht.f8.System?this.systemTheme$:(0,Be.of)(e))))}applyThemeChangesTo(e){return this.theme$.subscribe((t=>{e.documentElement.classList.remove("theme_"+Ht.f8.Light,"theme_"+Ht.f8.Dark,"theme_"+Ht.f8.Nord,"theme_"+Ht.f8.SolarizedDark),e.documentElement.classList.add("theme_"+t)}))}}Wh.ɵfac=function(e){return new(e||Wh)(s.LFG(Fu.v),s.LFG(o.zU))},Wh.ɵprov=s.Yz7({token:Wh,factory:Wh.ɵfac});var Xh=i(81301),eg=i(61374);const tg=[Gh.a,jh.a,eg.Z,Bh.C,{provide:o.m9,useValue:window},{provide:s.soG,useFactory:e=>e.translationLocale,deps:[$n.D]},{provide:o.Zk,useFactory:e=>e.supportsSecureStorage(),deps:[es.P]},{provide:o.PE,useValue:"./locales"},{provide:o.YZ,useFactory:e=>e.navigator.language,deps:[o.m9]},{provide:o.r5,useValue:new ls(vs,ms.mR)},{provide:o.JN,useFactory:e=>(t,i)=>Promise.resolve(e.send("logout",{expired:t,userId:i})),deps:[Xn.o]},{provide:o.xI,useValue:null},{provide:o.n3,useValue:!0},{provide:o.zU,useFactory:e=>Wh.createSystemThemeFromWindow(e),deps:[o.m9]},{provide:Fu.v,useClass:Fu.Q,deps:[he.MC]},{provide:Xh.v,useClass:Wh,deps:[Fu.v,o.zU]},{provide:Jn.s,useClass:class{constructor(e){const t=e.get(bs),i=e.get(Us);this.appId$=t.state$.pipe((0,ys.b)((e=>ws(this,void 0,void 0,(function*(){e||(yield t.update((()=>Fe.c.newGuid())))})))),(0,cs.h)((e=>!!e))),this.anonymousAppId$=i.state$.pipe((0,ys.b)((e=>ws(this,void 0,void 0,(function*(){e||(yield i.update((()=>Fe.c.newGuid())))})))),(0,cs.h)((e=>!!e)))}getAppId(){return ws(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.appId$)}))}getAnonymousAppId(){return ws(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.anonymousAppId$)}))}},deps:[he.MC]},{provide:c.C,useClass:Ld,deps:[Bn.O,l.s]},{provide:ut.e,useClass:class{constructor(e,t,i,n,s,o){this.accountService=e,this.messagingService=t,this.cryptoService=i,this.apiService=n,this.stateService=s,this.tokenService=o,this.activeAccountStatus$=this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id)),(0,it.w)((e=>this.authStatusFor$(e)))),this.authStatuses$=this.accountService.accounts$.pipe((0,de.U)((e=>Object.keys(e))),(0,it.w)((e=>0===e.length?(0,Be.of)([]):(0,Ke.a)(e.map((e=>this.authStatusFor$(e).pipe((0,de.U)((t=>({userId:e,status:t}))))))))),(0,de.U)((e=>e.reduce(((e,{userId:t,status:i})=>(e[t]=i,e)),{}))))}authStatusFor$(e){return Fe.c.isGuid(e)?(0,Ke.a)([this.cryptoService.getInMemoryUserKeyFor$(e),this.tokenService.hasAccessToken$(e)]).pipe((0,de.U)((([e,t])=>t?e?Qt.y.Unlocked:Qt.y.Locked:Qt.y.LoggedOut)),(0,Ot.x)(),(0,kt.d)({bufferSize:1,refCount:!1})):(0,Be.of)(Qt.y.LoggedOut)}getAuthStatus(e){return Gt(this,void 0,void 0,(function*(){return null!=e||(e=yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id))))),yield(0,pe.z)(this.authStatusFor$(e))}))}logOut(e){e(),this.messagingService.send("loggedOut")}},deps:[lt.BR,Xn.o,Qn.$,l.s,ts.b,bt.B]},{provide:a.m,useClass:a.s,deps:[lt.BR,vt.R,Qn.$,l.s,bt.B,Jn.s,es.P,Xn.o,Wn.$,mt.J,jn.L,ts.b,Ut.S,$n.D,Gn.U,rp.A,k.d,pt.U,a.JD,a.UK,he.MC,Zn.M,ft.d]},{provide:Vn,useClass:class{constructor(e){this.logService=e,this.azureFileUploadService=new Eo(e),this.bitwardenFileUploadService=new Jo}upload(e,t,i,n){return zo(this,void 0,void 0,(function*(){try{switch(e.fileUploadType){case Ht.Fz.Direct:yield this.bitwardenFileUploadService.upload(t.encryptedString,i,(e=>n.postDirect(e)));break;case Ht.Fz.Azure:yield this.azureFileUploadService.upload(e.url,i,n.renewFileUploadUrl);break;default:throw new Error("Unknown file upload type")}}catch(s){throw yield n.rollback(),s}}))}},deps:[Wn.$]},{provide:kp,useClass:class{constructor(e,t){this.apiService=e,this.fileUploadService=t}upload(e,t,i,n,s){return _h(this,void 0,void 0,(function*(){const o={key:s[1].encryptedString,fileName:t.encryptedString,fileSize:i.buffer.byteLength,adminRequest:n};let r;try{const s=yield this.apiService.postCipherAttachment(e.id,o);r=n?s.cipherMiniResponse:s.cipherResponse,yield this.fileUploadService.upload(s,t,i,this.generateMethods(s,r,o.adminRequest))}catch(a){if(!(a instanceof Ee.i&&404===a.statusCode||405===a.statusCode))throw a instanceof Ee.i?new Error(a.getSingleMessage()):a;r=yield this.legacyServerAttachmentFileUpload(o.adminRequest,e.id,t,i,s[1])}return r}))}generateMethods(e,t,i){return{postDirect:this.generatePostDirectCallback(e,i),renewFileUploadUrl:this.generateRenewFileUploadUrlCallback(e,t,i),rollback:this.generateRollbackCallback(t,e,i)}}generatePostDirectCallback(e,t){return i=>{const n=t?e.cipherMiniResponse:e.cipherResponse;return this.apiService.postAttachmentFile(n.id,e.attachmentId,i)}}generateRenewFileUploadUrlCallback(e,t,i){return()=>_h(this,void 0,void 0,(function*(){const i=yield this.apiService.renewAttachmentUploadUrl(t.id,e.attachmentId);return null==i?void 0:i.url}))}generateRollbackCallback(e,t,i){return()=>i?this.apiService.deleteCipherAttachmentAdmin(e.id,t.attachmentId):this.apiService.deleteCipherAttachment(e.id,t.attachmentId)}legacyServerAttachmentFileUpload(e,t,i,n,s){return _h(this,void 0,void 0,(function*(){const o=new FormData;try{const e=new Blob([n.buffer],{type:"application/octet-stream"});o.append("key",s.encryptedString),o.append("data",e,i.encryptedString)}catch(a){if(!Fe.c.isNode||Fe.c.isBrowser)throw a;o.append("key",s.encryptedString),o.append("data",Buffer.from(n.buffer),{filepath:i.encryptedString,contentType:"application/octet-stream"})}let r;try{r=e?yield this.apiService.postCipherAttachmentAdminLegacy(t,o):yield this.apiService.postCipherAttachmentLegacy(t,o)}catch(a){throw new Error(a.getSingleMessage())}return r}))}},deps:[l.s,Vn]},{provide:Cp.u,useFactory:(e,t,i,n,s,o,r,a,l,c,u)=>new gh(e,t,i,n,s,o,r,a,l,c,u),deps:[Qn.$,An.z,l.s,$n.D,h.o,ts.b,bn,Gn.U,kp,Kn.E,he.X9]},{provide:qp.G,useClass:class{constructor(e,t,i,n){this.cryptoService=e,this.i18nService=t,this.cipherService=i,this.stateProvider=n,this.encryptedFoldersState=this.stateProvider.getActive(Oh),this.decryptedFoldersState=this.stateProvider.getDerived(this.encryptedFoldersState.state$,kh,{folderService:this,cryptoService:this.cryptoService}),this.folders$=this.encryptedFoldersState.state$.pipe((0,de.U)((e=>Object.values(e).map((e=>new Sh.g(e)))))),this.folderViews$=this.decryptedFoldersState.state$}clearCache(){return Ph(this,void 0,void 0,(function*(){yield this.decryptedFoldersState.forceValue([])}))}encrypt(e,t){return Ph(this,void 0,void 0,(function*(){const i=new Sh.g;return i.id=e.id,i.name=yield this.cryptoService.encrypt(e.name,t),i}))}get(e){return Ph(this,void 0,void 0,(function*(){return(yield(0,pe.z)(this.folders$)).find((t=>t.id===e))}))}getAllFromState(){return Ph(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.folders$)}))}getFromState(e){return Ph(this,void 0,void 0,(function*(){const t=yield this.get(e);return t||null}))}getAllDecryptedFromState(){return Ph(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.folderViews$)}))}upsert(e){return Ph(this,void 0,void 0,(function*(){yield this.encryptedFoldersState.update((t=>{if(null==t&&(t={}),e instanceof Ah){const i=e;t[i.id]=i}else e.forEach((e=>{t[e.id]=e}));return t}))}))}replace(e){return Ph(this,void 0,void 0,(function*(){e&&(yield this.encryptedFoldersState.update((()=>Object.assign({},e))))}))}clear(e){return Ph(this,void 0,void 0,(function*(){null==e?(yield this.encryptedFoldersState.update((()=>({}))),yield this.decryptedFoldersState.forceValue([])):yield this.stateProvider.getUser(e,Oh).update((()=>({})))}))}delete(e){return Ph(this,void 0,void 0,(function*(){yield this.encryptedFoldersState.update((t=>{if(null!=t){if("string"==typeof e){if(null==t[e])return;delete t[e]}else e.forEach((e=>{delete t[e]}));return t}}));const t=yield this.cipherService.getAll();if(null!=t){const i=[];for(const n in t)t[n].folderId===e&&(t[n].folderId=null,i.push(t[n]));i.length>0&&this.cipherService.upsert(i.map((e=>e.toCipherData())))}}))}decryptFolders(e){return Ph(this,void 0,void 0,(function*(){const t=e.map((e=>e.decrypt())),i=yield Promise.all(t);i.sort(Fe.c.getSortFunction(this.i18nService,"name"));const n=new Th.a;return n.name=this.i18nService.t("noneFolder"),i.push(n),i}))}},deps:[Qn.$,$n.D,Cp.u,he.X9]},{provide:qp.s,useExisting:qp.G},{provide:Pp.s,useClass:class{constructor(e,t){this.folderService=e,this.apiService=t}save(e){return xh(this,void 0,void 0,(function*(){const t=new Zh.i(e);let i;null==e.id?(i=yield this.postFolder(t),e.id=i.id):i=yield this.putFolder(e.id,t);const n=new Ah(i);yield this.folderService.upsert(n)}))}delete(e){return xh(this,void 0,void 0,(function*(){yield this.deleteFolder(e),yield this.folderService.delete(e)}))}get(e){return xh(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/folders/"+e,null,!0,!0);return new kd(t)}))}postFolder(e){return xh(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/folders",e,!0,!0);return new kd(t)}))}putFolder(e,t){return xh(this,void 0,void 0,(function*(){const i=yield this.apiService.send("PUT","/folders/"+e,t,!0,!0);return new kd(i)}))}deleteFolder(e){return this.apiService.send("DELETE","/folders/"+e,null,!0,!1)}},deps:[qp.G,l.s]},{provide:at.X,useClass:class{constructor(e,t,i,n){this.apiService=e,this.userVerificationService=t,this.logService=i,this.accountService=n}deleteAccount(e){return Tt(this,void 0,void 0,(function*(){try{const t=yield this.userVerificationService.buildRequest(e);yield this.apiService.send("DELETE","/accounts",t,!0,!1),this.accountService.delete()}catch(t){throw this.logService.error(t),t}}))}},deps:[l.s,At.i,Wn.$,lt._5]},{provide:lt._5,useClass:class{constructor(e,t,i){this.messagingService=e,this.logService=t,this.globalStateProvider=i,this.accountsState=this.globalStateProvider.get(qt),this.activeAccountIdState=this.globalStateProvider.get(It),this.accounts$=this.accountsState.state$.pipe((0,de.U)((e=>null==e?{}:e))),this.activeAccount$=this.activeAccountIdState.state$.pipe((0,Ct.V)(this.accounts$),(0,de.U)((([e,t])=>e?Object.assign({id:e},t[e]):void 0)),(0,Ot.x)(((e,t)=>(null==e?void 0:e.id)===(null==t?void 0:t.id)&&(0,lt.wZ)(e,t))),(0,kt.d)({bufferSize:1,refCount:!1})),this.accountActivity$=this.globalStateProvider.get(Mt).state$.pipe((0,de.U)((e=>null!=e?e:{}))),this.sortedUserIds$=this.accountActivity$.pipe((0,de.U)((e=>Object.entries(e).map((([e,t])=>({userId:e,lastActive:t}))).sort(((e,t)=>t.lastActive.getTime()-e.lastActive.getTime())).map((e=>e.userId))))),this.nextUpAccount$=(0,Ke.a)([this.accounts$,this.activeAccount$,this.sortedUserIds$]).pipe((0,de.U)((([e,t,i])=>{const n=i.find((i=>i!==(null==t?void 0:t.id)&&null!=e[i]));return n?Object.assign({id:n},e[n]):null})))}addAccount(e,t){return Pt(this,void 0,void 0,(function*(){if(!Fe.c.isGuid(e))throw new Error("userId is required");yield this.accountsState.update((i=>(i||(i={}),i[e]=t,i))),yield this.setAccountActivity(e,new Date)}))}setAccountName(e,t){return Pt(this,void 0,void 0,(function*(){yield this.setAccountInfo(e,{name:t})}))}setAccountEmail(e,t){return Pt(this,void 0,void 0,(function*(){yield this.setAccountInfo(e,{email:t})}))}setAccountEmailVerified(e,t){return Pt(this,void 0,void 0,(function*(){yield this.setAccountInfo(e,{emailVerified:t})}))}clean(e){return Pt(this,void 0,void 0,(function*(){yield this.setAccountInfo(e,Nt),yield this.removeAccountActivity(e)}))}switchAccount(e){return Pt(this,void 0,void 0,(function*(){yield this.activeAccountIdState.update(((t,i)=>{if(null==e)return null;if(null==(null==i?void 0:i[e]))throw new Error("Account does not exist");return e}),{combineLatestWith:this.accounts$,shouldUpdate:t=>t!==e})}))}setAccountActivity(e,t){return Pt(this,void 0,void 0,(function*(){Fe.c.isGuid(e)&&(yield this.globalStateProvider.get(Mt).update((i=>(i||(i={}),i[e]=t,i)),{shouldUpdate:i=>{var n;return(null===(n=null==i?void 0:i[e])||void 0===n?void 0:n.getTime())!==(null==t?void 0:t.getTime())}}))}))}removeAccountActivity(e){return Pt(this,void 0,void 0,(function*(){yield this.globalStateProvider.get(Mt).update((t=>(null==t||delete t[e],t)),{shouldUpdate:t=>null!=(null==t?void 0:t[e])})}))}delete(){var e;return Pt(this,void 0,void 0,(function*(){try{null===(e=this.messagingService)||void 0===e||e.send("logout")}catch(t){throw this.logService.error(t),t}}))}setAccountInfo(e,t){return Pt(this,void 0,void 0,(function*(){function i(e){return Object.assign(Object.assign({},e),t)}yield this.accountsState.update((t=>(t[e]=i(t[e]),t)),{shouldUpdate:t=>{if(null==(null==t?void 0:t[e]))throw new Error("Account does not exist");return!(0,lt.wZ)(t[e],i(t[e]))}})}))}},deps:[Xn.o,Wn.$,he.MC]},{provide:lt.BR,useExisting:lt._5},{provide:dt.o,useClass:class{constructor(e,t){this.apiService=e,this.stateProvider=t,this.avatarColor$=this.stateProvider.getActive($t).state$}setAvatarColor(e){return Vt(this,void 0,void 0,(function*(){const{avatarColor:t}=yield this.apiService.putAvatar(new jt(e));yield this.stateProvider.setUserState($t,t)}))}setSyncAvatarColor(e,t){return Vt(this,void 0,void 0,(function*(){yield this.stateProvider.getUser(e,$t).update((()=>t))}))}getUserAvatarColor$(e){return this.stateProvider.getUser(e,$t).state$}},deps:[l.s,he.X9]},{provide:Wn.$,useFactory:()=>new Es.d(!1),deps:[]},{provide:Op.a,useClass:class{decryptedCollectionViews$(e){return this.decryptedCollections$.pipe((0,de.U)((t=>t.filter((t=>e.includes(t.id))))))}constructor(e,t,i){this.cryptoService=e,this.i18nService=t,this.stateProvider=i,this.encryptedCollectionDataState=this.stateProvider.getActive(bh),this.encryptedCollections$=this.encryptedCollectionDataState.state$.pipe((0,de.U)((e=>{const t=[];for(const i in null!=e?e:{})t.push(new mh.F(e[i]));return t}))),this.decryptedCollectionDataState=this.stateProvider.getDerived(this.encryptedCollectionDataState.state$,Uh,{collectionService:this}),this.decryptedCollections$=this.decryptedCollectionDataState.state$}clearActiveUserCache(){return wh(this,void 0,void 0,(function*(){yield this.decryptedCollectionDataState.forceValue(null)}))}encrypt(e){return wh(this,void 0,void 0,(function*(){if(null==e.organizationId)throw new Error("Collection has no organization id.");const t=yield this.cryptoService.getOrgKey(e.organizationId);if(null==t)throw new Error("No key for this collection's organization.");const i=new mh.F;return i.id=e.id,i.organizationId=e.organizationId,i.readOnly=e.readOnly,i.name=yield this.cryptoService.encrypt(e.name,t),i}))}decryptMany(e){return wh(this,void 0,void 0,(function*(){if(null==e)return[];const t=[],i=[];return e.forEach((e=>{i.push(e.decrypt().then((e=>t.push(e))))})),yield Promise.all(i),t.sort(Fe.c.getSortFunction(this.i18nService,"name"))}))}get(e){var t;return wh(this,void 0,void 0,(function*(){return null!==(t=yield(0,pe.z)(this.encryptedCollections$.pipe((0,de.U)((t=>t.find((t=>t.id===e)))))))&&void 0!==t?t:null}))}getAll(){return wh(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.encryptedCollections$)}))}getAllDecrypted(){return wh(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.decryptedCollections$)}))}getAllNested(e=null){return wh(this,void 0,void 0,(function*(){null==e&&(e=yield this.getAllDecrypted());const t=[];return e.forEach((e=>{const i=new vh.n;i.id=e.id,i.organizationId=e.organizationId;const n=null!=e.name?e.name.replace(/^\/+|\/+$/g,"").split("/"):[];yh.L.nestedTraverse(t,0,n,i,null,"/")})),t}))}getNested(e){return wh(this,void 0,void 0,(function*(){const t=yield this.getAllNested();return yh.L.getTreeNodeObjectFromList(t,e)}))}upsert(e){return wh(this,void 0,void 0,(function*(){null!=e&&(yield this.encryptedCollectionDataState.update((t=>(null==t&&(t={}),Array.isArray(e)?e.forEach((e=>{t[e.id]=e})):t[e.id]=e,t))))}))}replace(e){return wh(this,void 0,void 0,(function*(){yield this.encryptedCollectionDataState.update((()=>e))}))}clear(e){return wh(this,void 0,void 0,(function*(){null==e?(yield this.encryptedCollectionDataState.update((()=>null)),yield this.decryptedCollectionDataState.forceValue(null)):yield this.stateProvider.getUser(e,bh).update((()=>null))}))}delete(e){return wh(this,void 0,void 0,(function*(){yield this.encryptedCollectionDataState.update((t=>(null==t&&(t={}),"string"==typeof e?delete t[e]:e.forEach((e=>{delete t[e]})),t)))}))}},deps:[Qn.$,$n.D,he.X9]},{provide:jn.L,useClass:Po,deps:[he.X9,lt.BR]},{provide:a.UK,useClass:a.mJ,deps:[he.X9]},{provide:a.Bb,useExisting:a.UK},{provide:Mp.w,useClass:class{constructor(e,t){this.cryptoFunctionService=e,this.logService=t}getCode(e){return Dh(this,void 0,void 0,(function*(){if(null==e)return null;let t=30,i="sha1",n=6,s=e;const o=0===e.toLowerCase().indexOf("otpauth://"),r=!o&&0===e.toLowerCase().indexOf("steam://");if(o){const o=Fe.c.getQueryParams(e);if(o.has("digits")&&null!=o.get("digits"))try{const e=parseInt(o.get("digits").trim(),null);e>10?n=10:e>0&&(n=e)}catch(f){this.logService.error("Invalid digits param.")}if(o.has("period")&&null!=o.get("period"))try{const e=parseInt(o.get("period").trim(),null);e>0&&(t=e)}catch(m){this.logService.error("Invalid period param.")}if(o.has("secret")&&null!=o.get("secret")&&(s=o.get("secret")),o.has("algorithm")&&null!=o.get("algorithm")){const e=o.get("algorithm").toLowerCase();"sha1"!==e&&"sha256"!==e&&"sha512"!==e||(i=e)}}else r&&(s=e.substr(8),n=5);const a=Math.round((new Date).getTime()/1e3),l=this.leftPad(this.decToHex(Math.floor(a/t)),16,"0"),c=Fe.c.fromHexToArray(l),u=this.b32ToBytes(s);if(!u.length||!c.length)return null;const d=yield this.sign(u,c,i);if(0===d.length)return null;const p=15&d[d.length-1],h=(127&d[p])<<24|(255&d[p+1])<<16|(255&d[p+2])<<8|255&d[p+3];let g="";if(r){let e=2147483647&h;for(let t=0;t<n;t++)g+=Fh[e%26],e=Math.trunc(e/26)}else g=(h%Math.pow(10,n)).toString(),g=this.leftPad(g,n,"0");return g}))}getTimeInterval(e){let t=30;if(null!=e&&0===e.toLowerCase().indexOf("otpauth://")){const n=Fe.c.getQueryParams(e);if(n.has("period")&&null!=n.get("period"))try{t=parseInt(n.get("period").trim(),null)}catch(i){this.logService.error("Invalid period param.")}}return t}leftPad(e,t,i){return t+1>=e.length&&(e=Array(t+1-e.length).join(i)+e),e}decToHex(e){return(e<15.5?"0":"")+Math.round(e).toString(16)}b32ToHex(e){e=e.toUpperCase();let t="";for(let s=0;s<e.length;s++)Eh.indexOf(e[s])<0||(t+=e[s]);e=t;let i="",n="";for(let s=0;s<e.length;s++){const t=Eh.indexOf(e.charAt(s));t<0||(i+=this.leftPad(t.toString(2),5,"0"))}for(let s=0;s+4<=i.length;s+=4){const e=i.substr(s,4);n+=parseInt(e,2).toString(16)}return n}b32ToBytes(e){return Fe.c.fromHexToArray(this.b32ToHex(e))}sign(e,t,i){return Dh(this,void 0,void 0,(function*(){const n=yield this.cryptoFunctionService.hmac(t,e,i);return new Uint8Array(n)}))}},deps:[Bn.O,Wn.$]},{provide:bt.B,useClass:class{constructor(e,t,i,n,s,o,r){this.singleUserStateProvider=e,this.globalStateProvider=t,this.platformSupportsSecureStorage=i,this.secureStorageService=n,this.keyGenerationService=s,this.encryptService=o,this.logService=r,this.accessTokenKeySecureStorageKey="_accessTokenKey",this.refreshTokenSecureStorageKey="_refreshToken",this.initializeState()}hasAccessToken$(e){return(0,Ke.a)([this.singleUserStateProvider.get(e,Di).state$,this.singleUserStateProvider.get(e,Ei).state$]).pipe((0,de.U)((([e,t])=>Boolean(e||t))))}initializeState(){this.emailTwoFactorTokenRecordGlobalState=this.globalStateProvider.get(Ji),this.activeUserIdGlobalState=this.globalStateProvider.get(It)}setTokens(e,t,i,n,s){return ji(this,void 0,void 0,(function*(){if(!e)throw new Error("Access token is required.");const o=yield this.getUserIdFromAccessToken(e);if(!o)throw new Error("User id not found. Cannot set tokens.");yield this._setAccessToken(e,t,i,o),n&&(yield this.setRefreshToken(n,t,i,o)),null!=s&&(yield this.setClientId(s[0],t,i,o),yield this.setClientSecret(s[1],t,i,o))}))}getAccessTokenKey(e){return ji(this,void 0,void 0,(function*(){const t=yield this.secureStorageService.get(`${e}${this.accessTokenKeySecureStorageKey}`,this.getSecureStorageOptions(e));if(!t)return null;return Wt.N.fromJSON(t)}))}createAndSaveAccessTokenKey(e){return ji(this,void 0,void 0,(function*(){const t=yield this.keyGenerationService.createKey(512);return yield this.secureStorageService.save(`${e}${this.accessTokenKeySecureStorageKey}`,t,this.getSecureStorageOptions(e)),t}))}clearAccessTokenKey(e){return ji(this,void 0,void 0,(function*(){yield this.secureStorageService.remove(`${e}${this.accessTokenKeySecureStorageKey}`,this.getSecureStorageOptions(e))}))}getOrCreateAccessTokenKey(e){return ji(this,void 0,void 0,(function*(){if(!this.platformSupportsSecureStorage)throw new Error("Platform does not support secure storage. Cannot obtain access token key.");if(!e)throw new Error("User id not found. Cannot obtain access token key.");let t=yield this.getAccessTokenKey(e);return t||(t=yield this.createAndSaveAccessTokenKey(e)),t}))}encryptAccessToken(e,t){return ji(this,void 0,void 0,(function*(){const i=yield this.getOrCreateAccessTokenKey(t);return yield this.encryptService.encrypt(e,i)}))}decryptAccessToken(e,t){return ji(this,void 0,void 0,(function*(){const i=yield this.getAccessTokenKey(t);if(!i)return null;return yield this.encryptService.decryptToUtf8(e,i)}))}_setAccessToken(e,t,i,n){return ji(this,void 0,void 0,(function*(){switch(yield this.determineStorageLocation(t,i,!0)){case Gi.SecureStorage:{const t=yield this.encryptAccessToken(e,n);return yield this.singleUserStateProvider.get(n,Di).update((e=>t.encryptedString)),void(yield this.singleUserStateProvider.get(n,Ei).update((e=>null)))}case Gi.Disk:return void(yield this.singleUserStateProvider.get(n,Di).update((t=>e)));case Gi.Memory:return void(yield this.singleUserStateProvider.get(n,Ei).update((t=>e)))}}))}setAccessToken(e,t,i){return ji(this,void 0,void 0,(function*(){if(!e)throw new Error("Access token is required.");const n=yield this.getUserIdFromAccessToken(e);if(!n)throw new Error("User id not found. Cannot save access token.");yield this._setAccessToken(e,t,i,n)}))}clearAccessToken(e){return ji(this,void 0,void 0,(function*(){if(null!=e||(e=yield(0,pe.z)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot clear access token.");this.platformSupportsSecureStorage&&(yield this.clearAccessTokenKey(e)),yield this.singleUserStateProvider.get(e,Di).update((e=>null)),yield this.singleUserStateProvider.get(e,Ei).update((e=>null))}))}getAccessToken(e){var t;return ji(this,void 0,void 0,(function*(){if(null!=e||(e=yield(0,pe.z)(this.activeUserIdGlobalState.state$)),!e)return;const i=yield this.getStateValueByUserIdAndKeyDef(e,Ei);if(null!=i)return i;const n=yield this.getStateValueByUserIdAndKeyDef(e,Di);if(!n)return null;if(this.platformSupportsSecureStorage){if(!(yield this.getAccessTokenKey(e)))return n;try{const t=new li._(n);return yield this.decryptAccessToken(t,e)}catch(s){return this.logService.error(`Failed to decrypt access token: ${null!==(t=null==s?void 0:s.message)&&void 0!==t?t:"Unknown error."}`),null}}return n}))}setRefreshToken(e,t,i,n){return ji(this,void 0,void 0,(function*(){if(!n)throw new Error("User id not found. Cannot save refresh token.");switch(yield this.determineStorageLocation(t,i,!0)){case Gi.SecureStorage:return yield this.saveStringToSecureStorage(n,this.refreshTokenSecureStorageKey,e),yield this.singleUserStateProvider.get(n,Fi).update((e=>null)),void(yield this.singleUserStateProvider.get(n,Ri).update((e=>null)));case Gi.Disk:return void(yield this.singleUserStateProvider.get(n,Fi).update((t=>e)));case Gi.Memory:return void(yield this.singleUserStateProvider.get(n,Ri).update((t=>e)))}}))}getRefreshToken(e){return ji(this,void 0,void 0,(function*(){if(null!=e||(e=yield(0,pe.z)(this.activeUserIdGlobalState.state$)),!e)return;const t=yield this.getStateValueByUserIdAndKeyDef(e,Ri);if(null!=t)return t;const i=yield this.getStateValueByUserIdAndKeyDef(e,Fi);if(null!=i)return i;if(this.platformSupportsSecureStorage){const t=yield this.getStringFromSecureStorage(e,this.refreshTokenSecureStorageKey);if(null!=t)return t}return null}))}clearRefreshToken(e){return ji(this,void 0,void 0,(function*(){if(!e)throw new Error("User id not found. Cannot clear refresh token.");this.platformSupportsSecureStorage&&(yield this.secureStorageService.remove(`${e}${this.refreshTokenSecureStorageKey}`,this.getSecureStorageOptions(e))),yield this.singleUserStateProvider.get(e,Ri).update((e=>null)),yield this.singleUserStateProvider.get(e,Fi).update((e=>null))}))}setClientId(e,t,i,n){return ji(this,void 0,void 0,(function*(){if(null!=n||(n=yield(0,pe.z)(this.activeUserIdGlobalState.state$)),!n)throw new Error("User id not found. Cannot save client id.");const s=yield this.determineStorageLocation(t,i,!1);s===Gi.Disk?yield this.singleUserStateProvider.get(n,zi).update((t=>e)):s===Gi.Memory&&(yield this.singleUserStateProvider.get(n,Yi).update((t=>e)))}))}getClientId(e){return ji(this,void 0,void 0,(function*(){if(null!=e||(e=yield(0,pe.z)(this.activeUserIdGlobalState.state$)),!e)return;const t=yield this.getStateValueByUserIdAndKeyDef(e,Yi);return null!=t?t:yield this.getStateValueByUserIdAndKeyDef(e,zi)}))}clearClientId(e){return ji(this,void 0,void 0,(function*(){if(null!=e||(e=yield(0,pe.z)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot clear client id.");yield this.singleUserStateProvider.get(e,Yi).update((e=>null)),yield this.singleUserStateProvider.get(e,zi).update((e=>null))}))}setClientSecret(e,t,i,n){return ji(this,void 0,void 0,(function*(){if(null!=n||(n=yield(0,pe.z)(this.activeUserIdGlobalState.state$)),!n)throw new Error("User id not found. Cannot save client secret.");const s=yield this.determineStorageLocation(t,i,!1);s===Gi.Disk?yield this.singleUserStateProvider.get(n,Ki).update((t=>e)):s===Gi.Memory&&(yield this.singleUserStateProvider.get(n,Bi).update((t=>e)))}))}getClientSecret(e){return ji(this,void 0,void 0,(function*(){if(null!=e||(e=yield(0,pe.z)(this.activeUserIdGlobalState.state$)),!e)return;const t=yield this.getStateValueByUserIdAndKeyDef(e,Bi);return null!=t?t:yield this.getStateValueByUserIdAndKeyDef(e,Ki)}))}clearClientSecret(e){return ji(this,void 0,void 0,(function*(){if(null!=e||(e=yield(0,pe.z)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot clear client secret.");yield this.singleUserStateProvider.get(e,Bi).update((e=>null)),yield this.singleUserStateProvider.get(e,Ki).update((e=>null))}))}setTwoFactorToken(e,t){return ji(this,void 0,void 0,(function*(){yield this.emailTwoFactorTokenRecordGlobalState.update((i=>(null!=i||(i={}),i[e]=t,i)))}))}getTwoFactorToken(e){return ji(this,void 0,void 0,(function*(){const t=yield(0,pe.z)(this.emailTwoFactorTokenRecordGlobalState.state$);return t?t[e]:null}))}clearTwoFactorToken(e){return ji(this,void 0,void 0,(function*(){yield this.emailTwoFactorTokenRecordGlobalState.update((t=>(null!=t||(t={}),delete t[e],t)))}))}clearTokens(e){return ji(this,void 0,void 0,(function*(){if(null!=e||(e=yield(0,pe.z)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot clear tokens.");yield Promise.all([this.clearAccessToken(e),this.clearRefreshToken(e),this.clearClientId(e),this.clearClientSecret(e)])}))}decodeAccessToken(e){return ji(this,void 0,void 0,(function*(){if(null==(e=null!=e?e:yield this.getAccessToken()))throw new Error("Access token not found.");return(0,a.fh)(e)}))}getTokenExpirationDate(){return ji(this,void 0,void 0,(function*(){let e;try{e=yield this.decodeAccessToken()}catch(i){throw new Error("Failed to decode access token: "+i.message)}if(!e||"number"!=typeof e.exp)return null;const t=new Date(0);return t.setUTCSeconds(e.exp),t}))}tokenSecondsRemaining(e=0){return ji(this,void 0,void 0,(function*(){const t=yield this.getTokenExpirationDate();if(null==t)return 0;const i=t.valueOf()-((new Date).valueOf()+1e3*e);return Math.round(i/1e3)}))}tokenNeedsRefresh(e=5){return ji(this,void 0,void 0,(function*(){return(yield this.tokenSecondsRemaining())<60*e}))}getUserId(){return ji(this,void 0,void 0,(function*(){let e;try{e=yield this.decodeAccessToken()}catch(t){throw new Error("Failed to decode access token: "+t.message)}if(!e||"string"!=typeof e.sub)throw new Error("No user id found");return e.sub}))}getUserIdFromAccessToken(e){return ji(this,void 0,void 0,(function*(){let t;try{t=yield this.decodeAccessToken(e)}catch(i){throw new Error("Failed to decode access token: "+i.message)}if(!t||"string"!=typeof t.sub)throw new Error("No user id found");return t.sub}))}getEmail(){return ji(this,void 0,void 0,(function*(){let e;try{e=yield this.decodeAccessToken()}catch(t){throw new Error("Failed to decode access token: "+t.message)}if(!e||"string"!=typeof e.email)throw new Error("No email found");return e.email}))}getEmailVerified(){return ji(this,void 0,void 0,(function*(){let e;try{e=yield this.decodeAccessToken()}catch(t){throw new Error("Failed to decode access token: "+t.message)}if(!e||"boolean"!=typeof e.email_verified)throw new Error("No email verification found");return e.email_verified}))}getName(){return ji(this,void 0,void 0,(function*(){let e;try{e=yield this.decodeAccessToken()}catch(t){throw new Error("Failed to decode access token: "+t.message)}return e&&"string"==typeof e.name?e.name:null}))}getIssuer(){return ji(this,void 0,void 0,(function*(){let e;try{e=yield this.decodeAccessToken()}catch(t){throw new Error("Failed to decode access token: "+t.message)}if(!e||"string"!=typeof e.iss)throw new Error("No issuer found");return e.iss}))}getIsExternal(){return ji(this,void 0,void 0,(function*(){let e;try{e=yield this.decodeAccessToken()}catch(t){throw new Error("Failed to decode access token: "+t.message)}return Array.isArray(e.amr)&&e.amr.includes("external")}))}getSecurityStamp(e){return ji(this,void 0,void 0,(function*(){if(null!=e||(e=yield(0,pe.z)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot get security stamp.");return yield this.getStateValueByUserIdAndKeyDef(e,Qi)}))}setSecurityStamp(e,t){return ji(this,void 0,void 0,(function*(){if(null!=t||(t=yield(0,pe.z)(this.activeUserIdGlobalState.state$)),!t)throw new Error("User id not found. Cannot set security stamp.");yield this.singleUserStateProvider.get(t,Qi).update((t=>e))}))}getStateValueByUserIdAndKeyDef(e,t){return ji(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.singleUserStateProvider.get(e,t).state$)}))}determineStorageLocation(e,t,i){return ji(this,void 0,void 0,(function*(){return e===Li.B.LogOut&&null!=t?Gi.Memory:i&&this.platformSupportsSecureStorage?Gi.SecureStorage:Gi.Disk}))}saveStringToSecureStorage(e,t,i){return ji(this,void 0,void 0,(function*(){yield this.secureStorageService.save(`${e}${t}`,i,this.getSecureStorageOptions(e))}))}getStringFromSecureStorage(e,t){return ji(this,void 0,void 0,(function*(){return yield this.secureStorageService.get(`${e}${t}`,this.getSecureStorageOptions(e))}))}getSecureStorageOptions(e){return{storageLocation:Ht.Ac.Disk,useSecureStorage:!0,userId:e}}},deps:[he.jC,he.MC,o.Zk,o.cy,Hn,Gn.U,Wn.$]},{provide:Hn,useClass:class{constructor(e){this.cryptoFunctionService=e}createKey(e){return Yo(this,void 0,void 0,(function*(){const t=yield this.cryptoFunctionService.aesGenerateKey(e);return new Wt.N(t)}))}createKeyWithPurpose(e,t,i){return Yo(this,void 0,void 0,(function*(){if(null==i){const e=yield this.cryptoFunctionService.randomBytes(32);i=Fe.c.fromBufferToUtf8(e)}const n=yield this.cryptoFunctionService.aesGenerateKey(e),s=yield this.cryptoFunctionService.hkdf(n,i,t,64,"sha256");return{salt:i,material:n,derivedKey:new Wt.N(s)}}))}deriveKeyFromMaterial(e,t,i){return Yo(this,void 0,void 0,(function*(){const n=yield this.cryptoFunctionService.hkdf(e,t,i,64,"sha256");return new Wt.N(n)}))}deriveKeyFromPassword(e,t,i){return Yo(this,void 0,void 0,(function*(){let n=null;if(null==i.kdfType||i.kdfType===Ht.G3.PBKDF2_SHA256)null==i.iterations&&(i.iterations=Ht.qv.defaultValue),n=yield this.cryptoFunctionService.pbkdf2(e,t,"sha256",i.iterations);else{if(i.kdfType!=Ht.G3.Argon2id)throw new Error("Unknown Kdf.");{null==i.iterations&&(i.iterations=Ht.lh.defaultValue),null==i.memory&&(i.memory=Ht._l.defaultValue),null==i.parallelism&&(i.parallelism=Ht.Oi.defaultValue);const s=yield this.cryptoFunctionService.hash(t,"sha256");n=yield this.cryptoFunctionService.argon2(e,s,i.iterations,1024*i.memory,i.parallelism)}}return new Wt.N(n)}))}},deps:[Bn.O]},{provide:Qn.$,useClass:ao,deps:[vt.R,Hn,Bn.O,Gn.U,es.P,Wn.$,ts.b,lt.BR,he.X9,ft.d]},{provide:rp.A,useClass:rp.N,deps:[]},{provide:Qc.UW,useClass:Qc.f9,deps:[Qn.$,k.d,ts.b]},{provide:op.vo,useClass:op.N$,deps:[Qn.$,ts.b,l.s]},{provide:l.s,useClass:class{constructor(e,t,i,n,s,o,r=null){this.tokenService=e,this.platformUtilsService=t,this.environmentService=i,this.appIdService=n,this.stateService=s,this.logoutCallback=o,this.customUserAgent=r,this.isWebClient=!1,this.isDesktopClient=!1,this.device=t.getDevice(),this.deviceType=this.device.toString(),this.isWebClient=this.device===De.Yi.IEBrowser||this.device===De.Yi.ChromeBrowser||this.device===De.Yi.EdgeBrowser||this.device===De.Yi.FirefoxBrowser||this.device===De.Yi.OperaBrowser||this.device===De.Yi.SafariBrowser||this.device===De.Yi.UnknownBrowser||this.device===De.Yi.VivaldiBrowser,this.isDesktopClient=this.device===De.Yi.WindowsDesktop||this.device===De.Yi.MacOsDesktop||this.device===De.Yi.LinuxDesktop||this.device===De.Yi.WindowsCLI||this.device===De.Yi.MacOsCLI||this.device===De.Yi.LinuxCLI}postIdentityToken(e){return qd(this,void 0,void 0,(function*(){const t=new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8",Accept:"application/json","Device-Type":this.deviceType});null!=this.customUserAgent&&t.set("User-Agent",this.customUserAgent),e.alterIdentityTokenHeaders(t);const i=e instanceof Xu.Z?e.toIdentityToken():e.toIdentityToken(this.platformUtilsService.getClientType()),n=yield(0,pe.z)(this.environmentService.environment$),s=yield this.fetch(new Request(n.getIdentityUrl()+"/connect/token",{body:this.qsStringify(i),credentials:yield this.getCredentials(),cache:"no-store",headers:t,method:"POST"}));let o=null;if(this.isJsonResponse(s)&&(o=yield s.json()),null!=o){if(200===s.status)return new nd.O(o);if(400===s.status&&o.TwoFactorProviders2&&Object.keys(o.TwoFactorProviders2).length)return new sd.b(o);if(400===s.status&&o.HCaptcha_SiteKey&&Object.keys(o.HCaptcha_SiteKey).length)return new id.b(o)}return Promise.reject(new Ee.i(o,s.status,!0))}))}refreshIdentityToken(){return qd(this,void 0,void 0,(function*(){try{yield this.doAuthRefresh()}catch(e){return Promise.reject(null)}}))}postAuthRequest(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/auth-requests/",e,!1,!0);return new ed(t)}))}postAdminAuthRequest(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/auth-requests/admin-request",e,!0,!0);return new ed(t)}))}getAuthResponse(e,t){return qd(this,void 0,void 0,(function*(){const i=`/auth-requests/${e}/response?code=${t}`,n=yield this.send("GET",i,null,!1,!0);return new ed(n)}))}getAuthRequest(e){return qd(this,void 0,void 0,(function*(){const t=`/auth-requests/${e}`,i=yield this.send("GET",t,null,!0,!0);return new ed(i)}))}putAuthRequest(e,t){return qd(this,void 0,void 0,(function*(){const i=`/auth-requests/${e}`,n=yield this.send("PUT",i,t,!0,!0);return new ed(n)}))}getAuthRequests(){return qd(this,void 0,void 0,(function*(){const e=yield this.send("GET","/auth-requests/",null,!0,!0);return new oe.L(e,ed)}))}getLastAuthRequest(){return qd(this,void 0,void 0,(function*(){const e=(yield this.getAuthRequests()).data.filter((e=>!e.isAnswered&&!e.isExpired));return e.sort(((e,t)=>e.creationDate.localeCompare(t.creationDate)))[e.length-1]}))}getProfile(){return qd(this,void 0,void 0,(function*(){const e=yield this.send("GET","/accounts/profile",null,!0,!0);return new ie(e)}))}getUserSubscription(){return qd(this,void 0,void 0,(function*(){const e=yield this.send("GET","/accounts/subscription",null,!0,!0);return new Q(e)}))}getTaxInfo(){return qd(this,void 0,void 0,(function*(){const e=yield this.send("GET","/accounts/tax",null,!0,!0);return new se(e)}))}putProfile(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/accounts/profile",e,!0,!0);return new ie(t)}))}putAvatar(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/accounts/avatar",e,!0,!0);return new ie(t)}))}putTaxInfo(e){return this.send("PUT","/accounts/tax",e,!0,!1)}postPrelogin(e){return qd(this,void 0,void 0,(function*(){const t=yield(0,pe.z)(this.environmentService.environment$),i=yield this.send("POST","/accounts/prelogin",e,!1,!0,t.getIdentityUrl());return new rd(i)}))}postEmailToken(e){return this.send("POST","/accounts/email-token",e,!0,!1)}postEmail(e){return this.send("POST","/accounts/email",e,!0,!1)}postPassword(e){return this.send("POST","/accounts/password",e,!0,!1)}setPassword(e){return this.send("POST","/accounts/set-password",e,!0,!1)}postSetKeyConnectorKey(e){return this.send("POST","/accounts/set-key-connector-key",e,!0,!1)}postSecurityStamp(e){return this.send("POST","/accounts/security-stamp",e,!0,!1)}getAccountRevisionDate(){return qd(this,void 0,void 0,(function*(){return yield this.send("GET","/accounts/revision-date",null,!0,!0)}))}postPasswordHint(e){return this.send("POST","/accounts/password-hint",e,!1,!1)}postRegister(e){return qd(this,void 0,void 0,(function*(){const t=yield(0,pe.z)(this.environmentService.environment$),i=yield this.send("POST","/accounts/register",e,!1,!0,t.getIdentityUrl());return new ad(i)}))}postPremium(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/accounts/premium",e,!0,!0);return new ne(t)}))}postReinstatePremium(){return this.send("POST","/accounts/reinstate-premium",null,!0,!1)}postAccountStorage(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/accounts/storage",e,!0,!0);return new ne(t)}))}postAccountPayment(e){return this.send("POST","/accounts/payment",e,!0,!1)}postAccountLicense(e){return this.send("POST","/accounts/license",e,!0,!1)}postAccountKeys(e){return this.send("POST","/accounts/keys",e,!0,!1)}postAccountVerifyEmail(){return this.send("POST","/accounts/verify-email",null,!0,!1)}postAccountVerifyEmailToken(e){return this.send("POST","/accounts/verify-email-token",e,!1,!1)}postAccountVerifyPassword(e){return this.send("POST","/accounts/verify-password",e,!0,!0)}postAccountRecoverDelete(e){return this.send("POST","/accounts/delete-recover",e,!1,!1)}postAccountRecoverDeleteToken(e){return this.send("POST","/accounts/delete-recover-token",e,!1,!1)}postAccountKdf(e){return this.send("POST","/accounts/kdf",e,!0,!1)}deleteSsoUser(e){return qd(this,void 0,void 0,(function*(){return this.send("DELETE","/accounts/sso/"+e,null,!0,!1)}))}getSsoUserIdentifier(){return qd(this,void 0,void 0,(function*(){return this.send("GET","/accounts/sso/user-identifier",null,!0,!0)}))}postUserApiKey(e,t){return qd(this,void 0,void 0,(function*(){const e=yield this.send("POST","/accounts/api-key",t,!0,!0);return new M(e)}))}postUserRotateApiKey(e,t){return qd(this,void 0,void 0,(function*(){const e=yield this.send("POST","/accounts/rotate-api-key",t,!0,!0);return new M(e)}))}putUpdateTempPassword(e){return this.send("PUT","/accounts/update-temp-password",e,!0,!1)}postConvertToKeyConnector(){return this.send("POST","/accounts/convert-to-key-connector",null,!0,!1)}getUserBillingHistory(){return qd(this,void 0,void 0,(function*(){const e=yield this.send("GET","/accounts/billing/history",null,!0,!0);return new md(e)}))}getUserBillingPayment(){return qd(this,void 0,void 0,(function*(){const e=yield this.send("GET","/accounts/billing/payment-method",null,!0,!0);return new vd(e)}))}getCipher(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("GET","/ciphers/"+e,null,!0,!0);return new Ju.r(t)}))}getFullCipherDetails(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("GET","/ciphers/"+e+"/details",null,!0,!0);return new Ju.r(t)}))}getCipherAdmin(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("GET","/ciphers/"+e+"/admin",null,!0,!0);return new Ju.r(t)}))}getCiphersOrganization(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("GET","/ciphers/organization-details?organizationId="+e,null,!0,!0);return new oe.L(t,Ju.r)}))}postCipher(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/ciphers",e,!0,!0);return new Ju.r(t)}))}postCipherCreate(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/ciphers/create",e,!0,!0);return new Ju.r(t)}))}postCipherAdmin(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/ciphers/admin",e,!0,!0);return new Ju.r(t)}))}putCipher(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/ciphers/"+e,t,!0,!0);return new Ju.r(i)}))}putPartialCipher(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/ciphers/"+e+"/partial",t,!0,!0);return new Ju.r(i)}))}putCipherAdmin(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/ciphers/"+e+"/admin",t,!0,!0);return new Ju.r(i)}))}deleteCipher(e){return this.send("DELETE","/ciphers/"+e,null,!0,!1)}deleteCipherAdmin(e){return this.send("DELETE","/ciphers/"+e+"/admin",null,!0,!1)}deleteManyCiphers(e){return this.send("DELETE","/ciphers",e,!0,!1)}deleteManyCiphersAdmin(e){return this.send("DELETE","/ciphers/admin",e,!0,!1)}putMoveCiphers(e){return this.send("PUT","/ciphers/move",e,!0,!1)}putShareCipher(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/ciphers/"+e+"/share",t,!0,!0);return new Ju.r(i)}))}putShareCiphers(e){return this.send("PUT","/ciphers/share",e,!0,!1)}putCipherCollections(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/ciphers/"+e+"/collections",t,!0,!0);return new Ju.r(i)}))}putCipherCollectionsAdmin(e,t){return this.send("PUT","/ciphers/"+e+"/collections-admin",t,!0,!1)}postPurgeCiphers(e,t=null){let i="/ciphers/purge";return null!=t&&(i+="?organizationId="+t),this.send("POST",i,e,!0,!1)}putDeleteCipher(e){return this.send("PUT","/ciphers/"+e+"/delete",null,!0,!1)}putDeleteCipherAdmin(e){return this.send("PUT","/ciphers/"+e+"/delete-admin",null,!0,!1)}putDeleteManyCiphers(e){return this.send("PUT","/ciphers/delete",e,!0,!1)}putDeleteManyCiphersAdmin(e){return this.send("PUT","/ciphers/delete-admin",e,!0,!1)}putRestoreCipher(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/ciphers/"+e+"/restore",null,!0,!0);return new Ju.r(t)}))}putRestoreCipherAdmin(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/ciphers/"+e+"/restore-admin",null,!0,!0);return new Ju.r(t)}))}putRestoreManyCiphers(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/ciphers/restore",e,!0,!0);return new oe.L(t,Ju.r)}))}putRestoreManyCiphersAdmin(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/ciphers/restore-admin",e,!0,!0);return new oe.L(t,Ju.r)}))}getAttachmentData(e,t,i){return qd(this,void 0,void 0,(function*(){const n=(null!=i?"/emergency-access/"+i+"/":"/ciphers/")+e+"/attachment/"+t,s=yield this.send("GET",n,null,!0,!0);return new Sd.j(s)}))}postCipherAttachment(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("POST","/ciphers/"+e+"/attachment/v2",t,!0,!0);return new xd(i)}))}postCipherAttachmentLegacy(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("POST","/ciphers/"+e+"/attachment",t,!0,!0);return new Ju.r(i)}))}postCipherAttachmentAdminLegacy(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("POST","/ciphers/"+e+"/attachment-admin",t,!0,!0);return new Ju.r(i)}))}deleteCipherAttachment(e,t){return this.send("DELETE","/ciphers/"+e+"/attachment/"+t,null,!0,!1)}deleteCipherAttachmentAdmin(e,t){return this.send("DELETE","/ciphers/"+e+"/attachment/"+t+"/admin",null,!0,!1)}postShareCipherAttachment(e,t,i,n){return this.send("POST","/ciphers/"+e+"/attachment/"+t+"/share?organizationId="+n,i,!0,!1)}renewAttachmentUploadUrl(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("GET","/ciphers/"+e+"/attachment/"+t+"/renew",null,!0,!0);return new xd(i)}))}postAttachmentFile(e,t,i){return this.send("POST","/ciphers/"+e+"/attachment/"+t,i,!0,!1)}getCollectionAccessDetails(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("GET","/organizations/"+e+"/collections/"+t+"/details",null,!0,!0);return new zu.QY(i)}))}getUserCollections(){return qd(this,void 0,void 0,(function*(){const e=yield this.send("GET","/collections",null,!0,!0);return new oe.L(e,zu.sy)}))}getCollections(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("GET","/organizations/"+e+"/collections",null,!0,!0);return new oe.L(t,zu.sy)}))}getManyCollectionsWithAccessDetails(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("GET","/organizations/"+e+"/collections/details",null,!0,!0);return new oe.L(t,zu.QY)}))}getCollectionUsers(e,t){return qd(this,void 0,void 0,(function*(){return(yield this.send("GET","/organizations/"+e+"/collections/"+t+"/users",null,!0,!0)).map((e=>new Ce.Y(e)))}))}postCollection(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("POST","/organizations/"+e+"/collections",t,!0,!0);return new zu.TO(i)}))}putCollection(e,t,i){return qd(this,void 0,void 0,(function*(){const n=yield this.send("PUT","/organizations/"+e+"/collections/"+t,i,!0,!0);return new zu.TO(n)}))}putCollectionUsers(e,t,i){return qd(this,void 0,void 0,(function*(){yield this.send("PUT","/organizations/"+e+"/collections/"+t+"/users",i,!0,!1)}))}deleteCollection(e,t){return this.send("DELETE","/organizations/"+e+"/collections/"+t,null,!0,!1)}deleteManyCollections(e,t){return this.send("DELETE","/organizations/"+e+"/collections",new wd(t),!0,!1)}deleteCollectionUser(e,t,i){return this.send("DELETE","/organizations/"+e+"/collections/"+t+"/user/"+i,null,!0,!1)}getGroupUsers(e,t){return qd(this,void 0,void 0,(function*(){return yield this.send("GET","/organizations/"+e+"/groups/"+t+"/users",null,!0,!0)}))}deleteGroupUser(e,t,i){return this.send("DELETE","/organizations/"+e+"/groups/"+t+"/user/"+i,null,!0,!1)}getPlans(){return qd(this,void 0,void 0,(function*(){const e=yield this.send("GET","/plans",null,!1,!0);return new oe.L(e,z)}))}postPublicImportDirectory(e){return qd(this,void 0,void 0,(function*(){return this.send("POST","/public/organization/import",e,!0,!1)}))}getTaxRates(){return qd(this,void 0,void 0,(function*(){const e=yield this.send("GET","/plans/sales-tax-rates/",null,!0,!0);return new oe.L(e,yd)}))}getSettingsDomains(){return qd(this,void 0,void 0,(function*(){const e=yield this.send("GET","/settings/domains",null,!0,!0);return new _d(e)}))}putSettingsDomains(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/settings/domains",e,!0,!0);return new _d(t)}))}getSync(){return qd(this,void 0,void 0,(function*(){const e=this.isDesktopClient||this.isWebClient?"/sync?excludeDomains=true":"/sync",t=yield this.send("GET",e,null,!0,!0);return new Pd(t)}))}getTwoFactorProviders(){return qd(this,void 0,void 0,(function*(){const e=yield this.send("GET","/two-factor",null,!0,!0);return new oe.L(e,pd)}))}getTwoFactorOrganizationProviders(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("GET","/organizations/"+e+"/two-factor",null,!0,!0);return new oe.L(t,pd)}))}getTwoFactorAuthenticator(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-authenticator",e,!0,!0);return new cd(t)}))}getTwoFactorEmail(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-email",e,!0,!0);return new dd(t)}))}getTwoFactorDuo(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-duo",e,!0,!0);return new ud(t)}))}getTwoFactorOrganizationDuo(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("POST","/organizations/"+e+"/two-factor/get-duo",t,!0,!0);return new ud(i)}))}getTwoFactorYubiKey(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-yubikey",e,!0,!0);return new fd(t)}))}getTwoFactorWebAuthn(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-webauthn",e,!0,!0);return new gd.pQ(t)}))}getTwoFactorWebAuthnChallenge(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-webauthn-challenge",e,!0,!0);return new gd.ap(t)}))}getTwoFactorRecover(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-recover",e,!0,!0);return new hd(t)}))}putTwoFactorAuthenticator(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/two-factor/authenticator",e,!0,!0);return new cd(t)}))}putTwoFactorEmail(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/two-factor/email",e,!0,!0);return new dd(t)}))}putTwoFactorDuo(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/two-factor/duo",e,!0,!0);return new ud(t)}))}putTwoFactorOrganizationDuo(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/organizations/"+e+"/two-factor/duo",t,!0,!0);return new ud(i)}))}putTwoFactorYubiKey(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/two-factor/yubikey",e,!0,!0);return new fd(t)}))}putTwoFactorWebAuthn(e){return qd(this,void 0,void 0,(function*(){const t=e.deviceResponse.response,i=Object.assign({},e);i.deviceResponse={id:e.deviceResponse.id,rawId:btoa(e.deviceResponse.id),type:e.deviceResponse.type,extensions:e.deviceResponse.getClientExtensionResults(),response:{AttestationObject:Fe.c.fromBufferToB64(t.attestationObject),clientDataJson:Fe.c.fromBufferToB64(t.clientDataJSON)}};const n=yield this.send("PUT","/two-factor/webauthn",i,!0,!0);return new gd.pQ(n)}))}deleteTwoFactorWebAuthn(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("DELETE","/two-factor/webauthn",e,!0,!0);return new gd.pQ(t)}))}putTwoFactorDisable(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/two-factor/disable",e,!0,!0);return new pd(t)}))}putTwoFactorOrganizationDisable(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/organizations/"+e+"/two-factor/disable",t,!0,!0);return new pd(i)}))}postTwoFactorRecover(e){return this.send("POST","/two-factor/recover",e,!1,!1)}postTwoFactorEmailSetup(e){return this.send("POST","/two-factor/send-email",e,!0,!1)}postTwoFactorEmail(e){return this.send("POST","/two-factor/send-email-login",e,!1,!1)}getDeviceVerificationSettings(){return qd(this,void 0,void 0,(function*(){const e=yield this.send("GET","/two-factor/get-device-verification-settings",null,!0,!0);return new td(e)}))}putDeviceVerificationSettings(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/two-factor/device-verification-settings",e,!0,!0);return new td(t)}))}getCloudCommunicationsEnabled(){return qd(this,void 0,void 0,(function*(){return yield this.send("GET","/organizations/connections/enabled",null,!0,!0)}))}getOrganizationConnection(e,t,i){return qd(this,void 0,void 0,(function*(){const n=yield this.send("GET",`/organizations/connections/${e}/${t}`,null,!0,!0);return new Ru(n,i)}))}createOrganizationConnection(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("POST","/organizations/connections/",e,!0,!0);return new Ru(i,t)}))}updateOrganizationConnection(e,t,i){return qd(this,void 0,void 0,(function*(){const n=yield this.send("PUT","/organizations/connections/"+i,e,!0,!0);return new Ru(n,t)}))}deleteOrganizationConnection(e){return qd(this,void 0,void 0,(function*(){return this.send("DELETE","/organizations/connections/"+e,null,!0,!1)}))}getProviderUsers(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("GET","/providers/"+e+"/users",null,!0,!0);return new oe.L(t,$u)}))}getProviderUser(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("GET","/providers/"+e+"/users/"+t,null,!0,!0);return new Vu(i)}))}postProviderUserInvite(e,t){return this.send("POST","/providers/"+e+"/users/invite",t,!0,!1)}postProviderUserReinvite(e,t){return this.send("POST","/providers/"+e+"/users/"+t+"/reinvite",null,!0,!1)}postManyProviderUserReinvite(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("POST","/providers/"+e+"/users/reinvite",t,!0,!0);return new oe.L(i,ju)}))}postProviderUserBulkConfirm(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("POST","/providers/"+e+"/users/confirm",t,!0,!0);return new oe.L(i,ju)}))}deleteManyProviderUsers(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("DELETE","/providers/"+e+"/users",t,!0,!0);return new oe.L(i,ju)}))}postProviderUserAccept(e,t,i){return this.send("POST","/providers/"+e+"/users/"+t+"/accept",i,!0,!1)}postProviderUserConfirm(e,t,i){return this.send("POST","/providers/"+e+"/users/"+t+"/confirm",i,!0,!1)}postProviderUsersPublicKey(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("POST","/providers/"+e+"/users/public-keys",t,!0,!0);return new oe.L(i,Gu)}))}putProviderUser(e,t,i){return this.send("PUT","/providers/"+e+"/users/"+t,i,!0,!1)}deleteProviderUser(e,t){return this.send("DELETE","/providers/"+e+"/users/"+t,null,!0,!1)}getProviderClients(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("GET","/providers/"+e+"/organizations",null,!0,!0);return new oe.L(t,Qu)}))}postProviderAddOrganization(e,t){return this.send("POST","/providers/"+e+"/organizations/add",t,!0,!1)}postProviderCreateOrganization(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.send("POST","/providers/"+e+"/organizations",t,!0,!0);return new Bu(i)}))}deleteProviderOrganization(e,t){return this.send("DELETE","/providers/"+e+"/organizations/"+t,null,!0,!1)}getEvents(e,t,i){return qd(this,void 0,void 0,(function*(){const n=yield this.send("GET",this.addEventParameters("/events",e,t,i),null,!0,!0);return new oe.L(n,Ad)}))}getEventsCipher(e,t,i,n){return qd(this,void 0,void 0,(function*(){const s=yield this.send("GET",this.addEventParameters("/ciphers/"+e+"/events",t,i,n),null,!0,!0);return new oe.L(s,Ad)}))}getEventsOrganization(e,t,i,n){return qd(this,void 0,void 0,(function*(){const s=yield this.send("GET",this.addEventParameters("/organizations/"+e+"/events",t,i,n),null,!0,!0);return new oe.L(s,Ad)}))}getEventsOrganizationUser(e,t,i,n,s){return qd(this,void 0,void 0,(function*(){const o=yield this.send("GET",this.addEventParameters("/organizations/"+e+"/users/"+t+"/events",i,n,s),null,!0,!0);return new oe.L(o,Ad)}))}getEventsProvider(e,t,i,n){return qd(this,void 0,void 0,(function*(){const s=yield this.send("GET",this.addEventParameters("/providers/"+e+"/events",t,i,n),null,!0,!0);return new oe.L(s,Ad)}))}getEventsProviderUser(e,t,i,n,s){return qd(this,void 0,void 0,(function*(){const o=yield this.send("GET",this.addEventParameters("/providers/"+e+"/users/"+t+"/events",i,n,s),null,!0,!0);return new oe.L(o,Ad)}))}postEventsCollect(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.tokenService.getAccessToken(t),n=new Headers({"Device-Type":this.deviceType,Authorization:"Bearer "+i,"Content-Type":"application/json; charset=utf-8"});null!=this.customUserAgent&&n.set("User-Agent",this.customUserAgent);const s=yield(0,pe.z)(this.environmentService.environment$);if(200!==(yield this.fetch(new Request(s.getEventsUrl()+"/collect",{cache:"no-store",credentials:yield this.getCredentials(),method:"POST",body:JSON.stringify(e),headers:n}))).status)return Promise.reject("Event post failed.")}))}getUserPublicKey(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("GET","/users/"+e+"/public-key",null,!0,!0);return new Zd(t)}))}getHibpBreach(e){return qd(this,void 0,void 0,(function*(){return(yield this.send("GET","/hibp/breach?username="+e,null,!0,!0)).map((e=>new bd(e)))}))}postBitPayInvoice(e){return qd(this,void 0,void 0,(function*(){return yield this.send("POST","/bitpay-invoice",e,!0,!0)}))}postSetupPayment(){return qd(this,void 0,void 0,(function*(){return yield this.send("POST","/setup-payment",null,!0,!0)}))}getMasterKeyFromKeyConnector(e){return qd(this,void 0,void 0,(function*(){const t=yield this.getActiveBearerToken(),i=yield this.fetch(new Request(e+"/user-keys",{cache:"no-store",method:"GET",headers:new Headers({Accept:"application/json",Authorization:"Bearer "+t})}));if(200!==i.status){const e=yield this.handleError(i,!1,!0);return Promise.reject(e)}return new od(yield i.json())}))}postUserKeyToKeyConnector(e,t){return qd(this,void 0,void 0,(function*(){const i=yield this.getActiveBearerToken(),n=yield this.fetch(new Request(e+"/user-keys",{cache:"no-store",method:"POST",headers:new Headers({Accept:"application/json",Authorization:"Bearer "+i,"Content-Type":"application/json; charset=utf-8"}),body:JSON.stringify(t)}));if(200!==n.status){const e=yield this.handleError(n,!1,!0);return Promise.reject(e)}}))}getKeyConnectorAlive(e){return qd(this,void 0,void 0,(function*(){const t=yield this.fetch(new Request(e+"/alive",{cache:"no-store",method:"GET",headers:new Headers({Accept:"application/json","Content-Type":"application/json; charset=utf-8"})}));if(200!==t.status){const e=yield this.handleError(t,!1,!0);return Promise.reject(e)}}))}getOrganizationExport(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("GET","/organizations/"+e+"/export",null,!0,!0);return new Yu(t)}))}getActiveBearerToken(){return qd(this,void 0,void 0,(function*(){let e=yield this.tokenService.getAccessToken();return(yield this.tokenService.tokenNeedsRefresh())&&(yield this.doAuthRefresh(),e=yield this.tokenService.getAccessToken()),e}))}fetch(e){return qd(this,void 0,void 0,(function*(){return"GET"===e.method&&(e.headers.set("Cache-Control","no-store"),e.headers.set("Pragma","no-cache")),e.headers.set("Bitwarden-Client-Name",this.platformUtilsService.getClientType()),e.headers.set("Bitwarden-Client-Version",yield this.platformUtilsService.getApplicationVersionNumber()),this.nativeFetch(e)}))}nativeFetch(e){return fetch(e)}preValidateSso(e){return qd(this,void 0,void 0,(function*(){if(null==e||""===e)throw new Error("Organization Identifier was not provided.");const t=new Headers({Accept:"application/json","Device-Type":this.deviceType});null!=this.customUserAgent&&t.set("User-Agent",this.customUserAgent);const i=yield(0,pe.z)(this.environmentService.environment$),n=`/sso/prevalidate?domainHint=${encodeURIComponent(e)}`,s=yield this.fetch(new Request(i.getIdentityUrl()+n,{cache:"no-store",credentials:yield this.getCredentials(),headers:t,method:"GET"}));if(200===s.status){const e=yield s.json();return new ld(e)}{const e=yield this.handleError(s,!1,!0);return Promise.reject(e)}}))}postCreateSponsorship(e,t){return qd(this,void 0,void 0,(function*(){return yield this.send("POST","/organization/sponsorship/"+(this.platformUtilsService.isSelfHost()?"self-hosted/":"")+e+"/families-for-enterprise",t,!0,!1)}))}getSponsorshipSyncStatus(e){return qd(this,void 0,void 0,(function*(){const t=yield this.send("GET","/organization/sponsorship/"+e+"/sync-status",null,!0,!0);return new Ku(t)}))}deleteRevokeSponsorship(e){return qd(this,void 0,void 0,(function*(){return yield this.send("DELETE","/organization/sponsorship/"+(this.platformUtilsService.isSelfHost()?"self-hosted/":"")+e,null,!0,!1)}))}deleteRemoveSponsorship(e){return qd(this,void 0,void 0,(function*(){return yield this.send("DELETE","/organization/sponsorship/sponsored/"+e,null,!0,!1)}))}postPreValidateSponsorshipToken(e){return qd(this,void 0,void 0,(function*(){return yield this.send("POST","/organization/sponsorship/validate-token?sponsorshipToken="+encodeURIComponent(e),null,!0,!0)}))}postRedeemSponsorship(e,t){return qd(this,void 0,void 0,(function*(){return yield this.send("POST","/organization/sponsorship/redeem?sponsorshipToken="+encodeURIComponent(e),t,!0,!1)}))}postResendSponsorshipOffer(e){return qd(this,void 0,void 0,(function*(){return yield this.send("POST","/organization/sponsorship/"+e+"/families-for-enterprise/resend",null,!0,!1)}))}doAuthRefresh(){return qd(this,void 0,void 0,(function*(){const e=yield this.tokenService.getRefreshToken();if(null!=e&&""!==e)return this.doRefreshToken();const t=yield this.tokenService.getClientId(),i=yield this.tokenService.getClientSecret();if(!Fe.c.isNullOrWhitespace(t)&&!Fe.c.isNullOrWhitespace(i))return this.doApiTokenRefresh();throw new Error("Cannot refresh token, no refresh token or api keys are stored")}))}doRefreshToken(){return qd(this,void 0,void 0,(function*(){const e=yield this.tokenService.getRefreshToken();if(null==e||""===e)throw new Error;const t=new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8",Accept:"application/json","Device-Type":this.deviceType});null!=this.customUserAgent&&t.set("User-Agent",this.customUserAgent);const i=yield(0,pe.z)(this.environmentService.environment$),n=yield this.tokenService.decodeAccessToken(),s=yield this.fetch(new Request(i.getIdentityUrl()+"/connect/token",{body:this.qsStringify({grant_type:"refresh_token",client_id:n.client_id,refresh_token:e}),cache:"no-store",credentials:yield this.getCredentials(),headers:t,method:"POST"}));if(200!==s.status){const e=yield this.handleError(s,!0,!0);return Promise.reject(e)}{const e=yield s.json(),t=new nd.O(e),i=yield this.stateService.getVaultTimeoutAction(),n=yield this.stateService.getVaultTimeout();yield this.tokenService.setTokens(t.accessToken,i,n,t.refreshToken)}}))}doApiTokenRefresh(){return qd(this,void 0,void 0,(function*(){const e=yield this.tokenService.getClientId(),t=yield this.tokenService.getClientSecret(),i=yield this.appIdService.getAppId(),n=new Hu.x(i,this.platformUtilsService),s=new Xu.Z(e,t,new Wu._,n),o=yield this.postIdentityToken(s);if(!(o instanceof nd.O))throw new Error("Invalid response received when refreshing api token");const r=yield this.stateService.getVaultTimeoutAction(),a=yield this.stateService.getVaultTimeout();yield this.tokenService.setAccessToken(o.accessToken,r,a)}))}send(e,t,i,n,s,o,r){return qd(this,void 0,void 0,(function*(){const a=yield(0,pe.z)(this.environmentService.environment$);o=Fe.c.isNullOrWhitespace(o)?a.getApiUrl():o;const l=t.split("?"),c=o+Fe.c.normalizePath(l[0])+(l.length>1?`?${l[1]}`:""),u=new Headers({"Device-Type":this.deviceType});null!=this.customUserAgent&&u.set("User-Agent",this.customUserAgent);const d={cache:"no-store",credentials:yield this.getCredentials(),method:e};if(n){const e=yield this.getActiveBearerToken();u.set("Authorization","Bearer "+e)}null!=i&&("string"==typeof i?(d.body=i,u.set("Content-Type","application/x-www-form-urlencoded; charset=utf-8")):"object"==typeof i&&(i instanceof FormData?d.body=i:(u.set("Content-Type","application/json; charset=utf-8"),d.body=JSON.stringify(i)))),s&&u.set("Accept","application/json"),null!=r&&r(u),d.headers=u;const p=yield this.fetch(new Request(c,d)),h=p.headers.get("content-type"),g=null!=h&&-1!==h.indexOf("application/json");if(s&&200===p.status&&g){return yield p.json()}if(200!==p.status){const e=yield this.handleError(p,!1,n);return Promise.reject(e)}}))}handleError(e,t,i){return qd(this,void 0,void 0,(function*(){let n=null;return this.isJsonResponse(e)?n=yield e.json():this.isTextResponse(e)&&(n={Message:yield e.text()}),i&&(401===e.status||403===e.status||t&&400===e.status&&null!=n&&"invalid_grant"===n.error)?(yield this.logoutCallback(!0),null):new Ee.i(n,e.status,t)}))}qsStringify(e){return Object.keys(e).map((t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&")}getCredentials(){return qd(this,void 0,void 0,(function*(){const e=yield(0,pe.z)(this.environmentService.environment$);if(!this.isWebClient||e.hasBaseUrl())return"include"}))}addEventParameters(e,t,i,n){return null!=t&&(e+="?start="+t),null!=i&&(e+=e.indexOf("?")>-1?"&":"?",e+="end="+i),null!=n&&(e+=e.indexOf("?")>-1?"&":"?",e+="continuationToken="+n),e}isJsonResponse(e){const t=e.headers.get("content-type");return null!=t&&t.indexOf("application/json")>-1}isTextResponse(e){const t=e.headers.get("content-type");return null!=t&&t.indexOf("text")>-1}},deps:[bt.B,es.P,jn.L,Jn.s,ts.b,o.JN]},{provide:Tp.N,useExisting:Tp.v},{provide:Tp.v,useClass:class{constructor(e,t,i,n,s){this.cryptoService=e,this.i18nService=t,this.keyGenerationService=i,this.stateProvider=n,this.encryptService=s,this.sendKeySalt="bitwarden-send",this.sendKeyPurpose="send",this.sends$=this.stateProvider.encryptedState$.pipe((0,de.U)((e=>Object.values(e||{}).map((e=>new Up.v(e)))))),this.sendViews$=this.stateProvider.encryptedState$.pipe((0,bu.b)((e=>this.decryptSends(Object.values(e||{}).map((e=>new Up.v(e)))))))}encrypt(e,t,i,n){return Sp(this,void 0,void 0,(function*(){let s=null;const o=new Up.v;if(o.id=e.id,o.type=e.type,o.disabled=e.disabled,o.hideEmail=e.hideEmail,o.maxAccessCount=e.maxAccessCount,null==e.key){const t=yield this.keyGenerationService.createKeyWithPurpose(128,this.sendKeyPurpose,this.sendKeySalt);e.key=t.material,e.cryptoKey=t.derivedKey}if(null!=i){const t=yield this.keyGenerationService.deriveKeyFromPassword(i,e.key,new hi.S(xp.g));o.password=t.keyB64}if(null==n&&(n=yield this.cryptoService.getUserKey()),o.key=yield this.encryptService.encrypt(e.key,n),o.name=yield this.encryptService.encrypt(e.name,e.cryptoKey),o.notes=yield this.encryptService.encrypt(e.notes,e.cryptoKey),o.type===ap.n.Text)o.text=new Ap.y,o.text.text=yield this.encryptService.encrypt(e.text.text,e.cryptoKey),o.text.hidden=e.text.hidden;else if(o.type===ap.n.File&&(o.file=new _p.f,null!=t))if(t instanceof ArrayBuffer){const[i,n]=yield this.encryptFileData(e.file.fileName,t,e.cryptoKey);o.file.fileName=i,s=n}else s=yield this.parseFile(o,t,e.cryptoKey);return[o,s]}))}get$(e){return this.sends$.pipe((0,Ot.x)(((t,i)=>{const n=t.find((t=>t.id===e)),s=i.find((t=>t.id===e));if(!n||!s)return!1;const o=Object.keys(s).every((e=>{if(null!=n[e]&&null===s[e]||null===n[e]&&null!=s[e])return!1;switch(e){case"name":case"notes":case"key":return null===n[e]&&null===s[e]||n[e].encryptedString===s[e].encryptedString;case"text":return null==n[e].text&&null==s[e].text||!(null!=n[e].text&&null==s[e].text||null==n[e].text&&null!=s[e].text)&&n[e].text.encryptedString===s[e].text.encryptedString;case"file":return!0;case"revisionDate":case"expirationDate":case"deletionDate":return null===n[e]&&null===s[e]||n[e].getTime()===s[e].getTime();default:return n[e]===s[e]}}));return o})),(0,de.U)((t=>t.find((t=>t.id===e)))))}getFromState(e){return Sp(this,void 0,void 0,(function*(){const t=yield this.stateProvider.getEncryptedSends();return null!=t&&t.hasOwnProperty(e)?new Up.v(t[e]):null}))}getAll(){return Sp(this,void 0,void 0,(function*(){const e=yield this.stateProvider.getEncryptedSends(),t=[];for(const i in e)e.hasOwnProperty(i)&&t.push(new Up.v(e[i]));return t}))}getAllDecryptedFromState(){return Sp(this,void 0,void 0,(function*(){let e=yield this.stateProvider.getDecryptedSends();if(null!=e)return e;e=[];if(!(yield this.cryptoService.hasUserKey()))throw new Error("No user key found.");const t=[];return(yield this.getAll()).forEach((i=>{t.push(i.decrypt().then((t=>e.push(t))))})),yield Promise.all(t),e.sort(Fe.c.getSortFunction(this.i18nService,"name")),yield this.stateProvider.setDecryptedSends(e),e}))}upsert(e){return Sp(this,void 0,void 0,(function*(){let t=yield this.stateProvider.getEncryptedSends();if(null==t&&(t={}),e instanceof up){const i=e;t[i.id]=i}else e.forEach((e=>{t[e.id]=e}));yield this.replace(t)}))}clear(e){return Sp(this,void 0,void 0,(function*(){yield this.stateProvider.setDecryptedSends(null),yield this.stateProvider.setEncryptedSends(null)}))}delete(e){return Sp(this,void 0,void 0,(function*(){const t=yield this.stateProvider.getEncryptedSends();if(null!=t){if("string"==typeof e){if(null==t[e])return;delete t[e]}else e.forEach((e=>{delete t[e]}));yield this.replace(t)}}))}replace(e){return Sp(this,void 0,void 0,(function*(){yield this.stateProvider.setEncryptedSends(e)}))}getRotatedKeys(e){return Sp(this,void 0,void 0,(function*(){if(null==e)throw new Error("New user key is required for rotation.");const t=yield this.cryptoService.getUserKey();return yield(0,pe.z)(this.sends$.pipe((0,bu.b)((i=>Sp(this,void 0,void 0,(function*(){return this.toRotatedKeyRequestMap(i,t,e)}))))))}))}toRotatedKeyRequestMap(e,t,i){return Sp(this,void 0,void 0,(function*(){return yield Promise.all(e.map((e=>Sp(this,void 0,void 0,(function*(){const n=yield this.encryptService.decryptToBytes(e.key,t);return e.key=yield this.encryptService.encrypt(n,i),new Zp(e)})))))}))}parseFile(e,t,i){return new Promise(((n,s)=>{const o=new FileReader;o.readAsArrayBuffer(t),o.onload=o=>Sp(this,void 0,void 0,(function*(){try{const[s,r]=yield this.encryptFileData(t.name,o.target.result,i);e.file.fileName=s,n(r)}catch(r){s(r)}})),o.onerror=()=>{s("Error reading file.")}}))}encryptFileData(e,t,i){return Sp(this,void 0,void 0,(function*(){null==i&&(i=yield this.cryptoService.getUserKey());return[yield this.encryptService.encrypt(e,i),yield this.encryptService.encryptToBytes(new Uint8Array(t),i)]}))}decryptSends(e){return Sp(this,void 0,void 0,(function*(){const t=e.map((e=>e.decrypt())),i=yield Promise.all(t);return i.sort(Fe.c.getSortFunction(this.i18nService,"name")),i}))}},deps:[Qn.$,$n.D,Hn,bp,Gn.U]},{provide:bp,useClass:class{constructor(e){this.stateProvider=e,this.activeUserEncryptedState=this.stateProvider.getActive(vp),this.encryptedState$=this.activeUserEncryptedState.state$,this.activeUserDecryptedState=this.stateProvider.getActive(yp),this.decryptedState$=this.activeUserDecryptedState.state$}getEncryptedSends(){return wp(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.encryptedState$)}))}setEncryptedSends(e){return wp(this,void 0,void 0,(function*(){yield this.activeUserEncryptedState.update((()=>e))}))}getDecryptedSends(){return wp(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.decryptedState$)}))}setDecryptedSends(e){return wp(this,void 0,void 0,(function*(){yield this.activeUserDecryptedState.update((()=>e))}))}},deps:[he.X9]},{provide:mp.e,useClass:class{constructor(e,t,i){this.apiService=e,this.fileUploadService=t,this.sendService=i}getSend(e){return fp(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/sends/"+e,null,!0,!0);return new Od(t)}))}postSendAccess(e,t,i){return fp(this,void 0,void 0,(function*(){const n=yield this.apiService.send("POST","/sends/access/"+e,t,!1,!0,i,(t=>{t.set("Send-Id",e)}));return new pp(n)}))}getSendFileDownloadData(e,t,i){return fp(this,void 0,void 0,(function*(){const n=yield this.apiService.send("POST","/sends/"+e.id+"/access/file/"+e.file.id,t,!1,!0,i,(t=>{t.set("Send-Id",e.id)}));return new hp(n)}))}getSends(){return fp(this,void 0,void 0,(function*(){const e=yield this.apiService.send("GET","/sends",null,!0,!0);return new oe.L(e,Od)}))}postSend(e){return fp(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/sends",e,!0,!0);return new Od(t)}))}postFileTypeSend(e){return fp(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/sends/file/v2",e,!0,!0);return new gp(t)}))}renewSendFileUploadUrl(e,t){return fp(this,void 0,void 0,(function*(){const i=yield this.apiService.send("GET","/sends/"+e+"/file/"+t,null,!0,!0);return new gp(i)}))}postSendFile(e,t,i){return this.apiService.send("POST","/sends/"+e+"/file/"+t,i,!0,!1)}postSendFileLegacy(e){return fp(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/sends/file",e,!0,!0);return new Od(t)}))}putSend(e,t){return fp(this,void 0,void 0,(function*(){const i=yield this.apiService.send("PUT","/sends/"+e,t,!0,!0);return new Od(i)}))}putSendRemovePassword(e){return fp(this,void 0,void 0,(function*(){const t=yield this.apiService.send("PUT","/sends/"+e+"/remove-password",null,!0,!0);return new Od(t)}))}deleteSend(e){return this.apiService.send("DELETE","/sends/"+e,null,!0,!1)}save(e){return fp(this,void 0,void 0,(function*(){const t=yield this.upload(e),i=new up(t);yield this.sendService.upsert(i)}))}delete(e){return fp(this,void 0,void 0,(function*(){yield this.deleteSend(e),yield this.sendService.delete(e)}))}removePassword(e){return fp(this,void 0,void 0,(function*(){const t=yield this.putSendRemovePassword(e),i=new up(t);yield this.sendService.upsert(i)}))}upload(e){var t;return fp(this,void 0,void 0,(function*(){const i=new dp(e[0],null===(t=e[1])||void 0===t?void 0:t.buffer.byteLength);let n;if(null==e[0].id){if(e[0].type===ap.n.Text)n=yield this.postSend(i);else try{const t=yield this.postFileTypeSend(i);n=t.sendResponse,yield this.fileUploadService.upload(t,e[0].file.fileName,e[1],this.generateMethods(t,n))}catch(s){if(!(s instanceof Ee.i&&404===s.statusCode))throw s instanceof Ee.i?new Error(s.getSingleMessage()):s;n=yield this.legacyServerSendFileUpload(e,i)}e[0].id=n.id,e[0].accessId=n.accessId}else n=yield this.putSend(e[0].id,i);return n}))}generateMethods(e,t){return{postDirect:this.generatePostDirectCallback(t),renewFileUploadUrl:this.generateRenewFileUploadUrlCallback(t.id,t.file.id),rollback:this.generateRollbackCallback(t.id)}}generatePostDirectCallback(e){return t=>this.postSendFile(e.id,e.file.id,t)}generateRenewFileUploadUrlCallback(e,t){return()=>fp(this,void 0,void 0,(function*(){const i=yield this.renewSendFileUploadUrl(e,t);return null==i?void 0:i.url}))}generateRollbackCallback(e){return()=>this.deleteSend(e)}legacyServerSendFileUpload(e,t){return fp(this,void 0,void 0,(function*(){const i=new FormData;try{const n=new Blob([e[1].buffer],{type:"application/octet-stream"});i.append("model",JSON.stringify(t)),i.append("data",n,e[0].file.fileName.encryptedString)}catch(n){if(!Fe.c.isNode||Fe.c.isBrowser)throw n;i.append("model",JSON.stringify(t)),i.append("data",Buffer.from(e[1].buffer),{filepath:e[0].file.fileName.encryptedString,contentType:"application/octet-stream"})}return yield this.postSendFileLegacy(i)}))}},deps:[l.s,Vn,Tp.v]},{provide:Ip._,useClass:Lh,deps:[vt.R,lt.BR,l.s,An.z,qp.G,Cp.u,Qn.$,Op.a,Xn.o,k.W,Tp.v,Wn.$,mt.J,ts.b,q.H,Pp.s,v.eC,mp.e,a.Bb,dt.o,o.JN,Zn.M,bt.B]},{provide:zn.A,useClass:class{constructor(e,t){this.messageSender=e,this.messageListener=t,this.subscriptions=new Map}send(e,t){this.messageSender.send(null==e?void 0:e.command,e)}subscribe(e,t){this.subscriptions.set(e,this.messageListener.allMessages$.subscribe((e=>{t(e)})))}unsubscribe(e){const t=this.subscriptions.get(e);null==t||t.unsubscribe(),this.subscriptions.delete(e)}},deps:[ps.B,ds]},{provide:g.E,useClass:class{constructor(e,t,i,n,s,o){this.userDecryptionOptionsService=e,this.cryptoService=t,this.tokenService=i,this.policyService=n,this.stateService=s,this.biometricStateService=o}setVaultTimeoutOptions(e,t){return ip(this,void 0,void 0,(function*(){const i=yield this.tokenService.getAccessToken(),n=yield this.tokenService.getRefreshToken(),s=yield this.tokenService.getClientId(),o=yield this.tokenService.getClientSecret();yield this.stateService.setVaultTimeout(e);const r=yield this.stateService.getVaultTimeoutAction();null==e&&0!==e||t!==Li.B.LogOut||t===r||(yield this.tokenService.clearTokens()),yield this.stateService.setVaultTimeoutAction(t),yield this.tokenService.setTokens(i,t,e,n,[s,o]),yield this.cryptoService.refreshAdditionalKeys()}))}availableVaultTimeoutActions$(e){return(0,oi.P)((()=>this.getAvailableVaultTimeoutActions(e)))}isPinLockSet(e){return ip(this,void 0,void 0,(function*(){const t=!!(yield this.stateService.getProtectedPin({userId:e})),i=!!(yield this.stateService.getPinKeyEncryptedUserKey({userId:e})),n=!!(yield this.stateService.getEncryptedPinProtected({userId:e}));return i||n?"PERSISTANT":!t||i||n?"DISABLED":"TRANSIENT"}))}isBiometricLockSet(e){return ip(this,void 0,void 0,(function*(){const t=null==e?(0,pe.z)(this.biometricStateService.biometricUnlockEnabled$):this.biometricStateService.getBiometricUnlockEnabled(e);return yield t}))}getVaultTimeout(e){return ip(this,void 0,void 0,(function*(){const t=yield this.stateService.getVaultTimeout({userId:e}),i=yield(0,pe.z)(this.policyService.getAll$(Qe.Mi.MaximumVaultTimeout,e));if(null==i?void 0:i.length){let n=Math.min(t,i[0].data.minutes);return(null==t||n<0)&&(n=i[0].data.minutes),t!==n&&(yield this.stateService.setVaultTimeout(n,{userId:e})),n}return t}))}vaultTimeoutAction$(e){return(0,oi.P)((()=>this.getVaultTimeoutAction(e)))}getVaultTimeoutAction(e){return ip(this,void 0,void 0,(function*(){const t=yield this.getAvailableVaultTimeoutActions();if(1===t.length)return t[0];const i=yield this.stateService.getVaultTimeoutAction({userId:e}),n=yield(0,pe.z)(this.policyService.getAll$(Qe.Mi.MaximumVaultTimeout,e));if(null==n?void 0:n.length){const s=n[0].data.action;if(s&&i!==s&&(yield this.stateService.setVaultTimeoutAction(s,{userId:e})),s&&t.includes(s))return s}if(null==i){const t=(yield this.userHasMasterPassword(e))?Li.B.Lock:Li.B.LogOut;return yield this.stateService.setVaultTimeoutAction(t,{userId:e}),t}return i===Li.B.LogOut?Li.B.LogOut:Li.B.Lock}))}getAvailableVaultTimeoutActions(e){return ip(this,void 0,void 0,(function*(){const t=[Li.B.LogOut];return((yield this.userHasMasterPassword(e))||"DISABLED"!==(yield this.isPinLockSet(e))||(yield this.isBiometricLockSet(e)))&&t.push(Li.B.Lock),t}))}clear(e){return ip(this,void 0,void 0,(function*(){yield this.cryptoService.clearPinKeys(e)}))}userHasMasterPassword(e){return ip(this,void 0,void 0,(function*(){if(e){const t=yield(0,pe.z)(this.userDecryptionOptionsService.userDecryptionOptionsById$(e));if(null!=(null==t?void 0:t.hasMasterPassword))return t.hasMasterPassword}return yield(0,pe.z)(this.userDecryptionOptionsService.hasMasterPassword$)}))}},deps:[a.Bb,Qn.$,bt.B,k.d,ts.b,os.d]},{provide:sp,useClass:sp,deps:[lt.BR,vt.R,Cp.u,qp.s,Op.a,es.P,Xn.o,h.o,ts.b,ut.e,g.E,Eu.q,o.xI,o.JN]},{provide:f.Q,useExisting:sp},{provide:wt.F,useClass:class{constructor(e){this.stateProvider=e,this.codeVerifierState=this.stateProvider.getGlobal(Pi),this.ssoState=this.stateProvider.getGlobal(qi),this.orgSsoIdentifierState=this.stateProvider.getGlobal(Mi),this.ssoEmailState=this.stateProvider.getGlobal(Ni),this.activeUserOrgSsoIdentifierState=this.stateProvider.getActive(Ii)}getCodeVerifier(){return(0,pe.z)(this.codeVerifierState.state$)}setCodeVerifier(e){return ki(this,void 0,void 0,(function*(){yield this.codeVerifierState.update((t=>e))}))}getSsoState(){return(0,pe.z)(this.ssoState.state$)}setSsoState(e){return ki(this,void 0,void 0,(function*(){yield this.ssoState.update((t=>e))}))}getOrganizationSsoIdentifier(){return(0,pe.z)(this.orgSsoIdentifierState.state$)}setOrganizationSsoIdentifier(e){return ki(this,void 0,void 0,(function*(){yield this.orgSsoIdentifierState.update((t=>e))}))}getSsoEmail(){return(0,pe.z)(this.ssoEmailState.state$)}setSsoEmail(e){return ki(this,void 0,void 0,(function*(){yield this.ssoEmailState.update((t=>e))}))}getActiveUserOrganizationSsoIdentifier(){return(0,pe.z)(this.activeUserOrgSsoIdentifierState.state$)}setActiveUserOrganizationSsoIdentifier(e){return ki(this,void 0,void 0,(function*(){yield this.activeUserOrgSsoIdentifierState.update((t=>e))}))}},deps:[he.X9]},{provide:ts.b,useClass:ru,deps:[is,o.cy,o.FZ,Wn.$,o.r5,lt.BR,jn.L,bt.B,Bc]},{provide:Kh.rZ,useClass:Kh.gO,deps:[l.s]},{provide:Kh.wF,useClass:Kh.Y5,deps:[Cp.u,qp.s,Kh.rZ,$n.D,Op.a,Qn.$]},{provide:Qh.Q0,useClass:Qh.Ko,deps:[qp.s,Cp.u,Qn.$,Bn.O,ft.d]},{provide:Qh.wz,useClass:Qh.P9,deps:[Cp.u,l.s,Qn.$,Bn.O,Op.a,ft.d]},{provide:Qh.qX,useClass:Qh.kK,deps:[Qh.Q0,Qh.wz]},{provide:h.o,useClass:tp,deps:[Wn.$,$n.D,he.X9]},{provide:p.T,useClass:(0,fs.UE)("noopNotifications")?class{constructor(e){this.logService=e}init(){return this.logService.info("Initializing no-op notification service, no push notifications will be received"),Promise.resolve()}updateConnection(e){return this.logService.info("Updating notification service connection"),Promise.resolve()}reconnectFromActivity(){return this.logService.info("Reconnecting notification service from activity"),Promise.resolve()}disconnectFromInactivity(){return this.logService.info("Disconnecting notification service from inactivity"),Promise.resolve()}}:class{constructor(e,t,i,n,s,o,r,a,l,c){this.logService=e,this.syncService=t,this.appIdService=i,this.apiService=n,this.environmentService=s,this.logoutCallback=o,this.stateService=r,this.authService=a,this.authRequestService=l,this.messagingService=c,this.connected=!1,this.inited=!1,this.inactive=!1,this.reconnectTimer=null,this.environmentService.environment$.subscribe((()=>{this.inited&&this.init()}))}init(){return Qd(this,void 0,void 0,(function*(){this.inited=!1,this.url=(yield(0,pe.z)(this.environmentService.environment$)).getNotificationsUrl(),"https://-"!==this.url&&(null!=this.signalrConnection&&(this.signalrConnection.off("ReceiveMessage"),this.signalrConnection.off("Heartbeat"),yield this.signalrConnection.stop(),this.connected=!1,this.signalrConnection=null),this.signalrConnection=(new Lt.s).withUrl(this.url+"/hub",{accessTokenFactory:()=>this.apiService.getActiveBearerToken(),skipNegotiation:!0,transport:Dt.n.WebSockets}).withHubProtocol(new Et.e).build(),this.signalrConnection.on("ReceiveMessage",(e=>this.processNotification(new Ft(e)))),this.signalrConnection.on("Heartbeat",(e=>{})),this.signalrConnection.onclose((()=>{this.connected=!1,this.reconnect(!0)})),this.inited=!0,(yield this.isAuthedAndUnlocked())&&(yield this.reconnect(!1)))}))}updateConnection(e=!1){return Qd(this,void 0,void 0,(function*(){if(this.inited)try{(yield this.isAuthedAndUnlocked())?yield this.reconnect(e):yield this.signalrConnection.stop()}catch(t){this.logService.error(t.toString())}}))}reconnectFromActivity(){return Qd(this,void 0,void 0,(function*(){this.inactive=!1,this.inited&&!this.connected&&(yield this.reconnect(!0))}))}disconnectFromInactivity(){return Qd(this,void 0,void 0,(function*(){this.inactive=!0,this.inited&&this.connected&&(yield this.signalrConnection.stop())}))}processNotification(e){return Qd(this,void 0,void 0,(function*(){const t=yield this.appIdService.getAppId();if(null==e||e.contextId===t)return;const i=yield this.stateService.getIsAuthenticated(),n=e.payload.userId||e.payload.UserId,s=yield this.stateService.getUserId();if(!i||null==n||n===s)switch(e.type){case De.k$.SyncCipherCreate:case De.k$.SyncCipherUpdate:yield this.syncService.syncUpsertCipher(e.payload,e.type===De.k$.SyncCipherUpdate);break;case De.k$.SyncCipherDelete:case De.k$.SyncLoginDelete:yield this.syncService.syncDeleteCipher(e.payload);break;case De.k$.SyncFolderCreate:case De.k$.SyncFolderUpdate:yield this.syncService.syncUpsertFolder(e.payload,e.type===De.k$.SyncFolderUpdate);break;case De.k$.SyncFolderDelete:yield this.syncService.syncDeleteFolder(e.payload);break;case De.k$.SyncVault:case De.k$.SyncCiphers:case De.k$.SyncSettings:i&&(yield this.syncService.fullSync(!1));break;case De.k$.SyncOrganizations:i&&(yield this.syncService.fullSync(!0));break;case De.k$.SyncOrgKeys:i&&(yield this.syncService.fullSync(!0),yield this.signalrConnection.stop());break;case De.k$.LogOut:i&&this.logoutCallback(!0);break;case De.k$.SyncSendCreate:case De.k$.SyncSendUpdate:yield this.syncService.syncUpsertSend(e.payload,e.type===De.k$.SyncSendUpdate);break;case De.k$.SyncSendDelete:yield this.syncService.syncDeleteSend(e.payload);break;case De.k$.AuthRequest:{const t=yield this.stateService.getUserId();(yield this.authRequestService.getAcceptAuthRequests(t))&&this.messagingService.send("openLoginApproval",{notificationId:e.payload.id})}}}))}reconnect(e){return Qd(this,void 0,void 0,(function*(){if(null!=this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.connected||!this.inited||this.inactive)return;if(yield this.isAuthedAndUnlocked()){try{yield this.signalrConnection.start(),this.connected=!0,e&&(yield this.syncService.fullSync(!1))}catch(t){this.logService.error(t)}this.connected||(this.reconnectTimer=setTimeout((()=>this.reconnect(e)),this.random(12e4,3e5)))}}))}isAuthedAndUnlocked(){return Qd(this,void 0,void 0,(function*(){return(yield this.authService.getAuthStatus())>=Qt.y.Unlocked}))}random(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}},deps:[Wn.$,Ip._,Jn.s,l.s,jn.L,o.JN,ts.b,ut.e,a.JD,Xn.o]},{provide:Bn.O,useClass:class{constructor(e){this.crypto=void 0!==e.crypto?e.crypto:null,this.subtle=this.crypto&&void 0!==this.crypto.subtle?this.crypto.subtle:null,this.wasmSupported=this.checkIfWasmSupported()}pbkdf2(e,t,i,n){return gu(this,void 0,void 0,(function*(){const s="sha256"===i?256:512,o=this.toBuf(e),r={name:"PBKDF2",salt:this.toBuf(t),iterations:n,hash:{name:this.toWebCryptoAlgorithm(i)}},a=yield this.subtle.importKey("raw",o,{name:"PBKDF2"},!1,["deriveBits"]),l=yield this.subtle.deriveBits(r,a,s);return new Uint8Array(l)}))}argon2(e,t,i,n,s){return gu(this,void 0,void 0,(function*(){if(!this.wasmSupported)throw"Webassembly support is required for the Argon2 KDF feature.";const o=new Uint8Array(this.toBuf(e)),r=new Uint8Array(this.toBuf(t)),a=yield du.hash({pass:o,salt:r,time:i,mem:n,parallelism:s,hashLen:32,type:du.ArgonType.Argon2id});return du.unloadRuntime(),a.hash}))}hkdf(e,t,i,n,s){return gu(this,void 0,void 0,(function*(){const o={name:"HKDF",salt:this.toBuf(t),info:this.toBuf(i),hash:{name:this.toWebCryptoAlgorithm(s)}},r=yield this.subtle.importKey("raw",e,{name:"HKDF"},!1,["deriveBits"]),a=yield this.subtle.deriveBits(o,r,8*n);return new Uint8Array(a)}))}hkdfExpand(e,t,i,n){return gu(this,void 0,void 0,(function*(){const s="sha256"===n?32:64;if(i>255*s)throw new Error("outputByteSize is too large.");if(new Uint8Array(e).length<s)throw new Error("prk is too small.");const o=this.toBuf(t),r=new Uint8Array(o);let a=0,l=new Uint8Array(0);const c=Math.ceil(i/s),u=new Uint8Array(c*s);for(let t=0;t<c;t++){const s=new Uint8Array(l.length+r.length+1);if(s.set(l),s.set(r,l.length),s.set([t+1],s.length-1),l=new Uint8Array(yield this.hmac(s,e,n)),u.set(l,a),a+=l.length,a>=i)break}return u.slice(0,i)}))}hash(e,t){return gu(this,void 0,void 0,(function*(){if("md5"===t){const t=pu.md.md5.create(),i=this.toByteString(e);return t.update(i,"raw"),Fe.c.fromByteStringToArray(t.digest().data)}const i=this.toBuf(e),n=yield this.subtle.digest({name:this.toWebCryptoAlgorithm(t)},i);return new Uint8Array(n)}))}hmac(e,t,i){return gu(this,void 0,void 0,(function*(){const n={name:"HMAC",hash:{name:this.toWebCryptoAlgorithm(i)}},s=yield this.subtle.importKey("raw",t,n,!1,["sign"]),o=yield this.subtle.sign(n,s,e);return new Uint8Array(o)}))}compare(e,t){return gu(this,void 0,void 0,(function*(){const i=yield this.randomBytes(32),n={name:"HMAC",hash:{name:"SHA-256"}},s=yield this.subtle.importKey("raw",i,n,!1,["sign"]),o=yield this.subtle.sign(n,s,e),r=yield this.subtle.sign(n,s,t);if(o.byteLength!==r.byteLength)return!1;const a=new Uint8Array(o),l=new Uint8Array(r);for(let e=0;e<l.length;e++)if(a[e]!==l[e])return!1;return!0}))}hmacFast(e,t,i){const n=pu.hmac.create();n.start(i,t),n.update(e);const s=n.digest().getBytes();return Promise.resolve(s)}compareFast(e,t){return gu(this,void 0,void 0,(function*(){const i=yield this.randomBytes(32),n=new Uint32Array(i),s=pu.util.createBuffer();for(let e=0;e<n.length;e++)s.putInt32(n[e]);const o=s.getBytes(),r=pu.hmac.create();r.start("sha256",o),r.update(e);const a=r.digest().getBytes();r.start(null,null),r.update(t);return a===r.digest().getBytes()}))}aesEncrypt(e,t,i){return gu(this,void 0,void 0,(function*(){const n=yield this.subtle.importKey("raw",i,{name:"AES-CBC"},!1,["encrypt"]),s=yield this.subtle.encrypt({name:"AES-CBC",iv:t},n,e);return new Uint8Array(s)}))}aesDecryptFastParameters(e,t,i,n){const s=new hu;return null!=n.meta&&(s.encKey=n.meta.encKeyByteString,s.macKey=n.meta.macKeyByteString),null==s.encKey&&(s.encKey=pu.util.decode64(n.encKeyB64)),s.data=pu.util.decode64(e),s.iv=pu.util.decode64(t),s.macData=s.iv+s.data,null==s.macKey&&null!=n.macKeyB64&&(s.macKey=pu.util.decode64(n.macKeyB64)),null!=i&&(s.mac=pu.util.decode64(i)),null==n.meta&&(n.meta={}),null==n.meta.encKeyByteString&&(n.meta.encKeyByteString=s.encKey),null!=s.macKey&&null==n.meta.macKeyByteString&&(n.meta.macKeyByteString=s.macKey),s}aesDecryptFast(e,t){const i=pu.cipher.createDecipher(this.toWebCryptoAesMode(t),e.encKey),n={};"cbc"===t&&(n.iv=e.iv);const s=pu.util.createBuffer(e.data);i.start(n),i.update(s),i.finish();const o=i.output.toString();return Promise.resolve(o)}aesDecrypt(e,t,i,n){return gu(this,void 0,void 0,(function*(){if("ecb"===n){const t=new hu;t.data=this.toByteString(e),t.encKey=this.toByteString(i);const n=yield this.aesDecryptFast(t,"ecb");return Fe.c.fromByteStringToArray(n)}const s=yield this.subtle.importKey("raw",i,{name:"AES-CBC"},!1,["decrypt"]),o=yield this.subtle.decrypt({name:"AES-CBC",iv:t},s,e);return new Uint8Array(o)}))}rsaEncrypt(e,t,i){return gu(this,void 0,void 0,(function*(){const n={name:"RSA-OAEP",hash:{name:this.toWebCryptoAlgorithm(i)}},s=yield this.subtle.importKey("spki",t,n,!1,["encrypt"]),o=yield this.subtle.encrypt(n,s,e);return new Uint8Array(o)}))}rsaDecrypt(e,t,i){return gu(this,void 0,void 0,(function*(){const n={name:"RSA-OAEP",hash:{name:this.toWebCryptoAlgorithm(i)}},s=yield this.subtle.importKey("pkcs8",t,n,!1,["decrypt"]),o=yield this.subtle.decrypt(n,s,e);return new Uint8Array(o)}))}rsaExtractPublicKey(e){return gu(this,void 0,void 0,(function*(){const t={name:"RSA-OAEP",hash:{name:this.toWebCryptoAlgorithm("sha1")}},i=yield this.subtle.importKey("pkcs8",e,t,!0,["decrypt"]),n=yield this.subtle.exportKey("jwk",i),s={kty:"RSA",e:n.e,n:n.n,alg:"RSA-OAEP",ext:!0},o=yield this.subtle.importKey("jwk",s,t,!0,["encrypt"]),r=yield this.subtle.exportKey("spki",o);return new Uint8Array(r)}))}aesGenerateKey(e=960){return gu(this,void 0,void 0,(function*(){if(512===e){const e=yield this.aesGenerateKey(256),t=yield this.aesGenerateKey(256);return new Uint8Array([...e,...t])}const t={name:"AES-CBC",length:e},i=yield this.subtle.generateKey(t,!0,["encrypt","decrypt"]),n=yield this.subtle.exportKey("raw",i);return new Uint8Array(n)}))}rsaGenerateKeyPair(e){return gu(this,void 0,void 0,(function*(){const t={name:"RSA-OAEP",modulusLength:e,publicExponent:new Uint8Array([1,0,1]),hash:{name:this.toWebCryptoAlgorithm("sha1")}},i=yield this.subtle.generateKey(t,!0,["encrypt","decrypt"]),n=yield this.subtle.exportKey("spki",i.publicKey),s=yield this.subtle.exportKey("pkcs8",i.privateKey);return[new Uint8Array(n),new Uint8Array(s)]}))}randomBytes(e){const t=new Uint8Array(e);return this.crypto.getRandomValues(t),Promise.resolve(t)}toBuf(e){let t;return t="string"==typeof e?Fe.c.fromUtf8ToArray(e):e,t}toByteString(e){let t;return t="string"==typeof e?pu.util.encodeUtf8(e):Fe.c.fromBufferToByteString(e),t}toWebCryptoAlgorithm(e){if("md5"===e)throw new Error("MD5 is not supported in WebCrypto.");return"sha1"===e?"SHA-1":"sha256"===e?"SHA-256":"SHA-512"}toWebCryptoAesMode(e){return"cbc"===e?"AES-CBC":"AES-ECB"}checkIfWasmSupported(){try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){return!1}return!1}},deps:[o.m9]},{provide:Gn.U,useFactory:function(e,t,i){return(0,fs.Sp)("multithreadDecryption")?new Uo(e,t,i):new po(e,t,i)},deps:[Bn.O,Wn.$,o.n3]},{provide:d.k,useClass:class{constructor(e,t,i,n){this.apiService=e,this.stateProvider=t,this.logService=i,this.authService=n,this.inited=!1}init(e){this.inited||(this.inited=!0,e&&(this.uploadEvents(),setInterval((()=>this.uploadEvents()),6e4)))}uploadEvents(e){return Bd(this,void 0,void 0,(function*(){if(e||(e=yield(0,pe.z)(this.stateProvider.activeUserId$)),!e)return;if(!(yield(0,pe.z)(this.authService.authStatusFor$(e).pipe((0,de.U)((e=>e===Qt.y.Unlocked))))))return;const t=yield this.takeEvents(e);if(null==t||0===t.length)return;const i=t.map((e=>{const t=new Kd;return t.type=e.type,t.cipherId=e.cipherId,t.date=e.date,t.organizationId=e.organizationId,t}));try{yield this.apiService.postEventsCollect(i,e)}catch(n){this.logService.error(n),yield this.stateProvider.setUserState(zd,t,e)}}))}takeEvents(e){return Bd(this,void 0,void 0,(function*(){let t=null;return yield this.stateProvider.getUser(e,zd).update((e=>(t=null!=e?e:[],[]))),t}))}},deps:[l.s,he.X9,Wn.$,ut.e]},{provide:u.j,useClass:class{constructor(e,t,i,n,s){this.cipherService=e,this.stateProvider=t,this.organizationService=i,this.eventUploadService=n,this.authService=s}collect(e,t=null,i=!1,n=null){return Yd(this,void 0,void 0,(function*(){const s=yield(0,pe.z)(this.stateProvider.activeUserId$),o=this.stateProvider.getUser(s,zd);if(!(yield this.shouldUpdate(t,n,e)))return;const r=new Jd;r.type=e,r.cipherId=t,r.date=(new Date).toISOString(),r.organizationId=n,yield o.update((e=>((e=null!=e?e:[]).push(r),e))),i&&(yield this.eventUploadService.uploadEvents())}))}shouldUpdate(e=null,t=null,i=null){return Yd(this,void 0,void 0,(function*(){const n=this.organizationService.organizations$.pipe((0,de.U)((e=>{var t,i;return null!==(i=null===(t=null==e?void 0:e.filter((e=>e.useEvents)))||void 0===t?void 0:t.map((e=>e.id)))&&void 0!==i?i:[]}))),s=(0,Fd.D)(this.cipherService.get(e)),[o,r,a]=yield(0,pe.z)((0,Rd.$)(this.authService.activeAccountStatus$,n,s));return o==Qt.y.Unlocked&&(null!=r&&0!=r.length&&(i==De.tw.User_ClientExportedVault||(null!=a||null!=t)&&(!(null!=a&&!r.includes(null==a?void 0:a.organizationId))&&!(null!=t&&!r.includes(t)))))}))}},deps:[Cp.u,he.X9,v.Mn,d.k,ut.e]},{provide:k.W,useClass:class{constructor(e,t){this.stateProvider=e,this.organizationService=t,this.activeUserPolicyState=this.stateProvider.getActive(We),this.activeUserPolicies$=this.activeUserPolicyState.state$.pipe((0,de.U)((e=>He(e)))),this.policies$=this.activeUserPolicies$}get$(e){const t=this.activeUserPolicies$.pipe((0,de.U)((t=>t.filter((t=>t.type===e)))));return(0,Ke.a)([t,this.organizationService.organizations$]).pipe((0,de.U)((([e,t])=>{var i,n;return null!==(n=null===(i=this.enforcedPolicyFilter(e,t))||void 0===i?void 0:i.at(0))&&void 0!==n?n:null})))}getAll$(e,t){const i=this.stateProvider.getUserState$(We,t).pipe((0,de.U)((e=>He(e))),(0,de.U)((t=>t.filter((t=>t.type===e)))));return(0,Ke.a)([i,this.organizationService.getAll$(t)]).pipe((0,de.U)((([e,t])=>this.enforcedPolicyFilter(e,t))))}getAll(e){return $e(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.policies$.pipe((0,de.U)((t=>t.filter((t=>t.type===e))))))}))}policyAppliesToActiveUser$(e){return this.get$(e).pipe((0,de.U)((e=>null!=e)))}policyAppliesToUser(e){return $e(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.policyAppliesToActiveUser$(e))}))}enforcedPolicyFilter(e,t){const i=Object.fromEntries(t.map((e=>[e.id,e])));return e.filter((e=>{const t=i[e.organizationId];return null==t||e.enabled&&t.status>=Qe.Dn.Accepted&&t.usePolicies&&!this.isExemptFromPolicy(e.type,t)}))}masterPasswordPolicyOptions$(e){return(e?(0,Be.of)(e):this.policies$).pipe((0,de.U)((e=>{let t=null;const i=e.filter((e=>e.type===Qe.Mi.MasterPassword));return null==i||0===i.length||i.forEach((e=>{e.enabled&&null!=e.data&&(null==t&&(t=new Ge.v),null!=e.data.minComplexity&&e.data.minComplexity>t.minComplexity&&(t.minComplexity=e.data.minComplexity),null!=e.data.minLength&&e.data.minLength>t.minLength&&(t.minLength=e.data.minLength),e.data.requireUpper&&(t.requireUpper=!0),e.data.requireLower&&(t.requireLower=!0),e.data.requireNumbers&&(t.requireNumbers=!0),e.data.requireSpecial&&(t.requireSpecial=!0),e.data.enforceOnLogin&&(t.enforceOnLogin=!0))})),t})))}evaluateMasterPassword(e,t,i){return null==i||!(i.minComplexity>0&&i.minComplexity>e)&&(!(i.minLength>0&&i.minLength>t.length)&&((!i.requireUpper||t.toLocaleLowerCase()!==t)&&((!i.requireLower||t.toLocaleUpperCase()!==t)&&(!(i.requireNumbers&&!/[0-9]/.test(t))&&!(i.requireSpecial&&!/[!@#$%\^&*]/g.test(t))))))}getResetPasswordPolicyOptions(e,t){var i,n,s;const o=new Ve;if(null==e||null==t)return[o,!1];const r=e.find((e=>e.organizationId===t&&e.type===Qe.Mi.ResetPassword&&e.enabled));return o.autoEnrollEnabled=null!==(n=null===(i=null==r?void 0:r.data)||void 0===i?void 0:i.autoEnrollEnabled)&&void 0!==n&&n,[o,null!==(s=null==r?void 0:r.enabled)&&void 0!==s&&s]}upsert(e){return $e(this,void 0,void 0,(function*(){yield this.activeUserPolicyState.update((t=>(null!=t||(t={}),t[e.id]=e,t)))}))}replace(e){return $e(this,void 0,void 0,(function*(){yield this.activeUserPolicyState.update((()=>e))}))}isExemptFromPolicy(e,t){switch(e){case Qe.Mi.MaximumVaultTimeout:return t.isOwner;case Qe.Mi.PasswordGenerator:return!1;default:return t.canManagePolicies}}},deps:[he.X9,v.Mn]},{provide:k.d,useExisting:k.W},{provide:O.P,useClass:class{constructor(e,t){this.policyService=e,this.apiService=t}getPolicy(e,t){return Ye(this,void 0,void 0,(function*(){const i=yield this.apiService.send("GET","/organizations/"+e+"/policies/"+t,null,!0,!0);return new ze.j(i)}))}getPolicies(e){return Ye(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/policies",null,!0,!0);return new oe.L(t,ze.j)}))}getPoliciesByToken(e,t,i,n){return Ye(this,void 0,void 0,(function*(){const s=yield this.apiService.send("GET","/organizations/"+e+"/policies/token?token="+encodeURIComponent(t)+"&email="+Fe.c.encodeRFC3986URIComponent(i)+"&organizationUserId="+n,null,!1,!0);return new oe.L(s,ze.j)}))}getMasterPasswordPolicyResponseForOrgUser(e){return Ye(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/policies/master-password",null,!0,!0);return new ze.j(t)}))}getMasterPasswordPolicyOptsForOrgUser(e){return Ye(this,void 0,void 0,(function*(){try{const t=yield this.getMasterPasswordPolicyResponseForOrgUser(e),i=Je.G.fromResponse(t);return i?yield(0,pe.z)(this.policyService.masterPasswordPolicyOptions$([i])):null}catch(t){if(t instanceof Ee.i&&t.statusCode===De.WE.NotFound)return null;throw t}}))}putPolicy(e,t,i){return Ye(this,void 0,void 0,(function*(){const n=yield this.apiService.send("PUT","/organizations/"+e+"/policies/"+t,i,!0,!0),s=new ze.j(n),o=new Re.n(s);yield this.policyService.upsert(o)}))}},deps:[k.W,l.s]},{provide:vt.R,useClass:class{constructor(e){this.stateProvider=e}masterKey$(e){if(null==e)throw new Error("User ID is required.");return this.stateProvider.getUser(e,Zi).state$}masterKeyHash$(e){if(null==e)throw new Error("User ID is required.");return this.stateProvider.getUser(e,xi).state$}forceSetPasswordReason$(e){if(null==e)throw new Error("User ID is required.");return this.stateProvider.getUser(e,Ti).state$.pipe((0,de.U)((e=>null!=e?e:_i.w.None)))}getMasterKeyEncryptedUserKey(e){return Ai(this,void 0,void 0,(function*(){if(null==e)throw new Error("User ID is required.");const t=yield(0,pe.z)(this.stateProvider.getUser(e,Si).state$);return li._.fromJSON(t)}))}setMasterKey(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e)throw new Error("Master key is required.");if(null==t)throw new Error("User ID is required.");yield this.stateProvider.getUser(t,Zi).update((t=>e))}))}clearMasterKey(e){return Ai(this,void 0,void 0,(function*(){if(null==e)throw new Error("User ID is required.");yield this.stateProvider.getUser(e,Zi).update((e=>null))}))}setMasterKeyHash(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e)throw new Error("Master key hash is required.");if(null==t)throw new Error("User ID is required.");yield this.stateProvider.getUser(t,xi).update((t=>e))}))}clearMasterKeyHash(e){return Ai(this,void 0,void 0,(function*(){if(null==e)throw new Error("User ID is required.");yield this.stateProvider.getUser(e,xi).update((e=>null))}))}setMasterKeyEncryptedUserKey(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e)throw new Error("Encrypted Key is required.");if(null==t)throw new Error("User ID is required.");yield this.stateProvider.getUser(t,Si).update((t=>e.toJSON()))}))}setForceSetPasswordReason(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e)throw new Error("Reason is required.");if(null==t)throw new Error("User ID is required.");yield this.stateProvider.getUser(t,Ti).update((t=>e))}))}},deps:[he.X9]},{provide:vt.j,useExisting:vt.R},{provide:mt.J,useClass:class{constructor(e,t,i,n,s,o,r,a,l,c){this.accountService=e,this.masterPasswordService=t,this.cryptoService=i,this.apiService=n,this.tokenService=s,this.logService=o,this.organizationService=r,this.keyGenerationService=a,this.logoutCallback=l,this.stateProvider=c,this.usesKeyConnectorState=this.stateProvider.getActive(bi),this.convertAccountToKeyConnectorState=this.stateProvider.getActive(Ui)}setUsesKeyConnector(e){return wi(this,void 0,void 0,(function*(){yield this.usesKeyConnectorState.update((()=>e))}))}getUsesKeyConnector(){return(0,pe.z)(this.usesKeyConnectorState.state$)}userNeedsMigration(){return wi(this,void 0,void 0,(function*(){const e=yield this.tokenService.getIsExternal(),t=null!=(yield this.getManagingOrganization()),i=!(yield this.getUsesKeyConnector());return e&&t&&i}))}migrateUser(){var e;return wi(this,void 0,void 0,(function*(){const t=yield this.getManagingOrganization(),i=null===(e=yield(0,pe.z)(this.accountService.activeAccount$))||void 0===e?void 0:e.id,n=yield(0,pe.z)(this.masterPasswordService.masterKey$(i)),s=new vi(n.encKeyB64);try{yield this.apiService.postUserKeyToKeyConnector(t.keyConnectorUrl,s)}catch(o){this.handleKeyConnectorError(o)}yield this.apiService.postConvertToKeyConnector()}))}setMasterKeyFromUrl(e,t){return wi(this,void 0,void 0,(function*(){try{const i=yield this.apiService.getMasterKeyFromKeyConnector(e),n=Fe.c.fromB64ToArray(i.key),s=new Wt.N(n);yield this.masterPasswordService.setMasterKey(s,t)}catch(i){this.handleKeyConnectorError(i)}}))}getManagingOrganization(){return wi(this,void 0,void 0,(function*(){return(yield this.organizationService.getAll()).find((e=>e.keyConnectorEnabled&&e.type!==Qe.je.Admin&&e.type!==Qe.je.Owner&&!e.isProviderUser))}))}convertNewSsoUserToKeyConnector(e,t,i){var n;return wi(this,void 0,void 0,(function*(){const{kdf:s,kdfIterations:o,kdfMemory:r,kdfParallelism:a,keyConnectorUrl:l,userDecryptionOptions:c}=e,u=yield this.keyGenerationService.createKey(512),d=s===pi.G3.PBKDF2_SHA256?new hi.S(o):new hi.H(o,r,a),p=yield this.cryptoService.makeMasterKey(u.keyB64,yield this.tokenService.getEmail(),d),h=new vi(p.encKeyB64);yield this.masterPasswordService.setMasterKey(p,i);const g=yield this.cryptoService.makeUserKey(p);yield this.cryptoService.setUserKey(g[0],i),yield this.cryptoService.setMasterKeyEncryptedUserKey(g[1].encryptedString,i);const[f,m]=yield this.cryptoService.makeKeyPair(g[0]);try{const e=null!=l?l:null===(n=null==c?void 0:c.keyConnectorOption)||void 0===n?void 0:n.keyConnectorUrl;yield this.apiService.postUserKeyToKeyConnector(e,h)}catch(w){this.handleKeyConnectorError(w)}const v=new mi.C(f,m.encryptedString),y=new yi(g[1].encryptedString,d,t,v);yield this.apiService.postSetKeyConnectorKey(y)}))}setConvertAccountRequired(e){return wi(this,void 0,void 0,(function*(){yield this.convertAccountToKeyConnectorState.update((()=>e))}))}getConvertAccountRequired(){return(0,pe.z)(this.convertAccountToKeyConnectorState.state$)}removeConvertAccountRequired(){return wi(this,void 0,void 0,(function*(){yield this.setConvertAccountRequired(null)}))}handleKeyConnectorError(e){throw this.logService.error(e),null!=this.logoutCallback&&this.logoutCallback(!1),new Error("Key Connector error")}},deps:[lt.BR,vt.R,Qn.$,l.s,bt.B,Wn.$,v.Mn,Hn,o.JN,he.X9]},{provide:At.i,useClass:class{constructor(e,t,i,n,s,o,r,a,l,c,u,d){this.stateService=e,this.cryptoService=t,this.accountService=i,this.masterPasswordService=n,this.i18nService=s,this.userVerificationApiService=o,this.userDecryptionOptionsService=r,this.pinCryptoService=a,this.logService=l,this.vaultTimeoutSettingsService=c,this.platformUtilsService=u,this.kdfConfigService=d}getAvailableVerificationOptions(e){return en(this,void 0,void 0,(function*(){if("client"===e){const[e,t,i,n]=yield Promise.all([this.hasMasterPasswordAndMasterKeyHash(),this.vaultTimeoutSettingsService.isPinLockSet(),this.vaultTimeoutSettingsService.isBiometricLockSet(),this.cryptoService.hasUserKeyStored(Hi.l.Biometric)]);return{client:{masterPassword:e,pin:"DISABLED"!==t,biometrics:i&&(n||!this.platformUtilsService.supportsSecureStorage())},server:{masterPassword:!1,otp:!1}}}{const e=yield this.hasMasterPassword();return{client:{masterPassword:!1,pin:!1,biometrics:!1},server:{masterPassword:e,otp:!e}}}}))}buildRequest(e,t,i){var n;return en(this,void 0,void 0,(function*(){this.validateSecretInput(e);const s=null!=t?new t:new Xt.Y;if(e.type===Wi.R.OTP)s.otp=e.secret;else{const t=null===(n=yield(0,pe.z)(this.accountService.activeAccount$))||void 0===n?void 0:n.id;let o=yield(0,pe.z)(this.masterPasswordService.masterKey$(t));o||i||(o=yield this.cryptoService.makeMasterKey(e.secret,yield this.stateService.getEmail(),yield this.kdfConfigService.getKdfConfig())),s.masterPasswordHash=i?e.secret:yield this.cryptoService.hashMasterKey(e.secret,o)}return s}))}verifyUser(e){return en(this,void 0,void 0,(function*(){switch(function(e){return"secret"in e}(e)&&this.validateSecretInput(e),e.type){case Wi.R.OTP:return this.verifyUserByOTP(e);case Wi.R.MasterPassword:return this.verifyUserByMasterPassword(e);case Wi.R.PIN:return this.verifyUserByPIN(e);case Wi.R.Biometrics:return this.verifyUserByBiometrics();default:return e}}))}verifyUserByOTP(e){return en(this,void 0,void 0,(function*(){const t=new Xi(e.secret);try{yield this.userVerificationApiService.postAccountVerifyOTP(t)}catch(i){throw new Error(this.i18nService.t("invalidVerificationCode"))}return!0}))}verifyUserByMasterPassword(e){var t;return en(this,void 0,void 0,(function*(){const i=null===(t=yield(0,pe.z)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;let n=yield(0,pe.z)(this.masterPasswordService.masterKey$(i));n||(n=yield this.cryptoService.makeMasterKey(e.secret,yield this.stateService.getEmail(),yield this.kdfConfigService.getKdfConfig()));if(!(yield this.cryptoService.compareAndUpdateKeyHash(e.secret,n)))throw new Error(this.i18nService.t("invalidMasterPassword"));return yield this.masterPasswordService.setMasterKey(n,i),!0}))}verifyUserByPIN(e){return en(this,void 0,void 0,(function*(){return null!=(yield this.pinCryptoService.decryptUserKeyWithPin(e.secret))}))}verifyUserByBiometrics(){return en(this,void 0,void 0,(function*(){let e;try{e=yield this.cryptoService.getUserKeyFromStorage(Hi.l.Biometric)}catch(t){return this.logService.error(`Biometrics User Verification failed: ${t.message}`),!1}return null!=e}))}requestOTP(){return en(this,void 0,void 0,(function*(){yield this.userVerificationApiService.postAccountRequestOTP()}))}hasMasterPassword(e){return en(this,void 0,void 0,(function*(){if(e){const t=yield(0,pe.z)(this.userDecryptionOptionsService.userDecryptionOptionsById$(e));if(null!=(null==t?void 0:t.hasMasterPassword))return t.hasMasterPassword}return yield(0,pe.z)(this.userDecryptionOptionsService.hasMasterPassword$)}))}hasMasterPasswordAndMasterKeyHash(e){var t;return en(this,void 0,void 0,(function*(){return null!=e||(e=null===(t=yield(0,pe.z)(this.accountService.activeAccount$))||void 0===t?void 0:t.id),(yield this.hasMasterPassword(e))&&null!=(yield(0,pe.z)(this.masterPasswordService.masterKeyHash$(e)))}))}validateSecretInput(e){if(null==(null==e?void 0:e.secret)||""===e.secret)switch(e.type){case Wi.R.OTP:throw new Error(this.i18nService.t("verificationCodeRequired"));case Wi.R.MasterPassword:throw new Error(this.i18nService.t("masterPasswordRequired"));case Wi.R.PIN:throw new Error(this.i18nService.t("pinRequired"))}}},deps:[ts.b,Qn.$,lt.BR,vt.R,$n.D,_t,a.Bb,a.Rv,Wn.$,g.E,es.P,ft.d]},{provide:v.eC,useClass:class{constructor(e){this.stateProvider=e,this.organizations$=this.getOrganizationsFromState$(),this.memberOrganizations$=this.organizations$.pipe((0,de.U)((e=>e.filter((e=>e.isMember))))),this.canManageSponsorships$=this.organizations$.pipe((0,de.U)((e=>e.filter((e=>e.canManageSponsorships)))),ye())}get$(e){return this.organizations$.pipe(we(e))}getAll$(e){return this.getOrganizationsFromState$(e)}getAll(e){return me(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.getOrganizationsFromState$(e))}))}hasOrganizations(){return me(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.organizations$.pipe(ye()))}))}upsert(e,t){return me(this,void 0,void 0,(function*(){yield this.stateFor(t).update((t=>{const i=null!=t?t:{};return i[e.id]=e,i}))}))}get(e){return me(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.organizations$.pipe(we(e)))}))}getFromState(e){return me(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.organizations$.pipe(we(e)))}))}replace(e,t){return me(this,void 0,void 0,(function*(){yield this.stateFor(t).update((()=>e))}))}getOrganizationsFromState$(e){return this.stateFor(e).state$.pipe(this.mapOrganizationRecordToArray())}mapOrganizationRecordToArray(){return(0,de.U)((e=>{var t;return null===(t=Object.values(null!=e?e:{}))||void 0===t?void 0:t.map((e=>new fe.c(e)))}))}stateFor(e){return e?this.stateProvider.getUser(e,ve):this.stateProvider.getActive(ve)}},deps:[he.X9]},{provide:v.Mn,useExisting:v.eC},{provide:C.t,useClass:class{constructor(e){this.apiService=e}getOrganizationUser(e,t,i){return Le(this,void 0,void 0,(function*(){const n=new URLSearchParams;(null==i?void 0:i.includeGroups)&&n.set("includeGroups","true");const s=yield this.apiService.send("GET",`/organizations/${e}/users/${t}?${n.toString()}`,null,!0,!0);return new Pe(s)}))}getOrganizationUserGroups(e,t){return Le(this,void 0,void 0,(function*(){return yield this.apiService.send("GET","/organizations/"+e+"/users/"+t+"/groups",null,!0,!0)}))}getAllUsers(e,t){return Le(this,void 0,void 0,(function*(){const i=new URLSearchParams;(null==t?void 0:t.includeCollections)&&i.set("includeCollections","true"),(null==t?void 0:t.includeGroups)&&i.set("includeGroups","true");const n=yield this.apiService.send("GET",`/organizations/${e}/users?${i.toString()}`,null,!0,!0);return new oe.L(n,ke)}))}getOrganizationUserResetPasswordDetails(e,t){return Le(this,void 0,void 0,(function*(){const i=yield this.apiService.send("GET","/organizations/"+e+"/users/"+t+"/reset-password-details",null,!0,!0);return new qe(i)}))}postOrganizationUserInvite(e,t){return this.apiService.send("POST","/organizations/"+e+"/users/invite",t,!0,!1)}postOrganizationUserReinvite(e,t){return this.apiService.send("POST","/organizations/"+e+"/users/"+t+"/reinvite",null,!0,!1)}postManyOrganizationUserReinvite(e,t){return Le(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/users/reinvite",new Ne(t),!0,!0);return new oe.L(i,Ie)}))}postOrganizationUserAcceptInit(e,t,i){return this.apiService.send("POST","/organizations/"+e+"/users/"+t+"/accept-init",i,!0,!1)}postOrganizationUserAccept(e,t,i){return this.apiService.send("POST","/organizations/"+e+"/users/"+t+"/accept",i,!0,!1)}postOrganizationUserConfirm(e,t,i){return this.apiService.send("POST","/organizations/"+e+"/users/"+t+"/confirm",i,!0,!1)}postOrganizationUsersPublicKey(e,t){return Le(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/users/public-keys",new Ne(t),!0,!0);return new oe.L(i,Me)}))}postOrganizationUserBulkConfirm(e,t){return Le(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/users/confirm",t,!0,!0);return new oe.L(i,Ie)}))}putOrganizationUserBulkEnableSecretsManager(e,t){return Le(this,void 0,void 0,(function*(){yield this.apiService.send("PUT","/organizations/"+e+"/users/enable-secrets-manager",new Ne(t),!0,!1)}))}putOrganizationUser(e,t,i){return this.apiService.send("PUT","/organizations/"+e+"/users/"+t,i,!0,!1)}putOrganizationUserResetPasswordEnrollment(e,t,i){return this.apiService.send("PUT","/organizations/"+e+"/users/"+t+"/reset-password-enrollment",i,!0,!1)}putOrganizationUserResetPassword(e,t,i){return this.apiService.send("PUT","/organizations/"+e+"/users/"+t+"/reset-password",i,!0,!1)}deleteOrganizationUser(e,t){return this.apiService.send("DELETE","/organizations/"+e+"/users/"+t,null,!0,!1)}deleteManyOrganizationUsers(e,t){return Le(this,void 0,void 0,(function*(){const i=yield this.apiService.send("DELETE","/organizations/"+e+"/users",new Ne(t),!0,!0);return new oe.L(i,Ie)}))}revokeOrganizationUser(e,t){return this.apiService.send("PUT","/organizations/"+e+"/users/"+t+"/revoke",null,!0,!1)}revokeManyOrganizationUsers(e,t){return Le(this,void 0,void 0,(function*(){const i=yield this.apiService.send("PUT","/organizations/"+e+"/users/revoke",new Ne(t),!0,!0);return new oe.L(i,Ie)}))}restoreOrganizationUser(e,t){return this.apiService.send("PUT","/organizations/"+e+"/users/"+t+"/restore",null,!0,!1)}restoreManyOrganizationUsers(e,t){return Le(this,void 0,void 0,(function*(){const i=yield this.apiService.send("PUT","/organizations/"+e+"/users/restore",new Ne(t),!0,!0);return new oe.L(i,Ie)}))}},deps:[l.s]},{provide:yt.U,useClass:class{constructor(e,t,i,n,s){this.organizationApiService=e,this.accountService=t,this.cryptoService=i,this.organizationUserService=n,this.i18nService=s}enrollIfRequired(e){return Oi(this,void 0,void 0,(function*(){const t=yield this.organizationApiService.getAutoEnrollStatus(e);t.resetPasswordEnabled||(yield this.enroll(t.id,null,null))}))}enroll(e,t,i){return Oi(this,void 0,void 0,(function*(){const n=yield this.organizationApiService.getKeys(e);if(null==n)throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));const s=Fe.c.fromB64ToArray(n.publicKey);t=null!=t?t:yield(0,pe.z)(this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id)))),i=null!=i?i:yield this.cryptoService.getUserKey(t);const o=yield this.cryptoService.rsaEncrypt(i.key,s),r=new Ci.w;r.resetPasswordKey=o.encryptedString,yield this.organizationUserService.putOrganizationUserResetPasswordEnrollment(e,t,r)}))}},deps:[m.M,lt.BR,Qn.$,C.t,$n.D]},{provide:q.H,useClass:class{constructor(e){this.stateProvider=e}providers$(e){return(null!=e?this.stateProvider.getUser(e,ot).state$:this.stateProvider.activeUserId$.pipe((0,tt.q)(1),(0,it.w)((e=>null!=e?this.stateProvider.getUser(e,ot).state$:(0,Be.of)(null))))).pipe(this.mapProviderRecordToArray())}mapProviderRecordToArray(){return(0,de.U)((e=>{var t;return null===(t=Object.values(null!=e?e:{}))||void 0===t?void 0:t.map((e=>new nt(e)))}))}get$(e){return this.providers$().pipe(rt(e))}get(e){return st(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.providers$().pipe(rt(e)))}))}getAll(){return st(this,void 0,void 0,(function*(){return yield(0,pe.z)(this.providers$())}))}save(e,t){return st(this,void 0,void 0,(function*(){yield this.stateProvider.setUserState(ot,e,t)}))}},deps:[he.X9]},{provide:Ut.S,useClass:Vi.Sz,deps:[$n.D,es.P,he.MC]},{provide:Vh.q,useClass:class{getFormValidationErrors(e){let t=[];return Object.keys(e).forEach((i=>{const n=e[i];n instanceof $h.nJ&&(t=t.concat(this.getFormValidationErrors(n.controls)));const s=e[i].errors;null!==s&&Object.keys(s).forEach((e=>{t.push({controlName:i,errorName:e})}))})),t}},deps:[]},{provide:_t,useClass:class{constructor(e){this.apiService=e}postAccountVerifyOTP(e){return this.apiService.send("POST","/accounts/verify-otp",e,!0,!1)}postAccountRequestOTP(){return $i(this,void 0,void 0,(function*(){return this.apiService.send("POST","/accounts/request-otp",null,!0,!1)}))}},deps:[l.s]},{provide:m.M,useClass:class{constructor(e,t){this.apiService=e,this.syncService=t}get(e){return ue(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e,null,!0,!0);return new B(t)}))}getBilling(e){return ue(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing",null,!0,!0);return new E(t)}))}getSubscription(e){return ue(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/subscription",null,!0,!0);return new $(t)}))}getLicense(e,t){return ue(this,void 0,void 0,(function*(){return this.apiService.send("GET","/organizations/"+e+"/license?installationId="+t,null,!0,!0)}))}getAutoEnrollStatus(e){return ue(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/auto-enroll-status",null,!0,!0);return new ae(t)}))}create(e){return ue(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/organizations",e,!0,!0);return yield this.syncService.fullSync(!0),new B(t)}))}createLicense(e){return ue(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/organizations/licenses/self-hosted",e,!0,!0);return new B(t)}))}save(e,t){return ue(this,void 0,void 0,(function*(){const i=yield this.apiService.send("PUT","/organizations/"+e,t,!0,!0),n=new B(i);return yield this.syncService.fullSync(!0),n}))}updatePayment(e,t){return ue(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/payment",t,!0,!1)}))}upgrade(e,t){return ue(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/upgrade",t,!0,!0);return new ne(i)}))}updatePasswordManagerSeats(e,t){return ue(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/subscription",t,!0,!1)}))}updateSecretsManagerSubscription(e,t){return ue(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/sm-subscription",t,!0,!1)}))}updateSeats(e,t){return ue(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/seat",t,!0,!0);return new ne(i)}))}updateStorage(e,t){return ue(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/storage",t,!0,!0);return new ne(i)}))}verifyBank(e,t){return ue(this,void 0,void 0,(function*(){yield this.apiService.send("POST","/organizations/"+e+"/verify-bank",t,!0,!1)}))}reinstate(e){return ue(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/reinstate",null,!0,!1)}))}leave(e){return ue(this,void 0,void 0,(function*(){yield this.apiService.send("POST","/organizations/"+e+"/leave",null,!0,!1),yield this.syncService.fullSync(!0)}))}delete(e,t){return ue(this,void 0,void 0,(function*(){yield this.apiService.send("DELETE","/organizations/"+e,t,!0,!1),yield this.syncService.fullSync(!0)}))}updateLicense(e,t){return ue(this,void 0,void 0,(function*(){yield this.apiService.send("POST","/organizations/licenses/self-hosted/"+e,t,!0,!1)}))}importDirectory(e,t){return ue(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/import",t,!0,!1)}))}getOrCreateApiKey(e,t){return ue(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/api-key",t,!0,!0);return new M(i)}))}getApiKeyInformation(e,t=null){return ue(this,void 0,void 0,(function*(){const i=null===t?"/organizations/"+e+"/api-key-information":"/organizations/"+e+"/api-key-information/"+t,n=yield this.apiService.send("GET",i,null,!0,!0);return new oe.L(n,re)}))}rotateApiKey(e,t){return ue(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/rotate-api-key",t,!0,!0);return new M(i)}))}getTaxInfo(e){return ue(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/tax",null,!0,!0);return new se(t)}))}updateTaxInfo(e,t){return ue(this,void 0,void 0,(function*(){return this.apiService.send("PUT","/organizations/"+e+"/tax",t,!0,!1)}))}getKeys(e){return ue(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/keys",null,!0,!0);return new ce(t)}))}updateKeys(e,t){return ue(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/keys",t,!0,!0);return new ce(i)}))}getSso(e){return ue(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/sso",null,!0,!0);return new L(t)}))}updateSso(e,t){return ue(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/sso",t,!0,!0);return new L(i)}))}selfHostedSyncLicense(e){return ue(this,void 0,void 0,(function*(){yield this.apiService.send("POST","/organizations/licenses/self-hosted/"+e+"/sync/",null,!0,!1)}))}subscribeToSecretsManager(e,t){return ue(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/subscribe-secrets-manager",t,!0,!0);return new X(i)}))}updateCollectionManagement(e,t){return ue(this,void 0,void 0,(function*(){const i=yield this.apiService.send("PUT","/organizations/"+e+"/collection-management",t,!0,!0),n=new B(i);return yield this.syncService.fullSync(!0),n}))}enableCollectionEnhancements(e){return ue(this,void 0,void 0,(function*(){yield this.apiService.send("POST","/organizations/"+e+"/enable-collection-enhancements",null,!0,!1),yield this.syncService.fullSync(!0)}))}},deps:[l.s,Ip._]},{provide:class{},useClass:class{constructor(){this._sync=new r.x,this.sync$=this._sync.asObservable()}next(e){this._sync.next(e)}},deps:[]},{provide:Ds,useClass:Ds,deps:[Yn,jn.L,Wn.$,he.X9]},{provide:Kn.E,useExisting:Ds},{provide:Yn,useClass:class{constructor(e,t){this.apiService=e,this.tokenService=t}get(e){return xs(this,void 0,void 0,(function*(){const t=null!=e&&null!=(yield this.tokenService.getAccessToken(e)),i=yield this.apiService.send("GET","/config",null,t,!0);return new _s(i)}))}},deps:[l.s,bt.B]},{provide:ct.r,useClass:class{constructor(e,t){this.environmentService=e,this.authRequestService=t}createHubConnection(e){return Bt(this,void 0,void 0,(function*(){this.url=(yield(0,pe.z)(this.environmentService.environment$)).getNotificationsUrl(),this.anonHubConnection=(new Lt.s).withUrl(this.url+"/anonymous-hub?Token="+e,{skipNegotiation:!0,transport:Dt.n.WebSockets}).withHubProtocol(new Et.e).build(),yield this.anonHubConnection.start(),this.anonHubConnection.on("AuthRequestResponseRecieved",(e=>{this.ProcessNotification(new Ft(e))}))}))}stopHubConnection(){return Bt(this,void 0,void 0,(function*(){this.anonHubConnection&&(yield this.anonHubConnection.stop())}))}ProcessNotification(e){if(e.type===De.k$.AuthRequestResponse)this.authRequestService.sendAuthRequestPushNotification(e.payload)}},deps:[jn.L,a.JD]},{provide:ss.R,useClass:class{constructor(e,t){this.i18nService=e,this.platformUtilsService=t}showError(e){const t=this.i18nService.t("unexpectedError");let i=[];return null!=e&&"string"==typeof e?i.push(e):null==e||"object"!=typeof e?i.push(t):null!=e.validationErrors?i=i.concat(e.getAllMessages()):i.push(e.message?e.message:t),1===i.length?this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),i[0]):i.length>1&&this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),i,{timeout:5e3*i.length}),i}},deps:[$n.D,es.P]},{provide:a.rh,useClass:a.pS,deps:[he.X9]},{provide:b,useClass:class{constructor(e,t){this.platformUtilsService=e,this.i18nService=t,this._orgDomains$=new Ze.X([]),this.orgDomains$=this._orgDomains$.asObservable()}get(e){return this._orgDomains$.getValue().find((t=>t.id===e))}copyDnsTxt(e){this.platformUtilsService.copyToClipboard(e),this.platformUtilsService.showToast("success",null,this.i18nService.t("valueCopied",this.i18nService.t("dnsTxtRecord")))}upsert(e){const t=this._orgDomains$.getValue();e.forEach((e=>{const i=t.findIndex((t=>t.id===e.id));-1!==i?t[i]=e:t.push(e)})),this._orgDomains$.next(t)}replace(e){this._orgDomains$.next(e)}clearCache(){this._orgDomains$.next([])}delete(e){const t=this._orgDomains$.getValue();e.forEach((e=>{const i=t.findIndex((t=>t.id===e));-1!==i&&t.splice(i,1)})),this._orgDomains$.next(t)}},deps:[es.P,$n.D]},{provide:w,useExisting:b},{provide:y.T,useClass:class{constructor(e,t){this.orgDomainService=e,this.apiService=t}getAllByOrgId(e){return Ae(this,void 0,void 0,(function*(){const t=(yield this.apiService.send("GET",`/organizations/${e}/domain`,null,!0,!0)).data.map((e=>new Ue(e)));return this.orgDomainService.replace(t),t}))}getByOrgIdAndOrgDomainId(e,t){return Ae(this,void 0,void 0,(function*(){const i=yield this.apiService.send("GET",`/organizations/${e}/domain/${t}`,null,!0,!0),n=new Ue(i);return this.orgDomainService.upsert([n]),n}))}post(e,t){return Ae(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST",`/organizations/${e}/domain`,t,!0,!0),n=new Ue(i);return this.orgDomainService.upsert([n]),n}))}verify(e,t){return Ae(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST",`/organizations/${e}/domain/${t}/verify`,null,!0,!0),n=new Ue(i);return this.orgDomainService.upsert([n]),n}))}delete(e,t){return Ae(this,void 0,void 0,(function*(){yield this.apiService.send("DELETE",`/organizations/${e}/domain/${t}`,null,!0,!1),this.orgDomainService.delete([t])}))}getClaimedOrgDomainByEmail(e){return Ae(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/organizations/domain/sso/details",new _e(e),!1,!0);return new be(t)}))}},deps:[b,l.s]},{provide:gt.c,useClass:class{constructor(e){this.apiService=e}getKnownDevice(e,t){return di(this,void 0,void 0,(function*(){return yield this.apiService.send("GET","/devices/knowndevice",null,!1,!0,null,(i=>{i.set("X-Device-Identifier",t),i.set("X-Request-Email",Fe.c.fromUtf8ToUrlB64(e))}))}))}getDeviceByIdentifier(e){return di(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET",`/devices/identifier/${e}`,null,!0,!0);return new ai(t)}))}getDevices(){return di(this,void 0,void 0,(function*(){const e=yield this.apiService.send("GET","/devices",null,!0,!0,null);return new oe.L(e,ai)}))}updateTrustedDeviceKeys(e,t,i,n){return di(this,void 0,void 0,(function*(){const s=new ui(t,i,n),o=yield this.apiService.send("PUT",`/devices/${e}/keys`,s,!0,!0);return new ai(o)}))}updateTrust(e,t){return di(this,void 0,void 0,(function*(){yield this.apiService.send("POST","/devices/update-trust",e,!0,!1,null,(e=>{e.set("Device-Identifier",t)}))}))}getDeviceKeys(e,t){return di(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST",`/devices/${e}/retrieve-keys`,t,!0,!0);return new ci(i)}))}},deps:[l.s]},{provide:ht.m,useClass:class{constructor(e){this.devicesApiService=e}getDevices$(){return(0,oi.P)((()=>this.devicesApiService.getDevices())).pipe((0,de.U)((e=>e.data.map((e=>new ri(e))))))}getDeviceByIdentifier$(e){return(0,oi.P)((()=>this.devicesApiService.getDeviceByIdentifier(e))).pipe((0,de.U)((e=>new ri(e))))}isDeviceKnownForUser$(e,t){return(0,oi.P)((()=>this.devicesApiService.getKnownDevice(e,t)))}updateTrustedDeviceKeys$(e,t,i,n){return(0,oi.P)((()=>this.devicesApiService.updateTrustedDeviceKeys(e,t,i,n))).pipe((0,de.U)((e=>new ri(e))))}},deps:[gt.c]},{provide:pt.U,useClass:class{constructor(e,t,i,n,s,o,r,a,l,c,u,d){this.keyGenerationService=e,this.cryptoFunctionService=t,this.cryptoService=i,this.encryptService=n,this.appIdService=s,this.devicesApiService=o,this.i18nService=r,this.platformUtilsService=a,this.stateProvider=l,this.secureStorageService=c,this.userDecryptionOptionsService=u,this.logService=d,this.platformSupportsSecureStorage=this.platformUtilsService.supportsSecureStorage(),this.deviceKeySecureStorageKey="_deviceKey",this.supportsDeviceTrust$=this.userDecryptionOptionsService.userDecryptionOptions$.pipe((0,de.U)((e=>{var t;return null!==(t=null!=(null==e?void 0:e.trustedDeviceOption))&&void 0!==t&&t})))}getShouldTrustDevice(e){return ii(this,void 0,void 0,(function*(){if(!e)throw new Error("UserId is required. Cannot get should trust device.");return yield(0,pe.z)(this.stateProvider.getUserState$(si,e))}))}setShouldTrustDevice(e,t){return ii(this,void 0,void 0,(function*(){if(!e)throw new Error("UserId is required. Cannot set should trust device.");yield this.stateProvider.setUserState(si,t,e)}))}trustDeviceIfRequired(e){return ii(this,void 0,void 0,(function*(){if(!e)throw new Error("UserId is required. Cannot trust device if required.");(yield this.getShouldTrustDevice(e))&&(yield this.trustDevice(e),yield this.setShouldTrustDevice(e,!1))}))}trustDevice(e){return ii(this,void 0,void 0,(function*(){if(!e)throw new Error("UserId is required. Cannot trust device.");const t=yield this.cryptoService.getUserKey(e);if(!t)throw new Error("User symmetric key not found");const i=yield this.makeDeviceKey(),[n,s]=yield this.cryptoFunctionService.rsaGenerateKeyPair(2048),[o,r,a]=yield Promise.all([this.cryptoService.rsaEncrypt(t.key,n),this.encryptService.encrypt(n,t),this.encryptService.encrypt(s,i)]),l=yield this.appIdService.getAppId(),c=yield this.devicesApiService.updateTrustedDeviceKeys(l,o.encryptedString,r.encryptedString,a.encryptedString);return yield this.setDeviceKey(e,i),this.platformUtilsService.showToast("success",null,this.i18nService.t("deviceTrusted")),c}))}rotateDevicesTrust(e,t,i){return ii(this,void 0,void 0,(function*(){if(!e)throw new Error("UserId is required. Cannot rotate device's trust.");if(null==(yield this.getDeviceKey(e)))return;const n=yield(0,pe.z)(this.cryptoService.activeUserKey$),s=yield this.appIdService.getAppId(),o=new Xt.Y;o.masterPasswordHash=i;const r=yield this.devicesApiService.getDeviceKeys(s,o),a=yield this.encryptService.decryptToBytes(r.encryptedPublicKey,n),l=yield this.cryptoService.rsaEncrypt(t.key,a),c=yield this.encryptService.encrypt(a,t),u=new ti;u.encryptedUserKey=l.encryptedString,u.encryptedPublicKey=c.encryptedString;const d=new ei;d.masterPasswordHash=i,d.currentDevice=u,d.otherDevices=[],yield this.devicesApiService.updateTrust(d,s)}))}getDeviceKey(e){return ii(this,void 0,void 0,(function*(){if(!e)throw new Error("UserId is required. Cannot get device key.");try{if(this.platformSupportsSecureStorage){const t=yield this.secureStorageService.get(`${e}${this.deviceKeySecureStorageKey}`,this.getSecureStorageOptions(e));return Wt.N.fromJSON(t)}return yield(0,pe.z)(this.stateProvider.getUserState$(ni,e))}catch(t){this.logService.error("Failed to get device key",t)}}))}setDeviceKey(e,t){return ii(this,void 0,void 0,(function*(){if(!e)throw new Error("UserId is required. Cannot set device key.");try{if(this.platformSupportsSecureStorage)return void(yield this.secureStorageService.save(`${e}${this.deviceKeySecureStorageKey}`,t,this.getSecureStorageOptions(e)));yield this.stateProvider.setUserState(ni,null==t?void 0:t.toJSON(),e)}catch(i){this.logService.error("Failed to set device key",i)}}))}makeDeviceKey(){return ii(this,void 0,void 0,(function*(){return yield this.keyGenerationService.createKey(512)}))}decryptUserKeyWithDeviceKey(e,t,i,n){return ii(this,void 0,void 0,(function*(){if(!e)throw new Error("UserId is required. Cannot decrypt user key with device key.");if(!n)return null;try{const e=yield this.encryptService.decryptToBytes(t,n),s=yield this.cryptoService.rsaDecrypt(i.encryptedString,e);return new Wt.N(s)}catch(s){return this.logService.error("Failed to decrypt using device key. Removing device key."),yield this.setDeviceKey(e,null),null}}))}getSecureStorageOptions(e){return{storageLocation:Ht.Ac.Disk,useSecureStorage:!0,userId:e}}},deps:[Hn,Bn.O,Qn.$,Gn.U,Jn.s,gt.c,$n.D,es.P,he.X9,o.cy,a.Bb,Wn.$]},{provide:a.JD,useClass:a.x8,deps:[Jn.s,lt.BR,vt.R,Qn.$,l.s,he.X9]},{provide:a.Rv,useClass:a.uZ,deps:[ts.b,Qn.$,g.E,Wn.$,ft.d]},{provide:xt.Z,useClass:class{constructor(e){this.cryptoFunctionService=e}getLoginWithPrfSalt(){return sn(this,void 0,void 0,(function*(){return yield this.cryptoFunctionService.hash("passwordless-login","sha256")}))}createSymmetricKeyFromPrf(e){return sn(this,void 0,void 0,(function*(){return yield this.stretchKey(new Uint8Array(e))}))}stretchKey(e){return sn(this,void 0,void 0,(function*(){const t=new Uint8Array(64),i=yield this.cryptoFunctionService.hkdfExpand(e,"enc",32,"sha256"),n=yield this.cryptoFunctionService.hkdfExpand(e,"mac",32,"sha256");return t.set(new Uint8Array(i)),t.set(new Uint8Array(n),32),new Wt.N(t)}))}},deps:[Bn.O]},{provide:Zt,useClass:class{constructor(e,t){this.apiService=e,this.environmentService=t}getCredentialAssertionOptions(){return nn(this,void 0,void 0,(function*(){const e=yield(0,pe.z)(this.environmentService.environment$),t=yield this.apiService.send("GET","/accounts/webauthn/assertion-options",null,!1,!0,e.getIdentityUrl());return new tn.D(t)}))}},deps:[l.s,jn.L]},{provide:St.V,useClass:class{constructor(e,t,i,n,s){this.webAuthnLoginApiService=e,this.loginStrategyService=t,this.webAuthnLoginPrfCryptoService=i,this.window=n,this.logService=s,this.navigatorCredentials=this.window.navigator.credentials}getCredentialAssertionOptions(){return ln(this,void 0,void 0,(function*(){const e=yield this.webAuthnLoginApiService.getCredentialAssertionOptions();return new on.s(e.options,e.token)}))}assertCredential(e){var t,i,n;return ln(this,void 0,void 0,(function*(){const s={publicKey:e.options};s.publicKey.extensions={prf:{eval:{first:yield this.webAuthnLoginPrfCryptoService.getLoginWithPrfSalt()}}};try{const n=yield this.navigatorCredentials.get(s);if(!(n instanceof PublicKeyCredential))return;const o=null===(i=null===(t=n.getClientExtensionResults().prf)||void 0===t?void 0:t.results)||void 0===i?void 0:i.first;let r;null!=o&&(r=yield this.webAuthnLoginPrfCryptoService.createSymmetricKeyFromPrf(o));const a=new an.J(n);if("prf"in a.extensions)throw new Error("PRF information is not allowed to be sent to the server.");return new rn(e.token,a,r)}catch(o){return void(null===(n=this.logService)||void 0===n||n.error(o))}}))}logIn(e){return ln(this,void 0,void 0,(function*(){const t=new a.iU(e.token,e.deviceResponse,e.prfKey);return yield this.loginStrategyService.logIn(t)}))}},deps:[Zt,a.m,xt.Z,o.m9,Wn.$]},{provide:lu,useClass:lu,deps:[o.jo,o.lF]},{provide:Du.MJ,useClass:Du.MJ,deps:[he.MC,lu]},{provide:Eu.q,useClass:Eu.q,deps:[he.MC,lu]},{provide:he.MC,useClass:class{constructor(e){this.storageServiceProvider=e,this.globalStateCache={}}get(e){const[t,i]=this.storageServiceProvider.get(e.stateDefinition.defaultStorageLocation,e.stateDefinition.storageLocationOverrides),n=this.buildCacheKey(t,e),s=this.globalStateCache[n];if(null!=s)return s;const o=new Iu(e,i);return this.globalStateCache[n]=o,o}buildCacheKey(e,t){return`${e}_${t.fullName}`}},deps:[lu]},{provide:he.vA,useClass:class{constructor(e,t){this.accountService=e,this.singleUserStateProvider=t,this.activeUserId$=this.accountService.activeAccount$.pipe((0,de.U)((e=>null==e?void 0:e.id)),(0,Ot.x)(((e,t)=>null==e||null==t?e==t:e===t)))}get(e){return(0,fu.u)(e)||(e=fu.f.fromBaseKeyDefinition(e)),new wu(e,this.activeUserId$,this.singleUserStateProvider)}},deps:[lt.BR,he.jC]},{provide:he.jC,useClass:class{constructor(e,t){this.storageServiceProvider=e,this.stateEventRegistrarService=t,this.cache={}}get(e,t){(0,fu.u)(t)||(t=fu.f.fromBaseKeyDefinition(t));const[i,n]=this.storageServiceProvider.get(t.stateDefinition.defaultStorageLocation,t.stateDefinition.storageLocationOverrides),s=this.buildCacheKey(i,e,t),o=this.cache[s];if(null!=o)return o;const r=new Nu(e,t,n,this.stateEventRegistrarService);return this.cache[s]=r,r}buildCacheKey(e,t,i){return`${e}_${i.fullName}_${t}`}},deps:[lu,Du.MJ]},{provide:he.DC,useClass:class{constructor(){this.cache={}}get(e,t,i){const n=t.buildCacheKey(),s=this.cache[n];if(null!=s)return s;const o=this.buildDerivedState(e,t,i);return this.cache[n]=o,o}buildDerivedState(e,t,i){return new Su(e,t,i)}},deps:[]},{provide:he.X9,useClass:class{constructor(e,t,i,n){this.activeUserStateProvider=e,this.singleUserStateProvider=t,this.globalStateProvider=i,this.derivedStateProvider=n,this.getActive=this.activeUserStateProvider.get.bind(this.activeUserStateProvider),this.getUser=this.singleUserStateProvider.get.bind(this.singleUserStateProvider),this.getGlobal=this.globalStateProvider.get.bind(this.globalStateProvider),this.getDerived=this.derivedStateProvider.get.bind(this.derivedStateProvider),this.activeUserId$=this.activeUserStateProvider.activeUserId$}getUserState$(e,t){return t?this.getUser(t,e).state$:this.activeUserId$.pipe((0,cs.h)((e=>null!=e)),(0,tt.q)(1),(0,it.w)((t=>this.getUser(t,e).state$)))}getUserStateOrDefault$(e,t){const{userId:i,defaultValue:n=null}=t;return i?this.getUser(i,e).state$:this.activeUserId$.pipe((0,tt.q)(1),(0,it.w)((t=>null!=t?this.getUser(t,e).state$:(0,Be.of)(n))))}setUserState(e,t,i){return Lu(this,void 0,void 0,(function*(){return i?[i,yield this.getUser(i,e).update((()=>t))]:yield this.getActive(e).update((()=>t))}))}},deps:[he.vA,he.jC,he.MC,he.DC]},{provide:Sn.c,useClass:class{constructor(e,t,i,n,s,o){this.apiService=e,this.cryptoService=t,this.encryptService=i,this.i18nService=n,this.organizationApiService=s,this.syncService=o}purchaseSubscription(e){return En(this,void 0,void 0,(function*(){const t=new Nn.a,i=yield this.makeOrganizationKeys();this.setOrganizationKeys(t,i),this.setOrganizationInformation(t,e.organization),this.setPlanInformation(t,e.plan),this.setPaymentInformation(t,e.payment);const n=yield this.organizationApiService.create(t);return yield this.apiService.refreshIdentityToken(),yield this.syncService.fullSync(!0),n}))}startFree(e){return En(this,void 0,void 0,(function*(){const t=new Nn.a,i=yield this.makeOrganizationKeys();this.setOrganizationKeys(t,i),this.setOrganizationInformation(t,e.organization),this.setPlanInformation(t,e.plan);const n=yield this.organizationApiService.create(t);return yield this.apiService.refreshIdentityToken(),yield this.syncService.fullSync(!0),n}))}makeOrganizationKeys(){return En(this,void 0,void 0,(function*(){const[e,t]=yield this.cryptoService.makeOrgKey(),[i,n]=yield this.cryptoService.makeKeyPair(t);return{encryptedKey:e,publicKey:i,encryptedPrivateKey:n,encryptedCollectionName:yield this.encryptService.encrypt(this.i18nService.t("defaultCollection"),t)}}))}prohibitsAdditionalSeats(e){switch(e){case Dn.k9.Free:case Dn.k9.FamiliesAnnually:case Dn.k9.FamiliesAnnually2019:case Dn.k9.TeamsStarter2023:case Dn.k9.TeamsStarter:return!0;default:return!1}}setOrganizationInformation(e,t){e.name=t.name,e.businessName=t.businessName,e.billingEmail=t.billingEmail,e.initiationPath=t.initiationPath}setOrganizationKeys(e,t){e.key=t.encryptedKey.encryptedString,e.keys=new Ln.u(t.publicKey,t.encryptedPrivateKey.encryptedString),e.collectionName=t.encryptedCollectionName.encryptedString}setPaymentInformation(e,t){const[i,n]=t.paymentMethod;e.paymentToken=i,e.paymentMethodType=n;const s=t.billing;e.billingAddressPostalCode=s.postalCode,e.billingAddressCountry=s.country,s.taxId&&(e.taxIdNumber=s.taxId,e.billingAddressLine1=s.addressLine1,e.billingAddressLine2=s.addressLine2,e.billingAddressCity=s.city,e.billingAddressState=s.state)}setPlanInformation(e,t){if(e.planType=t.type,this.prohibitsAdditionalSeats(e.planType))return e.useSecretsManager=t.subscribeToSecretsManager,void(e.isFromSecretsManagerTrial=t.isFromSecretsManagerTrial);e.additionalSeats=t.passwordManagerSeats,t.subscribeToSecretsManager&&(e.useSecretsManager=!0,e.isFromSecretsManagerTrial=t.isFromSecretsManagerTrial,e.additionalSmSeats=t.secretsManagerSeats,e.additionalServiceAccounts=t.secretsManagerServiceAccounts),t.storage&&(e.additionalStorageGb=t.storage)}},deps:[l.s,Qn.$,Gn.U,$n.D,m.M,Ip._]},{provide:bn,useClass:class{constructor(e,t){this.stateProvider=e,this.policyService=t,this.autofillOnPageLoadState=this.stateProvider.getActive(pn),this.autofillOnPageLoad$=this.autofillOnPageLoadState.state$.pipe((0,de.U)((e=>null!=e&&e))),this.autofillOnPageLoadDefaultState=this.stateProvider.getActive(hn),this.autofillOnPageLoadDefault$=this.autofillOnPageLoadDefaultState.state$.pipe((0,de.U)((e=>null==e||e))),this.autofillOnPageLoadCalloutIsDismissedState=this.stateProvider.getActive(gn),this.autofillOnPageLoadCalloutIsDismissed$=this.autofillOnPageLoadCalloutIsDismissedState.state$.pipe((0,de.U)((e=>null!=e&&e))),this.activateAutofillOnPageLoadFromPolicy$=this.policyService.policyAppliesToActiveUser$(Qe.Mi.ActivateAutofill),this.autofillOnPageLoadPolicyToastHasDisplayedState=this.stateProvider.getActive(fn),this.autofillOnPageLoadPolicyToastHasDisplayed$=this.autofillOnPageLoadState.state$.pipe((0,de.U)((e=>null!=e&&e))),this.autoCopyTotpState=this.stateProvider.getActive(mn),this.autoCopyTotp$=this.autoCopyTotpState.state$.pipe((0,de.U)((e=>null==e||e))),this.inlineMenuVisibilityState=this.stateProvider.getGlobal(vn),this.inlineMenuVisibility$=this.inlineMenuVisibilityState.state$.pipe((0,de.U)((e=>null!=e?e:un))),this.enableContextMenuState=this.stateProvider.getGlobal(yn),this.enableContextMenu$=this.enableContextMenuState.state$.pipe((0,de.U)((e=>null==e||e))),this.clearClipboardDelayState=this.stateProvider.getActive(wn),this.clearClipboardDelay$=this.clearClipboardDelayState.state$.pipe((0,de.U)((e=>null!=e?e:cn)))}setAutofillOnPageLoad(e){return dn(this,void 0,void 0,(function*(){yield this.autofillOnPageLoadState.update((()=>e))}))}setAutofillOnPageLoadDefault(e){return dn(this,void 0,void 0,(function*(){yield this.autofillOnPageLoadDefaultState.update((()=>e))}))}setAutofillOnPageLoadCalloutIsDismissed(e){return dn(this,void 0,void 0,(function*(){yield this.autofillOnPageLoadCalloutIsDismissedState.update((()=>e))}))}setAutofillOnPageLoadPolicyToastHasDisplayed(e){return dn(this,void 0,void 0,(function*(){yield this.autofillOnPageLoadPolicyToastHasDisplayedState.update((()=>e))}))}setAutoCopyTotp(e){return dn(this,void 0,void 0,(function*(){yield this.autoCopyTotpState.update((()=>e))}))}setInlineMenuVisibility(e){return dn(this,void 0,void 0,(function*(){yield this.inlineMenuVisibilityState.update((()=>e))}))}setEnableContextMenu(e){return dn(this,void 0,void 0,(function*(){yield this.enableContextMenuState.update((()=>e))}))}setClearClipboardDelay(e){return dn(this,void 0,void 0,(function*(){yield this.clearClipboardDelayState.update((()=>e))}))}},deps:[he.X9,k.d]},{provide:class{},useClass:class{constructor(e){this.stateProvider=e,this.enableBadgeCounterState=this.stateProvider.getActive(_n),this.enableBadgeCounter$=this.enableBadgeCounterState.state$.pipe((0,de.U)((e=>null==e||e)))}setEnableBadgeCounter(e){return Un(this,void 0,void 0,(function*(){yield this.enableBadgeCounterState.update((()=>e))}))}},deps:[he.X9]},{provide:An.z,useClass:An.B,deps:[he.X9]},{provide:os.d,useClass:os.f,deps:[he.X9]},{provide:class{},useClass:class{constructor(e){this.stateProvider=e,this.enablePasskeysState=this.stateProvider.getGlobal(Rh),this.enablePasskeys$=this.enablePasskeysState.state$.pipe((0,de.U)((e=>null==e||e))),this.showCardsCurrentTabState=this.stateProvider.getActive(Jh),this.showCardsCurrentTab$=this.showCardsCurrentTabState.state$.pipe((0,de.U)((e=>null==e||e))),this.showIdentitiesCurrentTabState=this.stateProvider.getActive(zh),this.showIdentitiesCurrentTab$=this.showIdentitiesCurrentTabState.state$.pipe((0,de.U)((e=>null==e||e)))}setShowCardsCurrentTab(e){return Yh(this,void 0,void 0,(function*(){yield this.showCardsCurrentTabState.update((()=>e))}))}setShowIdentitiesCurrentTab(e){return Yh(this,void 0,void 0,(function*(){yield this.showIdentitiesCurrentTabState.update((()=>e))}))}setEnablePasskeys(e){return Yh(this,void 0,void 0,(function*(){yield this.enablePasskeysState.update((()=>e))}))}},deps:[he.X9]},{provide:Bc,useClass:Bc,deps:[is,Wn.$,Rc,o.qV]},{provide:Rc,useClass:Rc,deps:[]},{provide:xn.l,useClass:class{constructor(e){this.apiService=e}cancelOrganizationSubscription(e,t){return this.apiService.send("POST","/organizations/"+e+"/cancel",t,!0,!1)}cancelPremiumUserSubscription(e){return this.apiService.send("POST","/accounts/cancel",e,!0,!1)}createClientOrganization(e,t){return this.apiService.send("POST","/providers/"+e+"/clients",t,!0,!1)}getBillingStatus(e){return Mn(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing-status",null,!0,!0);return new Pn(t)}))}getOrganizationBillingMetadata(e){return Mn(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing/metadata",null,!0,!0);return new kn(t)}))}getOrganizationSubscription(e){return Mn(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/subscription",null,!0,!0);return new $(t)}))}getPlans(){return Mn(this,void 0,void 0,(function*(){const e=yield this.apiService.send("GET","/plans",null,!1,!0);return new oe.L(e,z)}))}getProviderSubscription(e){return Mn(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/providers/"+e+"/billing/subscription",null,!0,!0);return new qn(t)}))}updateClientOrganization(e,t,i){return Mn(this,void 0,void 0,(function*(){return yield this.apiService.send("PUT","/providers/"+e+"/clients/"+t,i,!0,!1)}))}},deps:[l.s]},{provide:Tn.I,useClass:class{constructor(e,t){this.billingApiService=e,this.stateProvider=t,this.getOneWeekAgo=()=>{const e=new Date;return e.setDate(e.getDate()-7),e},this.paymentMethodWarningsState=this.stateProvider.getActive(Fn),this.paymentMethodWarnings$=this.paymentMethodWarningsState.state$}acknowledge(e){return Rn(this,void 0,void 0,(function*(){yield this.paymentMethodWarningsState.update((t=>{const i=t[e];return t[e]=Object.assign(Object.assign({},i),{acknowledged:!0}),t}))}))}removeSubscriptionRisk(e){return Rn(this,void 0,void 0,(function*(){yield this.paymentMethodWarningsState.update((t=>{const i=t[e];return t[e]=Object.assign(Object.assign({},i),{risksSubscriptionFailure:!1}),t}))}))}clear(){return Rn(this,void 0,void 0,(function*(){yield this.paymentMethodWarningsState.update((()=>({})))}))}update(e){return Rn(this,void 0,void 0,(function*(){const t=yield(0,pe.z)(this.paymentMethodWarningsState.state$.pipe((0,de.U)((t=>t?t[e]:null))));if(!t||t.savedAt<this.getOneWeekAgo()){const{organizationName:t,risksSubscriptionFailure:i}=yield this.billingApiService.getBillingStatus(e);yield this.paymentMethodWarningsState.update((n=>(null!=n||(n={}),n[e]={organizationName:t,risksSubscriptionFailure:i,acknowledged:!1,savedAt:new Date},n)))}}))}},deps:[xn.l,he.X9]},{provide:Zn.M,useClass:class{constructor(e){this.billingAccountProfileState=e.getActive(On);const t=e.activeUserId$.pipe((0,it.w)((t=>null!=t?e.getUser(t,On).state$:(0,Be.of)(null))));this.hasPremiumFromAnyOrganization$=t.pipe((0,de.U)((e=>!!(null==e?void 0:e.hasPremiumFromAnyOrganization)))),this.hasPremiumPersonally$=t.pipe((0,de.U)((e=>!!(null==e?void 0:e.hasPremiumPersonally)))),this.hasPremiumFromAnySource$=t.pipe((0,de.U)((e=>!0===(null==e?void 0:e.hasPremiumFromAnyOrganization)||!0===(null==e?void 0:e.hasPremiumPersonally))))}setHasPremium(e,t){return Cn(this,void 0,void 0,(function*(){yield this.billingAccountProfileState.update((i=>({hasPremiumPersonally:e,hasPremiumFromAnyOrganization:t})))}))}},deps:[he.X9]},{provide:T.R,useClass:class{constructor(e){this.stateProvider=e,this.autoConfirmFingerPrints=this.buildOrganizationManagementPreference(Se,!1)}buildOrganizationManagementPreference(e,t){return new T.Y(this.getKeyFromState(e).state$.pipe((0,de.U)((e=>null!=e?e:t))),this.setKeyInStateFn(e))}getKeyFromState(e){return this.stateProvider.getActive(e)}setKeyInStateFn(e){return t=>xe(this,void 0,void 0,(function*(){yield this.getKeyFromState(e).update((()=>t))}))}},deps:[he.X9]},{provide:uu,useClass:uu,deps:[Qn.$]},{provide:s.qLn,useClass:Hh,deps:[]},{provide:o.TY,useFactory:()=>new r.x,deps:[]},{provide:ds,useFactory:e=>new ds(e.asObservable()),deps:[o.TY]},{provide:ps.B,useFactory:e=>new gs(e),deps:[o.TY]},{provide:P.L,useClass:class{constructor(e){this.apiService=e}postProviderSetup(e,t){return et(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/providers/"+e+"/setup",t,!0,!0);return new Xe(i)}))}getProvider(e){return et(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/providers/"+e,null,!0,!0);return new Xe(t)}))}putProvider(e,t){return et(this,void 0,void 0,(function*(){const i=yield this.apiService.send("PUT","/providers/"+e,t,!0,!0);return new Xe(i)}))}providerRecoverDeleteToken(e,t){return this.apiService.send("POST","/providers/"+e+"/delete-recover-token",t,!1,!1)}deleteProvider(e){return et(this,void 0,void 0,(function*(){yield this.apiService.send("DELETE","/providers/"+e,null,!0,!1)}))}},deps:[l.s]},{provide:ft.d,useClass:class{constructor(e){this.stateProvider=e}setKdfConfig(e,t){return gi(this,void 0,void 0,(function*(){if(!e)throw new Error("userId cannot be null");if(null===t)throw new Error("kdfConfig cannot be null");yield this.stateProvider.setUserState(fi,t,e)}))}getKdfConfig(){return gi(this,void 0,void 0,(function*(){const e=yield(0,pe.z)(this.stateProvider.activeUserId$),t=yield(0,pe.z)(this.stateProvider.getUser(e,fi).state$);if(null===t)throw new Error("KdfConfig for active user account state is null");return t}))}},deps:[he.X9]}];class ig{}ig.ɵfac=function(e){return new(e||ig)},ig.ɵmod=s.oAB({type:ig}),ig.ɵinj=s.cJS({providers:tg});var ng=i(53481),sg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class og extends ns{constructor(){super(...arguments),this.store=new Map,this.updatesSubject=new r.x}get valuesRequireDeserialization(){return!1}get updates$(){return this.updatesSubject.asObservable()}get(e){if(this.store.has(e)){const t=this.store.get(e);return Promise.resolve(t)}return Promise.resolve(null)}has(e){return sg(this,void 0,void 0,(function*(){return null!=(yield this.get(e))}))}save(e,t){if(null==t)return this.remove(e);const i=structuredClone(t);return this.store.set(e,i),this.updatesSubject.next({key:e,updateType:"save"}),Promise.resolve()}remove(e){return this.store.delete(e),this.updatesSubject.next({key:e,updateType:"remove"}),Promise.resolve()}getBypassCache(e){return this.get(e)}}var rg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var ag=i(28753),lg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class cg{get defaultOptions(){return{htmlStorageLocation:Ht.CR.Session}}get valuesRequireDeserialization(){return!0}constructor(){this.updatesSubject=new r.x,this.updates$=this.updatesSubject.asObservable()}get(e,t=this.defaultOptions){let i=null;switch(t.htmlStorageLocation){case Ht.CR.Local:i=window.localStorage.getItem(e);break;case Ht.CR.Session:default:i=window.sessionStorage.getItem(e)}if(null!=i){const e=JSON.parse(i);return Promise.resolve(e)}return Promise.resolve(null)}has(e,t=this.defaultOptions){return lg(this,void 0,void 0,(function*(){return null!=(yield this.get(e,t))}))}save(e,t,i=this.defaultOptions){if(null==t)return this.remove(e,i);t instanceof Set&&(t=Array.from(t));const n=JSON.stringify(t);switch(i.htmlStorageLocation){case Ht.CR.Local:window.localStorage.setItem(e,n);break;case Ht.CR.Session:default:window.sessionStorage.setItem(e,n)}return this.updatesSubject.next({key:e,updateType:"save"}),Promise.resolve()}remove(e,t=this.defaultOptions){switch(t.htmlStorageLocation){case Ht.CR.Local:window.localStorage.removeItem(e);break;case Ht.CR.Session:default:window.sessionStorage.removeItem(e)}return this.updatesSubject.next({key:e,updateType:"remove"}),Promise.resolve()}}cg.ɵfac=function(e){return new(e||cg)},cg.ɵprov=s.Yz7({token:cg,factory:cg.ɵfac});var ug=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class dg{constructor(e,t,i){this.systemLanguage=e,this.localesDirectory=t,this.getLocalesJson=i,this.supportedTranslationLocales=["en"],this.defaultLocale="en",this.localeNames=new Map([["af","Afrikaans"],["ar","العربية الفصحى"],["az","Azərbaycanca"],["be","Беларуская"],["bg","български"],["bn","বাংলা"],["bs","bosanski jezik"],["ca","català"],["cs","čeština"],["cy","Cymraeg, y Gymraeg"],["da","dansk"],["de","Deutsch"],["el","Ελληνικά"],["en","English"],["en-GB","English (British)"],["en-IN","English (India)"],["eo","Esperanto"],["es","español"],["et","eesti"],["eu","euskara"],["fa","فارسی"],["fi","suomi"],["fil","Wikang Filipino"],["fr","français"],["gl","galego"],["he","עברית"],["hi","हिन्दी"],["hr","hrvatski"],["hu","magyar"],["id","Bahasa Indonesia"],["it","italiano"],["ja","日本語"],["ka","ქართული"],["km","ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ"],["kn","ಕನ್ನಡ"],["ko","한국어"],["lt","lietuvių kalba"],["lv","Latvietis"],["me","црногорски"],["ml","മലയാളം"],["mr","मराठी"],["my","ဗမာစကား"],["nb","norsk (bokmål)"],["ne","नेपाली"],["nl","Nederlands"],["nn","Norsk Nynorsk"],["or","ଓଡ଼ିଆ"],["pl","polski"],["pt-BR","português do Brasil"],["pt-PT","português"],["ro","română"],["ru","русский"],["si","සිංහල"],["sk","slovenčina"],["sl","Slovenski jezik, Slovenščina"],["sr","Српски"],["sv","svenska"],["te","తెలుగు"],["th","ไทย"],["tr","Türkçe"],["uk","українська"],["vi","Tiếng Việt"],["zh-CN","中文(中国大陆)"],["zh-TW","中文(台灣)"]]),this.defaultMessages={},this.localeMessages={},this.systemLanguage=e.replace("_","-")}init(e){return ug(this,void 0,void 0,(function*(){if(this.inited)throw new Error("i18n already initialized.");if(null==this.supportedTranslationLocales||0===this.supportedTranslationLocales.length)throw new Error("supportedTranslationLocales not set.");this.inited=!0,this.translationLocale=null!=e?e:this.systemLanguage;try{this.collator=new Intl.Collator(this.translationLocale,{numeric:!0,sensitivity:"base"})}catch(t){this.collator=null}-1===this.supportedTranslationLocales.indexOf(this.translationLocale)&&(this.translationLocale=this.translationLocale.slice(0,2),-1===this.supportedTranslationLocales.indexOf(this.translationLocale)&&(this.translationLocale=this.defaultLocale)),null!=this.localesDirectory&&(yield this.loadMessages(this.translationLocale,this.localeMessages),this.translationLocale!==this.defaultLocale&&(yield this.loadMessages(this.defaultLocale,this.defaultMessages)))}))}t(e,t,i,n){return this.translate(e,t,i,n)}translate(e,t,i,n){let s;return s=this.localeMessages.hasOwnProperty(e)&&this.localeMessages[e]?this.localeMessages[e]:this.defaultMessages.hasOwnProperty(e)&&this.defaultMessages[e]?this.defaultMessages[e]:"",""!==s&&(null!=t&&(s=s.split("__$1__").join(t.toString())),null!=i&&(s=s.split("__$2__").join(i.toString())),null!=n&&(s=s.split("__$3__").join(n.toString()))),s}loadMessages(e,t){return ug(this,void 0,void 0,(function*(){const i=e.replace("-","_"),n=yield this.getLocalesJson(i);for(const e in n)if(n.hasOwnProperty(e)&&(t[e]=n[e].message,n[e].placeholders))for(const i in n[e].placeholders){if(!n[e].placeholders.hasOwnProperty(i)||!n[e].placeholders[i].content)continue;const s="\\$"+i.toUpperCase()+"\\$";let o=n[e].placeholders[i].content;"$1"!==o&&"$2"!==o&&"$3"!==o||(o="__$"+o+"__"),t[e]=t[e].replace(new RegExp(s,"g"),o)}}))}}var pg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const hg=new he.vh(he.Vj,"locale",{deserializer:e=>e});class gg extends dg{constructor(e,t,i,n){super(e,t,i),this.systemLanguage=e,this.localesDirectory=t,this.getLocalesJson=i,this.translationLocaleState=n.get(hg),this.userSetLocale$=this.translationLocaleState.state$,this.locale$=this.userSetLocale$.pipe((0,de.U)((e=>null!=e?e:this.translationLocale)))}setLocale(e){return pg(this,void 0,void 0,(function*(){yield this.translationLocaleState.update((()=>e))}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return pg(this,void 0,void 0,(function*(){const t=yield(0,pe.z)(this.translationLocaleState.state$);yield e.init.call(this,t)}))}}const fg=["en","af","ar","az","be","bg","bn","bs","ca","cs","cy","da","de","el","en-GB","en-IN","eo","es","et","eu","fa","fi","fil","fr","gl","he","hi","hr","hu","id","it","ja","ka","km","kn","ko","lv","ml","mr","my","nb","ne","nl","nn","or","pl","pt-PT","pt-BR","ro","ru","si","sk","sl","sr","sv","te","th","tr","uk","vi","zh-CN","zh-TW"];var mg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var vg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class yg extends No{constructor(e,t){super(e),this.urls=t}}var wg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class bg extends zc{constructor(e,t,i){super(e,t,i,"web-disk-local",De.Bh.Web),this.diskLocalStorageService=t}getAccounts(){return wg(this,void 0,void 0,(function*(){const e=this.diskLocalStorageService.getKeys(),t=[];for(const i of e){if(!Fe.c.isGuid(i))continue;const e=yield this.diskLocalStorageService.get(i);null!=e&&("object"==typeof e&&t.push({userId:i,account:e}))}return t}))}}var Ug=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class _g{constructor(e){this.storage=e,this.updatesSubject=new r.x,this.updates$=this.updatesSubject.asObservable()}get valuesRequireDeserialization(){return!0}get(e,t){const i=this.storage.getItem(e);return null!=i?Promise.resolve(JSON.parse(i)):Promise.resolve(null)}has(e,t){return Ug(this,void 0,void 0,(function*(){return null!=(yield this.get(e,t))}))}save(e,t,i){if(null==t)return this.remove(e,i);t instanceof Set&&(t=Array.from(t)),this.storage.setItem(e,JSON.stringify(t)),this.updatesSubject.next({key:e,updateType:"save"})}remove(e,t){return this.storage.removeItem(e),this.updatesSubject.next({key:e,updateType:"remove"}),Promise.resolve()}getKeys(){return Object.keys(this.storage)}}var Ag=i(88409),Zg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class xg{constructor(e,t){this.i18nService=e,t.policies$.subscribe((e=>{this.policies=e}))}getDefaultDateFilters(){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59);e.setDate(e.getDate()-30);const i=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0);return[this.toDateTimeLocalString(i),this.toDateTimeLocalString(t)]}formatDateFilters(e,t){const i=new Date(e),n=new Date(t+":59.999");if(isNaN(i.getTime())||isNaN(n.getTime())||n<i)throw new Error("Invalid date range.");return[i.toISOString(),n.toISOString()]}getEventInfo(e,t=new Sg){return Zg(this,void 0,void 0,(function*(){const i=this.getAppInfo(e),{message:n,humanReadableMessage:s}=yield this.getEventMessage(e,t);return{message:n,humanReadableMessage:s,appIcon:i[0],appName:i[1]}}))}getEventMessage(e,t){return Zg(this,void 0,void 0,(function*(){let i="",n="";switch(e.type){case De.tw.User_LoggedIn:i=n=this.i18nService.t("loggedIn");break;case De.tw.User_ChangedPassword:i=n=this.i18nService.t("changedPassword");break;case De.tw.User_Updated2fa:i=n=this.i18nService.t("enabledUpdated2fa");break;case De.tw.User_Disabled2fa:i=n=this.i18nService.t("disabled2fa");break;case De.tw.User_Recovered2fa:i=n=this.i18nService.t("recovered2fa");break;case De.tw.User_FailedLogIn:i=n=this.i18nService.t("failedLogin");break;case De.tw.User_FailedLogIn2fa:i=n=this.i18nService.t("failedLogin2fa");break;case De.tw.User_ClientExportedVault:i=n=this.i18nService.t("exportedVault");break;case De.tw.User_UpdatedTempPassword:i=n=this.i18nService.t("updatedTempPassword");break;case De.tw.User_MigratedKeyToKeyConnector:i=n=this.i18nService.t("migratedKeyConnector");break;case De.tw.User_RequestedDeviceApproval:i=n=this.i18nService.t("requestedDeviceApproval");break;case De.tw.Cipher_Created:i=this.i18nService.t("createdItemId",this.formatCipherId(e,t)),n=this.i18nService.t("createdItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_Updated:i=this.i18nService.t("editedItemId",this.formatCipherId(e,t)),n=this.i18nService.t("editedItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_Deleted:i=this.i18nService.t("permanentlyDeletedItemId",this.formatCipherId(e,t)),n=this.i18nService.t("permanentlyDeletedItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_SoftDeleted:i=this.i18nService.t("deletedItemId",this.formatCipherId(e,t)),n=this.i18nService.t("deletedItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_Restored:i=this.i18nService.t("restoredItemId",this.formatCipherId(e,t)),n=this.i18nService.t("restoredItemId",this.formatCipherId(e,t));break;case De.tw.Cipher_AttachmentCreated:i=this.i18nService.t("createdAttachmentForItem",this.formatCipherId(e,t)),n=this.i18nService.t("createdAttachmentForItem",this.getShortId(e.cipherId));break;case De.tw.Cipher_AttachmentDeleted:i=this.i18nService.t("deletedAttachmentForItem",this.formatCipherId(e,t)),n=this.i18nService.t("deletedAttachmentForItem",this.getShortId(e.cipherId));break;case De.tw.Cipher_Shared:i=this.i18nService.t("movedItemIdToOrg",this.formatCipherId(e,t)),n=this.i18nService.t("movedItemIdToOrg",this.getShortId(e.cipherId));break;case De.tw.Cipher_ClientViewed:i=this.i18nService.t("viewedItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_ClientToggledPasswordVisible:i=this.i18nService.t("viewedPasswordItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedPasswordItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_ClientToggledHiddenFieldVisible:i=this.i18nService.t("viewedHiddenFieldItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedHiddenFieldItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_ClientToggledCardNumberVisible:i=this.i18nService.t("viewedCardNumberItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedCardNumberItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_ClientToggledCardCodeVisible:i=this.i18nService.t("viewedSecurityCodeItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedSecurityCodeItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_ClientCopiedHiddenField:i=this.i18nService.t("copiedHiddenFieldItemId",this.formatCipherId(e,t)),n=this.i18nService.t("copiedHiddenFieldItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_ClientCopiedPassword:i=this.i18nService.t("copiedPasswordItemId",this.formatCipherId(e,t)),n=this.i18nService.t("copiedPasswordItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_ClientCopiedCardCode:i=this.i18nService.t("copiedSecurityCodeItemId",this.formatCipherId(e,t)),n=this.i18nService.t("copiedSecurityCodeItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_ClientAutofilled:i=this.i18nService.t("autofilledItemId",this.formatCipherId(e,t)),n=this.i18nService.t("autofilledItemId",this.getShortId(e.cipherId));break;case De.tw.Cipher_UpdatedCollections:i=this.i18nService.t("editedCollectionsForItem",this.formatCipherId(e,t)),n=this.i18nService.t("editedCollectionsForItem",this.getShortId(e.cipherId));break;case De.tw.Collection_Created:i=this.i18nService.t("createdCollectionId",this.formatCollectionId(e)),n=this.i18nService.t("createdCollectionId",this.getShortId(e.collectionId));break;case De.tw.Collection_Updated:i=this.i18nService.t("editedCollectionId",this.formatCollectionId(e)),n=this.i18nService.t("editedCollectionId",this.getShortId(e.collectionId));break;case De.tw.Collection_Deleted:i=this.i18nService.t("deletedCollectionId",this.formatCollectionId(e)),n=this.i18nService.t("deletedCollectionId",this.getShortId(e.collectionId));break;case De.tw.Group_Created:i=this.i18nService.t("createdGroupId",this.formatGroupId(e)),n=this.i18nService.t("createdGroupId",this.getShortId(e.groupId));break;case De.tw.Group_Updated:i=this.i18nService.t("editedGroupId",this.formatGroupId(e)),n=this.i18nService.t("editedGroupId",this.getShortId(e.groupId));break;case De.tw.Group_Deleted:i=this.i18nService.t("deletedGroupId",this.formatGroupId(e)),n=this.i18nService.t("deletedGroupId",this.getShortId(e.groupId));break;case De.tw.OrganizationUser_Invited:i=this.i18nService.t("invitedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("invitedUserId",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_Confirmed:i=this.i18nService.t("confirmedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("confirmedUserId",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_Updated:i=this.i18nService.t("editedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("editedUserId",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_Removed:i=this.i18nService.t("removedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("removedUserId",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_UpdatedGroups:i=this.i18nService.t("editedGroupsForUser",this.formatOrgUserId(e)),n=this.i18nService.t("editedGroupsForUser",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_UnlinkedSso:i=this.i18nService.t("unlinkedSsoUser",this.formatOrgUserId(e)),n=this.i18nService.t("unlinkedSsoUser",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_ResetPassword_Enroll:i=this.i18nService.t("eventEnrollAccountRecovery",this.formatOrgUserId(e)),n=this.i18nService.t("eventEnrollAccountRecovery",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_ResetPassword_Withdraw:i=this.i18nService.t("eventWithdrawAccountRecovery",this.formatOrgUserId(e)),n=this.i18nService.t("eventWithdrawAccountRecovery",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_AdminResetPassword:i=this.i18nService.t("eventAdminPasswordReset",this.formatOrgUserId(e)),n=this.i18nService.t("eventAdminPasswordReset",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_ResetSsoLink:i=this.i18nService.t("eventResetSsoLink",this.formatOrgUserId(e)),n=this.i18nService.t("eventResetSsoLink",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_FirstSsoLogin:i=this.i18nService.t("firstSsoLogin",this.formatOrgUserId(e)),n=this.i18nService.t("firstSsoLogin",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_Revoked:i=this.i18nService.t("revokedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("revokedUserId",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_Restored:i=this.i18nService.t("restoredUserId",this.formatOrgUserId(e)),n=this.i18nService.t("restoredUserId",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_ApprovedAuthRequest:i=this.i18nService.t("approvedAuthRequest",this.formatOrgUserId(e)),n=this.i18nService.t("approvedAuthRequest",this.getShortId(e.organizationUserId));break;case De.tw.OrganizationUser_RejectedAuthRequest:i=this.i18nService.t("rejectedAuthRequest",this.formatOrgUserId(e)),n=this.i18nService.t("rejectedAuthRequest",this.getShortId(e.organizationUserId));break;case De.tw.Organization_Updated:i=n=this.i18nService.t("editedOrgSettings");break;case De.tw.Organization_PurgedVault:i=n=this.i18nService.t("purgedOrganizationVault");break;case De.tw.Organization_ClientExportedVault:i=n=this.i18nService.t("exportedOrganizationVault");break;case De.tw.Organization_VaultAccessed:i=n=this.i18nService.t("vaultAccessedByProvider");break;case De.tw.Organization_EnabledSso:i=n=this.i18nService.t("enabledSso");break;case De.tw.Organization_DisabledSso:i=n=this.i18nService.t("disabledSso");break;case De.tw.Organization_EnabledKeyConnector:i=n=this.i18nService.t("enabledKeyConnector");break;case De.tw.Organization_DisabledKeyConnector:i=n=this.i18nService.t("disabledKeyConnector");break;case De.tw.Organization_SponsorshipsSynced:i=n=this.i18nService.t("sponsorshipsSynced");break;case De.tw.Organization_CollectionManagementUpdated:i=this.i18nService.t("modifiedCollectionManagement",this.formatOrganizationId(e)),n=this.i18nService.t("modifiedCollectionManagement",this.getShortId(e.organizationId));break;case De.tw.Policy_Updated:{i=this.i18nService.t("modifiedPolicyId",this.formatPolicyId(e));const t=this.policies.filter((t=>t.id===e.policyId))[0];let s=this.getShortId(e.policyId);null!=t&&(s=Qe.Mi[t.type]),n=this.i18nService.t("modifiedPolicyId",s);break}case De.tw.ProviderUser_Invited:i=this.i18nService.t("invitedUserId",this.formatProviderUserId(e)),n=this.i18nService.t("invitedUserId",this.getShortId(e.providerUserId));break;case De.tw.ProviderUser_Confirmed:i=this.i18nService.t("confirmedUserId",this.formatProviderUserId(e)),n=this.i18nService.t("confirmedUserId",this.getShortId(e.providerUserId));break;case De.tw.ProviderUser_Updated:i=this.i18nService.t("editedUserId",this.formatProviderUserId(e)),n=this.i18nService.t("editedUserId",this.getShortId(e.providerUserId));break;case De.tw.ProviderUser_Removed:i=this.i18nService.t("removedUserId",this.formatProviderUserId(e)),n=this.i18nService.t("removedUserId",this.getShortId(e.providerUserId));break;case De.tw.ProviderOrganization_Created:i=this.i18nService.t("createdOrganizationId",this.formatProviderOrganizationId(e)),n=this.i18nService.t("createdOrganizationId",this.getShortId(e.providerOrganizationId));break;case De.tw.ProviderOrganization_Added:i=this.i18nService.t("addedOrganizationId",this.formatProviderOrganizationId(e)),n=this.i18nService.t("addedOrganizationId",this.getShortId(e.providerOrganizationId));break;case De.tw.ProviderOrganization_Removed:i=this.i18nService.t("removedOrganizationId",this.formatProviderOrganizationId(e)),n=this.i18nService.t("removedOrganizationId",this.getShortId(e.providerOrganizationId));break;case De.tw.ProviderOrganization_VaultAccessed:i=this.i18nService.t("accessedClientVault",this.formatProviderOrganizationId(e)),n=this.i18nService.t("accessedClientVault",this.getShortId(e.providerOrganizationId));break;case De.tw.OrganizationDomain_Added:i=n=this.i18nService.t("addedDomain",e.domainName);break;case De.tw.OrganizationDomain_Removed:i=n=this.i18nService.t("removedDomain",e.domainName);break;case De.tw.OrganizationDomain_Verified:i=n=this.i18nService.t("domainVerifiedEvent",e.domainName);break;case De.tw.OrganizationDomain_NotVerified:i=n=this.i18nService.t("domainNotVerifiedEvent",e.domainName);break;case De.tw.Secret_Retrieved:i=this.i18nService.t("accessedSecret",this.formatSecretId(e)),n=this.i18nService.t("accessedSecret",this.getShortId(e.secretId))}return{message:""===i?null:i,humanReadableMessage:""===n?null:n}}))}getAppInfo(e){if(e.serviceAccountId)return["bwi-globe",this.i18nService.t("sdk")];switch(e.deviceType){case De.Yi.Android:return["bwi-android",this.i18nService.t("mobile")+" - Android"];case De.Yi.iOS:return["bwi-apple",this.i18nService.t("mobile")+" - iOS"];case De.Yi.UWP:return["bwi-windows",this.i18nService.t("mobile")+" - Windows"];case De.Yi.ChromeExtension:return["bwi-chrome",this.i18nService.t("extension")+" - Chrome"];case De.Yi.FirefoxExtension:return["bwi-firefox",this.i18nService.t("extension")+" - Firefox"];case De.Yi.OperaExtension:return["bwi-opera",this.i18nService.t("extension")+" - Opera"];case De.Yi.EdgeExtension:return["bwi-edge",this.i18nService.t("extension")+" - Edge"];case De.Yi.VivaldiExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Vivaldi"];case De.Yi.SafariExtension:return["bwi-safari",this.i18nService.t("extension")+" - Safari"];case De.Yi.WindowsDesktop:return["bwi-windows",this.i18nService.t("desktop")+" - Windows"];case De.Yi.MacOsDesktop:return["bwi-apple",this.i18nService.t("desktop")+" - macOS"];case De.Yi.LinuxDesktop:return["bwi-linux",this.i18nService.t("desktop")+" - Linux"];case De.Yi.ChromeBrowser:return["bwi-globe",this.i18nService.t("webVault")+" - Chrome"];case De.Yi.FirefoxBrowser:return["bwi-globe",this.i18nService.t("webVault")+" - Firefox"];case De.Yi.OperaBrowser:return["bwi-globe",this.i18nService.t("webVault")+" - Opera"];case De.Yi.SafariBrowser:return["bwi-globe",this.i18nService.t("webVault")+" - Safari"];case De.Yi.VivaldiBrowser:return["bwi-globe",this.i18nService.t("webVault")+" - Vivaldi"];case De.Yi.EdgeBrowser:return["bwi-globe",this.i18nService.t("webVault")+" - Edge"];case De.Yi.IEBrowser:return["bwi-globe",this.i18nService.t("webVault")+" - IE"];case De.Yi.Server:return["bwi-server",this.i18nService.t("server")];case De.Yi.WindowsCLI:return["bwi-cli",this.i18nService.t("cli")+" - Windows"];case De.Yi.MacOsCLI:return["bwi-cli",this.i18nService.t("cli")+" - macOS"];case De.Yi.LinuxCLI:return["bwi-cli",this.i18nService.t("cli")+" - Linux"];case De.Yi.UnknownBrowser:return["bwi-globe",this.i18nService.t("webVault")+" - "+this.i18nService.t("unknown")];default:return["bwi-globe",this.i18nService.t("unknown")]}}formatCipherId(e,t){const i=this.getShortId(e.cipherId);if(null==e.organizationId||!t.cipherInfo)return"<code>"+i+"</code>";const n=this.makeAnchor(i);return n.setAttribute("href",`#/organizations/${e.organizationId}/vault?search=${i}&viewEvents=${e.cipherId}&type=all`),n.outerHTML}formatGroupId(e){const t=this.getShortId(e.groupId),i=this.makeAnchor(t);return i.setAttribute("href","#/organizations/"+e.organizationId+"/groups?search="+t),i.outerHTML}formatCollectionId(e){const t=this.getShortId(e.collectionId),i=this.makeAnchor(t);return i.setAttribute("href",`#/organizations/${e.organizationId}/vault?collectionId=${e.collectionId}`),i.outerHTML}formatOrgUserId(e){const t=this.getShortId(e.organizationUserId),i=this.makeAnchor(t);return i.setAttribute("href","#/organizations/"+e.organizationId+"/members?search="+t+"&viewEvents="+e.organizationUserId),i.outerHTML}formatProviderUserId(e){const t=this.getShortId(e.providerUserId),i=this.makeAnchor(t);return i.setAttribute("href","#/providers/"+e.providerId+"/manage/people?search="+t+"&viewEvents="+e.providerUserId),i.outerHTML}formatProviderOrganizationId(e){const t=this.getShortId(e.providerOrganizationId),i=this.makeAnchor(t);return i.setAttribute("href","#/providers/"+e.providerId+"/clients?search="+t),i.outerHTML}formatOrganizationId(e){const t=this.getShortId(e.organizationId),i=this.makeAnchor(t);return i.setAttribute("href","#/organizations/"+e.organizationId+"/settings/account"),i.outerHTML}formatPolicyId(e){const t=this.getShortId(e.policyId),i=this.makeAnchor(t);return i.setAttribute("href","#/organizations/"+e.organizationId+"/settings/policies?policyId="+e.policyId),i.outerHTML}formatSecretId(e){const t=this.getShortId(e.secretId),i=this.makeAnchor(t);return i.setAttribute("href","#/sm/"+e.organizationId+"/secrets?search="+t),i.outerHTML}makeAnchor(e){const t=document.createElement("a");return t.title=this.i18nService.t("view"),t.innerHTML="<code>"+e+"</code>",t}getShortId(e){return null==e?void 0:e.substring(0,8)}toDateTimeLocalString(e){return e.getFullYear()+"-"+this.pad(e.getMonth()+1)+"-"+this.pad(e.getDate())+"T"+this.pad(e.getHours())+":"+this.pad(e.getMinutes())}pad(e){const t=Math.floor(Math.abs(e));return(t<10?"0":"")+t}}xg.ɵfac=function(e){return new(e||xg)(s.LFG($n.D),s.LFG(k.d))},xg.ɵprov=s.Yz7({token:xg,factory:xg.ɵfac});class Sg{constructor(){this.cipherInfo=!0}}class Tg{constructor(e,t){this.cryptoService=e,this.encryptService=t}attachToGlobal(e){e.bitwardenContainerService||(e.bitwardenContainerService=this)}getCryptoService(){if(null==this.cryptoService)throw new Error("ContainerService.cryptoService not initialized.");return this.cryptoService}getEncryptService(){if(null==this.encryptService)throw new Error("ContainerService.encryptService not initialized.");return this.encryptService}}var Cg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Og{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p){this.win=e,this.notificationsService=t,this.vaultTimeoutService=i,this.i18nService=n,this.eventUploadService=s,this.twoFactorService=o,this.stateService=r,this.cryptoService=a,this.themingService=l,this.encryptService=c,this.userAutoUnlockKeyService=u,this.accountService=d,this.document=p}init(){return()=>Cg(this,void 0,void 0,(function*(){yield this.stateService.init();const e=yield(0,pe.z)(this.accountService.activeAccount$);e&&(yield this.userAutoUnlockKeyService.setUserKeyInMemoryIfAutoUserKeySet(e.id)),setTimeout((()=>this.notificationsService.init()),3e3),yield this.vaultTimeoutService.init(!0),yield this.i18nService.init(),this.eventUploadService.init(!0),this.twoFactorService.init();this.win.document.documentElement.classList.add("locale_"+this.i18nService.translationLocale),this.themingService.applyThemeChangesTo(this.document);new Tg(this.cryptoService,this.encryptService).attachToGlobal(this.win)}))}}Og.ɵfac=function(e){return new(e||Og)(s.LFG(o.m9),s.LFG(p.T),s.LFG(sp),s.LFG($n.D),s.LFG(d.k),s.LFG(Ut.S),s.LFG(ts.b),s.LFG(Qn.$),s.LFG(Xh.v),s.LFG(Gn.U),s.LFG(uu),s.LFG(lt.BR),s.LFG(n.K0))},Og.ɵprov=s.Yz7({token:Og,factory:Og.ɵfac});var kg=i(36200),Pg=i(19887);class qg extends eg.Z{constructor(e,t){super(e),this.messagingService=t,this.el=null,this.modalOpen=!1}setupHandlers(e){e.onCreated.pipe((0,Pg.P)()).subscribe((()=>{const t=Array.from(document.querySelectorAll(".modal"));t.length>0&&(this.el=kg(t[0]),this.el.modal("show"),this.el.on("show.bs.modal",(()=>{e.show(),this.messagingService.send("modalShow")})),this.el.on("shown.bs.modal",(()=>{e.shown(),this.messagingService.send("modalShown"),Fe.c.isMobileBrowser||this.el.find("*[appAutoFocus]").focus()})),this.el.on("hide.bs.modal",(()=>{this.messagingService.send("modalClose")})),this.el.on("hidden.bs.modal",(()=>{e.closed(),this.messagingService.send("modalClosed")})))})),e.onClose.pipe((0,Pg.P)()).subscribe((()=>{null!=this.el&&this.el.modal("hide")}))}}qg.ɵfac=function(e){return new(e||qg)(s.LFG(s.zs3),s.LFG(Xn.o))},qg.ɵprov=s.Yz7({token:qg,factory:qg.ɵfac});var Ig=i(70062);class Mg extends ms.H6{constructor(){super(...arguments),this.vaultTimeout=15}}class Ng extends ms.mR{constructor(e){super(e),this.settings=new Mg,Object.assign(this.settings,Object.assign(Object.assign({},new Mg),this.settings))}}var Lg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Dg extends ru{constructor(e,t,i,n,s,o,r,a,l){super(e,t,i,n,s,o,r,a,l)}addAccount(e){const t=Object.create(null,{addAccount:{get:()=>super.addAccount}});return Lg(this,void 0,void 0,(function*(){e=new Ng(e),yield t.addAccount.call(this,e)}))}getLastSync(e){const t=Object.create(null,{getLastSync:{get:()=>super.getLastSync}});return Lg(this,void 0,void 0,(function*(){return e=this.reconcileOptions(e,yield this.defaultInMemoryOptions()),yield t.getLastSync.call(this,e)}))}setLastSync(e,t){const i=Object.create(null,{setLastSync:{get:()=>super.setLastSync}});return Lg(this,void 0,void 0,(function*(){return t=this.reconcileOptions(t,yield this.defaultInMemoryOptions()),yield i.setLastSync.call(this,e,t)}))}}Dg.ɵfac=function(e){return new(e||Dg)(s.LFG(is),s.LFG(o.cy),s.LFG(o.FZ),s.LFG(Wn.$),s.LFG(o.r5),s.LFG(lt.BR),s.LFG(jn.L),s.LFG(bt.B),s.LFG(Bc))},Dg.ɵprov=s.Yz7({token:Dg,factory:Dg.ɵfac});class Eg{get blobOptions(){var e;const t=null!==(e=this._request.blobOptions)&&void 0!==e?e:{};return null==t.type&&(t.type=this.fileType),t}get blob(){return null!=this.blobOptions?new Blob([this._request.blobData],this.blobOptions):new Blob([this._request.blobData])}get downloadMethod(){return null!=this._request.downloadMethod?this._request.downloadMethod:"application/pdf"!=this.fileType?"save":"open"}get fileType(){const e=this._request.fileName.toLowerCase();return e.endsWith(".pdf")?"application/pdf":e.endsWith(".xlsx")?"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":e.endsWith(".docx")?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":e.endsWith(".pptx")?"application/vnd.openxmlformats-officedocument.presentationml.presentation":e.endsWith(".csv")?"text/csv":e.endsWith(".png")?"image/png":e.endsWith(".jpg")||e.endsWith(".jpeg")?"image/jpeg":e.endsWith(".gif")?"image/gif":null}constructor(e){this._request=e}}class Fg{constructor(e){this.platformUtilsService=e}download(e){const t=new Eg(e),i=window.document.createElement("a");"save"===t.downloadMethod?i.download=e.fileName:this.platformUtilsService.isSafari()||(i.rel="noreferrer",i.target="_blank"),i.href=URL.createObjectURL(t.blob),i.style.position="fixed",window.document.body.appendChild(i),i.click(),window.document.body.removeChild(i)}}Fg.ɵfac=function(e){return new(e||Fg)(s.LFG(es.P))},Fg.ɵprov=s.Yz7({token:Fg,factory:Fg.ɵfac});var Rg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Jg{constructor(e,t,i){this.i18nService=e,this.messagingService=t,this.logService=i,this.browserCache=null}getDevice(){return null!=this.browserCache||(-1!==navigator.userAgent.indexOf(" Firefox/")||-1!==navigator.userAgent.indexOf(" Gecko/")?this.browserCache=De.Yi.FirefoxBrowser:navigator.userAgent.indexOf(" OPR/")>=0?this.browserCache=De.Yi.OperaBrowser:-1!==navigator.userAgent.indexOf(" Edg/")?this.browserCache=De.Yi.EdgeBrowser:-1!==navigator.userAgent.indexOf(" Vivaldi/")?this.browserCache=De.Yi.VivaldiBrowser:-1!==navigator.userAgent.indexOf(" Safari/")&&-1===navigator.userAgent.indexOf("Chrome")?this.browserCache=De.Yi.SafariBrowser:window.chrome&&-1!==navigator.userAgent.indexOf(" Chrome/")?this.browserCache=De.Yi.ChromeBrowser:-1!==navigator.userAgent.indexOf(" Trident/")?this.browserCache=De.Yi.IEBrowser:this.browserCache=De.Yi.UnknownBrowser),this.browserCache}getDeviceString(){return De.Yi[this.getDevice()].toLowerCase().replace("browser","")}getClientType(){return De.Bh.Web}isFirefox(){return this.getDevice()===De.Yi.FirefoxBrowser}isChrome(){return this.getDevice()===De.Yi.ChromeBrowser}isEdge(){return this.getDevice()===De.Yi.EdgeBrowser}isOpera(){return this.getDevice()===De.Yi.OperaBrowser}isVivaldi(){return this.getDevice()===De.Yi.VivaldiBrowser}isSafari(){return this.getDevice()===De.Yi.SafariBrowser}isMacAppStore(){return!1}isViewOpen(){return Promise.resolve(!1)}launchUri(e,t){const i=document.createElement("a");i.href=e,null!=t&&t.sameWindow||(i.target="_blank",i.rel="noreferrer noopener"),i.classList.add("d-none"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}getApplicationVersion(){return Promise.resolve("2024.5.1")}getApplicationVersionNumber(){return Rg(this,void 0,void 0,(function*(){return(yield this.getApplicationVersion()).split(RegExp("[+|-]"))[0].trim()}))}supportsWebAuthn(e){return"undefined"!=typeof PublicKeyCredential}supportsDuo(){return!0}showToast(e,t,i,n){this.messagingService.send("showToast",{text:i,title:t,type:e,options:n})}isDev(){return!1}isSelfHost(){return!0}static isSelfHost(){return!0}copyToClipboard(e,t){let i=window,n=window.document;if(t&&(t.window||t.win)?(i=t.window||t.win,n=i.document):t&&t.doc&&(n=t.doc),n.queryCommandSupported&&n.queryCommandSupported("copy")){const t=n.createElement("textarea");t.textContent=e,t.style.position="fixed";let i=n.body;n.body.classList.contains("modal-open")&&(i=n.body.querySelector(".modal")),i.appendChild(t),t.select();let o=!1;try{o=n.execCommand("copy"),o||this.logService.debug("Copy command unsupported or disabled.")}catch(s){console.warn("Copy to clipboard failed.",s)}finally{i.removeChild(t)}return o}}readFromClipboard(e){throw new Error("Cannot read from clipboard on web.")}supportsBiometric(){return Promise.resolve(!1)}authenticateBiometric(){return Promise.resolve(!1)}supportsSecureStorage(){return!1}getAutofillKeyboardShortcut(){return null}}Jg.ɵfac=function(e){return new(e||Jg)(s.LFG($n.D),s.LFG(Xn.o),s.LFG(Wn.$))},Jg.ɵprov=s.Yz7({token:Jg,factory:Jg.ɵfac});const zg=[Og,Ig.c,xg,ag.x,{provide:s.ip1,useFactory:e=>e.init(),deps:[Og],multi:!0},{provide:o.r5,useValue:new ls(class extends vs{constructor(){super(...arguments),this.rememberEmail=!0}},Ng)},{provide:$n.D,useClass:class extends gg{constructor(e,t,i){super(e||"en-US",t,(e=>mg(this,void 0,void 0,(function*(){const t=this.localesDirectory+"/"+e+"/messages.json?cache=mtmtsr",i=yield fetch(t);return yield i.json()}))),i),this.supportedTranslationLocales=fg}},deps:[o.YZ,o.PE,he.MC]},{provide:is,useClass:cg,deps:[]},{provide:o.cy,useClass:og,deps:[]},{provide:o.FZ,useClass:og,deps:[]},{provide:o.lF,useClass:class extends ns{constructor(){super(...arguments),this.store={},this.updatesSubject=new r.x}get valuesRequireDeserialization(){return!0}get updates$(){return this.updatesSubject.asObservable()}get(e){const t=this.store[e];if(t){const e=JSON.parse(t);return Promise.resolve(e)}return Promise.resolve(null)}has(e){return rg(this,void 0,void 0,(function*(){return null!=(yield this.get(e))}))}save(e,t){return null==t?this.remove(e):(this.store[e]=JSON.stringify(t),this.updatesSubject.next({key:e,updateType:"save"}),Promise.resolve())}remove(e){return delete this.store[e],this.updatesSubject.next({key:e,updateType:"remove"}),Promise.resolve()}getBypassCache(e){return this.get(e)}},deps:[]},{provide:o.jo,useFactory:()=>new _g(window.sessionStorage),deps:[]},{provide:es.P,useClass:Jg,useAngularDecorators:!0},{provide:eg.Z,useClass:qg,useAngularDecorators:!0},Dg,{provide:ts.b,useExisting:Dg},{provide:ng._,useClass:Fg,useAngularDecorators:!0},Ag.m,{provide:_g,useFactory:()=>new _g(window.localStorage),deps:[]},{provide:o.x3,useExisting:_g},{provide:lu,useClass:class extends lu{constructor(e,t,i){super(e,t),this.diskLocalStorageService=i}get(e,t){var i;const n=null!==(i=t.web)&&void 0!==i?i:e;return"disk-local"===n?["disk-local",this.diskLocalStorageService]:super.get(n,t)}},deps:[o.jo,o.lF,o.x3]},{provide:Bc,useClass:class extends Bc{constructor(e,t,i,n){super(e,t,i,De.Bh.Web),this.diskLocalStorage=n}run(){const e=Object.create(null,{run:{get:()=>super.run}});return wg(this,void 0,void 0,(function*(){yield e.run.call(this);const t=this.migrationBuilderService.build();let i=yield this.diskLocalStorage.get("stateVersion");null==i&&(i=12);const n=new bg(i,this.diskLocalStorage,this.logService);yield t.migrate(n)}))}},deps:[is,Wn.$,Rc,_g]},{provide:jn.L,useClass:class extends Po{constructor(e,t,i){super(t,i),this.win=e;let n=this.win.location.href;n=n.replace(/(\/+|\/*#.*|\/*\?.*)$/,"");const s={base:n},o=Fe.c.getDomain(this.win.location.href),r=this.availableRegions().find((e=>Fe.c.getDomain(e.urls.webVault)===o));let a;a=r?new yg(r,s):new Lo(s);const l=new Au.t(1);l.next(a),this.environment$=l.asObservable()}setEnvironment(e,t){return vg(this,void 0,void 0,(function*(){}))}},deps:[o.m9,he.X9,lt.BR]},{provide:Fu.v,useFactory:e=>new Fu.Q(e,Ht.f8.Light),deps:[he.MC]},{provide:o.qV,useValue:De.Bh.Web}];class Yg{constructor(e){if(e)throw new Error("CoreModule is already loaded. Import it in the AppModule only")}}Yg.ɵfac=function(e){return new(e||Yg)(s.LFG(Yg,12))},Yg.ɵmod=s.oAB({type:Yg}),Yg.ɵinj=s.cJS({providers:zg,imports:[n.ez,ig]})},70062:(e,t,i)=>{"use strict";i.d(t,{c:()=>h});var n=i(8111),s=i(67775),o=i(99042),r=i(27646),a=i(36957),l=i(85762),c=i(68088),u=i(78627),d=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const p=new a.vh(a.Dw,"deepLinkRedirectUrl",{deserializer:e=>e});class h{constructor(e,t,i,o,r){this.router=e,this.activatedRoute=t,this.titleService=i,this.stateProvider=o,this.previousUrl=void 0,this.currentUrl=void 0,this.deepLinkRedirectUrlState=this.stateProvider.getGlobal(p),this.currentUrl=this.router.url,e.events.pipe((0,s.h)((e=>e instanceof n.m2))).subscribe((e=>{var t,i,n,s,o,a,l;this.currentUrl=e.url;let c="Vaultwarden Web";this.currentUrl.includes("/sm/")&&(c=r.t("bitSecretsManager"));let u=this.activatedRoute.firstChild;for(;u.firstChild;)u=u.firstChild;const d=null===(i=null===(t=null==u?void 0:u.snapshot)||void 0===t?void 0:t.data)||void 0===i?void 0:i.titleId,p=null===(s=null===(n=null==u?void 0:u.snapshot)||void 0===n?void 0:n.data)||void 0===s?void 0:s.title,h=null===(l=!(null===(a=null===(o=null==u?void 0:u.snapshot)||void 0===o?void 0:o.data)||void 0===a?void 0:a.doNotSaveUrl))||void 0===l||l;if(null!=d||null!=p){const e=null!=p?p:r.t(d);null!=e&&""!==e&&(c=e+" | "+c)}this.titleService.setTitle(c),h&&this.setPreviousUrl(this.currentUrl)}))}getPreviousUrl(){return this.previousUrl}setPreviousUrl(e){this.previousUrl=e}persistLoginRedirectUrl(e){return d(this,void 0,void 0,(function*(){yield this.deepLinkRedirectUrlState.update((()=>e))}))}getAndClearLoginRedirectUrl(){return d(this,void 0,void 0,(function*(){const e=yield(0,o.z)(this.deepLinkRedirectUrlState.state$);if(!r.c.isNullOrEmpty(e))return yield this.persistLoginRedirectUrl(null),e}))}}h.ɵfac=function(e){return new(e||h)(l.LFG(n.F0),l.LFG(n.gz),l.LFG(c.Dx),l.LFG(a.X9),l.LFG(u.D))},h.ɵprov=l.Yz7({token:h,factory:h.ɵfac})},95379:(e,t,i)=>{"use strict";i.d(t,{O:()=>L});var n=i(49781),s=i(782),o=i(71146),r=i(85915),a=i(58618),l=i(85762),c=i(28508),u=i(8111),d=i(12963),p=i(12492),h=i(73974),g=i(26194),f=i(44234),m=i(91849),v=i(28315),y=i(21656),w=i(33031),b=i(92786),U=i(59157),_=i(58691),A=i(5959),Z=i(82933),x=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const S=["menu"];function T(e,t){if(1&e&&(l.TgZ(0,"a",7),l._uU(1,"\n        "),l._UZ(2,"i"),l._uU(3,"\n        "),l.TgZ(4,"span",8),l._uU(5),l.qZA(),l._uU(6,"\n      "),l.qZA()),2&e){const e=t.$implicit;l.Q6J("routerLink",e.appRoute)("ngClass",e.isActive?"tw-bg-primary-600 tw-font-bold !tw-text-contrast tw-ring-offset-2 hover:tw-bg-primary-600":""),l.xp6(2),l.Gre("bwi ",e.icon," tw-text-4xl !tw-m-0 !tw-mb-1"),l.xp6(3),l.Oqu(e.name)}}function C(e,t){if(1&e&&(l.TgZ(0,"a",12),l._uU(1,"\n        "),l.TgZ(2,"span",13),l._uU(3,"\n          "),l._UZ(4,"i"),l._uU(5),l.qZA(),l._uU(6,"\n      "),l.qZA()),2&e){const e=t.$implicit;l.Q6J("href",e.marketingRoute,l.LSH),l.xp6(4),l.Gre("bwi bwi-fw ",e.icon," tw-m-0 !tw-mr-3"),l.xp6(1),l.hij("",e.name,"\n        ")}}function O(e,t){if(1&e&&(l.TgZ(0,"section",9),l._uU(1,"\n      "),l.TgZ(2,"span",10),l._uU(3),l.ALo(4,"i18n"),l.qZA(),l._uU(5,"\n      "),l.YNc(6,C,7,5,"a",11),l._uU(7,"\n    "),l.qZA()),2&e){const e=l.oxw().ngIf;l.xp6(3),l.Oqu(l.lcZ(4,2,"moreFromBitwarden")),l.xp6(3),l.Q6J("ngForOf",e.other)}}const k=function(e){return{"--num-products":e,"grid-template-columns":"repeat(min(var(--num-products,1),3),auto)"}};function P(e,t){if(1&e&&(l.TgZ(0,"div",3),l._uU(1,"\n    "),l._uU(2,"\n    "),l._uU(3,"\n    "),l.TgZ(4,"section",4),l._uU(5,"\n      "),l.YNc(6,T,7,6,"a",5),l._uU(7,"\n    "),l.qZA(),l._uU(8,"\n\n    "),l._uU(9,"\n    "),l.YNc(10,O,8,4,"section",6),l._uU(11,"\n  "),l.qZA()),2&e){const e=t.ngIf;l.xp6(4),l.Q6J("ngStyle",l.VKq(3,k,e.bento.length)),l.xp6(2),l.Q6J("ngForOf",e.bento),l.xp6(4),l.Q6J("ngIf",!1)}}class q{constructor(e,t,i,n){this.organizationService=e,this.providerService=t,this.route=i,this.router=n,this.products$=(0,w.a)([this.organizationService.organizations$,this.route.paramMap]).pipe((0,b.U)((([e,t])=>[e.sort(((e,t)=>e.name.localeCompare(t.name))),t])),(0,U.b)((([e,t])=>x(this,void 0,void 0,(function*(){var i;const n=e.find((e=>e.id===t.get("organizationId"))),s=(null==n?void 0:n.canAccessSecretsManager)&&1==(null==n?void 0:n.enabled)?n:e.find((e=>e.canAccessSecretsManager&&1==e.enabled)),o=null!=n&&(0,_.gW)(n)?n:e.find((e=>(0,_.gW)(e))),r=yield this.providerService.getAll(),a={pm:{name:"Password Manager",icon:"bwi-lock",appRoute:"/vault",marketingRoute:"https://bitwarden.com/products/personal/",isActive:!this.router.url.includes("/sm/")&&!this.router.url.includes("/organizations/")&&!this.router.url.includes("/providers/")},sm:{name:"Secrets Manager",icon:"bwi-cli",appRoute:["/sm",null==s?void 0:s.id],marketingRoute:"https://bitwarden.com/products/secrets-manager/",isActive:this.router.url.includes("/sm/")},ac:{name:"Admin Console",icon:"bwi-user-monitor",appRoute:["/organizations",null==o?void 0:o.id],marketingRoute:"https://bitwarden.com/products/business/",isActive:this.router.url.includes("/organizations/")},provider:{name:"Provider Portal",icon:"bwi-provider",appRoute:["/providers",null===(i=r[0])||void 0===i?void 0:i.id],isActive:this.router.url.includes("/providers/")},orgs:{name:"Organizations",icon:"bwi-business",marketingRoute:"https://bitwarden.com/products/business/"}},l=[a.pm],c=[];return s?l.push(a.sm):c.push(a.sm),o?l.push(a.ac):c.push(a.orgs),r.length>0&&l.push(a.provider),{bento:l,other:c}})))))}}q.ɵfac=function(e){return new(e||q)(l.Y36(_.Mn),l.Y36(A.H),l.Y36(u.gz),l.Y36(u.F0))},q.ɵcmp=l.Xpm({type:q,selectors:[["product-switcher-content"]],viewQuery:function(e,t){if(1&e&&l.Gf(S,5),2&e){let e;l.iGM(e=l.CRH())&&(t.menu=e.first)}},decls:8,vars:6,consts:[["ariaRole","dialog",3,"ariaLabel"],["menu",""],["class","tw-px-4 tw-py-2",4,"ngIf"],[1,"tw-px-4","tw-py-2"],[1,"tw-grid","tw-gap-2",3,"ngStyle"],["class","tw-group tw-flex tw-h-24 tw-w-28 tw-flex-col tw-items-center tw-justify-center tw-rounded tw-p-1 tw-text-primary-600 tw-outline-none hover:tw-bg-background-alt hover:tw-text-primary-700 hover:tw-no-underline focus-visible:!tw-ring-2 focus-visible:!tw-ring-primary-700","ariaCurrentWhenActive","page",3,"routerLink","ngClass",4,"ngFor","ngForOf"],["class","tw-mt-4 tw-flex tw-w-full tw-flex-col tw-gap-2 tw-border-0 tw-border-t tw-border-solid tw-border-t-text-muted tw-p-2 tw-pb-0",4,"ngIf"],["ariaCurrentWhenActive","page",1,"tw-group","tw-flex","tw-h-24","tw-w-28","tw-flex-col","tw-items-center","tw-justify-center","tw-rounded","tw-p-1","tw-text-primary-600","tw-outline-none","hover:tw-bg-background-alt","hover:tw-text-primary-700","hover:tw-no-underline","focus-visible:!tw-ring-2","focus-visible:!tw-ring-primary-700",3,"routerLink","ngClass"],[1,"tw-max-w-24","tw-text-center","tw-text-sm","tw-leading-snug","group-hover:tw-underline"],[1,"tw-mt-4","tw-flex","tw-w-full","tw-flex-col","tw-gap-2","tw-border-0","tw-border-t","tw-border-solid","tw-border-t-text-muted","tw-p-2","tw-pb-0"],[1,"tw-mb-1","tw-text-xs","tw-text-muted"],["bitLink","","target","_blank","rel","noreferrer",3,"href",4,"ngFor","ngForOf"],["bitLink","","target","_blank","rel","noreferrer",3,"href"],[1,"tw-flex","tw-items-center","tw-font-normal"]],template:function(e,t){1&e&&(l.TgZ(0,"bit-menu",0,1),l.ALo(2,"i18n"),l._uU(3,"\n  "),l.YNc(4,P,12,5,"div",2),l.ALo(5,"async"),l._uU(6,"\n"),l.qZA(),l._uU(7,"\n")),2&e&&(l.Q6J("ariaLabel",l.lcZ(2,2,"switchProducts")),l.xp6(4),l.Q6J("ngIf",l.lcZ(5,4,t.products$)))},dependencies:[c.mk,c.sg,c.O5,c.PC,u.rH,p.r,h.M,c.Ov,Z.C],encapsulation:2});class I{ngAfterViewInit(){this.changeDetector.detectChanges()}constructor(e){this.changeDetector=e,this.buttonType="main"}}I.ɵfac=function(e){return new(e||I)(l.Y36(l.sBO))},I.ɵcmp=l.Xpm({type:I,selectors:[["product-switcher"]],inputs:{buttonType:"buttonType"},decls:6,vars:5,consts:[["type","button","bitIconButton","bwi bwi-fw bwi-filter",3,"bitMenuTriggerFor","buttonType"],["content",""]],template:function(e,t){if(1&e&&(l._UZ(0,"button",0),l.ALo(1,"i18n"),l._uU(2,"\n"),l._UZ(3,"product-switcher-content",null,1),l._uU(5,"\n")),2&e){const e=l.MAs(4);l.Q6J("bitMenuTriggerFor",null==e?null:e.menu)("buttonType",t.buttonType),l.uIk("aria-label",l.lcZ(1,3,"switchProducts"))}},dependencies:[y.Q,g.t,q,Z.C],encapsulation:2});var M=i(40041),N=i(19576);class L{}L.ɵfac=function(e){return new(e||L)},L.ɵmod=l.oAB({type:L}),L.ɵinj=l.cJS({imports:[o.m,s.D,r.O,n.s]}),l.B6R(a.k,[c.mk,c.O5,u.rH,d._,p.r,h.M,g.t,f.e,m.n,v.t,s.D,I,M.S],[c.Ov,Z.C,N.z])},58618:(e,t,i)=>{"use strict";i.d(t,{k:()=>M});var n=i(92786),s=i(59157),o=i(33031),r=i(53634),a=i(58691),l=i(56934),c=i(36957),u=i(85762),d=i(55602),p=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class h{constructor(e){this.apiService=e}getShowUnassignedCiphersBanner(){return p(this,void 0,void 0,(function*(){return yield this.apiService.send("GET","/ciphers/has-unassigned-ciphers",null,!0,!0)}))}}h.ɵfac=function(e){return new(e||h)(u.LFG(d.s))},h.ɵprov=u.Yz7({token:h,factory:h.ɵfac,providedIn:"root"});var g=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const f=new c.fX(c.Qi,"showBanner",{deserializer:e=>e,clearOn:[]});class m{constructor(e,t,i,c){this.stateProvider=e,this.apiService=t,this.environmentService=i,this.organizationService=c,this._showBanner=this.stateProvider.getActive(f),this.showBanner$=this._showBanner.state$.pipe((0,s.b)((e=>g(this,void 0,void 0,(function*(){if(null==e){const e=yield this.apiService.getShowUnassignedCiphersBanner();return yield this._showBanner.update((()=>e)),e}return e}))))),this.adminConsoleOrg$=this.organizationService.organizations$.pipe((0,n.U)((e=>e.find((e=>(0,a.gW)(e)))))),this.adminConsoleUrl$=(0,o.a)([this.adminConsoleOrg$,this.environmentService.environment$]).pipe((0,n.U)((([e,t])=>null==e||null==t?"#":t.getWebVaultUrl()+"/#/organizations/"+e.id))),this.bannerText$=this.environmentService.environment$.pipe((0,n.U)((e=>(null==e?void 0:e.getRegion())==l.y.SelfHosted?"unassignedItemsBannerSelfHostNotice":"unassignedItemsBannerNotice"))),this.loading$=(0,o.a)([this.adminConsoleUrl$,this.bannerText$]).pipe((0,r.O)(!0),(0,n.U)((()=>!1)))}hideBanner(){return g(this,void 0,void 0,(function*(){yield this._showBanner.update((()=>!1))}))}}m.ɵfac=function(e){return new(e||m)(u.LFG(c.X9),u.LFG(h),u.LFG(l.L),u.LFG(a.Mn))},m.ɵprov=u.Yz7({token:m,factory:m.ɵfac,providedIn:"root"});var v=i(59281),y=i(27059),w=i(34961),b=i(8111),U=i(99721),_=i(7203),A=i(65254),Z=i(47724);function x(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"bit-banner",2),u.NdJ("onClose",(function(){u.CHM(e);const t=u.oxw();return u.KtG(t.unassignedItemsBannerService.hideBanner())})),u._uU(1),u.ALo(2,"i18n"),u.ALo(3,"async"),u.ALo(4,"i18n"),u.TgZ(5,"a",3),u.ALo(6,"async"),u._uU(7),u.ALo(8,"i18n"),u.qZA(),u._uU(9),u.ALo(10,"i18n"),u.TgZ(11,"a",4),u._uU(12),u.ALo(13,"i18n"),u.qZA(),u._uU(14,"\n"),u.qZA()}if(2&e){const e=u.oxw();u.xp6(1),u.AsE("\n  ",u.lcZ(2,6,u.lcZ(3,8,e.unassignedItemsBannerService.bannerText$)),"\n  ",u.lcZ(4,10,"unassignedItemsBannerCTAPartOne"),"\n  "),u.xp6(4),u.Q6J("href",u.lcZ(6,12,e.unassignedItemsBannerService.adminConsoleUrl$),u.LSH),u.xp6(2),u.Oqu(u.lcZ(8,14,"adminConsole")),u.xp6(2),u.hij("\n  ",u.lcZ(10,16,"unassignedItemsBannerCTAPartTwo"),"\n  "),u.xp6(3),u.Oqu(u.lcZ(13,18,"learnMore"))}}function S(e,t){if(1&e&&u._UZ(0,"i",17),2&e){const e=u.oxw(2);u.Gre("bwi ",e.icon,"")}}function T(e,t){if(1&e&&(u.ynx(0),u._uU(1,"\n                "),u._UZ(2,"bit-menu-divider"),u._uU(3,"\n                "),u.TgZ(4,"span",34),u._uU(5),u.qZA(),u._uU(6,"\n              "),u.BQk()),2&e){const e=u.oxw(3);u.xp6(5),u.hij("\n                  ",e.hostname,"\n                ")}}function C(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"button",32),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(3);return u.KtG(t.lock())})),u._uU(1,"\n                "),u._UZ(2,"i",35),u._uU(3),u.ALo(4,"i18n"),u.qZA()}2&e&&(u.xp6(3),u.hij("\n                ",u.lcZ(4,1,"lockNow"),"\n              "))}function O(e,t){if(1&e){const e=u.EpF();u.ynx(0),u._uU(1,"\n          "),u.TgZ(2,"button",18),u._uU(3,"\n            "),u._UZ(4,"dynamic-avatar",19),u.ALo(5,"userName"),u._uU(6,"\n          "),u.qZA(),u._uU(7,"\n\n          "),u.TgZ(8,"bit-menu",null,20),u._uU(10,"\n            "),u.TgZ(11,"div",21),u._uU(12,"\n              "),u.TgZ(13,"div",22),u._uU(14,"\n                "),u._UZ(15,"dynamic-avatar",19),u.ALo(16,"userName"),u._uU(17,"\n                "),u.TgZ(18,"div",23),u._uU(19,"\n                  "),u.TgZ(20,"span"),u._uU(21),u.ALo(22,"i18n"),u.qZA(),u._uU(23,"\n                  "),u.TgZ(24,"small",24),u._uU(25),u.ALo(26,"userName"),u.qZA(),u._uU(27,"\n                "),u.qZA(),u._uU(28,"\n              "),u.qZA(),u._uU(29,"\n\n              "),u.YNc(30,T,7,1,"ng-container",12),u._uU(31,"\n\n              "),u._UZ(32,"bit-menu-divider"),u._uU(33,"\n\n              "),u.TgZ(34,"a",25),u._uU(35,"\n                "),u._UZ(36,"i",26),u._uU(37),u.ALo(38,"i18n"),u.qZA(),u._uU(39,"\n              "),u.TgZ(40,"a",27),u._uU(41,"\n                "),u._UZ(42,"i",28),u._uU(43),u.ALo(44,"i18n"),u.qZA(),u._uU(45,"\n              "),u.TgZ(46,"a",29),u._uU(47,"\n                "),u._UZ(48,"i",30),u._uU(49),u.ALo(50,"i18n"),u.qZA(),u._uU(51,"\n\n              "),u._UZ(52,"bit-menu-divider"),u._uU(53,"\n\n              "),u.YNc(54,C,5,3,"button",31),u.ALo(55,"async"),u._uU(56,"\n              "),u.TgZ(57,"button",32),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(2);return u.KtG(t.logout())})),u._uU(58,"\n                "),u._UZ(59,"i",33),u._uU(60),u.ALo(61,"i18n"),u.qZA(),u._uU(62,"\n            "),u.qZA(),u._uU(63,"\n          "),u.qZA(),u._uU(64,"\n        "),u.BQk()}if(2&e){const e=t.ngIf,i=u.MAs(9),n=u.oxw(2);u.xp6(2),u.Q6J("bitMenuTriggerFor",i),u.xp6(2),u.Q6J("id",e.id)("text",u.lcZ(5,13,e)),u.xp6(11),u.Q6J("id",e.id)("text",u.lcZ(16,15,e)),u.xp6(6),u.Oqu(u.lcZ(22,17,"loggedInAs")),u.xp6(4),u.hij("\n                    ",u.lcZ(26,19,e),"\n                  "),u.xp6(5),u.Q6J("ngIf",n.selfHosted),u.xp6(7),u.hij("\n                ",u.lcZ(38,21,"accountSettings"),"\n              "),u.xp6(6),u.hij("\n                ",u.lcZ(44,23,"getHelp"),"\n              "),u.xp6(6),u.hij("\n                ",u.lcZ(50,25,"getApps"),"\n              "),u.xp6(5),u.Q6J("ngIf",u.lcZ(55,27,n.canLock$)),u.xp6(6),u.hij("\n                ",u.lcZ(61,29,"logOut"),"\n              ")}}const k=function(e){return{"tw-border-0 tw-border-b tw-border-solid tw-border-secondary-300 tw-bg-background-alt tw-pb-0":e}},P=function(e){return{"tw-hidden":e}};function q(e,t){if(1&e&&(u.TgZ(0,"header",5),u._uU(1,"\n  "),u.TgZ(2,"div",6),u._uU(3,"\n    "),u.TgZ(4,"div",7),u._uU(5,"\n      "),u.Hsn(6),u._uU(7,"\n      "),u.TgZ(8,"h1",8),u.ALo(9,"i18n"),u._uU(10,"\n        "),u.YNc(11,S,1,3,"i",9),u._uU(12),u.ALo(13,"i18n"),u.Hsn(14,1),u._uU(15,"\n      "),u.qZA(),u._uU(16,"\n    "),u.qZA(),u._uU(17,"\n    "),u.TgZ(18,"div",10),u._uU(19,"\n      "),u.TgZ(20,"div",11),u._uU(21,"\n        "),u.Hsn(22,2),u._uU(23,"\n        "),u._UZ(24,"product-switcher"),u._uU(25,"\n        "),u.YNc(26,O,65,31,"ng-container",12),u.ALo(27,"async"),u._uU(28,"\n      "),u.qZA(),u._uU(29,"\n      "),u.TgZ(30,"div",13,14),u._uU(32,"\n        "),u.Hsn(33,3),u._uU(34,"\n      "),u.qZA(),u._uU(35,"\n    "),u.qZA(),u._uU(36,"\n  "),u.qZA(),u._uU(37,"\n  "),u.TgZ(38,"div",15,16),u._uU(40,"\n    "),u.Hsn(41,4),u._uU(42,"\n  "),u.qZA(),u._uU(43,"\n"),u.qZA()),2&e){const e=t.ngIf,i=u.MAs(31),n=u.MAs(39),s=u.oxw();u.Q6J("ngClass",u.VKq(13,k,0!==n.childElementCount)),u.xp6(8),u.Q6J("title",s.title||u.lcZ(9,7,e.titleId)),u.xp6(3),u.Q6J("ngIf",s.icon),u.xp6(1),u.hij("\n        ",s.title||u.lcZ(13,9,e.titleId),"\n        "),u.xp6(14),u.Q6J("ngIf",u.lcZ(27,11,s.account$)),u.xp6(4),u.Q6J("ngClass",u.VKq(15,P,0===i.childElementCount)),u.xp6(8),u.Q6J("ngClass",u.VKq(17,P,0===n.childElementCount))}}const I=[[["","slot","breadcrumbs"]],[["","slot","title-suffix"]],"*",[["","slot","secondary"]],[["","slot","tabs"]]];class M{constructor(e,t,i,s,o,r,a){this.route=e,this.platformUtilsService=t,this.vaultTimeoutSettingsService=i,this.messagingService=s,this.unassignedItemsBannerService=o,this.configService=r,this.accountService=a,this.hostname=location.hostname,this.unassignedItemsBannerEnabled$=this.configService.getFeatureFlag$(v.T.UnassignedItemsBanner),this.routeData$=this.route.data.pipe((0,n.U)((e=>({titleId:e.titleId})))),this.selfHosted=this.platformUtilsService.isSelfHost(),this.account$=this.accountService.activeAccount$,this.canLock$=this.vaultTimeoutSettingsService.availableVaultTimeoutActions$().pipe((0,n.U)((e=>e.includes(y.B.Lock))))}lock(){this.messagingService.send("lockVault")}logout(){this.messagingService.send("logout")}}M.ɵfac=function(e){return new(e||M)(u.Y36(b.gz),u.Y36(U.P),u.Y36(_.E),u.Y36(w.o),u.Y36(m),u.Y36(A.E),u.Y36(Z.BR))},M.ɵcmp=u.Xpm({type:M,selectors:[["app-header"]],inputs:{title:"title",icon:"icon"},ngContentSelectors:["[slot=breadcrumbs]","[slot=title-suffix]","*","[slot=secondary]","[slot=tabs]"],decls:8,vars:10,consts:[["class","-tw-m-6 tw-flex tw-flex-col tw-pb-6",3,"onClose",4,"ngIf"],["class","-tw-m-6 tw-mb-3 tw-flex tw-flex-col tw-p-6",3,"ngClass",4,"ngIf"],[1,"-tw-m-6","tw-flex","tw-flex-col","tw-pb-6",3,"onClose"],["bitLink","","linkType","contrast","rel","noreferrer",3,"href"],["href","https://bitwarden.com/help/unassigned-vault-items-moved-to-admin-console","bitLink","","linkType","contrast","target","_blank","rel","noreferrer"],[1,"-tw-m-6","tw-mb-3","tw-flex","tw-flex-col","tw-p-6",3,"ngClass"],[1,"tw-flex"],[1,"tw-flex","tw-min-w-0","tw-flex-1","tw-flex-col","tw-gap-2"],["bitTypography","h1","noMargin","",1,"tw-m-0","tw-mr-2","tw-truncate","tw-leading-10",3,"title"],["aria-hidden","true",3,"class",4,"ngIf"],[1,"tw-ml-auto","tw-flex","tw-flex-col","tw-gap-4"],[1,"tw-flex","tw-min-w-max","tw-items-center","tw-justify-end","tw-gap-2"],[4,"ngIf"],[1,"tw-ml-auto",3,"ngClass"],["contentContainer",""],[1,"-tw-mx-4","-tw-mb-px",3,"ngClass"],["tabsContainer",""],["aria-hidden","true"],["type","button",1,"tw-border-0","tw-bg-transparent","tw-p-0",3,"bitMenuTriggerFor"],[3,"id","text"],["accountMenu",""],[1,"tw-flex","tw-min-w-52","tw-max-w-72","tw-flex-col"],["appStopProp","",1,"tw-flex","tw-items-center","tw-px-4","tw-py-1","tw-leading-tight","tw-text-info"],[1,"tw-ml-2","tw-block","tw-overflow-hidden","tw-whitespace-nowrap"],[1,"tw-block","tw-overflow-hidden","tw-whitespace-nowrap","tw-text-muted"],["bitMenuItem","","routerLink","/settings/account"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-user"],["bitMenuItem","","href","https://github.com/dani-garcia/vaultwarden","target","_blank","rel","noreferrer"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-question-circle"],["bitMenuItem","","href","https://bitwarden.com/download/","target","_blank","rel","noreferrer"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-download"],["bitMenuItem","","type","button",3,"click",4,"ngIf"],["bitMenuItem","","type","button",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-sign-out"],[1,"tw-break-all","tw-px-4","tw-py-1","tw-text-left","tw-text-muted"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-lock"]],template:function(e,t){1&e&&(u.F$t(I),u.YNc(0,x,15,20,"bit-banner",0),u.ALo(1,"async"),u.ALo(2,"async"),u.ALo(3,"async"),u._uU(4,"\n"),u.YNc(5,q,44,19,"header",1),u.ALo(6,"async"),u._uU(7,"\n")),2&e&&(u.Q6J("ngIf",u.lcZ(1,2,t.unassignedItemsBannerEnabled$)&&u.lcZ(2,4,t.unassignedItemsBannerService.showBanner$)&&!u.lcZ(3,6,t.unassignedItemsBannerService.loading$)),u.xp6(5),u.Q6J("ngIf",u.lcZ(6,8,t.routeData$)))},encapsulation:2})},85915:(e,t,i)=>{"use strict";i.d(t,{O:()=>l});var n=i(66267),s=i(8111),o=i(82933),r=i(71146),a=i(85762);class l{}l.ɵfac=function(e){return new(e||l)},l.ɵmod=a.oAB({type:l}),l.ɵinj=a.cJS({providers:[o.C],imports:[r.m,n.rt,s.Bz]})},53423:(e,t,i)=>{"use strict";i.d(t,{x:()=>c});var n=i(28508),s=i(38261),o=i(85762),r=i(99721),a=i(59880);function l(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"bit-nav-item",1),o.NdJ("click",(function(){o.CHM(e);const t=o.oxw();return o.KtG(t.toggleWidth())})),o.qZA()}}class c{constructor(e){this.isDev=e.isDev()}toggleWidth(){"unset"===document.body.style.minWidth?document.body.style.minWidth="":document.body.style.minWidth="unset"}}c.ɵfac=function(e){return new(e||c)(o.Y36(r.P))},c.ɵcmp=o.Xpm({type:c,selectors:[["app-toggle-width"]],standalone:!0,features:[o.jDz],decls:1,vars:1,consts:[["text","Toggle Width","icon","bwi-bug","class","tw-absolute tw-bottom-0 tw-w-full",3,"click",4,"ngIf"],["text","Toggle Width","icon","bwi-bug",1,"tw-absolute","tw-bottom-0","tw-w-full",3,"click"]],template:function(e,t){1&e&&o.YNc(0,l,1,0,"bit-nav-item",0),2&e&&o.Q6J("ngIf",t.isDev)},dependencies:[n.ez,n.O5,s.A,a.H],encapsulation:2})},28926:(e,t,i)=>{"use strict";i.d(t,{z:()=>C});var n=i(28508),s=i(8111),o=i(92716),r=i(5344),a=i(58691),l=i(59281),c=i(33760),u=i(5261),d=i(38261);const p=i(66997).W4`
<svg version="1.1" viewBox="0 0 800 200" xmlns="http://www.w3.org/2000/svg">
 <path class="tw-fill-text-alt2" d="m457.16 129.39-11.407-36.49q-1.0783-3.3482-4.0292-15.209h-.454q-2.27 9.9313-3.9725 15.322l-11.747 36.377h-10.896l-16.968-62.197h9.8744q6.0158 23.438 9.137 35.696 3.178 12.258 3.632 16.514h.454q.62424-3.2347 1.9863-8.342 1.4188-5.1642 2.4402-8.1717l11.407-35.696h10.215l11.123 35.696q3.178 9.7611 4.313 16.401h.454q.227-2.043 1.1918-6.2993 1.0215-4.2562 11.861-45.797h9.7611l-17.195 62.197zm77.858 0-1.8727-8.8528h-.454q-4.6535 5.8455-9.3072 7.9451-4.5968 2.043-11.52 2.043-9.2503 0-14.528-4.767-5.221-4.767-5.221-13.563 0-18.841 30.134-19.749l10.555-.3405v-3.859q0-7.3209-3.178-10.783-3.1212-3.5185-10.045-3.5185-7.7748 0-17.592 4.767l-2.8943-7.207q4.5968-2.497 10.045-3.9158 5.5048-1.4187 11.009-1.4187 11.123 0 16.457 4.9373 5.3912 4.9373 5.3912 15.833v42.449zm-21.281-6.6399q8.7964 0 13.79-4.8238 5.0508-4.8238 5.0508-13.506v-5.6183l-9.4205.39725q-11.237.39725-16.231 3.5185-4.9372 3.0645-4.9372 9.5908 0 5.1075 3.0645 7.7748 3.1212 2.6672 8.6825 2.6672zm76.045-56.693q4.1428 0 7.4343.68101l-1.3053 8.7395q-3.859-.85122-6.8101-.85122-7.5476 0-12.939 6.1291-5.3345 6.1291-5.3345 15.266v33.369h-9.4205v-62.197h7.7748l1.0783 11.52h.454q3.4617-6.0721 8.3425-9.3636 4.8805-3.2915 10.726-3.2915zm59.077 54.991h-.51081q-6.526 9.4775-19.522 9.4775-12.201 0-19.011-8.342-6.7532-8.342-6.7532-23.721t6.8102-23.892q6.8101-8.5122 18.954-8.5122 12.655 0 19.408 9.1933h.73779l-.39725-4.4832-.22704-4.3697v-25.311h9.4205v88.301h-7.6615zm-18.841 1.589q9.6478 0 13.96-5.221 4.3697-5.2777 4.3697-16.968v-1.9863q0-13.223-4.4264-18.841-4.3698-5.675-14.017-5.675-8.2856 0-12.712 6.4696-4.3698 6.4127-4.3698 18.16 0 11.918 4.3698 17.99 4.3697 6.0721 12.825 6.0721zm74 7.8881q-13.79 0-21.792-8.3989-7.9451-8.3989-7.9451-23.324 0-15.039 7.3773-23.892 7.4343-8.8528 19.919-8.8528 11.69 0 18.501 7.7179 6.8101 7.6615 6.8101 20.26v5.9588h-42.846q.28376 10.953 5.5048 16.628 5.2777 5.675 14.812 5.675 10.045 0 19.863-4.1995v8.3989q-4.994 2.1565-9.4775 3.0645-4.4265.96478-10.726.96478zm-2.5537-56.58q-7.4912 0-11.975 4.8805-4.4265 4.8805-5.221 13.506h32.518q0-8.9097-3.9725-13.62-3.9725-4.767-11.35-4.767zm84.047 55.445v-40.236q0-7.6045-3.4617-11.35-3.4618-3.7455-10.839-3.7455-9.7611 0-14.301 5.2777t-4.54 17.422v32.631h-9.4205v-62.197h7.6615l1.5322 8.5122h.45403q2.8942-4.5968 8.1153-7.0937 5.221-2.5537 11.634-2.5537 11.237 0 16.912 5.448 5.675 5.3912 5.675 17.309v40.576z"/>
 <path class="tw-fill-text-alt2" d="m213.24 129.39-3.3482-8.6261h-.454q-4.3697 5.5048-9.023 7.6615-4.5968 2.0998-12.031 2.0998-9.137 0-14.415-5.221-5.221-5.221-5.221-14.869 0-10.102 7.0368-14.869 7.0937-4.8238 21.338-5.3345l11.009-.3405v-2.7808q0-9.6478-9.8744-9.6478-7.6045 0-17.876 4.5968l-5.7318-11.69q10.953-5.7318 24.289-5.7318 12.769 0 19.579 5.5615 6.8102 5.5615 6.8102 16.912v42.279zm-5.1075-29.397-6.6962.227q-7.5476.227-11.237 2.724-3.6888 2.497-3.6888 7.6045 0 7.321 8.3989 7.321 6.0158 0 9.5908-3.4617 3.632-3.4617 3.632-9.1933zm79.962 29.397-2.3268-8.1153h-.908q-2.7808 4.4265-7.8881 6.8665-5.1075 2.3835-11.634 2.3835-11.18 0-16.855-5.9588-5.675-6.0158-5.675-17.252v-41.371h17.309v37.058q0 6.8665 2.4402 10.328 2.4402 3.405 7.7748 3.405 7.264 0 10.499-4.8238 3.2348-4.8805 3.2348-16.117v-29.85h17.309v63.447zm48.748 0h-17.309v-88.301h17.309zm44.889-12.655q4.54 0 10.896-1.9863v12.882q-6.4696 2.8943-15.89 2.8943-10.385 0-15.152-5.221-4.7103-5.2777-4.7103-15.776v-30.588h-8.2856v-7.321l9.5338-5.7885 4.994-13.393h11.066v13.506h17.763v12.996h-17.763v30.588q0 3.6887 2.043 5.448 2.0998 1.7592 5.5047 1.7592z"/>
 <path class="tw-fill-text-alt2" d="m51.982 33.947-15.322.002 41.131 115.17h14.518l41.131-115.17h-15.162l-25.971 73.872c-1.7205 4.7315-3.1706 9.1927-4.3535 13.387-1.1829 4.086-2.1516 8.0119-2.9043 11.775-.75272-3.7636-1.7195-7.7417-2.9023-11.936-1.1829-4.1938-2.635-8.7098-4.3555-13.549l-25.809-73.552z"/>
 <path class="tw-fill-text-alt2" d="m84.264 5.0749a2.3288 2.3288 0 00-1.2122.99654l-4.145 6.9077c-.72599.06029-1.4502.12529-2.1701.20657l-5.406-5.9599a2.3288 2.3288 0 00-3.9203.77975l-2.7161 7.5796c-.7008.20184-1.4008.40458-2.0929.62653l-6.4616-4.7875a2.3288 2.3288 0 00-3.691 1.53l-1.1884 7.9871c-.63834.33084-1.2749.66363-1.9023 1.0124l-7.297-3.4482a2.3288 2.3288 0 00-3.3222 2.2201l.39272 8.0937c-.55229.44111-1.0997.8874-1.639 1.3438l-7.8588-1.9647a2.3288 2.3288 0 00-2.825 2.825l1.9647 7.8588c-.45646.53923-.90273 1.0867-1.3439 1.639l-8.0937-.39271a2.3288 2.3288 0 00-2.2201 3.3222l3.4482 7.297c-.3488.62737-.68158 1.2639-1.0124 1.9023l-7.9871 1.1884a2.3288 2.3288 0 00-1.53 3.6911l4.7875 6.4616c-.22196.69217-.4247 1.3921-.62653 2.093l-7.5796 2.7161a2.3288 2.3288 0 00-.77976 3.9203l5.9599 5.4061c-.08128.71995-.14628 1.4442-.20657 2.1701l-6.9077 4.1451a2.3288 2.3288 0 000 3.9952l6.9077 4.1439c.06028.72636.12524 1.451.20657 2.1713l-5.9599 5.4061a2.3288 2.3288 0 00.77976 3.9192l7.5796 2.7161c.20188.70099.4045 1.4017.62653 2.0941l-4.7875 6.4605a2.3288 2.3288 0 001.53 3.6922l7.9871 1.1884c.33079.63822.6637 1.275 1.0124 1.9023l-3.4482 7.297a2.3288 2.3288 0 002.2201 3.3222l8.0937-.39272c.44117.55235.88734 1.0997 1.3439 1.639l-1.9647 7.8588a2.3288 2.3288 0 002.825 2.825l7.8588-1.9647c.53923.45647 1.0867.90273 1.639 1.3438l-.39272 8.0926a2.3288 2.3288 0 003.3222 2.2201l7.297-3.447c.62736.34881 1.2639.68158 1.9023 1.0124l1.1884 7.987a2.3288 2.3288 0 003.691 1.5289l6.4616-4.7864c.69217.22197 1.3921.4247 2.0929.62654l2.7161 7.5796a2.3288 2.3288 0 003.9203.7786l5.4049-5.9588c.72031.0813 1.4449.14624 2.1713.20656l4.145 6.9077a2.3288 2.3288 0 003.9952 0l4.1439-6.9077c.72674-.0603 1.4517-.12518 2.1724-.20656l5.4049 5.9588a2.3288 2.3288 0 003.9192-.7786l2.7161-7.5796c.70103-.20189 1.4017-.4045 2.0941-.62654l6.4605 4.7864a2.3288 2.3288 0 003.6922-1.5289l1.1884-7.987c.63823-.33079 1.275-.6637 1.9023-1.0124l7.297 3.447a2.3288 2.3288 0 003.3222-2.2201l-.39271-8.0926c.55234-.44117 1.0997-.88734 1.639-1.3438l7.8588 1.9647a2.3288 2.3288 0 002.825-2.825l-1.9647-7.8588c.4565-.53928.90269-1.0866 1.3438-1.639l8.0926.39272a2.3288 2.3288 0 002.2201-3.3222l-3.447-7.297c.34872-.62723.68163-1.264 1.0124-1.9023l7.987-1.1884a2.3288 2.3288 0 001.5289-3.6922l-4.7863-6.4605c.22202-.69235.42462-1.3931.62652-2.0941l7.5796-2.7161a2.3288 2.3288 0 00.77862-3.9192l-5.9588-5.4049c.0814-.72069.14623-1.4457.20658-2.1724l6.9077-4.1439a2.3288 2.3288 0 000-3.9952l-6.9077-4.1451c-.0603-.72635-.12524-1.451-.20658-2.1713l5.9588-5.4049a2.3288 2.3288 0 00-.77862-3.9203l-7.5796-2.7161c-.20184-.70082-.40457-1.4008-.62652-2.093l4.7863-6.4616a2.3288 2.3288 0 00-1.5289-3.6911l-7.987-1.1884c-.33084-.63836-.66362-1.2749-1.0124-1.9023l3.447-7.297a2.3288 2.3288 0 00-2.2201-3.3222l-8.0926.39271c-.44112-.55229-.8874-1.0997-1.3438-1.639l1.9647-7.8588a2.3288 2.3288 0 00-2.825-2.825l-7.8588 1.9647c-.53927-.4565-1.0866-.9027-1.639-1.3438l.39271-8.0937a2.3288 2.3288 0 00-3.3222-2.2201l-7.297 3.4482c-.62726-.34873-1.264-.68165-1.9023-1.0124l-1.1884-7.9871a2.3288 2.3288 0 00-3.6922-1.53l-6.4605 4.7875c-.69236-.22201-1.3931-.42463-2.0941-.62653l-2.7161-7.5796a2.3288 2.3288 0 00-3.9192-.77975l-5.406 5.9599c-.72032-.08133-1.4449-.14626-2.1713-.20657l-4.1439-6.9077a2.3288 2.3288 0 00-2.783-.99654zm.78543 14.613a4.657 4.657 0 014.6569 4.6569 4.657 4.657 0 01-4.6569 4.6569 4.657 4.657 0 01-4.6569-4.6569 4.657 4.657 0 014.6569-4.6569zm-10.998 8.0064 7.7056 7.7056a4.6575 4.6575 0 006.5853 0l7.7056-7.7056c17.959 3.3214 33.023 14.65 41.468 30.141l-4.943 9.6998a4.6575 4.6575 0 002.0351 6.263l9.7123 4.9486c.32157 2.5182.49487 5.0839.49487 7.692 0 15.934-6.1974 30.369-16.306 41.066l-10.796-1.7093a4.6575 4.6575 0 00-5.3277 3.8704l-1.7116 10.804c-7.7603 3.6739-16.443 5.734-25.624 5.734-9.1812 0-17.864-2.0608-25.625-5.7352l-1.7116-10.803a4.6575 4.6575 0 00-5.3277-3.8715l-10.795 1.7105c-10.108-10.697-16.306-25.132-16.306-41.066 0-2.608.1733-5.1738.49487-7.692l9.7111-4.9486a4.6575 4.6575 0 002.0351-6.263l-4.9418-9.6986c8.4449-15.492 23.508-26.821 41.468-30.142zm-47.923 34.902a4.657 4.657 0 011.3064.22587 4.657 4.657 0 012.9896 5.868 4.657 4.657 0 01-5.868 2.9907 4.657 4.657 0 01-2.9907-5.8691 4.657 4.657 0 014.5627-3.2155zm117.84 0a4.657 4.657 0 014.5616 3.2155 4.657 4.657 0 01-2.9896 5.8691 4.657 4.657 0 01-5.868-2.9907 4.657 4.657 0 012.9896-5.868 4.657 4.657 0 011.3064-.22587zm-95.153 69.428a4.657 4.657 0 012.4709.88189 4.657 4.657 0 011.0306 6.5047 4.657 4.657 0 01-6.5047 1.0306 4.657 4.657 0 01-1.0306-6.5047 4.657 4.657 0 014.0338-1.9125zm72.463 0a4.657 4.657 0 014.0338 1.9125 4.657 4.657 0 01-1.0306 6.5047 4.657 4.657 0 01-6.5047-1.0306 4.657 4.657 0 011.0306-6.5047 4.657 4.657 0 012.4709-.88189z"/>
 <path class="tw-fill-text-alt2" d="m304.87 145.51q7.8436 0 11.429 3.0814t3.5857 8.684q0 3.3055-1.5127 6.2189-1.4567 2.8573-4.9863 4.6502-3.4736 1.7928-9.4684 1.7928h-4.5941v15.575h-5.0423v-40.003zm-.44821 4.314h-5.0984v15.799h4.0339q5.7147 0 8.516-1.8489 2.8013-1.8488 2.8013-6.2749 0-3.8658-2.4652-5.7707-2.4651-1.9049-7.7876-1.9049zm34.456 5.1544q5.4906 0 8.1238 2.4091t2.6332 7.6756v20.449h-3.5857l-.95244-4.258h-.2241q-1.9609 2.4651-4.1459 3.6417-2.129 1.1765-5.9388 1.1765-4.0899 0-6.7792-2.129-2.6892-2.185-2.6892-6.7791 0-4.4821 3.5296-6.8912 3.5296-2.4651 10.869-2.6892l5.0984-.16808v-1.7928q0-3.7537-1.6248-5.2104t-4.5941-1.4567q-2.3531 0-4.4821.72834-2.129.67231-3.9778 1.5687l-1.5127-3.6977q1.9609-1.0645 4.6502-1.7928 2.6892-.78437 5.6026-.78437zm1.4567 16.023q-5.6026.2241-7.7876 1.7928-2.129 1.5687-2.129 4.426 0 2.5212 1.5127 3.6977 1.5687 1.1766 3.9778 1.1766 3.8098 0 6.3309-2.073 2.5212-2.129 2.5212-6.499v-2.6892zm38.154 6.2189q0 4.37-3.2495 6.6111-3.2495 2.241-8.7401 2.241-3.1375 0-5.4345-.50423-2.241-.50424-3.9778-1.4006v-4.4821q1.7928.89641 4.314 1.6808 2.5772.72834 5.2104.72834 3.7537 0 5.4345-1.1766 1.6808-1.2326 1.6808-3.2495 0-1.1205-.61628-2.0169-.61629-.89642-2.241-1.7928-1.5687-.89641-4.5381-2.0169-2.9134-1.1205-4.9863-2.241t-3.1935-2.6892-1.1205-4.0339q0-3.8098 3.0814-5.8827 3.1374-2.073 8.1798-2.073 2.7453 0 5.0984.56026 2.4091.50423 4.4821 1.4567l-1.6808 3.9218q-1.9049-.78436-3.9778-1.3446t-4.258-.56026q-3.0254 0-4.6502 1.0085-1.5687.95244-1.5687 2.6332 0 1.2326.72834 2.129.72834.84039 2.4091 1.6808 1.7368.78436 4.5941 1.9049 2.8573 1.0645 4.8743 2.185t3.0814 2.7453q1.0645 1.5687 1.0645 3.9778zm26.836 0q0 4.37-3.2495 6.6111t-8.74 2.241q-3.1375 0-5.4345-.50423-2.241-.50424-3.9778-1.4006v-4.4821q1.7928.89641 4.314 1.6808 2.5772.72834 5.2104.72834 3.7537 0 5.4345-1.1766 1.6808-1.2326 1.6808-3.2495 0-1.1205-.61629-2.0169-.61628-.89642-2.241-1.7928-1.5687-.89641-4.5381-2.0169-2.9134-1.1205-4.9863-2.241-2.073-1.1205-3.1935-2.6892t-1.1205-4.0339q0-3.8098 3.0814-5.8827 3.1375-2.073 8.1798-2.073 2.7453 0 5.0984.56026 2.4091.50423 4.4821 1.4567l-1.6808 3.9218q-1.9049-.78436-3.9778-1.3446t-4.258-.56026q-3.0254 0-4.6502 1.0085-1.5687.95244-1.5687 2.6332 0 1.2326.72833 2.129.72834.84039 2.4091 1.6808 1.7368.78436 4.5941 1.9049 2.8573 1.0645 4.8743 2.185 2.0169 1.1205 3.0814 2.7453 1.0645 1.5687 1.0645 3.9778zm26.668-8.684q-.72834-2.2971-1.2886-4.4821-.50424-2.241-.78437-3.4736h-.2241q-.2241 1.2326-.72834 3.4736-.50423 2.185-1.2886 4.5381l-5.3785 16.864h-5.6026l-8.2358-30.03h5.0984l4.1459 16.023q.61628 2.4091 1.1765 4.8743.56026 2.4651.78437 4.0899h.2241q.2241-.95245.50423-2.3531.33616-1.4006.72834-2.9134.39218-1.5687.78437-2.8013l5.3225-16.92h5.3785l5.1544 16.92q.61629 1.9049 1.1766 4.1459.61629 2.241.84039 3.8658h.2241q.16808-1.4006.72834-3.8658.61629-2.4652 1.2886-5.0423l4.202-16.023h5.0423l-8.3479 30.03h-5.7707zm50.76 1.9049q0 7.4515-3.8098 11.541-3.7537 4.0899-10.197 4.0899-3.9778 0-7.1153-1.7928-3.0814-1.8489-4.8743-5.3225-1.7928-3.5296-1.7928-8.516 0-7.4515 3.7537-11.485t10.197-4.0339q4.0899 0 7.1713 1.8488 3.1375 1.7928 4.8743 5.2664 1.7928 3.4176 1.7928 8.4039zm-22.691 0q0 5.3225 2.073 8.4599 2.129 3.0814 6.7231 3.0814 4.5381 0 6.6671-3.0814 2.129-3.1374 2.129-8.4599t-2.129-8.3479q-2.129-3.0254-6.7231-3.0254t-6.6671 3.0254q-2.073 3.0254-2.073 8.3479zm44.485-15.519q.84039 0 1.7928.11205 1.0085.056 1.7368.2241l-.61628 4.5381q-.72834-.16808-1.6248-.28013-.84039-.11205-1.6248-.11205-2.2971 0-4.314 1.2886-2.0169 1.2326-3.2495 3.5296-1.1766 2.241-1.1766 5.2664v16.023h-4.9303v-30.03h4.0339l.56026 5.4905h.2241q1.4567-2.4651 3.7537-4.258 2.2971-1.7928 5.4345-1.7928zm18.657 31.15q-5.6026 0-8.9642-3.8658-3.3616-3.9218-3.3616-11.653t3.3616-11.653q3.4176-3.9778 9.0202-3.9778 3.4736 0 5.6586 1.2886 2.241 1.2886 3.6417 3.1375h.33615q-.056-.72834-.2241-2.129-.11205-1.4567-.11205-2.2971v-11.99h4.9303v42.58h-3.9778l-.72834-4.0339h-.2241q-1.3446 1.9049-3.5857 3.2495-2.241 1.3446-5.7707 1.3446zm.78437-4.0899q4.7622 0 6.6671-2.5772 1.9609-2.6332 1.9609-7.8997v-.89641q0-5.6026-1.8488-8.572-1.8489-3.0254-6.8352-3.0254-3.9778 0-5.9948 3.1935-1.9609 3.1374-1.9609 8.4599 0 5.3785 1.9609 8.3479 2.0169 2.9694 6.0508 2.9694zm55.914 3.5296-13.166-35.072h-.2241q.16808 1.7368.28013 4.7062.11205 2.9134.11205 6.1068v24.259h-4.6502v-40.003h7.4515l12.326 32.775h.22411l12.55-32.775h7.3954v40.003h-4.9863v-24.595q0-2.9134.11205-5.7707.16808-2.8573.28013-4.6502h-.2241l-13.334 35.016zm43.868-30.534q5.4906 0 8.1238 2.4091t2.6332 7.6756v20.449h-3.5857l-.95244-4.258h-.22411q-1.9609 2.4651-4.1459 3.6417-2.129 1.1765-5.9388 1.1765-4.0899 0-6.7791-2.129-2.6892-2.185-2.6892-6.7791 0-4.4821 3.5296-6.8912 3.5296-2.4651 10.869-2.6892l5.0984-.16808v-1.7928q0-3.7537-1.6248-5.2104t-4.5941-1.4567q-2.3531 0-4.4821.72834-2.129.67231-3.9778 1.5687l-1.5127-3.6977q1.9609-1.0645 4.6502-1.7928 2.6892-.78437 5.6026-.78437zm1.4567 16.023q-5.6026.2241-7.7876 1.7928-2.129 1.5687-2.129 4.426 0 2.5212 1.5127 3.6977 1.5687 1.1766 3.9778 1.1766 3.8098 0 6.3309-2.073 2.5212-2.129 2.5212-6.499v-2.6892zm33.055-16.079q5.3785 0 8.1238 2.6332 2.7453 2.5772 2.7453 8.4039v19.553h-4.8743v-19.217q0-7.2274-6.7231-7.2274-4.9863 0-6.8912 2.8013t-1.9049 8.0677v15.575h-4.9303v-30.03h3.9778l.72834 4.0899h.28013q1.4567-2.3531 4.0339-3.4736 2.5772-1.1765 5.4345-1.1765zm31.543.056q5.4906 0 8.1238 2.4091t2.6332 7.6756v20.449h-3.5857l-.95245-4.258h-.2241q-1.9609 2.4651-4.1459 3.6417-2.129 1.1765-5.9388 1.1765-4.0899 0-6.7792-2.129-2.6892-2.185-2.6892-6.7791 0-4.4821 3.5296-6.8912 3.5296-2.4651 10.869-2.6892l5.0984-.16808v-1.7928q0-3.7537-1.6248-5.2104t-4.5941-1.4567q-2.3531 0-4.4821.72834-2.129.67231-3.9778 1.5687l-1.5127-3.6977q1.9609-1.0645 4.6502-1.7928 2.6892-.78437 5.6026-.78437zm1.4567 16.023q-5.6026.2241-7.7876 1.7928-2.129 1.5687-2.129 4.426 0 2.5212 1.5127 3.6977 1.5687 1.1766 3.9778 1.1766 3.8098 0 6.3309-2.073 2.5212-2.129 2.5212-6.499v-2.6892zm29.246-16.079q2.9694 0 5.3225 1.1205 2.4091 1.1205 4.0899 3.4176h.28013l.67231-3.9778h3.9218v30.534q0 6.443-3.3055 9.6925-3.2495 3.2495-10.141 3.2495-6.6111 0-10.813-1.9049v-4.5381q4.426 2.3531 11.093 2.3531 3.8658 0 6.0508-2.2971 2.241-2.241 2.241-6.1629v-1.1766q0-.67231.056-1.9049.056-1.2886.11205-1.7928h-.2241q-3.0254 4.5381-9.3003 4.5381-5.8267 0-9.1322-4.0899-3.2495-4.0899-3.2495-11.429 0-7.1713 3.2495-11.373 3.3055-4.258 9.0762-4.258zm.67232 4.1459q-3.7538 0-5.8267 3.0254-2.073 2.9694-2.073 8.516t2.0169 8.516q2.073 2.9134 5.9948 2.9134 4.5381 0 6.6111-2.4091 2.073-2.4651 2.073-7.8997v-1.1766q0-6.1629-2.129-8.7961-2.129-2.6892-6.6671-2.6892zm34.736-4.1459q3.8658 0 6.6111 1.6808 2.8013 1.6808 4.258 4.7622 1.5127 3.0254 1.5127 7.1153v2.9694h-20.562q.11206 5.0984 2.5772 7.7876 2.5212 2.6332 7.0032 2.6332 2.8573 0 5.0423-.50423 2.241-.56026 4.5941-1.5687v4.314q-2.2971 1.0085-4.5381 1.4567-2.241.50423-5.3225.50423-4.258 0-7.5635-1.7368-3.2495-1.7368-5.0984-5.1544-1.7928-3.4736-1.7928-8.4599 0-4.9303 1.6248-8.4599 1.6808-3.5296 4.6502-5.4345 3.0254-1.9049 7.0032-1.9049zm-.056 4.0339q-3.5296 0-5.6026 2.2971-2.0169 2.241-2.4091 6.2749h15.295q-.056-3.8098-1.7928-6.1629-1.7368-2.4091-5.4906-2.4091zm34.064-4.0339q.84039 0 1.7928.11205 1.0085.056 1.7368.2241l-.61629 4.5381q-.72834-.16808-1.6248-.28013-.84039-.11205-1.6248-.11205-2.2971 0-4.314 1.2886-2.0169 1.2326-3.2495 3.5296-1.1765 2.241-1.1765 5.2664v16.023h-4.9303v-30.03h4.0339l.56026 5.4905h.22411q1.4567-2.4651 3.7537-4.258 2.2971-1.7928 5.4345-1.7928z"/>
</svg>
`;var h=i(53423),g=i(85762),f=i(99721),m=i(55602),v=i(4871),y=i(65254),w=i(384),b=i(33245),U=i(82933),_=i(22221),A=i(11169),Z=i(59880),x=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function S(e,t){1&e&&(g._UZ(0,"bit-nav-item",18),g.ALo(1,"i18n")),2&e&&g.Q6J("text",g.lcZ(1,1,"subscription"))}function T(e,t){1&e&&(g._UZ(0,"bit-nav-item",19),g.ALo(1,"i18n")),2&e&&g.Q6J("text",g.lcZ(1,1,"sponsoredFamilies"))}class C{constructor(e,t,i,n,s,o){this.platformUtilsService=e,this.organizationService=t,this.apiService=i,this.syncService=n,this.configService=s,this.billingAccountProfileStateService=o,this.logo=p,this.showPaymentMethodWarningBanners$=this.configService.getFeatureFlag$(l.T.ShowPaymentMethodWarningBanners)}ngOnInit(){return x(this,void 0,void 0,(function*(){document.body.classList.remove("layout_frontend"),yield this.syncService.fullSync(!1),this.hasFamilySponsorshipAvailable$=(0,o.of)(!1),this.showSubscription$=(0,o.of)(!1)}))}}C.ɵfac=function(e){return new(e||C)(g.Y36(f.P),g.Y36(a.Mn),g.Y36(m.s),g.Y36(v._),g.Y36(y.E),g.Y36(w.M))},C.ɵcmp=g.Xpm({type:C,selectors:[["app-user-layout"]],standalone:!0,features:[g.jDz],decls:63,vars:49,consts:[["slot","sidebar"],["routerLink",".",1,"tw-m-5","tw-mt-7","tw-block",3,"appA11yTitle"],[3,"icon"],["icon","bwi-collection","route","vault",3,"text"],["icon","bwi-send","route","sends",3,"text"],["icon","bwi-wrench","route","tools",3,"text"],["route","tools/generator",3,"text"],["route","tools/import",3,"text"],["route","tools/export",3,"text"],["icon","bwi-sliders","route","reports",3,"text"],["icon","bwi-cog","route","settings",3,"text"],["route","settings/account",3,"text"],["route","settings/security",3,"text"],["route","settings/preferences",3,"text"],["route","settings/subscription",3,"text",4,"ngIf"],["route","settings/domain-rules",3,"text"],["route","settings/emergency-access",3,"text"],["route","settings/sponsored-families",3,"text",4,"ngIf"],["route","settings/subscription",3,"text"],["route","settings/sponsored-families",3,"text"]],template:function(e,t){1&e&&(g.TgZ(0,"bit-layout"),g._uU(1,"\n  "),g.TgZ(2,"nav",0),g._uU(3,"\n    "),g.TgZ(4,"a",1),g.ALo(5,"i18n"),g._uU(6,"\n      "),g._UZ(7,"bit-icon",2),g._uU(8,"\n    "),g.qZA(),g._uU(9,"\n\n    "),g._UZ(10,"bit-nav-item",3),g.ALo(11,"i18n"),g._uU(12,"\n    "),g._UZ(13,"bit-nav-item",4),g.ALo(14,"i18n"),g._uU(15,"\n    "),g.TgZ(16,"bit-nav-group",5),g.ALo(17,"i18n"),g._uU(18,"\n      "),g._UZ(19,"bit-nav-item",6),g.ALo(20,"i18n"),g._uU(21,"\n      "),g._UZ(22,"bit-nav-item",7),g.ALo(23,"i18n"),g._uU(24,"\n      "),g._UZ(25,"bit-nav-item",8),g.ALo(26,"i18n"),g._uU(27,"\n    "),g.qZA(),g._uU(28,"\n    "),g._UZ(29,"bit-nav-item",9),g.ALo(30,"i18n"),g._uU(31,"\n    "),g.TgZ(32,"bit-nav-group",10),g.ALo(33,"i18n"),g._uU(34,"\n      "),g._UZ(35,"bit-nav-item",11),g.ALo(36,"i18n"),g._uU(37,"\n      "),g._UZ(38,"bit-nav-item",12),g.ALo(39,"i18n"),g._uU(40,"\n      "),g._UZ(41,"bit-nav-item",13),g.ALo(42,"i18n"),g._uU(43,"\n      "),g.YNc(44,S,2,3,"bit-nav-item",14),g.ALo(45,"async"),g._uU(46,"\n      "),g._UZ(47,"bit-nav-item",15),g.ALo(48,"i18n"),g._uU(49,"\n      "),g._UZ(50,"bit-nav-item",16),g.ALo(51,"i18n"),g._uU(52,"\n      "),g.YNc(53,T,2,3,"bit-nav-item",17),g.ALo(54,"async"),g._uU(55,"\n    "),g.qZA(),g._uU(56,"\n\n    "),g._UZ(57,"app-toggle-width"),g._uU(58,"\n  "),g.qZA(),g._uU(59,"\n  "),g._UZ(60,"router-outlet"),g._uU(61,"\n"),g.qZA(),g._uU(62,"\n")),2&e&&(g.xp6(4),g.Q6J("appA11yTitle",g.lcZ(5,17,"passwordManager")),g.xp6(3),g.Q6J("icon",t.logo),g.xp6(3),g.Q6J("text",g.lcZ(11,19,"vaults")),g.xp6(3),g.Q6J("text",g.lcZ(14,21,"send")),g.xp6(3),g.Q6J("text",g.lcZ(17,23,"tools")),g.xp6(3),g.Q6J("text",g.lcZ(20,25,"generator")),g.xp6(3),g.Q6J("text",g.lcZ(23,27,"importData")),g.xp6(3),g.Q6J("text",g.lcZ(26,29,"exportVault")),g.xp6(4),g.Q6J("text",g.lcZ(30,31,"reports")),g.xp6(3),g.Q6J("text",g.lcZ(33,33,"settings")),g.xp6(3),g.Q6J("text",g.lcZ(36,35,"myAccount")),g.xp6(3),g.Q6J("text",g.lcZ(39,37,"security")),g.xp6(3),g.Q6J("text",g.lcZ(42,39,"preferences")),g.xp6(3),g.Q6J("ngIf",g.lcZ(45,41,t.showSubscription$)),g.xp6(3),g.Q6J("text",g.lcZ(48,43,"domainRules")),g.xp6(3),g.Q6J("text",g.lcZ(51,45,"emergencyAccess")),g.xp6(3),g.Q6J("ngIf",g.lcZ(54,47,t.hasFamilySponsorshipAvailable$)))},dependencies:[n.ez,n.O5,n.Ov,s.Bz,s.lC,s.rH,r.b,b.B,U.C,c.$,u.Q,_.G,d.A,A.W,Z.H,h.x],encapsulation:2})},17854:(e,t,i)=>{"use strict";i.d(t,{V:()=>d});var n=i(85921),s=i(85762),o=i(76528),r=i(28508),a=i(33245),l=i(82933),c=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function u(e,t){if(1&e&&(s.TgZ(0,"p"),s._uU(1),s.TgZ(2,"a",1),s.ALo(3,"i18n"),s._uU(4,"\n      "),s._UZ(5,"i",2),s.qZA(),s._uU(6,"\n    "),s._UZ(7,"br"),s._uU(8,"\n    "),s.TgZ(9,"code",3),s._uU(10),s.qZA(),s._uU(11,"\n  "),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.hij("\n    ",e.fingerprintLabel,":\n    "),s.xp6(1),s.s9C("appA11yTitle",s.lcZ(3,3,"learnMore")),s.xp6(8),s.Oqu(e.fingerprint)}}class d{constructor(e){this.cryptoService=e}ngOnInit(){var e;return c(this,void 0,void 0,(function*(){const t=yield this.cryptoService.getFingerprint(this.fingerprintMaterial,this.publicKeyBuffer);this.fingerprint=null!==(e=null==t?void 0:t.join("-"))&&void 0!==e?e:null}))}}d.ɵfac=function(e){return new(e||d)(s.Y36(o.$))},d.ɵcmp=s.Xpm({type:d,selectors:[["app-account-fingerprint"]],inputs:{fingerprintMaterial:"fingerprintMaterial",publicKeyBuffer:"publicKeyBuffer",fingerprintLabel:"fingerprintLabel"},standalone:!0,features:[s.jDz],decls:7,vars:1,consts:[[4,"ngIf"],["href","https://bitwarden.com/help/fingerprint-phrase/","target","_blank","rel","noreferrer",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],[1,"tw-text-code"]],template:function(e,t){1&e&&(s.ynx(0),s._uU(1,"\n  "),s._UZ(2,"hr"),s._uU(3,"\n  "),s.YNc(4,u,12,5,"p",0),s._uU(5,"\n"),s.BQk(),s._uU(6,"\n")),2&e&&(s.xp6(4),s.Q6J("ngIf",t.fingerprint))},dependencies:[n.m,r.O5,a.B,l.C],encapsulation:2})},71146:(e,t,i)=>{"use strict";i.d(t,{f:()=>s.f,m:()=>n.m});var n=i(85921),s=i(7357)},7357:(e,t,i)=>{"use strict";i.d(t,{f:()=>k});var n=i(33970),s=i(33760),o=i(38261),r=i(96085),a=i(99005),l=i(31978),c=i(99877),u=i(28508),d=i(71146),p=i(85762);class h{}h.ɵfac=function(e){return new(e||h)},h.ɵmod=p.oAB({type:h}),h.ɵinj=p.cJS({imports:[u.ez,d.m]});var g=i(4519),f=i(782),m=i(95379),v=i(85915),y=i(28926),w=i(63391),b=i(21151),U=i(59784),_=i(17854),A=i(85921),Z=i(37513),x=i(24610),S=i(2051),T=i(12963),C=i(82933),O=i(19576);class k{}k.ɵfac=function(e){return new(e||k)},k.ɵmod=p.oAB({type:k}),k.ɵinj=p.cJS({imports:[A.m,a.Q,v.O,g.Zn,h,f.D,U.I,_.V,w.D,b.D,n.ey,n.FI,l.q,s.$,o.A,m.O,r.f,y.z,g.Zn,m.O]}),p.B6R(c.d,[u.O5,Z.Fj,Z.JJ,Z.JL,Z.On,Z.F,x.b,S.O,T._,f.D,_.V],[C.C,O.z])},85921:(e,t,i)=>{"use strict";i.d(t,{m:()=>Ye});var n=i(89614),s=i(28508),o=i(37513),r=i(8111),a=i(8724),l=i(5344),c=i(2012),u=i(85762);class d{}d.ɵfac=function(e){return new(e||d)},d.ɵmod=u.oAB({type:d}),d.ɵinj=u.cJS({imports:[s.ez]});var p=i(47404),h=i(36903);class g{}g.ɵfac=function(e){return new(e||g)},g.ɵmod=u.oAB({type:g}),g.ɵinj=u.cJS({imports:[h.m,p.T]});var f=i(40925),m=i(7266),v=i(72444);class y{}y.ɵfac=function(e){return new(e||y)},y.ɵmod=u.oAB({type:y}),y.ɵinj=u.cJS({imports:[s.ez]});var w=i(81168),b=i(29445),U=i(49106),_=i(41938),A=i(5261),Z=i(19244),x=i(59692),S=i(39639),T=i(51676),C=i(20953),O=i(84575),k=i(13936),P=i(83134);class q{}q.ɵfac=function(e){return new(e||q)},q.ɵmod=u.oAB({type:q}),q.ɵinj=u.cJS({imports:[s.ez,r.Bz,P.eL]});class I{}I.ɵfac=function(e){return new(e||I)},I.ɵmod=u.oAB({type:I}),I.ɵinj=u.cJS({imports:[s.ez,p.T]});var M=i(33229),N=i(31393),L=i(9511),D=i(81743),E=i(11281),F=i(95357),R=i(42382),J=i(51793),z=i(79732),Y=i(96529),K=i(77975),B=i(97230),Q=i(83008),G=i(54943),j=i(4196),V=i(75739),$=i(10235),H=i(22369),W=i(40218),X=i(85679),ee=i(35408),te=i(73254),ie=i(39899),ne=i(21543),se=i(55660),oe=i(6761),re=i(95701),ae=i(29251),le=i(87276),ce=i(33546),ue=i(21920),de=i(56580),pe=i(25625),he=i(28646),ge=i(18337),fe=i(63194),me=i(55264),ve=i(60977),ye=i(32006),we=i(53819),be=i(53233),Ue=i(19361),_e=i(7384),Ae=i(65155),Ze=i(52159),xe=i(60810),Se=i(48083),Te=i(21564),Ce=i(86250),Oe=i(98029),ke=i(99850),Pe=i(8033),qe=i(54673),Ie=i(53465),Me=i(34206),Ne=i(5116),Le=i(12821),De=i(78867),Ee=i(47276),Fe=i(72235),Re=i(85790),Je=i(72108),ze=i(73573);(0,s.qS)(L.Z,"af"),(0,s.qS)(D.Z,"ar"),(0,s.qS)(E.Z,"az"),(0,s.qS)(F.Z,"be"),(0,s.qS)(R.Z,"bg"),(0,s.qS)(J.Z,"bn"),(0,s.qS)(z.Z,"bs"),(0,s.qS)(Y.Z,"ca"),(0,s.qS)(K.Z,"cs"),(0,s.qS)(B.Z,"cy"),(0,s.qS)(Q.Z,"da"),(0,s.qS)(G.Z,"de"),(0,s.qS)(j.Z,"el"),(0,s.qS)(V.Z,"en-GB"),(0,s.qS)($.Z,"en-IN"),(0,s.qS)(H.Z,"eo"),(0,s.qS)(W.Z,"es"),(0,s.qS)(X.Z,"et"),(0,s.qS)(ee.Z,"eu"),(0,s.qS)(te.Z,"fa"),(0,s.qS)(ie.Z,"fi"),(0,s.qS)(ne.Z,"fil"),(0,s.qS)(se.Z,"fr"),(0,s.qS)(oe.Z,"gl"),(0,s.qS)(re.Z,"he"),(0,s.qS)(ae.Z,"hi"),(0,s.qS)(le.Z,"hr"),(0,s.qS)(ce.Z,"hu"),(0,s.qS)(ue.Z,"id"),(0,s.qS)(de.Z,"it"),(0,s.qS)(pe.Z,"ja"),(0,s.qS)(he.Z,"ka"),(0,s.qS)(ge.Z,"km"),(0,s.qS)(fe.Z,"kn"),(0,s.qS)(me.Z,"ko"),(0,s.qS)(ve.Z,"lv"),(0,s.qS)(ye.Z,"ml"),(0,s.qS)(we.Z,"mr"),(0,s.qS)(be.Z,"my"),(0,s.qS)(Ue.Z,"nb"),(0,s.qS)(_e.Z,"ne"),(0,s.qS)(Ae.Z,"nl"),(0,s.qS)(Ze.Z,"nn"),(0,s.qS)(xe.Z,"or"),(0,s.qS)(Se.Z,"pl"),(0,s.qS)(Te.Z,"pt-BR"),(0,s.qS)(Ce.Z,"pt-PT"),(0,s.qS)(Oe.Z,"ro"),(0,s.qS)(ke.Z,"ru"),(0,s.qS)(Pe.Z,"si"),(0,s.qS)(qe.Z,"sk"),(0,s.qS)(Ie.Z,"sl"),(0,s.qS)(Me.Z,"sr"),(0,s.qS)(Ne.Z,"sv"),(0,s.qS)(Le.Z,"te"),(0,s.qS)(De.Z,"th"),(0,s.qS)(Ee.Z,"tr"),(0,s.qS)(Fe.Z,"uk"),(0,s.qS)(Re.Z,"vi"),(0,s.qS)(Je.Z,"zh-CN"),(0,s.qS)(ze.Z,"zh-TW");class Ye{}Ye.ɵfac=function(e){return new(e||Ye)},Ye.ɵmod=u.oAB({type:Ye}),Ye.ɵinj=u.cJS({providers:[s.uU],imports:[s.ez,n._t,o.u5,o.UX,a.Rq,r.Bz,l.b,c.G,d,g,p.T,f.h,m.d,v.n,y,w.e,b.S,U.k,_.v,A.Q,Z.L,x.$,S.q,T.q,C.c,O.e,k.U,q,I,M.Z,s.ez,n._t,o.u5,o.UX,a.Rq,r.Bz,l.b,c.G,d,g,p.T,f.h,m.d,v.n,y,b.S,U.k,_.v,A.Q,Z.L,x.$,S.q,T.q,C.c,N.A,k.U,q,I,M.Z]})},84949:(e,t,i)=>{"use strict";i.d(t,{C2:()=>K,x6:()=>Q.x,Fz:()=>re,FX:()=>j,Gm:()=>B});var n=i(28508),s=i(95379),o=i(71146),r=i(63391),a=i(21151),l=i(8111),c=i(66463),u=i(85762),d=i(80060),p=i(384),h=i(34961);function g(){return(e,t)=>{const i=(0,u.f3M)(l.F0),n=(0,u.f3M)(h.o);return(0,u.f3M)(p.M).hasPremiumFromAnySource$.pipe((0,d.b)((e=>{e||n.send("premiumRequired")})),(0,d.b)((e=>{if(!e&&"/login"===i.url)return i.createUrlTree(["/"])})))}}var f=i(98438),m=i(58172),v=i(37513),y=i(24610),w=i(53707),b=i(81974),U=i(81168),_=i(58618),A=i(82933),Z=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function x(e,t){1&e&&(u.TgZ(0,"p"),u._uU(1),u.ALo(2,"i18n"),u.qZA()),2&e&&(u.xp6(1),u.hij("",u.lcZ(2,1,"reportError"),"..."))}function S(e,t){if(1&e&&(u.TgZ(0,"app-callout",14),u.ALo(1,"i18n"),u._uU(2),u.ALo(3,"i18n"),u.qZA()),2&e){const e=u.oxw(3);u.s9C("title",u.lcZ(1,2,"goodNews")),u.xp6(2),u.hij("\n        ",u.xi3(3,4,"breachUsernameNotFound",e.checkedUsername),"\n      ")}}function T(e,t){if(1&e&&(u.TgZ(0,"app-callout",15),u.ALo(1,"i18n"),u._uU(2),u.ALo(3,"i18n"),u.qZA()),2&e){const e=u.oxw(3);u.s9C("title",u.lcZ(1,2,"breachFound")),u.xp6(2),u.hij("\n        ",u.Dn7(3,4,"breachUsernameFound",e.checkedUsername,e.breachedAccounts.length),"\n      ")}}function C(e,t){if(1&e&&(u.TgZ(0,"li"),u._uU(1),u.qZA()),2&e){const e=t.$implicit;u.xp6(1),u.Oqu(e)}}function O(e,t){if(1&e&&(u.TgZ(0,"li",18),u._uU(1,"\n          "),u.TgZ(2,"div",2),u._uU(3,"\n            "),u.TgZ(4,"div",19),u._uU(5,"\n              "),u._UZ(6,"img",20),u._uU(7,"\n            "),u.qZA(),u._uU(8,"\n            "),u.TgZ(9,"div",21),u._uU(10,"\n              "),u.TgZ(11,"h3",22),u._uU(12),u.qZA(),u._uU(13,"\n              "),u._UZ(14,"p",23),u._uU(15,"\n              "),u.TgZ(16,"p",24),u._uU(17),u.ALo(18,"i18n"),u.qZA(),u._uU(19,"\n              "),u.TgZ(20,"ul"),u._uU(21,"\n                "),u.YNc(22,C,2,1,"li",25),u._uU(23,"\n              "),u.qZA(),u._uU(24,"\n            "),u.qZA(),u._uU(25,"\n            "),u.TgZ(26,"div",26),u._uU(27,"\n              "),u.TgZ(28,"dl"),u._uU(29,"\n                "),u.TgZ(30,"dt"),u._uU(31),u.ALo(32,"i18n"),u.qZA(),u._uU(33,"\n                "),u.TgZ(34,"dd"),u._uU(35),u.qZA(),u._uU(36,"\n                "),u.TgZ(37,"dt"),u._uU(38),u.ALo(39,"i18n"),u.qZA(),u._uU(40,"\n                "),u.TgZ(41,"dd"),u._uU(42),u.ALo(43,"number"),u.qZA(),u._uU(44,"\n                "),u.TgZ(45,"dt"),u._uU(46),u.ALo(47,"i18n"),u.qZA(),u._uU(48,"\n                "),u.TgZ(49,"dd"),u._uU(50),u.ALo(51,"date"),u.qZA(),u._uU(52,"\n                "),u.TgZ(53,"dt"),u._uU(54),u.ALo(55,"i18n"),u.qZA(),u._uU(56,"\n                "),u.TgZ(57,"dd"),u._uU(58),u.ALo(59,"date"),u.qZA(),u._uU(60,"\n              "),u.qZA(),u._uU(61,"\n            "),u.qZA(),u._uU(62,"\n          "),u.qZA(),u._uU(63,"\n        "),u.qZA()),2&e){const e=t.$implicit;u.xp6(6),u.Q6J("src",e.logoPath,u.LSH),u.xp6(6),u.Oqu(e.title),u.xp6(2),u.Q6J("innerHTML",e.description,u.oJD),u.xp6(3),u.hij("",u.lcZ(18,13,"compromisedData"),":"),u.xp6(5),u.Q6J("ngForOf",e.dataClasses),u.xp6(9),u.Oqu(u.lcZ(32,15,"website")),u.xp6(4),u.Oqu(e.domain),u.xp6(3),u.Oqu(u.lcZ(39,17,"affectedUsers")),u.xp6(4),u.Oqu(u.lcZ(43,19,e.pwnCount)),u.xp6(4),u.Oqu(u.lcZ(47,21,"breachOccurred")),u.xp6(4),u.Oqu(u.xi3(51,23,e.breachDate,"mediumDate")),u.xp6(4),u.Oqu(u.lcZ(55,26,"breachReported")),u.xp6(4),u.Oqu(u.xi3(59,28,e.addedDate,"mediumDate"))}}function k(e,t){if(1&e&&(u.TgZ(0,"ul",16),u._uU(1,"\n        "),u.YNc(2,O,64,31,"li",17),u._uU(3,"\n      "),u.qZA()),2&e){const e=u.oxw(3);u.xp6(2),u.Q6J("ngForOf",e.breachedAccounts)}}function P(e,t){if(1&e&&(u.ynx(0),u._uU(1,"\n      "),u.YNc(2,S,4,7,"app-callout",11),u._uU(3,"\n      "),u.YNc(4,T,4,8,"app-callout",12),u._uU(5,"\n      "),u.YNc(6,k,4,1,"ul",13),u._uU(7,"\n    "),u.BQk()),2&e){const e=u.oxw(2);u.xp6(2),u.Q6J("ngIf",!e.breachedAccounts.length),u.xp6(2),u.Q6J("ngIf",e.breachedAccounts.length),u.xp6(2),u.Q6J("ngIf",e.breachedAccounts.length)}}function q(e,t){if(1&e&&(u.TgZ(0,"div",9),u._uU(1,"\n    "),u.YNc(2,x,3,3,"p",10),u._uU(3,"\n    "),u.YNc(4,P,8,3,"ng-container",10),u._uU(5,"\n  "),u.qZA()),2&e){const e=u.oxw();u.xp6(2),u.Q6J("ngIf",e.error),u.xp6(2),u.Q6J("ngIf",!e.error)}}class I{constructor(e,t){this.auditService=e,this.stateService=t,this.error=!1,this.breachedAccounts=[]}ngOnInit(){return Z(this,void 0,void 0,(function*(){this.username=yield this.stateService.getEmail()}))}submit(){return Z(this,void 0,void 0,(function*(){this.error=!1,this.username=this.username.toLowerCase();try{this.formPromise=this.auditService.breachedAccounts(this.username),this.breachedAccounts=yield this.formPromise}catch(e){this.error=!0}this.checkedUsername=this.username}))}}I.ɵfac=function(e){return new(e||I)(u.Y36(f.C),u.Y36(m.b))},I.ɵcmp=u.Xpm({type:I,selectors:[["app-breach-report"]],decls:35,vars:16,consts:[["ngNativeValidate","",3,"appApiAction","ngSubmit"],["form",""],[1,"row"],[1,"form-group","col-6"],["for","username"],["id","username","type","text","name","Username","required","",1,"form-control",3,"ngModel","ngModelChange"],[1,"form-text","text-muted"],["type","submit","buttonType","primary","bitButton","",3,"loading"],["class","mt-4",4,"ngIf"],[1,"mt-4"],[4,"ngIf"],["type","success",3,"title",4,"ngIf"],["type","danger",3,"title",4,"ngIf"],["class","list-group list-group-breach",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[1,"list-group","list-group-breach"],["class","list-group-item min-height-fix",4,"ngFor","ngForOf"],[1,"list-group-item","min-height-fix"],[1,"col-2","text-center"],["alt","",1,"img-fluid",3,"src"],[1,"col-7"],[1,"text-lg"],[3,"innerHTML"],[1,"mb-1"],[4,"ngFor","ngForOf"],[1,"col-3"]],template:function(e,t){if(1&e&&(u._UZ(0,"app-header"),u._uU(1,"\n\n"),u.TgZ(2,"bit-container"),u._uU(3,"\n  "),u.TgZ(4,"p"),u._uU(5),u.ALo(6,"i18n"),u.qZA(),u._uU(7,"\n  "),u.TgZ(8,"form",0,1),u.NdJ("ngSubmit",(function(){return t.submit()})),u._uU(10,"\n    "),u.TgZ(11,"div",2),u._uU(12,"\n      "),u.TgZ(13,"div",3),u._uU(14,"\n        "),u.TgZ(15,"label",4),u._uU(16),u.ALo(17,"i18n"),u.qZA(),u._uU(18,"\n        "),u.TgZ(19,"input",5),u.NdJ("ngModelChange",(function(e){return t.username=e})),u.qZA(),u._uU(20,"\n        "),u.TgZ(21,"small",6),u._uU(22),u.ALo(23,"i18n"),u.qZA(),u._uU(24,"\n      "),u.qZA(),u._uU(25,"\n    "),u.qZA(),u._uU(26,"\n    "),u.TgZ(27,"button",7),u._uU(28),u.ALo(29,"i18n"),u.qZA(),u._uU(30,"\n  "),u.qZA(),u._uU(31,"\n  "),u.YNc(32,q,6,2,"div",8),u._uU(33,"\n"),u.qZA(),u._uU(34,"\n")),2&e){const e=u.MAs(9);u.xp6(5),u.Oqu(u.lcZ(6,8,"breachDesc")),u.xp6(3),u.Q6J("appApiAction",t.formPromise),u.xp6(8),u.Oqu(u.lcZ(17,10,"username")),u.xp6(3),u.Q6J("ngModel",t.username),u.xp6(3),u.Oqu(u.lcZ(23,12,"breachCheckUsernameEmail")),u.xp6(5),u.Q6J("loading",e.loading),u.xp6(1),u.hij("\n      ",u.lcZ(29,14,"checkBreaches"),"\n    "),u.xp6(4),u.Q6J("ngIf",!e.loading&&t.checkedUsername)}},dependencies:[n.sg,n.O5,v.Fj,v.JJ,v.JL,v.Q7,v.On,v.F,y.b,w.O,b.r,U.e,_.k,n.JJ,n.uU,A.C],encapsulation:2});var M=i(53550),N=i(92006),L=i(99042),D=i(66997);const E=D.W4`
  <svg width="58" height="75" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path d="M39.569 74H13.007a7 7 0 0 1-7-7V31.077a7 7 0 0 1 7-7h19.101a7 7 0 0 1 4.988 2.088l7.46 7.576a7 7 0 0 1 2.013 4.912V67a7 7 0 0 1-7 7Z" fill="#175DDC" stroke="#fff" stroke-width="2" />
    <path d="M44.576 69.055H18.015a7 7 0 0 1-7-7V26.132a7 7 0 0 1 7-7h19.1a7 7 0 0 1 4.988 2.088l7.46 7.576a7 7 0 0 1 2.013 4.911v28.348a7 7 0 0 1-7 7Z" fill="#175DDC" stroke="#fff" stroke-width="2" />
    <path d="M50 63.698H23.439a7 7 0 0 1-7-7V20.775a7 7 0 0 1 7-7h19.1a7 7 0 0 1 4.988 2.088l7.46 7.575A7 7 0 0 1 57 28.35v28.348a7 7 0 0 1-7 7Z" fill="#175DDC" stroke="#fff" stroke-width="2" />
    <path d="M44.648 13.599v3.95a8 8 0 0 0 8 8h4.518" stroke="#fff" stroke-width="2" />
    <path stroke="#fff" stroke-width="2" stroke-linecap="round" d="M23.533 37.736H49.49M23.533 46.802H49.49M23.533 42.269H49.49M23.533 55.456H49.49M23.533 50.923H49.49" />
    <path d="M1 16.483C1 7.944 8.013 1 16.69 1c8.678 0 15.691 6.944 15.691 15.483 0 8.54-7.013 15.484-15.69 15.484C8.012 31.967 1 25.023 1 16.484Z" fill="#518FFF" stroke="#fff" stroke-width="2" />
    <path d="m16.562 7.979.1 11.538" stroke="#fff" stroke-width="2" stroke-linecap="round" />
    <ellipse rx="1.252" ry="1.236" transform="rotate(-.479 2802.219 -1964.476) skewX(.012)" fill="#fff" />
  </svg>
`,F=D.W4`
  <svg width="101" height="77" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path fill-rule="evenodd" clip-rule="evenodd" d="M32.374 50.192a26.42 26.42 0 0 0 9.111 1.608c14.34 0 25.965-11.372 25.965-25.4 0-.337-.007-.673-.02-1.008h25.299v34.85H32.374v-10.05Z" fill="currentColor" />
    <path d="M15.805 26.4c0 14.028 11.625 25.4 25.965 25.4s25.964-11.372 25.964-25.4C67.734 12.372 56.11 1 41.77 1 27.43 1 15.805 12.372 15.805 26.4Z" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M27.914 47.849a1 1 0 0 0-2 0h2Zm68.288-26.792a2.12 2.12 0 0 1 2.14 2.11h2c0-2.253-1.83-4.11-4.14-4.11v2Zm2.14 2.11v40.552h2V23.167h-2Zm0 40.552c0 1.172-.958 2.11-2.14 2.11v2c2.25 0 4.14-1.798 4.14-4.11h-2Zm-2.14 2.11H30.054v2h66.148v-2Zm-66.148 0a2.12 2.12 0 0 1-2.14-2.11h-2a4.12 4.12 0 0 0 4.14 4.11v-2Zm-2.14-2.11V47.85h-2v15.87h2Zm39.254-42.662h29.034v-2H67.168v2Z" fill="#fff" />
    <path d="M67.203 25.56h25.64v34.85H32.487V50.011" stroke="#fff" stroke-width="2" stroke-linejoin="round" />
    <path d="M47.343 76h31.571" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M57.557 66.83V76M67.771 66.83V76" stroke="#fff" stroke-width="2" stroke-linejoin="round" />
    <path d="m20.995 42.873-3.972 3.972-14.61 14.61a3.413 3.413 0 0 0 0 4.826v0a3.413 3.413 0 0 0 4.827 0l14.61-14.61 3.972-3.972" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M86.037 32.488H71.845M86.037 37.81H76.28M71.845 37.81h-6.652M86.037 43.132h-6.209M74.95 43.132H61.2M86.037 48.454H71.845M66.967 48.454h-7.54M86.037 53.776H66.08M61.201 53.776h-11.53M44.793 53.776h-7.096" stroke="#fff" stroke-width="2" stroke-linecap="round" />
    <rect width="40.801" height="9.757" rx="4" transform="matrix(-1 0 0 1 61.201 14.748)" stroke="#fff" stroke-width="2" />
    <path d="M16.852 33.375h28.375a4 4 0 0 1 4 4v1.757a4 4 0 0 1-4 4H22.174M66.523 33.375h-3.539a4 4 0 0 0-4 4v3.761c0 1.102.894 1.996 1.996 1.996v0" stroke="#fff" stroke-width="2" stroke-linecap="round" />
  </svg>
`,R=D.W4`
  <svg width="42" height="75" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path fill="currentColor" stroke="#fff" stroke-width="2" d="M1 13.121h39.595v48.758H1z" />
    <rect x="1" y="1" width="39.595" height="73" rx="8" stroke="#fff" stroke-width="2" />
    <path stroke="#fff" stroke-width="2" stroke-linecap="round" d="M12.344 8.091h16.907M18.907 67.424h3.025M31.503 32.515c-2.047-4.337-6.717-7.061-11.73-6.414a11.356 11.356 0 0 0-9.125 7.126M10.816 42.016c2.047 4.337 6.718 7.062 11.73 6.414 4.346-.562 7.8-3.51 9.213-7.358" />
    <path d="m33.584 29.293-1.295 4.625-4.625-1.295M8.523 44.725l1.441-4.581 4.582 1.441" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
  </svg>
`,J=D.W4`
  <svg width="102" height="102" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path d="M57.983 15.06a35.664 35.664 0 0 1 14.531 6.27c16.164 11.78 19.585 34.613 7.643 51a37.227 37.227 0 0 1-6.81 7.138m-32.842 6.697a35.708 35.708 0 0 1-11.239-5.495c-16.163-11.78-19.585-34.613-7.642-51a37.55 37.55 0 0 1 3.295-3.929" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M93.909 64.598H7.72c-.708 0-1.275-.662-1.275-1.49V40.273c0-.828.567-1.49 1.275-1.49H93.91c.708 0 1.275.663 1.275 1.49v22.837c.047.827-.567 1.49-1.275 1.49Z" fill="currentColor" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M21.532 52.186v-5.965M21.532 52.187l5.748-1.844M21.532 52.186l3.524 4.881M21.531 52.186l-3.47 4.881M21.532 52.187l-5.694-1.844M40.944 52.186v-5.965M40.944 52.187l5.694-1.844M40.944 52.187l3.525 4.88M40.944 52.187l-3.525 4.88M40.944 52.187l-5.694-1.844M54.849 57.337h11.294M74.21 57.337h11.295M41.75 83l.71 4.75-4.75.71M58.664 18.66 56 14.665 59.996 12" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
  </svg>
`,z=D.W4`
  <svg width="113" height="76" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path d="M1.71 12.983h110.362v55.11a6 6 0 0 1-6 6H7.711a6 6 0 0 1-6-6v-55.11Z" fill="currentColor" />
    <rect x="1" y="1.073" width="110.5" height="73.454" rx="9" stroke="#fff" stroke-width="2" />
    <path d="M89.48 8.048V7.47M96.363 8.048V7.47M103.246 8.048V7.47" stroke="#fff" stroke-width="4" stroke-linecap="round" />
    <path d="M0 12.983h111.217" stroke="#fff" stroke-width="2" />
    <path d="m93.236 44.384-18.42-11.026 2.93 21.266 5.582-5.237 4.27 6.46 2.98-1.971-4.26-6.446 6.918-3.046Z" fill="#175DDC" stroke="#fff" stroke-width="2" stroke-linejoin="round" />
    <rect width="96.673" height="6.886" rx="3.443" transform="matrix(-1 0 0 1 104.373 18.721)" stroke="#fff" />
  </svg>
`,Y=D.W4`
  <svg width="78" height="78" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path d="M66.493 64.415V77H9.979V64.324M9.979 44.065V32.106h56.514v12.148" stroke="#fff" stroke-width="2" stroke-linejoin="round" />
    <path d="M75.44 64.852H2.085c-.603 0-1.085-.555-1.085-1.25V44.448c0-.694.482-1.25 1.085-1.25H75.44c.603 0 1.085.556 1.085 1.25v19.156c.04.694-.482 1.25-1.085 1.25Z" fill="currentColor" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M13.84 54.56v-5.077M13.84 54.56l4.893-1.57M13.84 54.56l3 4.153M13.84 54.56l-2.954 4.153M13.84 54.56l-4.846-1.57M30.363 54.56v-5.077M30.363 54.56l4.846-1.57M30.363 54.56l3 4.153M30.363 54.56l-3 4.153M30.363 54.56l-4.846-1.57M42.197 59.042h9.506M58.57 59.042h9.507" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M20.863 31.364c-.274-5.285 0-15.817 1.093-18.863 1.276-3.554 6.233-10.826 15.856-11.482 4.83-.273 15.2 2.296 18.043 14.763" stroke="#fff" stroke-width="2" />
  </svg>
`;var K;!function(e){e.ExposedPasswords="exposedPasswords",e.ReusedPasswords="reusedPasswords",e.WeakPasswords="weakPasswords",e.UnsecuredWebsites="unsecuredWebsites",e.Inactive2fa="inactive2fa",e.DataBreach="dataBreach"}(K||(K={}));const B={[K.ExposedPasswords]:{title:"exposedPasswordsReport",description:"exposedPasswordsReportDesc",route:"exposed-passwords-report",icon:F},[K.ReusedPasswords]:{title:"reusedPasswordsReport",description:"reusedPasswordsReportDesc",route:"reused-passwords-report",icon:J},[K.WeakPasswords]:{title:"weakPasswordsReport",description:"weakPasswordsReportDesc",route:"weak-passwords-report",icon:Y},[K.UnsecuredWebsites]:{title:"unsecuredWebsitesReport",description:"unsecuredWebsitesReportDesc",route:"unsecured-websites-report",icon:z},[K.Inactive2fa]:{title:"inactive2faReport",description:"inactive2faReportDesc",route:"inactive-two-factor-report",icon:R},[K.DataBreach]:{title:"dataBreachReport",description:"breachDesc",route:"breach-report",icon:E}};var Q=i(54307),G=i(85921);class j{}j.ɵfac=function(e){return new(e||j)},j.ɵmod=u.oAB({type:j}),j.ɵinj=u.cJS({imports:[n.ez,G.m]});var V=i(2930),$=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class H{constructor(e){this.billingAccountProfileStateService=e}ngOnInit(){return $(this,void 0,void 0,(function*(){const e=(yield(0,L.z)(this.billingAccountProfileStateService.hasPremiumFromAnySource$))?Q.x.Enabled:Q.x.RequiresPremium;this.reports=[Object.assign(Object.assign({},B[K.ExposedPasswords]),{variant:e}),Object.assign(Object.assign({},B[K.ReusedPasswords]),{variant:e}),Object.assign(Object.assign({},B[K.WeakPasswords]),{variant:e}),Object.assign(Object.assign({},B[K.UnsecuredWebsites]),{variant:e}),Object.assign(Object.assign({},B[K.Inactive2fa]),{variant:e}),Object.assign(Object.assign({},B[K.DataBreach]),{variant:Q.x.Enabled})]}))}}H.ɵfac=function(e){return new(e||H)(u.Y36(p.M))},H.ɵcmp=u.Xpm({type:H,selectors:[["app-reports-home"]],decls:11,vars:4,consts:[[3,"reports"]],template:function(e,t){1&e&&(u._UZ(0,"app-header"),u._uU(1,"\n\n"),u.TgZ(2,"bit-container"),u._uU(3,"\n  "),u.TgZ(4,"p"),u._uU(5),u.ALo(6,"i18n"),u.qZA(),u._uU(7,"\n\n  "),u._UZ(8,"app-report-list",0),u._uU(9,"\n"),u.qZA(),u._uU(10,"\n")),2&e&&(u.xp6(5),u.Oqu(u.lcZ(6,2,"reportsDesc")),u.xp6(3),u.Q6J("reports",t.reports))},dependencies:[U.e,V.s,_.k,A.C],encapsulation:2});var W=i(22353),X=i(88775),ee=i(2578),te=i(67775);function ie(e,t){1&e&&(u.TgZ(0,"a",3),u._uU(1,"\n      "),u._UZ(2,"i",4),u._uU(3),u.ALo(4,"i18n"),u.qZA()),2&e&&(u.xp6(3),u.hij("\n      ",u.lcZ(4,1,"backToReports"),"\n    "))}class ne{constructor(e){this.homepage=!0,this.subscription=e.events.pipe((0,te.h)((e=>e instanceof l.m2))).subscribe((e=>{this.homepage="/reports"==e.url}))}ngOnDestroy(){var e;null===(e=this.subscription)||void 0===e||e.unsubscribe()}}ne.ɵfac=function(e){return new(e||ne)(u.Y36(l.F0))},ne.ɵcmp=u.Xpm({type:ne,selectors:[["app-reports-layout"]],decls:10,vars:1,consts:[[1,"row","mt-4"],[1,"col"],["bitButton","","routerLink","./",4,"ngIf"],["bitButton","","routerLink","./"],["aria-hidden","true",1,"bwi","bwi-angle-left"]],template:function(e,t){1&e&&(u._UZ(0,"router-outlet"),u._uU(1,"\n\n"),u.TgZ(2,"div",0),u._uU(3,"\n  "),u.TgZ(4,"div",1),u._uU(5,"\n    "),u.YNc(6,ie,5,3,"a",2),u._uU(7,"\n  "),u.qZA(),u._uU(8,"\n"),u.qZA(),u._uU(9,"\n")),2&e&&(u.xp6(6),u.Q6J("ngIf",!t.homepage))},dependencies:[n.O5,l.lC,l.rH,b.r,A.C],encapsulation:2});const se=[{path:"",component:ne,canActivate:[c.a1],children:[{path:"",pathMatch:"full",component:H,data:{titleId:"reports",homepage:!0}},{path:"breach-report",component:I,data:{titleId:"dataBreachReport"}},{path:"reused-passwords-report",component:W.Q,data:{titleId:"reusedPasswordsReport"},canActivate:[g()]},{path:"unsecured-websites-report",component:X.i,data:{titleId:"unsecuredWebsitesReport"},canActivate:[g()]},{path:"weak-passwords-report",component:ee.m,data:{titleId:"weakPasswordsReport"},canActivate:[g()]},{path:"exposed-passwords-report",component:M.W,data:{titleId:"exposedPasswordsReport"},canActivate:[g()]},{path:"inactive-two-factor-report",component:N.Y,data:{titleId:"inactive2faReport"},canActivate:[g()]}]}];class oe{}oe.ɵfac=function(e){return new(e||oe)},oe.ɵmod=u.oAB({type:oe}),oe.ɵinj=u.cJS({imports:[l.Bz.forChild(se),l.Bz]});class re{}re.ɵfac=function(e){return new(e||re)},re.ɵmod=u.oAB({type:re}),re.ɵinj=u.cJS({imports:[n.ez,o.m,j,oe,r.D,a.D,s.O]})},47317:(e,t,i)=>{"use strict";i.d(t,{E:()=>y});var n=i(85762),s=i(59554),o=i(54019),r=i(68362),a=i(61374),l=i(58691),c=i(72285),u=i(25406),d=i(1018),p=i(24415),h=i(92236),g=i(78627),f=i(4871),m=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const v=["cipherAddEdit"];class y{constructor(e,t,i,n,a,l){this.cipherService=e,this.modalService=t,this.passwordRepromptService=i,this.organizationService=n,this.i18nService=a,this.syncService=l,this.isAdminConsoleActive=!1,this.loading=!1,this.hasLoaded=!1,this.ciphers=[],this.allCiphers=[],this.filterStatus=[0],this.showFilterToggle=!1,this.vaultMsg="vault",this.filterOrgStatus$=new s.X(0),this.destroyed$=new o.x,this.organizations$=this.organizationService.organizations$,this.organizations$.pipe((0,r.R)(this.destroyed$)).subscribe((e=>{this.organizations=e}))}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}getName(e){let t;return 0===e?t=this.i18nService.t("all"):1===e?t=this.i18nService.t("me"):this.organizations.filter((i=>{if(i.id===e)return t=i.name,i})),t}getCount(e){let t,i;return 0===e?i=this.allCiphers.length:1===e?i=this.allCiphers.filter((e=>null===e.orgFilterStatus)).length:(this.organizations.filter((i=>{if(i.id===e)return t=i.id,i})),i=this.allCiphers.filter((e=>e.orgFilterStatus===t)).length),i}filterOrgToggle(e){return m(this,void 0,void 0,(function*(){this.currentFilterStatus=e,yield this.setCiphers(),0!==e&&(this.ciphers=1===e?this.ciphers.filter((e=>null==e.orgFilterStatus)):this.ciphers.filter((t=>t.orgFilterStatus===e)))}))}load(){return m(this,void 0,void 0,(function*(){this.loading=!0,yield this.syncService.fullSync(!1),this.currentFilterStatus?this.ciphers.length>2?(this.filterOrgStatus$.next(this.currentFilterStatus),yield this.filterOrgToggle(this.currentFilterStatus)):(this.filterOrgStatus$.next(0),yield this.filterOrgToggle(0)):yield this.setCiphers(),this.loading=!1,this.hasLoaded=!0}))}selectCipher(e){return m(this,void 0,void 0,(function*(){if(!(yield this.repromptCipher(e)))return;const t=null!=this.organization?p.Z:d.Z,[i,n]=yield this.modalService.openViewRef(t,this.cipherAddEditModalRef,(t=>{null!=this.organization&&(t.organization=this.organization,t.organizationId=this.organization.id),t.cipherId=null==e?null:e.id,t.onSavedCipher.subscribe((()=>m(this,void 0,void 0,(function*(){i.close(),yield this.load()})))),t.onDeletedCipher.subscribe((()=>m(this,void 0,void 0,(function*(){i.close(),yield this.load()})))),t.onRestoredCipher.subscribe((()=>m(this,void 0,void 0,(function*(){i.close(),yield this.load()}))))}));return n}))}setCiphers(){return m(this,void 0,void 0,(function*(){this.allCiphers=[]}))}repromptCipher(e){return m(this,void 0,void 0,(function*(){return e.reprompt===c.N.None||(yield this.passwordRepromptService.showPasswordPrompt())}))}getAllCiphers(){return m(this,void 0,void 0,(function*(){return yield this.cipherService.getAllDecrypted()}))}filterCiphersByOrg(e){this.allCiphers=[...e],this.ciphers=e.map((e=>(e.orgFilterStatus=e.organizationId,-1===this.filterStatus.indexOf(e.organizationId)&&null!=e.organizationId?this.filterStatus.push(e.organizationId):-1===this.filterStatus.indexOf(1)&&null==e.organizationId&&this.filterStatus.splice(1,0,1),e))),this.filterStatus.length>2?(this.showFilterToggle=!0,this.vaultMsg="vaults"):(this.showFilterToggle=!1,this.vaultMsg="vault")}}y.ɵfac=function(e){return new(e||y)(n.Y36(h.u),n.Y36(a.Z),n.Y36(u.C),n.Y36(l.Mn),n.Y36(g.D),n.Y36(f._))},y.ɵdir=n.lG2({type:y,viewQuery:function(e,t){if(1&e&&n.Gf(v,7,n.s_b),2&e){let e;n.iGM(e=n.CRH())&&(t.cipherAddEditModalRef=e.first)}}})},53550:(e,t,i)=>{"use strict";i.d(t,{W:()=>J});var n=i(61374),s=i(58691),o=i(89474),r=i(25406),a=i(47317),l=i(85762),c=i(92236),u=i(98438),d=i(78627),p=i(4871),h=i(28508),g=i(53707),f=i(15252),m=i(2051),v=i(12963),y=i(66385),w=i(81974),b=i(81168),U=i(98797),_=i(65777),A=i(82081),Z=i(58618),x=i(82933),S=i(36409),T=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function C(e,t){1&e&&(l.TgZ(0,"app-callout",6),l.ALo(1,"i18n"),l._uU(2),l.ALo(3,"i18n"),l.qZA()),2&e&&(l.s9C("title",l.lcZ(1,2,"goodNews")),l.xp6(2),l.hij("\n      ",l.lcZ(3,4,"noExposedPasswords"),"\n    "))}function O(e,t){if(1&e&&(l.ynx(0),l._uU(1,"\n          "),l.TgZ(2,"bit-toggle",13),l._uU(3),l.TgZ(4,"span",14),l._uU(5),l.qZA(),l._uU(6,"\n          "),l.qZA(),l._uU(7,"\n        "),l.BQk()),2&e){const e=t.$implicit,i=l.oxw(4);l.xp6(2),l.Q6J("value",e),l.xp6(1),l.hij("\n            ",i.getName(e),"\n            "),l.xp6(2),l.hij(" ",i.getCount(e)," ")}}function k(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"bit-toggle-group",12),l.NdJ("selectedChange",(function(t){l.CHM(e);const i=l.oxw(3);return l.KtG(i.filterOrgToggle(t))})),l.ALo(1,"async"),l.ALo(2,"i18n"),l._uU(3,"\n        "),l.YNc(4,O,8,3,"ng-container",11),l._uU(5,"\n      "),l.qZA()}if(2&e){const e=l.oxw(3);l.Q6J("selected",l.lcZ(1,3,e.filterOrgStatus$)),l.uIk("aria-label",l.lcZ(2,5,"addAccessFilter")),l.xp6(4),l.Q6J("ngForOf",e.filterStatus)}}function P(e,t){1&e&&(l.TgZ(0,"thead",15),l._uU(1,"\n          "),l.TgZ(2,"tr"),l._uU(3,"\n            "),l._UZ(4,"th"),l._uU(5,"\n            "),l.TgZ(6,"th"),l._uU(7),l.ALo(8,"i18n"),l.qZA(),l._uU(9,"\n            "),l.TgZ(10,"th"),l._uU(11),l.ALo(12,"i18n"),l.qZA(),l._uU(13,"\n          "),l.qZA(),l._uU(14,"\n        "),l.qZA()),2&e&&(l.xp6(7),l.Oqu(l.lcZ(8,2,"name")),l.xp6(4),l.Oqu(l.lcZ(12,4,"owner")))}function q(e,t){if(1&e){const e=l.EpF();l.ynx(0),l._uU(1,"\n                "),l.TgZ(2,"a",24),l.NdJ("click",(function(){l.CHM(e);const t=l.oxw().$implicit,i=l.oxw(3);return l.KtG(i.selectCipher(t))})),l.ALo(3,"i18n"),l._uU(4),l.qZA(),l._uU(5,"\n              "),l.BQk()}if(2&e){const e=l.oxw().$implicit;l.xp6(2),l.s9C("title",l.lcZ(3,2,"editItem")),l.xp6(2),l.Oqu(e.name)}}function I(e,t){if(1&e&&(l._uU(0,"\n                "),l.TgZ(1,"span"),l._uU(2),l.qZA(),l._uU(3,"\n              ")),2&e){const e=l.oxw().$implicit;l.xp6(2),l.Oqu(e.name)}}function M(e,t){1&e&&(l.ynx(0),l._uU(1,"\n                "),l._UZ(2,"i",25),l.ALo(3,"i18n"),l._uU(4,"\n                "),l.TgZ(5,"span",26),l._uU(6),l.ALo(7,"i18n"),l.qZA(),l._uU(8,"\n              "),l.BQk()),2&e&&(l.xp6(2),l.s9C("title",l.lcZ(3,2,"shared")),l.xp6(4),l.Oqu(l.lcZ(7,4,"shared")))}function N(e,t){1&e&&(l.ynx(0),l._uU(1,"\n                "),l._UZ(2,"i",27),l.ALo(3,"i18n"),l._uU(4,"\n                "),l.TgZ(5,"span",26),l._uU(6),l.ALo(7,"i18n"),l.qZA(),l._uU(8,"\n              "),l.BQk()),2&e&&(l.xp6(2),l.s9C("title",l.lcZ(3,2,"attachments")),l.xp6(4),l.Oqu(l.lcZ(7,4,"attachments")))}function L(e,t){if(1&e&&(l.TgZ(0,"app-org-badge",28),l.ALo(1,"orgNameFromId"),l.ALo(2,"async"),l._uU(3,"\n              "),l.qZA()),2&e){const e=l.oxw().$implicit,t=l.oxw(3);l.Q6J("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",l.xi3(1,3,e.organizationId,l.lcZ(2,6,t.organizations$)))}}function D(e,t){if(1&e&&(l.TgZ(0,"tr"),l._uU(1,"\n            "),l.TgZ(2,"td",16),l._uU(3,"\n              "),l._UZ(4,"app-vault-icon",17),l._uU(5,"\n            "),l.qZA(),l._uU(6,"\n            "),l.TgZ(7,"td",18),l._uU(8,"\n              "),l.YNc(9,q,6,4,"ng-container",19),l._uU(10,"\n              "),l.YNc(11,I,4,1,"ng-template",null,20,l.W1O),l._uU(13,"\n              "),l.YNc(14,M,9,6,"ng-container",5),l._uU(15,"\n              "),l.YNc(16,N,9,6,"ng-container",5),l._uU(17,"\n              "),l._UZ(18,"br"),l._uU(19,"\n              "),l.TgZ(20,"small"),l._uU(21),l.qZA(),l._uU(22,"\n            "),l.qZA(),l._uU(23,"\n            "),l.TgZ(24,"td"),l._uU(25,"\n              "),l.YNc(26,L,4,8,"app-org-badge",21),l._uU(27,"\n            "),l.qZA(),l._uU(28,"\n            "),l.TgZ(29,"td",22),l._uU(30,"\n              "),l.TgZ(31,"span",23),l._uU(32),l.ALo(33,"i18n"),l.ALo(34,"number"),l.qZA(),l._uU(35,"\n            "),l.qZA(),l._uU(36,"\n          "),l.qZA()),2&e){const e=t.$implicit,i=l.MAs(12),n=l.oxw(3);l.xp6(4),l.Q6J("cipher",e),l.xp6(5),l.Q6J("ngIf",!n.organization||n.canManageCipher(e))("ngIfElse",i),l.xp6(5),l.Q6J("ngIf",!n.organization&&e.organizationId),l.xp6(2),l.Q6J("ngIf",e.hasAttachments),l.xp6(5),l.Oqu(e.subTitle),l.xp6(5),l.Q6J("ngIf",!n.organization),l.xp6(6),l.hij("\n                ",l.xi3(33,8,"exposedXTimes",l.lcZ(34,11,n.exposedPasswordMap.get(e.id))),"\n              ")}}function E(e,t){if(1&e&&(l.ynx(0),l._uU(1,"\n      "),l.TgZ(2,"app-callout",7),l.ALo(3,"i18n"),l._uU(4),l.ALo(5,"i18n"),l.ALo(6,"number"),l.qZA(),l._uU(7,"\n      "),l.YNc(8,k,6,7,"bit-toggle-group",8),l._uU(9,"\n      "),l.TgZ(10,"table",9),l._uU(11,"\n        "),l.YNc(12,P,15,6,"thead",10),l._uU(13,"\n        "),l.TgZ(14,"tbody"),l._uU(15,"\n          "),l.YNc(16,D,37,13,"tr",11),l._uU(17,"\n        "),l.qZA(),l._uU(18,"\n      "),l.qZA(),l._uU(19,"\n    "),l.BQk()),2&e){const e=l.oxw(2);l.xp6(2),l.s9C("title",l.lcZ(3,6,"exposedPasswordsFound")),l.Q6J("useAlertRole",!0),l.xp6(2),l.hij("\n        ",l.Dn7(5,8,"exposedPasswordsFoundReportDesc",l.lcZ(6,12,e.ciphers.length),e.vaultMsg),"\n      "),l.xp6(4),l.Q6J("ngIf",e.showFilterToggle&&!e.isAdminConsoleActive),l.xp6(4),l.Q6J("ngIf",!e.isAdminConsoleActive),l.xp6(4),l.Q6J("ngForOf",e.ciphers)}}function F(e,t){if(1&e&&(l.TgZ(0,"div",3),l._uU(1,"\n    "),l.YNc(2,C,4,6,"app-callout",4),l._uU(3,"\n    "),l.YNc(4,E,20,14,"ng-container",5),l._uU(5,"\n  "),l.qZA()),2&e){const e=l.oxw();l.xp6(2),l.Q6J("ngIf",!e.ciphers.length),l.xp6(2),l.Q6J("ngIf",e.ciphers.length)}}function R(e,t){}class J extends a.E{constructor(e,t,i,n,s,o,r){super(e,n,s,i,o,r),this.cipherService=e,this.auditService=t,this.organizationService=i,this.exposedPasswordMap=new Map,this.disabled=!0}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return T(this,void 0,void 0,(function*(){yield e.load.call(this)}))}setCiphers(){return T(this,void 0,void 0,(function*(){const e=yield this.getAllCiphers(),t=[],i=[];this.filterStatus=[0],e.forEach((e=>{const{type:n,login:s,isDeleted:r,edit:a,viewPassword:l,id:c}=e;if(n!==o.Ou.Login||null==s.password||""===s.password||r||!this.organization&&!a||!l)return;const u=this.auditService.passwordLeaked(s.password).then((i=>{i>0&&(t.push(e),this.exposedPasswordMap.set(c,i))}));i.push(u)})),yield Promise.all(i),this.filterCiphersByOrg(t)}))}canManageCipher(e){return!0}}J.ɵfac=function(e){return new(e||J)(l.Y36(c.u),l.Y36(u.C),l.Y36(s.Mn),l.Y36(n.Z),l.Y36(r.C),l.Y36(d.D),l.Y36(p._))},J.ɵcmp=l.Xpm({type:J,selectors:[["app-exposed-passwords-report"]],features:[l.qOj],decls:18,vars:8,consts:[["type","submit","buttonType","primary","bitButton","",3,"loading","click"],["class","mt-4",4,"ngIf"],["cipherAddEdit",""],[1,"mt-4"],["type","success",3,"title",4,"ngIf"],[4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title","useAlertRole"],[3,"selected","selectedChange",4,"ngIf"],[1,"table","table-hover","table-list","table-ciphers"],["class","tw-border-0 tw-border-b-2 tw-border-solid tw-border-secondary-300 tw-font-bold tw-text-muted",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"selected","selectedChange"],[3,"value"],["bitBadge","","variant","info"],[1,"tw-border-0","tw-border-b-2","tw-border-solid","tw-border-secondary-300","tw-font-bold","tw-text-muted"],[1,"table-list-icon"],[3,"cipher"],[1,"reduced-lh","wrap"],[4,"ngIf","ngIfElse"],["cantManage",""],["appStopProp","",3,"disabled","organizationId","organizationName",4,"ngIf"],[1,"text-right"],["bitBadge","","variant","warning"],["href","#","appStopClick","",3,"title","click"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection",3,"title"],[1,"sr-only"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(l._UZ(0,"app-header"),l._uU(1,"\n\n"),l.TgZ(2,"bit-container"),l._uU(3,"\n  "),l.TgZ(4,"p"),l._uU(5),l.ALo(6,"i18n"),l.qZA(),l._uU(7,"\n  "),l.TgZ(8,"button",0),l.NdJ("click",(function(){return t.load()})),l._uU(9),l.ALo(10,"i18n"),l.qZA(),l._uU(11,"\n  "),l.YNc(12,F,6,2,"div",1),l._uU(13,"\n  "),l.YNc(14,R,0,0,"ng-template",null,2,l.W1O),l._uU(16,"\n"),l.qZA(),l._uU(17,"\n")),2&e&&(l.xp6(5),l.Oqu(l.lcZ(6,4,"exposedPasswordsReportDesc")),l.xp6(3),l.Q6J("loading",t.loading),l.xp6(1),l.hij("\n    ",l.lcZ(10,6,"checkExposedPasswords"),"\n  "),l.xp6(3),l.Q6J("ngIf",t.hasLoaded))},dependencies:[h.sg,h.O5,g.O,f.o,m.O,v._,y.l,w.r,b.e,U.f,_.n,A.C,Z.k,h.Ov,h.JJ,x.C,S.l],encapsulation:2})},92006:(e,t,i)=>{"use strict";i.d(t,{Y:()=>J});var n=i(61374),s=i(58691),o=i(27646),r=i(89474),a=i(25406),l=i(47317),c=i(85762),u=i(92236),d=i(66459),p=i(78627),h=i(4871),g=i(28508),f=i(53707),m=i(15252),v=i(2051),y=i(12963),w=i(66385),b=i(81168),U=i(98797),_=i(65777),A=i(82081),Z=i(58618),x=i(82933),S=i(36409),T=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function C(e,t){1&e&&(c.TgZ(0,"div"),c._uU(1,"\n    "),c._UZ(2,"i",3),c.ALo(3,"i18n"),c._uU(4,"\n    "),c.TgZ(5,"span",4),c._uU(6),c.ALo(7,"i18n"),c.qZA(),c._uU(8,"\n  "),c.qZA()),2&e&&(c.xp6(2),c.s9C("title",c.lcZ(3,2,"loading")),c.xp6(4),c.Oqu(c.lcZ(7,4,"loading")))}function O(e,t){1&e&&(c.TgZ(0,"app-callout",7),c.ALo(1,"i18n"),c._uU(2),c.ALo(3,"i18n"),c.qZA()),2&e&&(c.s9C("title",c.lcZ(1,2,"goodNews")),c.xp6(2),c.hij("\n      ",c.lcZ(3,4,"noInactive2fa"),"\n    "))}function k(e,t){if(1&e&&(c.ynx(0),c._uU(1,"\n          "),c.TgZ(2,"bit-toggle",14),c._uU(3),c.TgZ(4,"span",15),c._uU(5),c.qZA(),c._uU(6,"\n          "),c.qZA(),c._uU(7,"\n        "),c.BQk()),2&e){const e=t.$implicit,i=c.oxw(4);c.xp6(2),c.Q6J("value",e),c.xp6(1),c.hij("\n            ",i.getName(e),"\n            "),c.xp6(2),c.hij(" ",i.getCount(e)," ")}}function P(e,t){if(1&e){const e=c.EpF();c.TgZ(0,"bit-toggle-group",13),c.NdJ("selectedChange",(function(t){c.CHM(e);const i=c.oxw(3);return c.KtG(i.filterOrgToggle(t))})),c.ALo(1,"async"),c.ALo(2,"i18n"),c._uU(3,"\n        "),c.YNc(4,k,8,3,"ng-container",12),c._uU(5,"\n      "),c.qZA()}if(2&e){const e=c.oxw(3);c.Q6J("selected",c.lcZ(1,3,e.filterOrgStatus$)),c.uIk("aria-label",c.lcZ(2,5,"addAccessFilter")),c.xp6(4),c.Q6J("ngForOf",e.filterStatus)}}function q(e,t){1&e&&(c.TgZ(0,"thead",16),c._uU(1,"\n          "),c.TgZ(2,"tr"),c._uU(3,"\n            "),c._UZ(4,"th"),c._uU(5,"\n            "),c.TgZ(6,"th"),c._uU(7),c.ALo(8,"i18n"),c.qZA(),c._uU(9,"\n            "),c.TgZ(10,"th"),c._uU(11),c.ALo(12,"i18n"),c.qZA(),c._uU(13,"\n          "),c.qZA(),c._uU(14,"\n        "),c.qZA()),2&e&&(c.xp6(7),c.Oqu(c.lcZ(8,2,"name")),c.xp6(4),c.Oqu(c.lcZ(12,4,"owner")))}function I(e,t){1&e&&(c.ynx(0),c._uU(1,"\n                "),c._UZ(2,"i",24),c.ALo(3,"i18n"),c._uU(4,"\n                "),c.TgZ(5,"span",4),c._uU(6),c.ALo(7,"i18n"),c.qZA(),c._uU(8,"\n              "),c.BQk()),2&e&&(c.xp6(2),c.s9C("title",c.lcZ(3,2,"shared")),c.xp6(4),c.Oqu(c.lcZ(7,4,"shared")))}function M(e,t){1&e&&(c.ynx(0),c._uU(1,"\n                "),c._UZ(2,"i",25),c.ALo(3,"i18n"),c._uU(4,"\n                "),c.TgZ(5,"span",4),c._uU(6),c.ALo(7,"i18n"),c.qZA(),c._uU(8,"\n              "),c.BQk()),2&e&&(c.xp6(2),c.s9C("title",c.lcZ(3,2,"attachments")),c.xp6(4),c.Oqu(c.lcZ(7,4,"attachments")))}function N(e,t){if(1&e&&(c.TgZ(0,"app-org-badge",26),c.ALo(1,"orgNameFromId"),c.ALo(2,"async"),c._uU(3,"\n              "),c.qZA()),2&e){const e=c.oxw().$implicit,t=c.oxw(3);c.Q6J("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",c.xi3(1,3,e.organizationId,c.lcZ(2,6,t.organizations$)))}}function L(e,t){if(1&e&&(c.TgZ(0,"a",27),c._uU(1),c.ALo(2,"i18n"),c.qZA()),2&e){const e=c.oxw().$implicit,t=c.oxw(3);c.s9C("href",t.cipherDocs.get(e.id),c.LSH),c.xp6(1),c.hij("\n                ",c.lcZ(2,2,"instructions"),"")}}function D(e,t){if(1&e){const e=c.EpF();c.TgZ(0,"tr"),c._uU(1,"\n            "),c.TgZ(2,"td",17),c._uU(3,"\n              "),c._UZ(4,"app-vault-icon",18),c._uU(5,"\n            "),c.qZA(),c._uU(6,"\n            "),c.TgZ(7,"td",19),c._uU(8,"\n              "),c.TgZ(9,"a",20),c.NdJ("click",(function(){const t=c.CHM(e).$implicit,i=c.oxw(3);return c.KtG(i.selectCipher(t))})),c.ALo(10,"i18n"),c._uU(11),c.qZA(),c._uU(12,"\n              "),c.YNc(13,I,9,6,"ng-container",0),c._uU(14,"\n              "),c.YNc(15,M,9,6,"ng-container",0),c._uU(16,"\n              "),c._UZ(17,"br"),c._uU(18,"\n              "),c.TgZ(19,"small"),c._uU(20),c.qZA(),c._uU(21,"\n            "),c.qZA(),c._uU(22,"\n            "),c.TgZ(23,"td"),c._uU(24,"\n              "),c.YNc(25,N,4,8,"app-org-badge",21),c._uU(26,"\n            "),c.qZA(),c._uU(27,"\n            "),c.TgZ(28,"td",22),c._uU(29,"\n              "),c.YNc(30,L,3,4,"a",23),c._uU(31,"\n            "),c.qZA(),c._uU(32,"\n          "),c.qZA()}if(2&e){const e=t.$implicit,i=c.oxw(3);c.xp6(4),c.Q6J("cipher",e),c.xp6(5),c.s9C("title",c.lcZ(10,8,"editItem")),c.xp6(2),c.Oqu(e.name),c.xp6(2),c.Q6J("ngIf",!i.organization&&e.organizationId),c.xp6(2),c.Q6J("ngIf",e.hasAttachments),c.xp6(5),c.Oqu(e.subTitle),c.xp6(5),c.Q6J("ngIf",!i.organization),c.xp6(5),c.Q6J("ngIf",i.cipherDocs.has(e.id))}}function E(e,t){if(1&e&&(c.ynx(0),c._uU(1,"\n      "),c.TgZ(2,"app-callout",8),c.ALo(3,"i18n"),c._uU(4),c.ALo(5,"i18n"),c.ALo(6,"number"),c.qZA(),c._uU(7,"\n      "),c.YNc(8,P,6,7,"bit-toggle-group",9),c._uU(9,"\n      "),c.TgZ(10,"table",10),c._uU(11,"\n        "),c.YNc(12,q,15,6,"thead",11),c._uU(13,"\n        "),c.TgZ(14,"tbody"),c._uU(15,"\n          "),c.YNc(16,D,33,10,"tr",12),c._uU(17,"\n        "),c.qZA(),c._uU(18,"\n      "),c.qZA(),c._uU(19,"\n    "),c.BQk()),2&e){const e=c.oxw(2);c.xp6(2),c.s9C("title",c.lcZ(3,5,"inactive2faFound")),c.xp6(2),c.hij("\n        ",c.Dn7(5,7,"inactive2faFoundReportDesc",c.lcZ(6,11,e.ciphers.length),e.vaultMsg),"\n      "),c.xp6(4),c.Q6J("ngIf",e.showFilterToggle&&!e.isAdminConsoleActive),c.xp6(4),c.Q6J("ngIf",!e.isAdminConsoleActive),c.xp6(4),c.Q6J("ngForOf",e.ciphers)}}function F(e,t){if(1&e&&(c.TgZ(0,"div",5),c._uU(1,"\n    "),c.YNc(2,O,4,6,"app-callout",6),c._uU(3,"\n    "),c.YNc(4,E,20,13,"ng-container",0),c._uU(5,"\n  "),c.qZA()),2&e){const e=c.oxw();c.xp6(2),c.Q6J("ngIf",!e.ciphers.length),c.xp6(2),c.Q6J("ngIf",e.ciphers.length)}}function R(e,t){}class J extends l.E{constructor(e,t,i,n,s,o,r){super(e,i,s,t,o,r),this.cipherService=e,this.organizationService=t,this.logService=n,this.services=new Map,this.cipherDocs=new Map,this.disabled=!0}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return T(this,void 0,void 0,(function*(){yield e.load.call(this)}))}setCiphers(){return T(this,void 0,void 0,(function*(){try{yield this.load2fa()}catch(e){this.logService.error(e)}if(this.services.size>0){const e=yield this.getAllCiphers(),t=[],i=new Map;this.filterStatus=[0],e.forEach((e=>{const{type:n,login:s,isDeleted:a,edit:l,id:c,viewPassword:u}=e;if(n===r.Ou.Login&&(null==s.totp||""===s.totp)&&s.hasUris&&!a&&(this.organization||l)&&u)for(let r=0;r<s.uris.length;r++){const n=s.uris[r];if(null!=n.uri&&""!==n.uri){const s=n.uri.replace("www.",""),r=o.c.getDomain(s);if(null!=r&&this.services.has(r))return null!=this.services.get(r)&&i.set(c,this.services.get(r)),void t.push(e)}}})),this.filterCiphersByOrg(t),this.cipherDocs=i}}))}load2fa(){return T(this,void 0,void 0,(function*(){if(this.services.size>0)return;const e=yield fetch(new Request("https://api.2fa.directory/v3/totp.json"));if(200!==e.status)throw new Error;const t=yield e.json();for(const i of t){const e=i[1];if(null!=e.domain&&null!=e.documentation){if(null!=e["additional-domains"])for(const t of e["additional-domains"])this.services.set(t,e.documentation);this.services.set(e.domain,e.documentation)}}}))}}J.ɵfac=function(e){return new(e||J)(c.Y36(u.u),c.Y36(s.Mn),c.Y36(n.Z),c.Y36(d.$),c.Y36(a.C),c.Y36(p.D),c.Y36(h._))},J.ɵcmp=c.Xpm({type:J,selectors:[["app-inactive-two-factor-report"]],features:[c.qOj],decls:16,vars:5,consts:[[4,"ngIf"],["class","mt-4",4,"ngIf"],["cipherAddEdit",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],[1,"mt-4"],["type","success",3,"title",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[3,"selected","selectedChange",4,"ngIf"],[1,"table","table-hover","table-list","table-ciphers"],["class","tw-border-0 tw-border-b-2 tw-border-solid tw-border-secondary-300 tw-font-bold tw-text-muted",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"selected","selectedChange"],[3,"value"],["bitBadge","","variant","info"],[1,"tw-border-0","tw-border-b-2","tw-border-solid","tw-border-secondary-300","tw-font-bold","tw-text-muted"],[1,"table-list-icon"],[3,"cipher"],[1,"reduced-lh","wrap"],["href","#","appStopClick","",3,"title","click"],["appStopProp","",3,"disabled","organizationId","organizationName",4,"ngIf"],[1,"text-right"],["bitBadge","","target","_blank","rel","noreferrer",3,"href",4,"ngIf"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"],["bitBadge","","target","_blank","rel","noreferrer",3,"href"]],template:function(e,t){1&e&&(c._UZ(0,"app-header"),c._uU(1,"\n\n"),c.TgZ(2,"bit-container"),c._uU(3,"\n  "),c.TgZ(4,"p"),c._uU(5),c.ALo(6,"i18n"),c.qZA(),c._uU(7,"\n  "),c.YNc(8,C,9,6,"div",0),c._uU(9,"\n  "),c.YNc(10,F,6,2,"div",1),c._uU(11,"\n  "),c.YNc(12,R,0,0,"ng-template",null,2,c.W1O),c._uU(14,"\n"),c.qZA(),c._uU(15,"\n")),2&e&&(c.xp6(5),c.Oqu(c.lcZ(6,3,"inactive2faReportDesc")),c.xp6(3),c.Q6J("ngIf",!t.hasLoaded&&t.loading),c.xp6(2),c.Q6J("ngIf",t.hasLoaded))},dependencies:[g.sg,g.O5,f.O,m.o,v.O,y._,w.l,b.e,U.f,_.n,A.C,Z.k,g.Ov,g.JJ,x.C,S.l],encapsulation:2})},22353:(e,t,i)=>{"use strict";i.d(t,{Q:()=>R});var n=i(61374),s=i(58691),o=i(89474),r=i(25406),a=i(47317),l=i(85762),c=i(92236),u=i(78627),d=i(4871),p=i(28508),h=i(53707),g=i(15252),f=i(2051),m=i(12963),v=i(66385),y=i(81168),w=i(98797),b=i(65777),U=i(82081),_=i(58618),A=i(82933),Z=i(36409),x=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function S(e,t){1&e&&(l.TgZ(0,"div"),l._uU(1,"\n    "),l._UZ(2,"i",3),l.ALo(3,"i18n"),l._uU(4,"\n    "),l.TgZ(5,"span",4),l._uU(6),l.ALo(7,"i18n"),l.qZA(),l._uU(8,"\n  "),l.qZA()),2&e&&(l.xp6(2),l.s9C("title",l.lcZ(3,2,"loading")),l.xp6(4),l.Oqu(l.lcZ(7,4,"loading")))}function T(e,t){1&e&&(l.TgZ(0,"app-callout",7),l.ALo(1,"i18n"),l._uU(2),l.ALo(3,"i18n"),l.qZA()),2&e&&(l.s9C("title",l.lcZ(1,2,"goodNews")),l.xp6(2),l.hij("\n      ",l.lcZ(3,4,"noReusedPasswords"),"\n    "))}function C(e,t){if(1&e&&(l.ynx(0),l._uU(1,"\n          "),l.TgZ(2,"bit-toggle",14),l._uU(3),l.TgZ(4,"span",15),l._uU(5),l.qZA(),l._uU(6,"\n          "),l.qZA(),l._uU(7,"\n        "),l.BQk()),2&e){const e=t.$implicit,i=l.oxw(4);l.xp6(2),l.Q6J("value",e),l.xp6(1),l.hij("\n            ",i.getName(e),"\n            "),l.xp6(2),l.hij(" ",i.getCount(e)," ")}}function O(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"bit-toggle-group",13),l.NdJ("selectedChange",(function(t){l.CHM(e);const i=l.oxw(3);return l.KtG(i.filterOrgToggle(t))})),l.ALo(1,"async"),l.ALo(2,"i18n"),l._uU(3,"\n        "),l.YNc(4,C,8,3,"ng-container",12),l._uU(5,"\n      "),l.qZA()}if(2&e){const e=l.oxw(3);l.Q6J("selected",l.lcZ(1,3,e.filterOrgStatus$)),l.uIk("aria-label",l.lcZ(2,5,"addAccessFilter")),l.xp6(4),l.Q6J("ngForOf",e.filterStatus)}}function k(e,t){1&e&&(l.TgZ(0,"thead",16),l._uU(1,"\n          "),l.TgZ(2,"tr"),l._uU(3,"\n            "),l._UZ(4,"th"),l._uU(5,"\n            "),l.TgZ(6,"th"),l._uU(7),l.ALo(8,"i18n"),l.qZA(),l._uU(9,"\n            "),l.TgZ(10,"th"),l._uU(11),l.ALo(12,"i18n"),l.qZA(),l._uU(13,"\n          "),l.qZA(),l._uU(14,"\n        "),l.qZA()),2&e&&(l.xp6(7),l.Oqu(l.lcZ(8,2,"name")),l.xp6(4),l.Oqu(l.lcZ(12,4,"owner")))}function P(e,t){if(1&e){const e=l.EpF();l.ynx(0),l._uU(1,"\n                "),l.TgZ(2,"a",25),l.NdJ("click",(function(){l.CHM(e);const t=l.oxw().$implicit,i=l.oxw(3);return l.KtG(i.selectCipher(t))})),l.ALo(3,"i18n"),l._uU(4),l.qZA(),l._uU(5,"\n              "),l.BQk()}if(2&e){const e=l.oxw().$implicit;l.xp6(2),l.s9C("title",l.lcZ(3,2,"editItem")),l.xp6(2),l.Oqu(e.name)}}function q(e,t){if(1&e&&(l._uU(0,"\n                "),l.TgZ(1,"span"),l._uU(2),l.qZA(),l._uU(3,"\n              ")),2&e){const e=l.oxw().$implicit;l.xp6(2),l.Oqu(e.name)}}function I(e,t){1&e&&(l.ynx(0),l._uU(1,"\n                "),l._UZ(2,"i",26),l.ALo(3,"i18n"),l._uU(4,"\n                "),l.TgZ(5,"span",4),l._uU(6),l.ALo(7,"i18n"),l.qZA(),l._uU(8,"\n              "),l.BQk()),2&e&&(l.xp6(2),l.s9C("title",l.lcZ(3,2,"shared")),l.xp6(4),l.Oqu(l.lcZ(7,4,"shared")))}function M(e,t){1&e&&(l.ynx(0),l._uU(1,"\n                "),l._UZ(2,"i",27),l.ALo(3,"i18n"),l._uU(4,"\n                "),l.TgZ(5,"span",4),l._uU(6),l.ALo(7,"i18n"),l.qZA(),l._uU(8,"\n              "),l.BQk()),2&e&&(l.xp6(2),l.s9C("title",l.lcZ(3,2,"attachments")),l.xp6(4),l.Oqu(l.lcZ(7,4,"attachments")))}function N(e,t){if(1&e&&(l.TgZ(0,"app-org-badge",28),l.ALo(1,"orgNameFromId"),l.ALo(2,"async"),l._uU(3,"\n              "),l.qZA()),2&e){const e=l.oxw().$implicit,t=l.oxw(3);l.Q6J("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",l.xi3(1,3,e.organizationId,l.lcZ(2,6,t.organizations$)))}}function L(e,t){if(1&e&&(l.TgZ(0,"tr"),l._uU(1,"\n            "),l.TgZ(2,"td",17),l._uU(3,"\n              "),l._UZ(4,"app-vault-icon",18),l._uU(5,"\n            "),l.qZA(),l._uU(6,"\n            "),l.TgZ(7,"td",19),l._uU(8,"\n              "),l.YNc(9,P,6,4,"ng-container",20),l._uU(10,"\n              "),l.YNc(11,q,4,1,"ng-template",null,21,l.W1O),l._uU(13,"\n              "),l.YNc(14,I,9,6,"ng-container",0),l._uU(15,"\n              "),l.YNc(16,M,9,6,"ng-container",0),l._uU(17,"\n              "),l._UZ(18,"br"),l._uU(19,"\n              "),l.TgZ(20,"small"),l._uU(21),l.qZA(),l._uU(22,"\n            "),l.qZA(),l._uU(23,"\n            "),l.TgZ(24,"td"),l._uU(25,"\n              "),l.YNc(26,N,4,8,"app-org-badge",22),l._uU(27,"\n            "),l.qZA(),l._uU(28,"\n            "),l.TgZ(29,"td",23),l._uU(30,"\n              "),l.TgZ(31,"span",24),l._uU(32),l.ALo(33,"i18n"),l.qZA(),l._uU(34,"\n            "),l.qZA(),l._uU(35,"\n          "),l.qZA()),2&e){const e=t.$implicit,i=l.MAs(12),n=l.oxw(3);l.xp6(4),l.Q6J("cipher",e),l.xp6(5),l.Q6J("ngIf",!n.organization||n.canManageCipher(e))("ngIfElse",i),l.xp6(5),l.Q6J("ngIf",!n.organization&&e.organizationId),l.xp6(2),l.Q6J("ngIf",e.hasAttachments),l.xp6(5),l.Oqu(e.subTitle),l.xp6(5),l.Q6J("ngIf",!n.organization),l.xp6(6),l.hij("\n                ",l.xi3(33,8,"reusedXTimes",n.passwordUseMap.get(e.login.password)),"\n              ")}}function D(e,t){if(1&e&&(l.ynx(0),l._uU(1,"\n      "),l.TgZ(2,"app-callout",8),l.ALo(3,"i18n"),l._uU(4),l.ALo(5,"i18n"),l.ALo(6,"number"),l.qZA(),l._uU(7,"\n\n      "),l.YNc(8,O,6,7,"bit-toggle-group",9),l._uU(9,"\n\n      "),l.TgZ(10,"table",10),l._uU(11,"\n        "),l.YNc(12,k,15,6,"thead",11),l._uU(13,"\n        "),l.TgZ(14,"tbody"),l._uU(15,"\n          "),l.YNc(16,L,36,11,"tr",12),l._uU(17,"\n        "),l.qZA(),l._uU(18,"\n      "),l.qZA(),l._uU(19,"\n    "),l.BQk()),2&e){const e=l.oxw(2);l.xp6(2),l.s9C("title",l.lcZ(3,5,"reusedPasswordsFound")),l.xp6(2),l.hij("\n        ",l.Dn7(5,7,"reusedPasswordsFoundReportDesc",l.lcZ(6,11,e.ciphers.length),e.vaultMsg),"\n      "),l.xp6(4),l.Q6J("ngIf",e.showFilterToggle&&!e.isAdminConsoleActive),l.xp6(4),l.Q6J("ngIf",!e.isAdminConsoleActive),l.xp6(4),l.Q6J("ngForOf",e.ciphers)}}function E(e,t){if(1&e&&(l.TgZ(0,"div",5),l._uU(1,"\n    "),l.YNc(2,T,4,6,"app-callout",6),l._uU(3,"\n    "),l.YNc(4,D,20,13,"ng-container",0),l._uU(5,"\n  "),l.qZA()),2&e){const e=l.oxw();l.xp6(2),l.Q6J("ngIf",!e.ciphers.length),l.xp6(2),l.Q6J("ngIf",e.ciphers.length)}}function F(e,t){}class R extends a.E{constructor(e,t,i,n,s,o){super(e,i,n,t,s,o),this.cipherService=e,this.organizationService=t,this.disabled=!0}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return x(this,void 0,void 0,(function*(){yield e.load.call(this)}))}setCiphers(){return x(this,void 0,void 0,(function*(){const e=yield this.getAllCiphers(),t=[];this.passwordUseMap=new Map,this.filterStatus=[0],e.forEach((e=>{const{type:i,login:n,isDeleted:s,edit:r,viewPassword:a}=e;i===o.Ou.Login&&null!=n.password&&""!==n.password&&!s&&(this.organization||r)&&a&&(t.push(e),this.passwordUseMap.has(n.password)?this.passwordUseMap.set(n.password,this.passwordUseMap.get(n.password)+1):this.passwordUseMap.set(n.password,1))}));const i=t.filter((e=>this.passwordUseMap.has(e.login.password)&&this.passwordUseMap.get(e.login.password)>1));this.filterCiphersByOrg(i)}))}canManageCipher(e){return!0}}R.ɵfac=function(e){return new(e||R)(l.Y36(c.u),l.Y36(s.Mn),l.Y36(n.Z),l.Y36(r.C),l.Y36(u.D),l.Y36(d._))},R.ɵcmp=l.Xpm({type:R,selectors:[["app-reused-passwords-report"]],features:[l.qOj],decls:16,vars:5,consts:[[4,"ngIf"],["class","mt-4",4,"ngIf"],["cipherAddEdit",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],[1,"mt-4"],["type","success",3,"title",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[3,"selected","selectedChange",4,"ngIf"],[1,"table","table-hover","table-list","table-ciphers"],["class","tw-border-0 tw-border-b-2 tw-border-solid tw-border-secondary-300 tw-font-bold tw-text-muted",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"selected","selectedChange"],[3,"value"],["bitBadge","","variant","info"],[1,"tw-border-0","tw-border-b-2","tw-border-solid","tw-border-secondary-300","tw-font-bold","tw-text-muted"],[1,"table-list-icon"],[3,"cipher"],[1,"reduced-lh","wrap"],[4,"ngIf","ngIfElse"],["cantManage",""],["appStopProp","",3,"disabled","organizationId","organizationName",4,"ngIf"],[1,"text-right"],["bitBadge","","variant","warning"],["href","#","appStopClick","",3,"title","click"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(l._UZ(0,"app-header"),l._uU(1,"\n\n"),l.TgZ(2,"bit-container"),l._uU(3,"\n  "),l.TgZ(4,"p"),l._uU(5),l.ALo(6,"i18n"),l.qZA(),l._uU(7,"\n  "),l.YNc(8,S,9,6,"div",0),l._uU(9,"\n  "),l.YNc(10,E,6,2,"div",1),l._uU(11,"\n  "),l.YNc(12,F,0,0,"ng-template",null,2,l.W1O),l._uU(14,"\n"),l.qZA(),l._uU(15,"\n")),2&e&&(l.xp6(5),l.Oqu(l.lcZ(6,3,"reusedPasswordsReportDesc")),l.xp6(3),l.Q6J("ngIf",!t.hasLoaded&&t.loading),l.xp6(2),l.Q6J("ngIf",t.hasLoaded))},dependencies:[p.sg,p.O5,h.O,g.o,f.O,m._,v.l,y.e,w.f,b.n,U.C,_.k,p.Ov,p.JJ,A.C,Z.l],encapsulation:2})},88775:(e,t,i)=>{"use strict";i.d(t,{i:()=>E});var n=i(61374),s=i(58691),o=i(89474),r=i(25406),a=i(47317),l=i(85762),c=i(92236),u=i(78627),d=i(4871),p=i(28508),h=i(53707),g=i(15252),f=i(2051),m=i(12963),v=i(66385),y=i(81168),w=i(98797),b=i(65777),U=i(82081),_=i(58618),A=i(82933),Z=i(36409),x=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function S(e,t){1&e&&(l.TgZ(0,"div"),l._uU(1,"\n    "),l._UZ(2,"i",3),l.ALo(3,"i18n"),l._uU(4,"\n    "),l.TgZ(5,"span",4),l._uU(6),l.ALo(7,"i18n"),l.qZA(),l._uU(8,"\n  "),l.qZA()),2&e&&(l.xp6(2),l.s9C("title",l.lcZ(3,2,"loading")),l.xp6(4),l.Oqu(l.lcZ(7,4,"loading")))}function T(e,t){1&e&&(l.TgZ(0,"app-callout",7),l.ALo(1,"i18n"),l._uU(2),l.ALo(3,"i18n"),l.qZA()),2&e&&(l.s9C("title",l.lcZ(1,2,"goodNews")),l.xp6(2),l.hij("\n      ",l.lcZ(3,4,"noUnsecuredWebsites"),"\n    "))}function C(e,t){if(1&e&&(l.ynx(0),l._uU(1,"\n          "),l.TgZ(2,"bit-toggle",14),l._uU(3),l.TgZ(4,"span",15),l._uU(5),l.qZA(),l._uU(6,"\n          "),l.qZA(),l._uU(7,"\n        "),l.BQk()),2&e){const e=t.$implicit,i=l.oxw(4);l.xp6(2),l.Q6J("value",e),l.xp6(1),l.hij("\n            ",i.getName(e),"\n            "),l.xp6(2),l.hij(" ",i.getCount(e)," ")}}function O(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"bit-toggle-group",13),l.NdJ("selectedChange",(function(t){l.CHM(e);const i=l.oxw(3);return l.KtG(i.filterOrgToggle(t))})),l.ALo(1,"async"),l.ALo(2,"i18n"),l._uU(3,"\n        "),l.YNc(4,C,8,3,"ng-container",12),l._uU(5,"\n      "),l.qZA()}if(2&e){const e=l.oxw(3);l.Q6J("selected",l.lcZ(1,3,e.filterOrgStatus$)),l.uIk("aria-label",l.lcZ(2,5,"addAccessFilter")),l.xp6(4),l.Q6J("ngForOf",e.filterStatus)}}function k(e,t){1&e&&(l.TgZ(0,"thead",16),l._uU(1,"\n          "),l.TgZ(2,"tr"),l._uU(3,"\n            "),l._UZ(4,"th"),l._uU(5,"\n            "),l.TgZ(6,"th"),l._uU(7),l.ALo(8,"i18n"),l.qZA(),l._uU(9,"\n            "),l.TgZ(10,"th"),l._uU(11),l.ALo(12,"i18n"),l.qZA(),l._uU(13,"\n          "),l.qZA(),l._uU(14,"\n        "),l.qZA()),2&e&&(l.xp6(7),l.Oqu(l.lcZ(8,2,"name")),l.xp6(4),l.Oqu(l.lcZ(12,4,"owner")))}function P(e,t){1&e&&(l.ynx(0),l._uU(1,"\n                "),l._UZ(2,"i",22),l.ALo(3,"i18n"),l._uU(4,"\n                "),l.TgZ(5,"span",4),l._uU(6),l.ALo(7,"i18n"),l.qZA(),l._uU(8,"\n              "),l.BQk()),2&e&&(l.xp6(2),l.s9C("title",l.lcZ(3,2,"shared")),l.xp6(4),l.Oqu(l.lcZ(7,4,"shared")))}function q(e,t){1&e&&(l.ynx(0),l._uU(1,"\n                "),l._UZ(2,"i",23),l.ALo(3,"i18n"),l._uU(4,"\n                "),l.TgZ(5,"span",4),l._uU(6),l.ALo(7,"i18n"),l.qZA(),l._uU(8,"\n              "),l.BQk()),2&e&&(l.xp6(2),l.s9C("title",l.lcZ(3,2,"attachments")),l.xp6(4),l.Oqu(l.lcZ(7,4,"attachments")))}function I(e,t){if(1&e&&(l.TgZ(0,"app-org-badge",24),l.ALo(1,"orgNameFromId"),l.ALo(2,"async"),l._uU(3,"\n              "),l.qZA()),2&e){const e=l.oxw().$implicit,t=l.oxw(3);l.Q6J("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",l.xi3(1,3,e.organizationId,l.lcZ(2,6,t.organizations$)))}}function M(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"tr"),l._uU(1,"\n            "),l.TgZ(2,"td",17),l._uU(3,"\n              "),l._UZ(4,"app-vault-icon",18),l._uU(5,"\n            "),l.qZA(),l._uU(6,"\n            "),l.TgZ(7,"td",19),l._uU(8,"\n              "),l.TgZ(9,"a",20),l.NdJ("click",(function(){const t=l.CHM(e).$implicit,i=l.oxw(3);return l.KtG(i.selectCipher(t))})),l.ALo(10,"i18n"),l._uU(11),l.qZA(),l._uU(12,"\n              "),l.YNc(13,P,9,6,"ng-container",0),l._uU(14,"\n              "),l.YNc(15,q,9,6,"ng-container",0),l._uU(16,"\n              "),l._UZ(17,"br"),l._uU(18,"\n              "),l.TgZ(19,"small"),l._uU(20),l.qZA(),l._uU(21,"\n            "),l.qZA(),l._uU(22,"\n            "),l.TgZ(23,"td"),l._uU(24,"\n              "),l.YNc(25,I,4,8,"app-org-badge",21),l._uU(26,"\n            "),l.qZA(),l._uU(27,"\n          "),l.qZA()}if(2&e){const e=t.$implicit,i=l.oxw(3);l.xp6(4),l.Q6J("cipher",e),l.xp6(5),l.s9C("title",l.lcZ(10,7,"editItem")),l.xp6(2),l.Oqu(e.name),l.xp6(2),l.Q6J("ngIf",!i.organization&&e.organizationId),l.xp6(2),l.Q6J("ngIf",e.hasAttachments),l.xp6(5),l.Oqu(e.subTitle),l.xp6(5),l.Q6J("ngIf",!i.organization)}}function N(e,t){if(1&e&&(l.ynx(0),l._uU(1,"\n      "),l.TgZ(2,"app-callout",8),l.ALo(3,"i18n"),l._uU(4),l.ALo(5,"i18n"),l.ALo(6,"number"),l.qZA(),l._uU(7,"\n\n      "),l.YNc(8,O,6,7,"bit-toggle-group",9),l._uU(9,"\n      "),l.TgZ(10,"table",10),l._uU(11,"\n        "),l.YNc(12,k,15,6,"thead",11),l._uU(13,"\n        "),l.TgZ(14,"tbody"),l._uU(15,"\n          "),l.YNc(16,M,28,9,"tr",12),l._uU(17,"\n        "),l.qZA(),l._uU(18,"\n      "),l.qZA(),l._uU(19,"\n    "),l.BQk()),2&e){const e=l.oxw(2);l.xp6(2),l.s9C("title",l.lcZ(3,5,"unsecuredWebsitesFound")),l.xp6(2),l.hij("\n        ",l.Dn7(5,7,"unsecuredWebsitesFoundReportDesc",l.lcZ(6,11,e.ciphers.length),e.vaultMsg),"\n      "),l.xp6(4),l.Q6J("ngIf",e.showFilterToggle&&!e.isAdminConsoleActive),l.xp6(4),l.Q6J("ngIf",!e.isAdminConsoleActive),l.xp6(4),l.Q6J("ngForOf",e.ciphers)}}function L(e,t){if(1&e&&(l.TgZ(0,"div",5),l._uU(1,"\n    "),l.YNc(2,T,4,6,"app-callout",6),l._uU(3,"\n    "),l.YNc(4,N,20,13,"ng-container",0),l._uU(5,"\n  "),l.qZA()),2&e){const e=l.oxw();l.xp6(2),l.Q6J("ngIf",!e.ciphers.length),l.xp6(2),l.Q6J("ngIf",e.ciphers.length)}}function D(e,t){}class E extends a.E{constructor(e,t,i,n,s,o){super(e,i,n,t,s,o),this.cipherService=e,this.organizationService=t,this.disabled=!0}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return x(this,void 0,void 0,(function*(){yield e.load.call(this)}))}setCiphers(){return x(this,void 0,void 0,(function*(){const e=yield this.getAllCiphers();this.filterStatus=[0];const t=e.filter((e=>!(e.type!==o.Ou.Login||!e.login.hasUris||e.isDeleted)&&e.login.uris.some((e=>null!=e.uri&&0===e.uri.indexOf("http://")))));this.filterCiphersByOrg(t)}))}}E.ɵfac=function(e){return new(e||E)(l.Y36(c.u),l.Y36(s.Mn),l.Y36(n.Z),l.Y36(r.C),l.Y36(u.D),l.Y36(d._))},E.ɵcmp=l.Xpm({type:E,selectors:[["app-unsecured-websites-report"]],features:[l.qOj],decls:16,vars:5,consts:[[4,"ngIf"],["class","mt-4",4,"ngIf"],["cipherAddEdit",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],[1,"mt-4"],["type","success",3,"title",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[3,"selected","selectedChange",4,"ngIf"],[1,"table","table-hover","table-list","table-ciphers"],["class","tw-border-0 tw-border-b-2 tw-border-solid tw-border-secondary-300 tw-font-bold tw-text-muted",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"selected","selectedChange"],[3,"value"],["bitBadge","","variant","info"],[1,"tw-border-0","tw-border-b-2","tw-border-solid","tw-border-secondary-300","tw-font-bold","tw-text-muted"],[1,"table-list-icon"],[3,"cipher"],[1,"reduced-lh","wrap"],["href","#","appStopClick","",3,"title","click"],["appStopProp","",3,"disabled","organizationId","organizationName",4,"ngIf"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(l._UZ(0,"app-header"),l._uU(1,"\n\n"),l.TgZ(2,"bit-container"),l._uU(3,"\n  "),l.TgZ(4,"p"),l._uU(5),l.ALo(6,"i18n"),l.qZA(),l._uU(7,"\n  "),l.YNc(8,S,9,6,"div",0),l._uU(9,"\n  "),l.YNc(10,L,6,2,"div",1),l._uU(11,"\n  "),l.YNc(12,D,0,0,"ng-template",null,2,l.W1O),l._uU(14,"\n"),l.qZA(),l._uU(15,"\n")),2&e&&(l.xp6(5),l.Oqu(l.lcZ(6,3,"unsecuredWebsitesReportDesc")),l.xp6(3),l.Q6J("ngIf",!t.hasLoaded&&t.loading),l.xp6(2),l.Q6J("ngIf",t.hasLoaded))},dependencies:[p.sg,p.O5,h.O,g.o,f.O,m._,v.l,y.e,w.f,b.n,U.C,_.k,p.Ov,p.JJ,A.C,Z.l],encapsulation:2})},2578:(e,t,i)=>{"use strict";i.d(t,{m:()=>z});var n=i(61374),s=i(58691),o=i(27646),r=i(51453),a=i(89474),l=i(25406),c=i(47317),u=i(85762),d=i(92236),p=i(78627),h=i(4871),g=i(28508),f=i(53707),m=i(15252),v=i(2051),y=i(12963),w=i(66385),b=i(81168),U=i(98797),_=i(65777),A=i(82081),Z=i(58618),x=i(82933),S=i(36409),T=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function C(e,t){1&e&&(u.TgZ(0,"div"),u._uU(1,"\n    "),u._UZ(2,"i",3),u.ALo(3,"i18n"),u._uU(4,"\n    "),u.TgZ(5,"span",4),u._uU(6),u.ALo(7,"i18n"),u.qZA(),u._uU(8,"\n  "),u.qZA()),2&e&&(u.xp6(2),u.s9C("title",u.lcZ(3,2,"loading")),u.xp6(4),u.Oqu(u.lcZ(7,4,"loading")))}function O(e,t){1&e&&(u.TgZ(0,"app-callout",7),u.ALo(1,"i18n"),u._uU(2),u.ALo(3,"i18n"),u.qZA()),2&e&&(u.s9C("title",u.lcZ(1,2,"goodNews")),u.xp6(2),u.hij("\n      ",u.lcZ(3,4,"noWeakPasswords"),"\n    "))}function k(e,t){if(1&e&&(u.ynx(0),u._uU(1,"\n          "),u.TgZ(2,"bit-toggle",14),u._uU(3),u.TgZ(4,"span",15),u._uU(5),u.qZA(),u._uU(6,"\n          "),u.qZA(),u._uU(7,"\n        "),u.BQk()),2&e){const e=t.$implicit,i=u.oxw(4);u.xp6(2),u.Q6J("value",e),u.xp6(1),u.hij("\n            ",i.getName(e),"\n            "),u.xp6(2),u.hij(" ",i.getCount(e)," ")}}function P(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"bit-toggle-group",13),u.NdJ("selectedChange",(function(t){u.CHM(e);const i=u.oxw(3);return u.KtG(i.filterOrgToggle(t))})),u.ALo(1,"async"),u.ALo(2,"i18n"),u._uU(3,"\n        "),u.YNc(4,k,8,3,"ng-container",12),u._uU(5,"\n      "),u.qZA()}if(2&e){const e=u.oxw(3);u.Q6J("selected",u.lcZ(1,3,e.filterOrgStatus$)),u.uIk("aria-label",u.lcZ(2,5,"addAccessFilter")),u.xp6(4),u.Q6J("ngForOf",e.filterStatus)}}function q(e,t){1&e&&(u.TgZ(0,"thead",16),u._uU(1,"\n          "),u.TgZ(2,"tr"),u._uU(3,"\n            "),u._UZ(4,"th"),u._uU(5,"\n            "),u.TgZ(6,"th"),u._uU(7),u.ALo(8,"i18n"),u.qZA(),u._uU(9,"\n            "),u.TgZ(10,"th"),u._uU(11),u.ALo(12,"i18n"),u.qZA(),u._uU(13,"\n          "),u.qZA(),u._uU(14,"\n        "),u.qZA()),2&e&&(u.xp6(7),u.Oqu(u.lcZ(8,2,"name")),u.xp6(4),u.Oqu(u.lcZ(12,4,"owner")))}function I(e,t){if(1&e){const e=u.EpF();u.ynx(0),u._uU(1,"\n                "),u.TgZ(2,"a",25),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw().$implicit,i=u.oxw(3);return u.KtG(i.selectCipher(t))})),u.ALo(3,"i18n"),u._uU(4),u.qZA(),u._uU(5,"\n              "),u.BQk()}if(2&e){const e=u.oxw().$implicit;u.xp6(2),u.s9C("title",u.lcZ(3,2,"editItem")),u.xp6(2),u.Oqu(e.name)}}function M(e,t){if(1&e&&(u._uU(0,"\n                "),u.TgZ(1,"span"),u._uU(2),u.qZA(),u._uU(3,"\n              ")),2&e){const e=u.oxw().$implicit;u.xp6(2),u.Oqu(e.name)}}function N(e,t){1&e&&(u.ynx(0),u._uU(1,"\n                "),u._UZ(2,"i",26),u.ALo(3,"i18n"),u._uU(4,"\n                "),u.TgZ(5,"span",4),u._uU(6),u.ALo(7,"i18n"),u.qZA(),u._uU(8,"\n              "),u.BQk()),2&e&&(u.xp6(2),u.s9C("title",u.lcZ(3,2,"shared")),u.xp6(4),u.Oqu(u.lcZ(7,4,"shared")))}function L(e,t){1&e&&(u.ynx(0),u._uU(1,"\n                "),u._UZ(2,"i",27),u.ALo(3,"i18n"),u._uU(4,"\n                "),u.TgZ(5,"span",4),u._uU(6),u.ALo(7,"i18n"),u.qZA(),u._uU(8,"\n              "),u.BQk()),2&e&&(u.xp6(2),u.s9C("title",u.lcZ(3,2,"attachments")),u.xp6(4),u.Oqu(u.lcZ(7,4,"attachments")))}function D(e,t){if(1&e&&(u.TgZ(0,"app-org-badge",28),u.ALo(1,"orgNameFromId"),u.ALo(2,"async"),u._uU(3,"\n              "),u.qZA()),2&e){const e=u.oxw().$implicit,t=u.oxw(3);u.Q6J("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",u.xi3(1,3,e.organizationId,u.lcZ(2,6,t.organizations$)))}}function E(e,t){if(1&e&&(u.TgZ(0,"tr"),u._uU(1,"\n            "),u.TgZ(2,"td",17),u._uU(3,"\n              "),u._UZ(4,"app-vault-icon",18),u._uU(5,"\n            "),u.qZA(),u._uU(6,"\n            "),u.TgZ(7,"td",19),u._uU(8,"\n              "),u.YNc(9,I,6,4,"ng-container",20),u._uU(10,"\n              "),u.YNc(11,M,4,1,"ng-template",null,21,u.W1O),u._uU(13,"\n              "),u.YNc(14,N,9,6,"ng-container",0),u._uU(15,"\n              "),u.YNc(16,L,9,6,"ng-container",0),u._uU(17,"\n              "),u._UZ(18,"br"),u._uU(19,"\n              "),u.TgZ(20,"small"),u._uU(21),u.qZA(),u._uU(22,"\n            "),u.qZA(),u._uU(23,"\n            "),u.TgZ(24,"td"),u._uU(25,"\n              "),u.YNc(26,D,4,8,"app-org-badge",22),u._uU(27,"\n            "),u.qZA(),u._uU(28,"\n            "),u.TgZ(29,"td",23),u._uU(30,"\n              "),u.TgZ(31,"span",24),u._uU(32),u.ALo(33,"i18n"),u.qZA(),u._uU(34,"\n            "),u.qZA(),u._uU(35,"\n          "),u.qZA()),2&e){const e=t.$implicit,i=u.MAs(12),n=u.oxw(3);u.xp6(4),u.Q6J("cipher",e),u.xp6(5),u.Q6J("ngIf",!n.organization||n.canManageCipher(e))("ngIfElse",i),u.xp6(5),u.Q6J("ngIf",!n.organization&&e.organizationId),u.xp6(2),u.Q6J("ngIf",e.hasAttachments),u.xp6(5),u.Oqu(e.subTitle),u.xp6(5),u.Q6J("ngIf",!n.organization),u.xp6(5),u.Q6J("variant",n.passwordStrengthMap.get(e.id)[1]),u.xp6(1),u.hij("\n                ",u.lcZ(33,9,n.passwordStrengthMap.get(e.id)[0]),"\n              ")}}function F(e,t){if(1&e&&(u.ynx(0),u._uU(1,"\n      "),u.TgZ(2,"app-callout",8),u.ALo(3,"i18n"),u._uU(4),u.ALo(5,"i18n"),u.ALo(6,"number"),u.qZA(),u._uU(7,"\n      "),u.YNc(8,P,6,7,"bit-toggle-group",9),u._uU(9,"\n      "),u.TgZ(10,"table",10),u._uU(11,"\n        "),u.YNc(12,q,15,6,"thead",11),u._uU(13,"\n        "),u.TgZ(14,"tbody"),u._uU(15,"\n          "),u.YNc(16,E,36,11,"tr",12),u._uU(17,"\n        "),u.qZA(),u._uU(18,"\n      "),u.qZA(),u._uU(19,"\n    "),u.BQk()),2&e){const e=u.oxw(2);u.xp6(2),u.s9C("title",u.lcZ(3,5,"weakPasswordsFound")),u.xp6(2),u.hij("\n        ",u.Dn7(5,7,"weakPasswordsFoundReportDesc",u.lcZ(6,11,e.ciphers.length),e.vaultMsg),"\n      "),u.xp6(4),u.Q6J("ngIf",e.showFilterToggle&&!e.isAdminConsoleActive),u.xp6(4),u.Q6J("ngIf",!e.isAdminConsoleActive),u.xp6(4),u.Q6J("ngForOf",e.ciphers)}}function R(e,t){if(1&e&&(u.TgZ(0,"div",5),u._uU(1,"\n    "),u.YNc(2,O,4,6,"app-callout",6),u._uU(3,"\n    "),u.YNc(4,F,20,13,"ng-container",0),u._uU(5,"\n  "),u.qZA()),2&e){const e=u.oxw();u.xp6(2),u.Q6J("ngIf",!e.ciphers.length),u.xp6(2),u.Q6J("ngIf",e.ciphers.length)}}function J(e,t){}class z extends c.E{constructor(e,t,i,n,s,o,r){super(e,n,s,i,o,r),this.cipherService=e,this.passwordStrengthService=t,this.organizationService=i,this.passwordStrengthMap=new Map,this.disabled=!0,this.passwordStrengthCache=new Map,this.weakPasswordCiphers=[]}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return T(this,void 0,void 0,(function*(){yield e.load.call(this)}))}setCiphers(){return T(this,void 0,void 0,(function*(){const e=yield this.getAllCiphers();this.passwordStrengthCache=new Map,this.weakPasswordCiphers=[],this.filterStatus=[0],this.findWeakPasswords(e)}))}findWeakPasswords(e){e.forEach((e=>{const{type:t,login:i,isDeleted:n,edit:s,viewPassword:o,id:r}=e;if(t!==a.Ou.Login||null==i.password||""===i.password||n||!this.organization&&!s||!o)return;const l=this.isUserNameNotEmpty(e),c=this.getCacheKey(e);if(!this.passwordStrengthCache.has(c)){let e=[];if(l){const t=i.username.indexOf("@");e=t>-1?e.concat(i.username.substr(0,t).trim().toLowerCase().split(/[^A-Za-z0-9]/)).filter((e=>e.length>=3)):i.username.trim().toLowerCase().split(/[^A-Za-z0-9]/).filter((e=>e.length>=3))}const t=this.passwordStrengthService.getPasswordStrength(i.password,null,e.length>0?e:null);this.passwordStrengthCache.set(c,t.score)}const u=this.passwordStrengthCache.get(c);null!=u&&u<=2&&(this.passwordStrengthMap.set(r,this.scoreKey(u)),this.weakPasswordCiphers.push(e))})),this.weakPasswordCiphers.sort(((e,t)=>this.passwordStrengthCache.get(this.getCacheKey(e))-this.passwordStrengthCache.get(this.getCacheKey(t)))),this.filterCiphersByOrg(this.weakPasswordCiphers)}canManageCipher(e){return!0}isUserNameNotEmpty(e){return!o.c.isNullOrWhitespace(e.login.username)}getCacheKey(e){return e.login.password+"_____"+(this.isUserNameNotEmpty(e)?e.login.username:"")}scoreKey(e){switch(e){case 4:return["strong","success"];case 3:return["good","primary"];case 2:return["weak","warning"];default:return["veryWeak","danger"]}}}z.ɵfac=function(e){return new(e||z)(u.Y36(d.u),u.Y36(r.A),u.Y36(s.Mn),u.Y36(n.Z),u.Y36(l.C),u.Y36(p.D),u.Y36(h._))},z.ɵcmp=u.Xpm({type:z,selectors:[["app-weak-passwords-report"]],features:[u.qOj],decls:16,vars:5,consts:[[4,"ngIf"],["class","mt-4",4,"ngIf"],["cipherAddEdit",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],[1,"mt-4"],["type","success",3,"title",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[3,"selected","selectedChange",4,"ngIf"],[1,"table","table-hover","table-list","table-ciphers"],["class","tw-border-0 tw-border-b-2 tw-border-solid tw-border-secondary-300 tw-font-bold tw-text-muted",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"selected","selectedChange"],[3,"value"],["bitBadge","","variant","info"],[1,"tw-border-0","tw-border-b-2","tw-border-solid","tw-border-secondary-300","tw-font-bold","tw-text-muted"],[1,"table-list-icon"],[3,"cipher"],[1,"reduced-lh","wrap"],[4,"ngIf","ngIfElse"],["cantManage",""],["appStopProp","",3,"disabled","organizationId","organizationName",4,"ngIf"],[1,"text-right"],["bitBadge","",3,"variant"],["href","#","appStopClick","",3,"title","click"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(u._UZ(0,"app-header"),u._uU(1,"\n\n"),u.TgZ(2,"bit-container"),u._uU(3,"\n  "),u.TgZ(4,"p"),u._uU(5),u.ALo(6,"i18n"),u.qZA(),u._uU(7,"\n  "),u.YNc(8,C,9,6,"div",0),u._uU(9,"\n  "),u.YNc(10,R,6,2,"div",1),u._uU(11,"\n  "),u.YNc(12,J,0,0,"ng-template",null,2,u.W1O),u._uU(14,"\n"),u.qZA(),u._uU(15,"\n")),2&e&&(u.xp6(5),u.Oqu(u.lcZ(6,3,"weakPasswordsReportDesc")),u.xp6(3),u.Q6J("ngIf",!t.hasLoaded&&t.loading),u.xp6(2),u.Q6J("ngIf",t.hasLoaded))},dependencies:[g.sg,g.O5,f.O,m.o,v.O,y._,w.l,b.e,U.f,_.n,A.C,Z.k,g.Ov,g.JJ,x.C,S.l],encapsulation:2})},54307:(e,t,i)=>{"use strict";var n;i.d(t,{x:()=>n}),function(e){e.Enabled="Enabled",e.RequiresPremium="RequiresPremium",e.RequiresUpgrade="RequiresUpgrade"}(n||(n={}))},2930:(e,t,i)=>{"use strict";i.d(t,{s:()=>m});var n=i(85762),s=i(28508),o=i(54307),r=i(8111),a=i(66385),l=i(22221),c=i(82933);function u(e,t){1&e&&(n.ynx(0),n._uU(1),n.ALo(2,"i18n"),n.BQk()),2&e&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"premium")))}function d(e,t){1&e&&(n.ynx(0),n._uU(1),n.ALo(2,"i18n"),n.BQk()),2&e&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"upgrade")))}function p(e,t){if(1&e&&(n.TgZ(0,"span",9),n._uU(1,"\n      "),n.YNc(2,u,3,3,"ng-container",10),n._uU(3,"\n      "),n.YNc(4,d,3,3,"ng-container",10),n._uU(5,"\n    "),n.qZA()),2&e){const e=n.oxw();n.Q6J("variant",e.requiresPremium?"success":"primary"),n.xp6(2),n.Q6J("ngIf",e.requiresPremium),n.xp6(2),n.Q6J("ngIf",!e.requiresPremium)}}const h=function(e){return{"tw-grayscale":e}};class g{get disabled(){return this.variant!=o.x.Enabled}get requiresPremium(){return this.variant==o.x.RequiresPremium}}function f(e,t){if(1&e&&(n.TgZ(0,"div"),n._uU(1,"\n    "),n._UZ(2,"app-report-card",2),n.ALo(3,"i18n"),n.ALo(4,"i18n"),n._uU(5,"\n  "),n.qZA()),2&e){const e=t.$implicit;n.xp6(2),n.Q6J("title",n.lcZ(3,5,e.title))("description",n.lcZ(4,7,e.description))("route",e.route)("variant",e.variant)("icon",e.icon)}}g.ɵfac=function(e){return new(e||g)},g.ɵcmp=n.Xpm({type:g,selectors:[["app-report-card"]],inputs:{title:"title",description:"description",route:"route",icon:"icon",variant:"variant"},decls:23,vars:11,consts:[[1,"tw-block","tw-h-full","tw-max-w-72","tw-overflow-hidden","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","!tw-text-main","tw-transition-all","hover:tw-scale-105","hover:tw-no-underline","focus:tw-outline-none","focus:tw-ring","focus:tw-ring-primary-700","focus:tw-ring-offset-2",3,"routerLink"],[1,"tw-relative"],[1,"tw-flex","tw-h-28","tw-bg-background-alt2","tw-text-center","tw-text-primary-300",3,"ngClass"],[1,"tw-m-auto"],["aria-hidden","true",3,"icon"],[1,"tw-p-5",3,"ngClass"],[1,"tw-mb-4","tw-text-xl","tw-font-bold"],[1,"tw-mb-0"],["bitBadge","","class","tw-absolute tw-left-2 tw-top-2 tw-leading-none",3,"variant",4,"ngIf"],["bitBadge","",1,"tw-absolute","tw-left-2","tw-top-2","tw-leading-none",3,"variant"],[4,"ngIf"]],template:function(e,t){1&e&&(n.TgZ(0,"a",0),n._uU(1,"\n  "),n.TgZ(2,"div",1),n._uU(3,"\n    "),n.TgZ(4,"div",2),n._uU(5,"\n      "),n.TgZ(6,"div",3),n._UZ(7,"bit-icon",4),n.qZA(),n._uU(8,"\n    "),n.qZA(),n._uU(9,"\n    "),n.TgZ(10,"div",5),n._uU(11,"\n      "),n.TgZ(12,"h3",6),n._uU(13),n.qZA(),n._uU(14,"\n      "),n.TgZ(15,"p",7),n._uU(16),n.qZA(),n._uU(17,"\n    "),n.qZA(),n._uU(18,"\n    "),n.YNc(19,p,6,3,"span",8),n._uU(20,"\n  "),n.qZA(),n._uU(21,"\n"),n.qZA(),n._uU(22,"\n")),2&e&&(n.Q6J("routerLink",t.route),n.xp6(4),n.Q6J("ngClass",n.VKq(7,h,t.disabled)),n.xp6(3),n.Q6J("icon",t.icon),n.xp6(3),n.Q6J("ngClass",n.VKq(9,h,t.disabled)),n.xp6(3),n.Oqu(t.title),n.xp6(3),n.Oqu(t.description),n.xp6(3),n.Q6J("ngIf",t.disabled))},dependencies:[s.mk,s.O5,r.rH,a.l,l.G,c.C],encapsulation:2});class m{}m.ɵfac=function(e){return new(e||m)},m.ɵcmp=n.Xpm({type:m,selectors:[["app-report-list"]],inputs:{reports:"reports"},decls:5,vars:1,consts:[[1,"tw-inline-grid","tw-grid-cols-3","tw-gap-4"],[4,"ngFor","ngForOf"],[3,"title","description","route","variant","icon"]],template:function(e,t){1&e&&(n.TgZ(0,"div",0),n._uU(1,"\n  "),n.YNc(2,f,6,9,"div",1),n._uU(3,"\n"),n.qZA(),n._uU(4,"\n")),2&e&&(n.xp6(2),n.Q6J("ngForOf",t.reports))},dependencies:[s.sg,g,c.C],encapsulation:2})},74690:(e,t,i)=>{"use strict";i.d(t,{a8:()=>y,WK:()=>Ue,sn:()=>v,ku:()=>ve});var n=i(28783),s=i(37513),o=i(54019),r=i(68362),a=i(92786),l=i(84598),c=i(30359),u=i(92716),d=i(33031),p=i(59260),h=i(19887),g=i(58691),f=i(59281),m=i(27646);var v,y,w=i(63078),b=i(36689),U=i(34632),_=i(88409),A=i(95607),Z=i(85762),x=i(31754),S=i(78627),T=i(99721),C=i(47244),O=i(65254),k=i(73369),P=i(62357),q=i(28508),I=i(33245),M=i(98205),N=i(46246),L=i(36338),D=i(81974),E=i(29465),F=i(24637),R=i(11512),J=i(36179),z=i(44358),Y=i(21656),K=i(28975),B=i(30469),Q=i(17731),G=i(26536),j=i(82933),V=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function $(e,t){if(1&e&&(Z.TgZ(0,"span",11),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Oqu(e.collection.name)}}function H(e,t){if(1&e&&(Z.ynx(0),Z._uU(1),Z.ALo(2,"i18n"),Z.YNc(3,$,2,1,"span",10),Z._uU(4,"\n      "),Z.BQk()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij("\n        ",Z.lcZ(2,2,"editCollection"),"\n        "),Z.xp6(2),Z.Q6J("ngIf",!e.loading)}}function W(e,t){1&e&&(Z.ynx(0),Z._uU(1),Z.ALo(2,"i18n"),Z.BQk()),2&e&&(Z.xp6(1),Z.hij("\n        ",Z.lcZ(2,1,"newCollection"),"\n      "))}function X(e,t){1&e&&(Z.ynx(0,null,12),Z._uU(2,"\n        "),Z._UZ(3,"i",13),Z._uU(4,"\n      "),Z.BQk())}function ee(e,t){if(1&e&&(Z.TgZ(0,"bit-option",28),Z._uU(1,"\n              "),Z.qZA()),2&e){const e=t.$implicit;Z.Q6J("value",e.id)("label",e.name)}}function te(e,t){if(1&e&&(Z.TgZ(0,"bit-form-field"),Z._uU(1,"\n            "),Z.TgZ(2,"bit-label"),Z._uU(3),Z.ALo(4,"i18n"),Z.qZA(),Z._uU(5,"\n            "),Z.TgZ(6,"bit-select",26),Z._uU(7,"\n              "),Z.YNc(8,ee,2,2,"bit-option",27),Z.ALo(9,"async"),Z._uU(10,"\n            "),Z.qZA(),Z._uU(11,"\n          "),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(3),Z.Oqu(Z.lcZ(4,2,"organization")),Z.xp6(5),Z.Q6J("ngForOf",Z.lcZ(9,4,e.organizations$))}}function ie(e,t){if(1&e&&(Z.TgZ(0,"bit-option",29),Z.ALo(1,"i18n"),Z._uU(2,"\n              "),Z.qZA()),2&e){const e=Z.oxw(2);Z.hYB("label","",e.deletedParentName," (",Z.lcZ(1,3,"deleted"),")"),Z.Q6J("value",e.deletedParentName)}}function ne(e,t){if(1&e&&(Z.TgZ(0,"bit-option",30),Z._uU(1,"\n              "),Z.qZA()),2&e){const e=t.$implicit;Z.Q6J("value",e.name)("label",e.name)}}function se(e,t){1&e&&(Z.ynx(0),Z._uU(1,"\n              "),Z.TgZ(2,"span"),Z._uU(3),Z.ALo(4,"i18n"),Z.qZA(),Z._uU(5,"\n            "),Z.BQk()),2&e&&(Z.xp6(3),Z.Oqu(Z.lcZ(4,1,"readOnlyCollectionAccess")))}function oe(e,t){1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.ALo(2,"i18n"),Z.qZA()),2&e&&(Z.xp6(1),Z.Oqu(Z.lcZ(2,1,"grantCollectionAccess")))}function re(e,t){1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.ALo(2,"i18n"),Z.qZA()),2&e&&(Z.xp6(1),Z.Oqu(Z.lcZ(2,1,"grantCollectionAccessMembersOnly")))}function ae(e,t){1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.ALo(2,"i18n"),Z.qZA()),2&e&&(Z.xp6(1),Z.Oqu(" "+Z.lcZ(2,1,"adminCollectionAccess")))}function le(e,t){if(1&e&&(Z.ynx(0),Z._uU(1,"\n              "),Z.YNc(2,oe,3,3,"span",3),Z._uU(3,"\n              "),Z.YNc(4,re,3,3,"span",3),Z._uU(5,"\n              "),Z.YNc(6,ae,3,3,"span",3),Z.ALo(7,"async"),Z._uU(8,"\n            "),Z.BQk()),2&e){const e=Z.oxw(3);Z.xp6(2),Z.Q6J("ngIf",e.organization.useGroups),Z.xp6(2),Z.Q6J("ngIf",!e.organization.useGroups),Z.xp6(2),Z.Q6J("ngIf",Z.lcZ(7,3,e.flexibleCollectionsV1Enabled$)&&e.organization.allowAdminAccessToAllCollectionItems)}}function ce(e,t){if(1&e&&(Z.TgZ(0,"div",31),Z._uU(1,"\n            "),Z.YNc(2,se,6,3,"ng-container",3),Z._uU(3,"\n            "),Z.YNc(4,le,9,5,"ng-container",3),Z._uU(5,"\n          "),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(2),Z.Q6J("ngIf",e.dialogReadonly),Z.xp6(2),Z.Q6J("ngIf",!e.dialogReadonly)}}function ue(e,t){1&e&&(Z.TgZ(0,"div",32),Z._uU(1,"\n            "),Z._UZ(2,"i",33),Z._uU(3),Z.ALo(4,"i18n"),Z.qZA()),2&e&&(Z.xp6(3),Z.hij(" ",Z.lcZ(4,1,"managePermissionRequired"),"\n          "))}function de(e,t){if(1&e&&(Z._UZ(0,"bit-access-selector",34),Z.ALo(1,"i18n"),Z.ALo(2,"i18n"),Z.ALo(3,"i18n"),Z.ALo(4,"i18n")),2&e){const e=Z.oxw(2);Z.Q6J("permissionMode",e.dialogReadonly?e.PermissionMode.Readonly:e.PermissionMode.Edit)("items",e.accessItems)("columnHeader",Z.lcZ(1,7,"groupSlashMemberColumnHeader"))("selectorLabelText",Z.lcZ(2,9,"selectGroupsAndMembers"))("selectorHelpText",Z.lcZ(3,11,"userPermissionOverrideHelper"))("emptySelectionText",Z.lcZ(4,13,"noMembersOrGroupsAdded"))("flexibleCollectionsEnabled",e.organization.flexibleCollections)}}function pe(e,t){if(1&e&&(Z._UZ(0,"bit-access-selector",35),Z.ALo(1,"i18n"),Z.ALo(2,"i18n"),Z.ALo(3,"i18n")),2&e){const e=Z.oxw(2);Z.Q6J("permissionMode",e.dialogReadonly?e.PermissionMode.Readonly:e.PermissionMode.Edit)("items",e.accessItems)("columnHeader",Z.lcZ(1,6,"memberColumnHeader"))("selectorLabelText",Z.lcZ(2,8,"selectMembers"))("emptySelectionText",Z.lcZ(3,10,"noMembersAdded"))("flexibleCollectionsEnabled",e.organization.flexibleCollections)}}function he(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"bit-tab-group",14),Z.NdJ("selectedIndexChange",(function(t){Z.CHM(e);const i=Z.oxw();return Z.KtG(i.tabIndex=t)})),Z._uU(1,"\n        "),Z.TgZ(2,"bit-tab",15),Z.ALo(3,"i18n"),Z._uU(4,"\n          "),Z.TgZ(5,"bit-form-field"),Z._uU(6,"\n            "),Z.TgZ(7,"bit-label"),Z._uU(8),Z.ALo(9,"i18n"),Z.qZA(),Z._uU(10,"\n            "),Z._UZ(11,"input",16),Z._uU(12,"\n          "),Z.qZA(),Z._uU(13,"\n\n          "),Z.YNc(14,te,12,6,"bit-form-field",3),Z._uU(15,"\n\n          "),Z.TgZ(16,"bit-form-field"),Z._uU(17,"\n            "),Z.TgZ(18,"bit-label"),Z._uU(19),Z.ALo(20,"i18n"),Z.qZA(),Z._uU(21,"\n            "),Z._UZ(22,"input",17),Z._uU(23,"\n            "),Z.TgZ(24,"bit-hint"),Z._uU(25),Z.ALo(26,"i18n"),Z.qZA(),Z._uU(27,"\n          "),Z.qZA(),Z._uU(28,"\n\n          "),Z.TgZ(29,"bit-form-field"),Z._uU(30,"\n            "),Z.TgZ(31,"bit-label"),Z._uU(32),Z.ALo(33,"i18n"),Z.qZA(),Z._uU(34,"\n            "),Z.TgZ(35,"bit-select",18),Z._uU(36,"\n              "),Z.TgZ(37,"bit-option",19),Z.ALo(38,"i18n"),Z._uU(39," "),Z.qZA(),Z._uU(40,"\n              "),Z.YNc(41,ie,3,5,"bit-option",20),Z._uU(42,"\n              "),Z.YNc(43,ne,2,2,"bit-option",21),Z._uU(44,"\n            "),Z.qZA(),Z._uU(45,"\n          "),Z.qZA(),Z._uU(46,"\n        "),Z.qZA(),Z._uU(47,"\n        "),Z.TgZ(48,"bit-tab",15),Z.ALo(49,"i18n"),Z._uU(50,"\n          "),Z.YNc(51,ce,6,2,"div",22),Z._uU(52,"\n          "),Z.YNc(53,ue,5,3,"div",23),Z._uU(54,"\n          "),Z.YNc(55,de,5,15,"bit-access-selector",24),Z._uU(56,"\n          "),Z.YNc(57,pe,4,12,"bit-access-selector",25),Z._uU(58,"\n        "),Z.qZA(),Z._uU(59,"\n      "),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("selectedIndex",e.tabIndex),Z.xp6(2),Z.s9C("label",Z.lcZ(3,16,"collectionInfo")),Z.xp6(6),Z.Oqu(Z.lcZ(9,18,"name")),Z.xp6(6),Z.Q6J("ngIf",e.showOrgSelector),Z.xp6(5),Z.Oqu(Z.lcZ(20,20,"externalId")),Z.xp6(6),Z.Oqu(Z.lcZ(26,22,"externalIdDesc")),Z.xp6(7),Z.Oqu(Z.lcZ(33,24,"nestCollectionUnder")),Z.xp6(5),Z.Q6J("value",void 0)("label",Z.lcZ(38,26,"noCollection")),Z.xp6(4),Z.Q6J("ngIf",e.deletedParentName),Z.xp6(2),Z.Q6J("ngForOf",e.nestOptions),Z.xp6(5),Z.s9C("label",Z.lcZ(49,28,"access")),Z.xp6(3),Z.Q6J("ngIf",e.organization.flexibleCollections),Z.xp6(2),Z.Q6J("ngIf",e.formGroup.controls.access.hasError("managePermissionRequired")),Z.xp6(2),Z.Q6J("ngIf",e.organization.useGroups),Z.xp6(2),Z.Q6J("ngIf",!e.organization.useGroups)}}function ge(e,t){if(1&e&&(Z._UZ(0,"button",36),Z.ALo(1,"i18n")),2&e){const e=Z.oxw();Z.Q6J("appA11yTitle",Z.lcZ(1,3,"delete"))("bitAction",e.delete)("disabled",e.loading)}}!function(e){e[e.Info=0]="Info",e[e.Access=1]="Access"}(v||(v={})),function(e){e.Saved="saved",e.Canceled="canceled",e.Deleted="deleted"}(y||(y={}));class fe{constructor(e,t,i,n,r,a,l,c,u,d,p,g,m){var w,_;this.params=e,this.formBuilder=t,this.dialogRef=i,this.organizationService=n,this.groupService=r,this.collectionAdminService=a,this.collectionService=l,this.i18nService=c,this.platformUtilsService=u,this.organizationUserService=d,this.configService=p,this.dialogService=g,this.changeDetectorRef=m,this.flexibleCollectionsV1Enabled$=this.configService.getFeatureFlag$(f.T.FlexibleCollectionsV1).pipe((0,h.P)()),this.destroy$=new o.x,this.loading=!0,this.nestOptions=[],this.accessItems=[],this.showOrgSelector=!1,this.formGroup=this.formBuilder.group({name:["",[s.kI.required,(_=["/"],e=>{if(!(e instanceof s.NI))throw new Error("forbiddenCharacters only supports validating FormControls");if(null===e.value||void 0===e.value)return null;const t=String(e.value);for(const i of t)if(_.includes(i))return{forbiddenCharacters:{value:e.value,characters:_}};return null})]],externalId:"",parent:void 0,access:[[]],selectedOrg:""}),this.PermissionMode=b.R,this.showDeleteButton=!1,this.submit=()=>V(this,void 0,void 0,(function*(){if(this.dialogReadonly)return;if(this.formGroup.markAllAsTouched(),this.formGroup.invalid){const e=this.formGroup.controls.access.hasError("managePermissionRequired");return void(this.tabIndex!==v.Access||e?this.tabIndex===v.Info&&e&&this.platformUtilsService.showToast("error",null,this.i18nService.t("fieldOnTabRequiresAttention",this.i18nService.t("access"))):this.platformUtilsService.showToast("error",null,this.i18nService.t("fieldOnTabRequiresAttention",this.i18nService.t("collectionInfo"))))}const e=new A.e;e.id=this.params.collectionId,e.organizationId=this.formGroup.controls.selectedOrg.value,e.externalId=this.formGroup.controls.externalId.value,e.groups=this.formGroup.controls.access.value.filter((e=>e.type===U.zD.Group)).map(U.E2),e.users=this.formGroup.controls.access.value.filter((e=>e.type===U.zD.Member)).map(U.E2);const t=this.formGroup.controls.parent.value;e.name=t?`${t}/${this.formGroup.controls.name.value}`:this.formGroup.controls.name.value;const i=yield this.collectionAdminService.save(e);this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode?"editedCollectionId":"createdCollectionId",e.name)),this.close(y.Saved,i)})),this.delete=()=>V(this,void 0,void 0,(function*(){var e,t;if(this.dialogReadonly)return;if(!(yield this.dialogService.openSimpleDialog({title:null===(e=this.collection)||void 0===e?void 0:e.name,content:{key:"deleteCollectionConfirmation"},type:"warning"}))&&this.params.collectionId)return!1;yield this.collectionAdminService.delete(this.params.organizationId,this.params.collectionId),this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedCollectionId",null===(t=this.collection)||void 0===t?void 0:t.name)),this.close(y.Deleted,this.collection)})),this.tabIndex=null!==(w=e.initialTab)&&void 0!==w?w:v.Info}ngOnInit(){return V(this,void 0,void 0,(function*(){this.params.showOrgSelector?(this.showOrgSelector=!0,this.formGroup.controls.selectedOrg.valueChanges.pipe((0,r.R)(this.destroy$)).subscribe((e=>this.loadOrg(e,this.params.collectionIds))),this.organizations$=this.organizationService.organizations$.pipe((0,h.P)(),(0,a.U)((e=>e.filter((e=>e.canCreateNewCollections&&!e.isProviderUser)).sort(m.c.getSortFunction(this.i18nService,"name"))))),this.formGroup.patchValue({selectedOrg:this.params.organizationId})):(this.formGroup.patchValue({selectedOrg:this.params.organizationId}),yield this.loadOrg(this.params.organizationId,this.params.collectionIds))}))}loadOrg(e,t){return V(this,void 0,void 0,(function*(){const i=this.organizationService.get$(e).pipe((0,l.d)({refCount:!0,bufferSize:1})),n=i.pipe((0,c.w)((t=>t.useGroups?this.groupService.getAll(e):(0,u.of)([]))));(0,d.a)({organization:i,collections:this.collectionAdminService.getAll(e),collectionDetails:this.params.collectionId?(0,p.D)(this.collectionAdminService.get(e,this.params.collectionId)):(0,u.of)(null),groups:n,users:this.organizationUserService.getAllUsers(e,{includeCollections:!0}),collection:this.params.collectionId?this.collectionService.get(this.params.collectionId):(0,u.of)(null),flexibleCollectionsV1:this.flexibleCollectionsV1Enabled$}).pipe((0,r.R)(this.formGroup.controls.selectedOrg.valueChanges),(0,r.R)(this.destroy$)).subscribe((({organization:e,collections:i,collectionDetails:n,groups:s,users:o,collection:r,flexibleCollectionsV1:a})=>{var l,c,u;if(this.organization=e,this.accessItems=[].concat(s.map((e=>function(e,t){return{id:e.id,type:U.zD.Group,listName:e.name,labelName:e.name,accessAllItems:e.accessAll,readonly:e.accessAll,readonlyPermission:null!=t?(0,U.d4)(e.collections.find((e=>e.id==t))):void 0}}(e,this.collectionId))),o.data.map((e=>function(e,t){var i,n;return{id:e.id,type:U.zD.Member,email:e.email,role:e.type,listName:(null===(i=e.name)||void 0===i?void 0:i.length)>0?`${e.name} (${e.email})`:e.email,labelName:null!==(n=e.name)&&void 0!==n?n:e.email,status:e.status,accessAllItems:e.accessAll,readonly:e.accessAll,readonlyPermission:null!=t?(0,U.d4)(new w.KF(e.collections.find((e=>e.id==t)))):void 0}}(e,this.collectionId)))),this.changeDetectorRef.detectChanges(),t&&(i=i.filter((e=>t.includes(e.id)))),this.params.collectionId){if(this.collection=i.find((e=>e.id===this.collectionId)),this.nestOptions=i.filter((e=>e.id!==this.collectionId)),!this.collection)throw new Error("Could not find collection to edit.");const{name:t,parent:s}=function(e){var t;const i=null===(t=e.name)||void 0===t?void 0:t.split("/"),n=i[i.length-1],s=i.length>1?i.slice(0,-1).join("/"):void 0;return{name:n,parent:s}}(this.collection);void 0===s||this.nestOptions.find((e=>e.name===s))||(this.deletedParentName=s);const o=function(e){if(null==e)return[];return[].concat(e.groups.map((e=>({id:e.id,type:U.zD.Group,permission:(0,U.d4)(e)}))),e.users.map((e=>({id:e.id,type:U.zD.Member,permission:(0,U.d4)(e)}))))}(n);this.formGroup.patchValue({name:t,externalId:this.collection.externalId,parent:s,access:o}),this.collection.manage=null!==(l=null==r?void 0:r.manage)&&void 0!==l&&l,this.showDeleteButton=!this.dialogReadonly&&this.collection.canDelete(e)}else{this.nestOptions=i;const t=i.find((e=>e.id===this.params.parentCollectionId)),n=null===(c=o.data.find((e=>{var t;return e.userId===(null===(t=this.organization)||void 0===t?void 0:t.userId)})))||void 0===c?void 0:c.id,s=void 0!==n&&e.flexibleCollections?[{id:n,type:U.zD.Member,permission:U.OU.Manage}]:[];this.formGroup.patchValue({parent:null!==(u=null==t?void 0:t.name)&&void 0!==u?u:void 0,access:s})}e.flexibleCollections&&a&&!e.allowAdminAccessToAllCollectionItems?this.formGroup.controls.access.addValidators(me):this.formGroup.controls.access.removeValidators(me),this.formGroup.controls.access.updateValueAndValidity(),this.handleFormGroupReadonly(this.dialogReadonly),this.loading=!1}))}))}get collectionId(){return this.params.collectionId}get editMode(){return null!=this.params.collectionId}get dialogReadonly(){return!0===this.params.readonly}cancel(){return V(this,void 0,void 0,(function*(){this.close(y.Canceled)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}handleFormGroupReadonly(e){e?(this.formGroup.controls.name.disable(),this.formGroup.controls.externalId.disable(),this.formGroup.controls.parent.disable(),this.formGroup.controls.access.disable()):(this.formGroup.controls.name.enable(),this.formGroup.controls.externalId.enable(),this.formGroup.controls.parent.enable(),this.formGroup.controls.access.enable())}close(e,t){this.dialogRef.close({action:e,collection:t})}}function me(e){return e.value.some((e=>e.permission===U.OU.Manage))?null:{managePermissionRequired:!0}}function ve(e,t){return e.open(fe,t)}fe.ɵfac=function(e){return new(e||fe)(Z.Y36(n.Kt),Z.Y36(s.qu),Z.Y36(n.zj),Z.Y36(g.Mn),Z.Y36(w.lT),Z.Y36(_.m),Z.Y36(x.a),Z.Y36(S.D),Z.Y36(T.P),Z.Y36(C.t),Z.Y36(O.E),Z.Y36(k.x),Z.Y36(Z.sBO))},fe.ɵcmp=Z.Xpm({type:fe,selectors:[["ng-component"]],decls:33,vars:16,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large",3,"disablePadding"],["bitDialogTitle",""],[4,"ngIf"],["bitDialogContent",""],[3,"selectedIndex","selectedIndexChange",4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"disabled"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"disabled","click"],["type","button","bitIconButton","bwi-trash","buttonType","danger","class","tw-ml-auto","bitFormButton","",3,"appA11yTitle","bitAction","disabled",4,"ngIf"],["class","tw-text-sm tw-normal-case tw-text-muted",4,"ngIf"],[1,"tw-text-sm","tw-normal-case","tw-text-muted"],["spinner",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin"],[3,"selectedIndex","selectedIndexChange"],[3,"label"],["bitInput","","appAutofocus","","formControlName","name"],["bitInput","","formControlName","externalId"],["bitInput","","formControlName","parent"],[3,"value","label"],["disabled","","icon","bwi-collection",3,"value","label",4,"ngIf"],["icon","bwi-collection",3,"value","label",4,"ngFor","ngForOf"],["class","tw-mb-3",4,"ngIf"],["class","tw-mb-3 tw-text-danger",4,"ngIf"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","selectorHelpText","emptySelectionText","flexibleCollectionsEnabled",4,"ngIf"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","emptySelectionText","flexibleCollectionsEnabled",4,"ngIf"],["bitInput","","formControlName","selectedOrg"],["icon","bwi-business",3,"value","label",4,"ngFor","ngForOf"],["icon","bwi-business",3,"value","label"],["disabled","","icon","bwi-collection",3,"value","label"],["icon","bwi-collection",3,"value","label"],[1,"tw-mb-3"],[1,"tw-mb-3","tw-text-danger"],[1,"bwi","bwi-error"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","selectorHelpText","emptySelectionText","flexibleCollectionsEnabled"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","emptySelectionText","flexibleCollectionsEnabled"],["type","button","bitIconButton","bwi-trash","buttonType","danger","bitFormButton","",1,"tw-ml-auto",3,"appA11yTitle","bitAction","disabled"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0),Z._uU(1,"\n  "),Z.TgZ(2,"bit-dialog",1),Z._uU(3,"\n    "),Z.TgZ(4,"span",2),Z._uU(5,"\n      "),Z.YNc(6,H,5,4,"ng-container",3),Z._uU(7,"\n      "),Z.YNc(8,W,3,3,"ng-container",3),Z._uU(9,"\n    "),Z.qZA(),Z._uU(10,"\n    "),Z.TgZ(11,"div",4),Z._uU(12,"\n      "),Z.YNc(13,X,5,0,"ng-container",3),Z._uU(14,"\n      "),Z.YNc(15,he,60,30,"bit-tab-group",5),Z._uU(16,"\n    "),Z.qZA(),Z._uU(17,"\n    "),Z.ynx(18,6),Z._uU(19,"\n      "),Z.TgZ(20,"button",7),Z._uU(21),Z.ALo(22,"i18n"),Z.qZA(),Z._uU(23,"\n      "),Z.TgZ(24,"button",8),Z.NdJ("click",(function(){return t.cancel()})),Z._uU(25),Z.ALo(26,"i18n"),Z.qZA(),Z._uU(27,"\n      "),Z.YNc(28,ge,2,5,"button",9),Z._uU(29,"\n    "),Z.BQk(),Z._uU(30,"\n  "),Z.qZA(),Z._uU(31,"\n"),Z.qZA(),Z._uU(32,"\n")),2&e&&(Z.Q6J("formGroup",t.formGroup)("bitSubmit",t.submit),Z.xp6(2),Z.Q6J("disablePadding",!t.loading),Z.xp6(4),Z.Q6J("ngIf",t.editMode),Z.xp6(2),Z.Q6J("ngIf",!t.editMode),Z.xp6(5),Z.Q6J("ngIf",t.loading),Z.xp6(2),Z.Q6J("ngIf",!t.loading),Z.xp6(5),Z.Q6J("disabled",t.loading||t.dialogReadonly),Z.xp6(1),Z.hij("\n        ",Z.lcZ(22,12,"save"),"\n      "),Z.xp6(3),Z.Q6J("disabled",t.loading),Z.xp6(1),Z.hij("\n        ",Z.lcZ(26,14,"cancel"),"\n      "),Z.xp6(3),Z.Q6J("ngIf",t.showDeleteButton))},dependencies:[q.sg,q.O5,s._Y,s.Fj,s.JJ,s.JL,s.sg,s.u,I.B,P.U,M.Q,N.b,L.u,D.r,E.a,F.d,R.G,J.u,z.M,Y.Q,K.H,B.x,Q.Q,G.i,b.f,q.Ov,j.C],encapsulation:2});var ye=i(31393),we=i(1176),be=i(71146);class Ue{}Ue.ɵfac=function(e){return new(e||Ue)},Ue.ɵmod=Z.oAB({type:Ue}),Ue.ɵinj=Z.cJS({imports:[be.m,we.k,ye.A]})},55039:(e,t,i)=>{"use strict";i.d(t,{R:()=>p});var n=i(34961),s=i(85762),o=i(99042),r=i(384),a=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class l{constructor(e,t,i){this.templateRef=e,this.viewContainer=t,this.billingAccountProfileStateService=i}ngOnInit(){return a(this,void 0,void 0,(function*(){(yield(0,o.z)(this.billingAccountProfileStateService.hasPremiumFromAnySource$))?this.viewContainer.clear():this.viewContainer.createEmbeddedView(this.templateRef)}))}}l.ɵfac=function(e){return new(e||l)(s.Y36(s.Rgc),s.Y36(s.s_b),s.Y36(r.M))},l.ɵdir=s.lG2({type:l,selectors:[["","appNotPremium",""]]});var c=i(66385),u=i(82933);function d(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",1),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.premiumRequired())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n      ",s.lcZ(2,1,"premium"),"\n    "))}class p{constructor(e){this.messagingService=e}premiumRequired(){this.messagingService.send("premiumRequired")}}p.ɵfac=function(e){return new(e||p)(s.Y36(n.o))},p.ɵcmp=s.Xpm({type:p,selectors:[["app-premium-badge"]],decls:3,vars:0,consts:[["type","button","bitBadge","","variant","success",3,"click",4,"appNotPremium"],["type","button","bitBadge","","variant","success",3,"click"]],template:function(e,t){1&e&&(s._uU(0,"\n    "),s.YNc(1,d,3,3,"button",0),s._uU(2,"\n  "))},dependencies:[l,c.l,u.C],encapsulation:2})},98583:(e,t,i)=>{"use strict";i.d(t,{JS:()=>U,RN:()=>b});var n=i(39518),s=i(85762),o=i(2138),r=i(16776);function a(e,t){1&e&&(s.TgZ(0,"th",16),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"owner")))}function l(e,t){1&e&&(s.TgZ(0,"th",16),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"collections")))}function c(e,t){1&e&&(s.TgZ(0,"th",16),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"groups")))}function u(e,t){1&e&&(s.TgZ(0,"th",16),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n          ",s.lcZ(2,1,"permission"),"\n        "))}function d(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",12),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.bulkMoveToFolder())})),s._uU(1,"\n              "),s._UZ(2,"i",17),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n              ",s.lcZ(4,1,"moveSelected"),"\n            "))}function p(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",12),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.bulkEditCollectionAccess())})),s._uU(1,"\n              "),s._UZ(2,"i",18),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n              ",s.lcZ(4,1,"access"),"\n            "))}function h(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",12),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.assignToCollections())})),s._uU(1,"\n              "),s._UZ(2,"i",19),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n              ",s.lcZ(4,1,"assignToCollections"),"\n            "))}function g(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",12),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.bulkMoveToOrganization())})),s._uU(1,"\n              "),s._UZ(2,"i",20),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n              ",s.lcZ(4,1,"moveSelectedToOrg"),"\n            "))}function f(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",12),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.bulkRestore())})),s._uU(1,"\n              "),s._UZ(2,"i",21),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n              ",s.lcZ(4,1,"restoreSelected"),"\n            "))}function m(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr",25),s.NdJ("checkedToggled",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(2);return s.KtG(i.selection.toggle(t))}))("onEvent",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.event(t))})),s.qZA()}if(2&e){const e=s.oxw().$implicit,t=s.oxw(2);s.Q6J("disabled",t.disabled)("collection",e.collection)("showOwner",t.showOwner)("showCollections",t.showCollections)("showGroups",t.showGroups)("organizations",t.allOrganizations)("showPermissionsColumn",t.showPermissionsColumn)("groups",t.allGroups)("canDeleteCollection",t.canDeleteCollection(e.collection))("canEditCollection",t.canEditCollection(e.collection))("checked",t.selection.isSelected(e))}}function v(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr",26),s.NdJ("checkedToggled",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(2);return s.KtG(i.selection.toggle(t))}))("onEvent",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.event(t))})),s.qZA()}if(2&e){const e=s.oxw().$implicit,t=s.oxw(2);s.Q6J("disabled",t.disabled)("cipher",e.cipher)("showOwner",t.showOwner)("showCollections",t.showCollections)("showGroups",t.showGroups)("showPremiumFeatures",t.showPremiumFeatures)("useEvents",t.useEvents)("viewingOrgVault",t.viewingOrgVault)("cloneable",t.canClone(e))("organizations",t.allOrganizations)("collections",t.allCollections)("checked",t.selection.isSelected(e))}}function y(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n        "),s.YNc(2,m,1,11,"tr",23),s._uU(3,"\n        "),s.YNc(4,v,1,12,"tr",24),s._uU(5,"\n      "),s.BQk()),2&e){const e=t.$implicit;s.xp6(2),s.Q6J("ngIf",e.collection),s.xp6(2),s.Q6J("ngIf",e.cipher)}}function w(e,t){if(1&e&&(s._uU(0,"\n      "),s.YNc(1,y,6,2,"ng-container",22),s._uU(2,"\n    ")),2&e){const e=t.$implicit;s.xp6(1),s.Q6J("cdkVirtualForOf",e)("cdkVirtualForTemplateCacheSize",0)}}const b="tw-h-[65px]";class U{constructor(){this.RowHeight=65,this.showAdminActions=!1,this.allOrganizations=[],this.allCollections=[],this.allGroups=[],this.showBulkEditCollectionAccess=!1,this.showBulkAddToCollections=!1,this.showPermissionsColumn=!1,this.flexibleCollectionsV1Enabled=!1,this._ciphers=[],this._collections=[],this.onEvent=new s.vpe,this.editableItems=[],this.dataSource=new o.G,this.selection=new n.Ov(!0,[],!0)}get ciphers(){return this._ciphers}set ciphers(e){this._ciphers=null!=e?e:[],this.refreshItems()}get collections(){return this._collections}set collections(e){this._collections=null!=e?e:[],this.refreshItems()}get showExtraColumn(){return this.showCollections||this.showGroups||this.showOwner}get isAllSelected(){return this.editableItems.slice(0,500).every((e=>this.selection.isSelected(e)))}get isEmpty(){return 0===this.dataSource.data.length}get bulkMoveAllowed(){return this.showBulkMove&&0===this.selection.selected.filter((e=>e.collection)).length}get bulkAssignToCollectionsAllowed(){return this.showBulkAddToCollections&&this.ciphers.length>0}canEditCollection(e){if(e.id===r.JK)return!1;const t=this.allOrganizations.find((t=>t.id===e.organizationId));return e.canEdit(t,this.flexibleCollectionsV1Enabled)}canDeleteCollection(e){if(e.id===r.JK)return!1;const t=this.allOrganizations.find((t=>t.id===e.organizationId));return e.canDelete(t)}toggleAll(){this.isAllSelected?this.selection.clear():this.selection.select(...this.editableItems.slice(0,500))}event(e){this.onEvent.emit(e)}bulkMoveToFolder(){this.event({type:"moveToFolder",items:this.selection.selected.filter((e=>void 0!==e.cipher)).map((e=>e.cipher))})}bulkMoveToOrganization(){this.event({type:"moveToOrganization",items:this.selection.selected.filter((e=>void 0!==e.cipher)).map((e=>e.cipher))})}bulkRestore(){this.event({type:"restore",items:this.selection.selected.filter((e=>void 0!==e.cipher)).map((e=>e.cipher))})}bulkDelete(){this.event({type:"delete",items:this.selection.selected})}canClone(e){if(null==e.cipher.organizationId)return!0;const t=this.allOrganizations.find((t=>t.id===e.cipher.organizationId));if(this.viewingOrgVault&&(t.isAdmin||t.permissions.editAnyCollection))return!0;const i=this.allCollections.filter((e=>e.organizationId===t.id));for(const n of i)if(e.cipher.collectionIds.includes(n.id)&&n.manage)return!0;return!1}refreshItems(){const e=this.collections.map((e=>({collection:e}))),t=this.ciphers.map((e=>({cipher:e}))),i=[].concat(e).concat(t);this.selection.clear(),this.editableItems=i.filter((e=>void 0!==e.cipher||void 0!==e.collection&&this.canDeleteCollection(e.collection))),this.dataSource.data=i}bulkEditCollectionAccess(){this.event({type:"bulkEditCollectionAccess",items:this.selection.selected.filter((e=>void 0!==e.collection)).map((e=>e.collection))})}assignToCollections(){this.event({type:"assignToCollections",items:this.selection.selected.filter((e=>void 0!==e.cipher)).map((e=>e.cipher))})}}U.ɵfac=function(e){return new(e||U)},U.ɵcmp=s.Xpm({type:U,selectors:[["app-vault-items"]],inputs:{disabled:"disabled",showOwner:"showOwner",showCollections:"showCollections",showGroups:"showGroups",useEvents:"useEvents",showPremiumFeatures:"showPremiumFeatures",showBulkMove:"showBulkMove",showBulkTrashOptions:"showBulkTrashOptions",showAdminActions:"showAdminActions",allOrganizations:"allOrganizations",allCollections:"allCollections",allGroups:"allGroups",showBulkEditCollectionAccess:"showBulkEditCollectionAccess",showBulkAddToCollections:"showBulkAddToCollections",showPermissionsColumn:"showPermissionsColumn",viewingOrgVault:"viewingOrgVault",flexibleCollectionsV1Enabled:"flexibleCollectionsV1Enabled",ciphers:"ciphers",collections:"collections"},outputs:{onEvent:"onEvent"},decls:64,vars:29,consts:[["scrollWindow","",1,"tw-pb-8",3,"itemSize"],["layout","fixed",3,"dataSource"],["header",""],["bitCell","","colspan","2",1,"tw-w-24","tw-whitespace-nowrap"],["type","checkbox","bitCheckbox","","id","checkAll",1,"tw-mr-2",3,"disabled","checked","change"],["for","checkAll",1,"tw-mb-0","!tw-font-bold","!tw-text-muted"],["bitCell",""],["bitCell","","class","tw-w-2/5",4,"ngIf"],["bitCell","",1,"tw-w-12","tw-text-right"],["bitIconButton","bwi-ellipsis-v","size","small","type","button",3,"disabled","bitMenuTriggerFor","appA11yTitle"],["headerMenu",""],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem","",3,"click"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],["body",""],["bitCell","",1,"tw-w-2/5"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-folder"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-users"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-collection"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-arrow-circle-right"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-undo"],[4,"cdkVirtualFor","cdkVirtualForOf","cdkVirtualForTemplateCacheSize"],["bitRow","","appVaultCollectionRow","","alignContent","middle",3,"disabled","collection","showOwner","showCollections","showGroups","organizations","showPermissionsColumn","groups","canDeleteCollection","canEditCollection","checked","checkedToggled","onEvent",4,"ngIf"],["bitRow","","appVaultCipherRow","","alignContent","middle",3,"disabled","cipher","showOwner","showCollections","showGroups","showPremiumFeatures","useEvents","viewingOrgVault","cloneable","organizations","collections","checked","checkedToggled","onEvent",4,"ngIf"],["bitRow","","appVaultCollectionRow","","alignContent","middle",3,"disabled","collection","showOwner","showCollections","showGroups","organizations","showPermissionsColumn","groups","canDeleteCollection","canEditCollection","checked","checkedToggled","onEvent"],["bitRow","","appVaultCipherRow","","alignContent","middle",3,"disabled","cipher","showOwner","showCollections","showGroups","showPremiumFeatures","useEvents","viewingOrgVault","cloneable","organizations","collections","checked","checkedToggled","onEvent"]],template:function(e,t){if(1&e&&(s.TgZ(0,"cdk-virtual-scroll-viewport",0),s._uU(1,"\n  "),s.TgZ(2,"bit-table",1),s._uU(3,"\n    "),s.ynx(4,2),s._uU(5,"\n      "),s.TgZ(6,"tr"),s._uU(7,"\n        "),s.TgZ(8,"th",3),s._uU(9,"\n          "),s.TgZ(10,"input",4),s.NdJ("change",(function(e){return e?t.toggleAll():null})),s.qZA(),s._uU(11,"\n          "),s.TgZ(12,"label",5),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n        "),s.qZA(),s._uU(16,"\n        "),s.TgZ(17,"th",6),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n        "),s.YNc(21,a,3,3,"th",7),s._uU(22,"\n        "),s.YNc(23,l,3,3,"th",7),s._uU(24,"\n        "),s.YNc(25,c,3,3,"th",7),s._uU(26,"\n        "),s.YNc(27,u,3,3,"th",7),s._uU(28,"\n        "),s.TgZ(29,"th",8),s._uU(30,"\n          "),s._UZ(31,"button",9),s.ALo(32,"i18n"),s._uU(33,"\n          "),s.TgZ(34,"bit-menu",null,10),s._uU(36,"\n            "),s.YNc(37,d,5,3,"button",11),s._uU(38,"\n            "),s.YNc(39,p,5,3,"button",11),s._uU(40,"\n            "),s.YNc(41,h,5,3,"button",11),s._uU(42,"\n            "),s.YNc(43,g,5,3,"button",11),s._uU(44,"\n            "),s.YNc(45,f,5,3,"button",11),s._uU(46,"\n            "),s.TgZ(47,"button",12),s.NdJ("click",(function(){return t.bulkDelete()})),s._uU(48,"\n              "),s.TgZ(49,"span",13),s._uU(50,"\n                "),s._UZ(51,"i",14),s._uU(52),s.ALo(53,"i18n"),s.qZA(),s._uU(54,"\n            "),s.qZA(),s._uU(55,"\n          "),s.qZA(),s._uU(56,"\n        "),s.qZA(),s._uU(57,"\n      "),s.qZA(),s._uU(58,"\n    "),s.BQk(),s._uU(59,"\n    "),s.YNc(60,w,3,2,"ng-template",15),s._uU(61,"\n  "),s.qZA(),s._uU(62,"\n"),s.qZA(),s._uU(63,"\n")),2&e){const e=s.MAs(35);s.Q6J("itemSize",t.RowHeight),s.xp6(2),s.Q6J("dataSource",t.dataSource),s.xp6(8),s.Q6J("disabled",t.disabled||t.isEmpty)("checked",t.selection.hasValue()&&t.isAllSelected),s.xp6(3),s.Oqu(s.lcZ(14,21,"all")),s.xp6(4),s.Tol(t.showExtraColumn?"tw-w-3/5":"tw-w-full"),s.xp6(1),s.Oqu(s.lcZ(19,23,"name")),s.xp6(3),s.Q6J("ngIf",t.showOwner),s.xp6(2),s.Q6J("ngIf",t.showCollections),s.xp6(2),s.Q6J("ngIf",t.showGroups),s.xp6(2),s.Q6J("ngIf",t.showPermissionsColumn),s.xp6(4),s.s9C("appA11yTitle",s.lcZ(32,25,"options")),s.Q6J("disabled",t.disabled||t.isEmpty)("bitMenuTriggerFor",e),s.xp6(6),s.Q6J("ngIf",t.bulkMoveAllowed),s.xp6(2),s.Q6J("ngIf",t.showAdminActions&&t.showBulkEditCollectionAccess),s.xp6(2),s.Q6J("ngIf",t.showAdminActions&&t.bulkAssignToCollectionsAllowed),s.xp6(2),s.Q6J("ngIf",t.bulkMoveAllowed),s.xp6(2),s.Q6J("ngIf",t.showBulkTrashOptions),s.xp6(7),s.hij("\n                ",s.lcZ(53,27,t.showBulkTrashOptions?"permanentlyDeleteSelected":"deleteSelected"),"\n              ")}},encapsulation:2})},35504:(e,t,i)=>{"use strict";i.d(t,{z:()=>we});var n=i(94821),s=i(28508),o=i(8111),r=i(13936),a=i(85921),l=i(63391),c=i(21151),u=i(16857),d=i(6242),p=i(85762),h=i(89474),g=(i(53061),i(98583)),f=i(33245),m=i(15252),v=i(12963),y=i(7172),w=i(21656),b=i(12492),U=i(73974),_=i(26194),A=i(44234),Z=i(50941),x=i(82081),S=i(66385);class T{transform(e,t){var i;return null===(i=t.find((t=>t.id===e)))||void 0===i?void 0:i.name}}function C(e,t){if(1&e&&(p.ynx(0),p._uU(1,"\n  "),p.TgZ(2,"span",2),p._uU(3),p.ALo(4,"collectionNameFromId"),p.qZA(),p._uU(5,"\n"),p.BQk()),2&e){const e=t.$implicit,i=p.oxw();p.xp6(3),p.Oqu(p.xi3(4,1,e,i.collections))}}function O(e,t){if(1&e&&(p.ynx(0),p._uU(1,"\n  "),p.TgZ(2,"span",2),p._uU(3),p.qZA(),p._uU(4,"\n"),p.BQk()),2&e){const e=p.oxw();p.xp6(3),p.hij("+ ",e.xMoreCount," more")}}T.ɵfac=function(e){return new(e||T)},T.ɵpipe=p.Yjl({name:"collectionNameFromId",type:T,pure:!0});class k{get shownCollections(){return this.showXMore?this.collectionIds.slice(0,2):this.collectionIds}get showXMore(){return this.collectionIds.length>3}get xMoreCount(){return this.collectionIds.length-2}}k.ɵfac=function(e){return new(e||k)},k.ɵcmp=p.Xpm({type:k,selectors:[["app-collection-badge"]],inputs:{collectionIds:"collectionIds",collections:"collections"},decls:4,vars:2,consts:[[4,"ngFor","ngForOf"],[4,"ngIf"],["bitBadge","","variant","secondary"]],template:function(e,t){1&e&&(p.YNc(0,C,6,4,"ng-container",0),p._uU(1,"\n"),p.YNc(2,O,5,1,"ng-container",1),p._uU(3,"\n")),2&e&&(p.Q6J("ngForOf",t.shownCollections),p.xp6(2),p.Q6J("ngIf",t.showXMore))},dependencies:[s.sg,s.O5,S.l,T],encapsulation:2});var P=i(82933),q=i(36409);function I(e,t){1&e&&(p.ynx(0),p._uU(1,"\n        "),p._UZ(2,"i",19),p.ALo(3,"i18n"),p._uU(4,"\n        "),p.TgZ(5,"span",18),p._uU(6),p.ALo(7,"i18n"),p.qZA(),p._uU(8,"\n      "),p.BQk()),2&e&&(p.xp6(2),p.s9C("title",p.lcZ(3,2,"attachmentsNeedFix")),p.xp6(4),p.Oqu(p.lcZ(7,4,"attachmentsNeedFix")))}function M(e,t){if(1&e&&(p.ynx(0),p._uU(1,"\n      "),p._UZ(2,"i",17),p.ALo(3,"i18n"),p._uU(4,"\n      "),p.TgZ(5,"span",18),p._uU(6),p.ALo(7,"i18n"),p.qZA(),p._uU(8,"\n      "),p.YNc(9,I,9,6,"ng-container",6),p._uU(10,"\n    "),p.BQk()),2&e){const e=p.oxw();p.xp6(2),p.s9C("title",p.lcZ(3,3,"attachments")),p.xp6(4),p.Oqu(p.lcZ(7,5,"attachments")),p.xp6(3),p.Q6J("ngIf",e.showFixOldAttachments)}}function N(e,t){if(1&e&&(p.TgZ(0,"td",20),p._uU(1,"\n  "),p.TgZ(2,"app-org-badge",21),p.ALo(3,"orgNameFromId"),p._uU(4,"\n  "),p.qZA(),p._uU(5,"\n"),p.qZA()),2&e){const e=p.oxw();p.Q6J("ngClass",e.RowHeightClass),p.xp6(2),p.Q6J("disabled",e.disabled)("organizationId",e.cipher.organizationId)("organizationName",p.xi3(3,4,e.cipher.organizationId,e.organizations))}}function L(e,t){if(1&e&&p._UZ(0,"app-collection-badge",23),2&e){const e=p.oxw(2);p.Q6J("collectionIds",e.cipher.collectionIds)("collections",e.collections)}}function D(e,t){if(1&e&&(p.TgZ(0,"td",20),p._uU(1,"\n  "),p.YNc(2,L,1,2,"app-collection-badge",22),p._uU(3,"\n"),p.qZA()),2&e){const e=p.oxw();p.Q6J("ngClass",e.RowHeightClass),p.xp6(2),p.Q6J("ngIf",e.cipher.collectionIds)}}function E(e,t){if(1&e&&p._UZ(0,"td",20),2&e){const e=p.oxw();p.Q6J("ngClass",e.RowHeightClass)}}function F(e,t){if(1&e&&p._UZ(0,"td",20),2&e){const e=p.oxw();p.Q6J("ngClass",e.RowHeightClass)}}function R(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",12),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw(2);return p.KtG(t.copy("password"))})),p._uU(1,"\n        "),p._UZ(2,"i",24),p._uU(3),p.ALo(4,"i18n"),p.qZA()}2&e&&(p.xp6(3),p.hij("\n        ",p.lcZ(4,1,"copyPassword"),"\n      "))}function J(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",12),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw(2);return p.KtG(t.copy("totp"))})),p._uU(1,"\n        "),p._UZ(2,"i",24),p._uU(3),p.ALo(4,"i18n"),p.qZA()}2&e&&(p.xp6(3),p.hij("\n        ",p.lcZ(4,1,"copyVerificationCode"),"\n      "))}function z(e,t){if(1&e&&(p.TgZ(0,"a",26),p._uU(1,"\n        "),p._UZ(2,"i",27),p._uU(3),p.ALo(4,"i18n"),p.qZA()),2&e){const e=p.oxw(2);p.Q6J("href",e.cipher.login.launchUri,p.LSH),p.xp6(3),p.hij("\n        ",p.lcZ(4,2,"launch"),"\n      ")}}function Y(e,t){if(1&e){const e=p.EpF();p.ynx(0),p._uU(1,"\n      "),p.TgZ(2,"button",12),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.copy("username"))})),p._uU(3,"\n        "),p._UZ(4,"i",24),p._uU(5),p.ALo(6,"i18n"),p.qZA(),p._uU(7,"\n      "),p.YNc(8,R,5,3,"button",14),p._uU(9,"\n      "),p.YNc(10,J,5,3,"button",14),p._uU(11,"\n      "),p.YNc(12,z,5,4,"a",25),p._uU(13,"\n    "),p.BQk()}if(2&e){const e=p.oxw();p.xp6(5),p.hij("\n        ",p.lcZ(6,4,"copyUsername"),"\n      "),p.xp6(3),p.Q6J("ngIf",e.cipher.viewPassword),p.xp6(2),p.Q6J("ngIf",e.showTotpCopyButton),p.xp6(2),p.Q6J("ngIf",e.cipher.login.canLaunch)}}function K(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",12),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.clone())})),p._uU(1,"\n      "),p._UZ(2,"i",28),p._uU(3),p.ALo(4,"i18n"),p.qZA()}2&e&&(p.xp6(3),p.hij("\n      ",p.lcZ(4,1,"clone"),"\n    "))}function B(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",12),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.moveToOrganization())})),p._uU(1,"\n      "),p._UZ(2,"i",29),p._uU(3),p.ALo(4,"i18n"),p.qZA()}2&e&&(p.xp6(3),p.hij("\n      ",p.lcZ(4,1,"moveToOrganization"),"\n    "))}function Q(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",12),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.editCollections())})),p._uU(1,"\n      "),p._UZ(2,"i",30),p._uU(3),p.ALo(4,"i18n"),p.qZA()}2&e&&(p.xp6(3),p.hij("\n      ",p.lcZ(4,1,"collections"),"\n    "))}function G(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",12),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.events())})),p._uU(1,"\n      "),p._UZ(2,"i",31),p._uU(3),p.ALo(4,"i18n"),p.qZA()}2&e&&(p.xp6(3),p.hij("\n      ",p.lcZ(4,1,"eventLogs"),"\n    "))}function j(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",12),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.restore())})),p._uU(1,"\n      "),p._UZ(2,"i",32),p._uU(3),p.ALo(4,"i18n"),p.qZA()}2&e&&(p.xp6(3),p.hij("\n      ",p.lcZ(4,1,"restore"),"\n    "))}const V=function(){return[]},$=function(e){return{itemId:e}};class H{constructor(){this.RowHeightClass=g.RN,this.onEvent=new p.vpe,this.checkedToggled=new p.vpe,this.CipherType=h.Ou}get showTotpCopyButton(){var e,t;return null!==(t=null===(e=this.cipher.login)||void 0===e?void 0:e.hasTotp)&&void 0!==t&&t&&(this.cipher.organizationUseTotp||this.showPremiumFeatures)}get showFixOldAttachments(){return this.cipher.hasOldAttachments&&null==this.cipher.organizationId}copy(e){this.onEvent.emit({type:"copyField",item:this.cipher,field:e})}clone(){this.onEvent.emit({type:"clone",item:this.cipher})}moveToOrganization(){this.onEvent.emit({type:"moveToOrganization",items:[this.cipher]})}editCollections(){this.onEvent.emit({type:"viewCollections",item:this.cipher})}events(){this.onEvent.emit({type:"viewEvents",item:this.cipher})}restore(){this.onEvent.emit({type:"restore",items:[this.cipher]})}deleteCipher(){this.onEvent.emit({type:"delete",items:[{cipher:this.cipher}]})}attachments(){this.onEvent.emit({type:"viewAttachments",item:this.cipher})}}H.ɵfac=function(e){return new(e||H)},H.ɵcmp=p.Xpm({type:H,selectors:[["tr","appVaultCipherRow",""]],inputs:{disabled:"disabled",cipher:"cipher",showOwner:"showOwner",showCollections:"showCollections",showGroups:"showGroups",showPremiumFeatures:"showPremiumFeatures",useEvents:"useEvents",cloneable:"cloneable",organizations:"organizations",collections:"collections",viewingOrgVault:"viewingOrgVault",checked:"checked"},outputs:{onEvent:"onEvent",checkedToggled:"checkedToggled"},attrs:["appVaultCipherRow",""],decls:73,vars:44,consts:[["bitCell","",1,"tw-min-w-fit",3,"ngClass"],["type","checkbox","bitCheckbox","","appStopProp","",3,"disabled","checked","change"],[3,"cipher"],["bitCell","",1,"tw-truncate",3,"ngClass"],[1,"tw-inline-flex","tw-w-full"],["bitLink","","queryParamsHandling","merge","type","button","appStopProp","",1,"tw-overflow-hidden","tw-text-ellipsis","tw-text-start","tw-leading-snug",3,"disabled","routerLink","queryParams","title"],[4,"ngIf"],["appStopProp","",1,"tw-text-sm","tw-text-muted"],["bitCell","",3,"ngClass",4,"ngIf"],["bitCell","",1,"tw-text-right",3,"ngClass"],["size","small","bitIconButton","bwi-ellipsis-v","type","button","appStopProp","",3,"disabled","bitMenuTriggerFor","appA11yTitle"],["cipherOptions",""],["bitMenuItem","","type","button",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-paperclip"],["bitMenuItem","","type","button",3,"click",4,"ngIf"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip","tw-ml-2","tw-leading-normal",3,"title"],[1,"sr-only"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-exclamation-triangle","tw-ml-2","tw-leading-normal","tw-text-warning",3,"title"],["bitCell","",3,"ngClass"],["appStopProp","",3,"disabled","organizationId","organizationName"],[3,"collectionIds","collections",4,"ngIf"],[3,"collectionIds","collections"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-clone"],["bitMenuItem","","type","button","target","_blank","rel","noreferrer",3,"href",4,"ngIf"],["bitMenuItem","","type","button","target","_blank","rel","noreferrer",3,"href"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-share-square"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-files"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-arrow-circle-right"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-collection"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-file-text"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-undo"]],template:function(e,t){if(1&e&&(p.TgZ(0,"td",0),p._uU(1,"\n  "),p.TgZ(2,"input",1),p.NdJ("change",(function(e){return e?t.checkedToggled.next():null})),p.ALo(3,"i18n"),p.qZA(),p._uU(4,"\n"),p.qZA(),p._uU(5,"\n"),p.TgZ(6,"td",0),p._uU(7,"\n  "),p._UZ(8,"app-vault-icon",2),p._uU(9,"\n"),p.qZA(),p._uU(10,"\n"),p.TgZ(11,"td",3),p._uU(12,"\n  "),p.TgZ(13,"div",4),p._uU(14,"\n    "),p.TgZ(15,"button",5),p.ALo(16,"i18n"),p._uU(17),p.qZA(),p._uU(18,"\n    "),p.YNc(19,M,11,7,"ng-container",6),p._uU(20,"\n  "),p.qZA(),p._uU(21,"\n  "),p._UZ(22,"br"),p._uU(23,"\n  "),p.TgZ(24,"span",7),p._uU(25),p.qZA(),p._uU(26,"\n"),p.qZA(),p._uU(27,"\n"),p.YNc(28,N,6,7,"td",8),p._uU(29,"\n"),p.YNc(30,D,4,2,"td",8),p._uU(31,"\n"),p.YNc(32,E,1,1,"td",8),p._uU(33,"\n"),p.YNc(34,F,1,1,"td",8),p._uU(35,"\n"),p.TgZ(36,"td",9),p._uU(37,"\n  "),p._UZ(38,"button",10),p.ALo(39,"i18n"),p._uU(40,"\n  "),p.TgZ(41,"bit-menu",null,11),p._uU(43,"\n    "),p.YNc(44,Y,14,6,"ng-container",6),p._uU(45,"\n\n    "),p.TgZ(46,"button",12),p.NdJ("click",(function(){return t.attachments()})),p._uU(47,"\n      "),p._UZ(48,"i",13),p._uU(49),p.ALo(50,"i18n"),p.qZA(),p._uU(51,"\n    "),p.YNc(52,K,5,3,"button",14),p._uU(53,"\n    "),p.YNc(54,B,5,3,"button",14),p._uU(55,"\n    "),p.YNc(56,Q,5,3,"button",14),p._uU(57,"\n    "),p.YNc(58,G,5,3,"button",14),p._uU(59,"\n    "),p.YNc(60,j,5,3,"button",14),p._uU(61,"\n    "),p.TgZ(62,"button",12),p.NdJ("click",(function(){return t.deleteCipher()})),p._uU(63,"\n      "),p.TgZ(64,"span",15),p._uU(65,"\n        "),p._UZ(66,"i",16),p._uU(67),p.ALo(68,"i18n"),p.qZA(),p._uU(69,"\n    "),p.qZA(),p._uU(70,"\n  "),p.qZA(),p._uU(71,"\n"),p.qZA(),p._uU(72,"\n")),2&e){const e=p.MAs(42);p.Q6J("ngClass",t.RowHeightClass),p.xp6(2),p.Q6J("disabled",t.disabled)("checked",t.checked),p.uIk("aria-label",p.lcZ(3,30,"vaultItemSelect")),p.xp6(4),p.Q6J("ngClass",t.RowHeightClass),p.xp6(2),p.Q6J("cipher",t.cipher),p.xp6(3),p.Q6J("ngClass",t.RowHeightClass),p.xp6(4),p.s9C("title",p.xi3(16,32,"editItemWithName",t.cipher.name)),p.Q6J("disabled",t.disabled)("routerLink",p.DdM(41,V))("queryParams",p.VKq(42,$,t.cipher.id)),p.xp6(2),p.hij("\n      ",t.cipher.name,"\n    "),p.xp6(2),p.Q6J("ngIf",t.cipher.hasAttachments),p.xp6(6),p.Oqu(t.cipher.subTitle),p.xp6(3),p.Q6J("ngIf",t.showOwner),p.xp6(2),p.Q6J("ngIf",t.showCollections),p.xp6(2),p.Q6J("ngIf",t.showGroups),p.xp6(2),p.Q6J("ngIf",t.viewingOrgVault),p.xp6(2),p.Q6J("ngClass",t.RowHeightClass),p.xp6(2),p.s9C("appA11yTitle",p.lcZ(39,35,"options")),p.Q6J("disabled",t.disabled)("bitMenuTriggerFor",e),p.xp6(6),p.Q6J("ngIf",t.cipher.type===t.CipherType.Login&&!t.cipher.isDeleted),p.xp6(5),p.hij("\n      ",p.lcZ(50,37,"attachments"),"\n    "),p.xp6(3),p.Q6J("ngIf",t.cloneable&&!t.cipher.isDeleted),p.xp6(2),p.Q6J("ngIf",!t.cipher.organizationId&&!t.cipher.isDeleted),p.xp6(2),p.Q6J("ngIf",t.cipher.organizationId&&!t.cipher.isDeleted),p.xp6(2),p.Q6J("ngIf",t.cipher.organizationId&&t.useEvents),p.xp6(2),p.Q6J("ngIf",t.cipher.isDeleted),p.xp6(7),p.hij("\n        ",p.lcZ(68,39,t.cipher.isDeleted?"permanentlyDelete":"delete"),"\n      ")}},dependencies:[s.mk,s.O5,o.rH,f.B,m.o,v._,y.b,w.Q,b._,U.M,_.t,A.e,Z.Y,x.C,k,P.C,q.l],encapsulation:2});i(23666);var W=i(95607),X=i(16776),ee=i(34632),te=i(78627),ie=i(1874);class ne{constructor(e){this.i18nService=e,this.groupNames=[]}ngOnChanges(){this.groupNames=this.selectedGroups.map((e=>{var t;return null===(t=this.allGroups.find((t=>t.id===e.id)))||void 0===t?void 0:t.name})).sort(this.i18nService.collator.compare)}}ne.ɵfac=function(e){return new(e||ne)(p.Y36(te.D))},ne.ɵcmp=p.Xpm({type:ne,selectors:[["app-group-badge"]],inputs:{selectedGroups:"selectedGroups",allGroups:"allGroups"},features:[p.TTD],decls:2,vars:2,consts:[["variant","secondary",3,"items","maxItems"]],template:function(e,t){1&e&&(p._UZ(0,"bit-badge-list",0),p._uU(1,"\n")),2&e&&p.Q6J("items",t.groupNames)("maxItems",3)},dependencies:[ie.b],encapsulation:2});function se(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"input",11),p.NdJ("change",(function(t){p.CHM(e);const i=p.oxw();return p.KtG(t?i.checkedToggled.next():null)})),p.ALo(1,"i18n"),p.qZA()}if(2&e){const e=p.oxw();p.Q6J("disabled",e.disabled)("checked",e.checked),p.uIk("aria-label",p.lcZ(1,3,"collectionItemSelect"))}}function oe(e,t){if(1&e&&(p.TgZ(0,"td",4),p._uU(1,"\n  "),p.TgZ(2,"app-org-badge",12),p.ALo(3,"orgNameFromId"),p._uU(4,"\n  "),p.qZA(),p._uU(5,"\n"),p.qZA()),2&e){const e=p.oxw();p.Q6J("ngClass",e.RowHeightClass),p.xp6(2),p.Q6J("disabled",e.disabled)("organizationId",e.collection.organizationId)("organizationName",p.xi3(3,4,e.collection.organizationId,e.organizations))}}function re(e,t){if(1&e&&p._UZ(0,"td",4),2&e){const e=p.oxw();p.Q6J("ngClass",e.RowHeightClass)}}function ae(e,t){if(1&e&&p._UZ(0,"app-group-badge",14),2&e){const e=p.oxw(2);p.Q6J("selectedGroups",e.collectionGroups)("allGroups",e.groups)}}function le(e,t){if(1&e&&(p.TgZ(0,"td",4),p._uU(1,"\n  "),p.YNc(2,ae,1,2,"app-group-badge",13),p._uU(3,"\n"),p.qZA()),2&e){const e=p.oxw();p.Q6J("ngClass",e.RowHeightClass),p.xp6(2),p.Q6J("ngIf",e.collectionGroups)}}function ce(e,t){if(1&e&&(p.TgZ(0,"td",4),p._uU(1,"\n  "),p.TgZ(2,"p",15),p._uU(3),p.qZA(),p._uU(4,"\n"),p.qZA()),2&e){const e=p.oxw();p.Q6J("ngClass",e.RowHeightClass),p.xp6(2),p.Q6J("title",e.permissionTooltip),p.xp6(1),p.hij("\n    ",e.permissionText,"\n  ")}}function ue(e,t){if(1&e&&(p._UZ(0,"button",16),p.ALo(1,"i18n")),2&e){const e=p.oxw(),t=p.MAs(33);p.s9C("appA11yTitle",p.lcZ(1,3,"options")),p.Q6J("disabled",e.disabled)("bitMenuTriggerFor",t)}}function de(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",17),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.edit())})),p._uU(1,"\n      "),p._UZ(2,"i",18),p._uU(3),p.ALo(4,"i18n"),p.qZA()}2&e&&(p.xp6(3),p.hij("\n      ",p.lcZ(4,1,"editInfo"),"\n    "))}function pe(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",17),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.access())})),p._uU(1,"\n      "),p._UZ(2,"i",19),p._uU(3),p.ALo(4,"i18n"),p.qZA()}2&e&&(p.xp6(3),p.hij("\n      ",p.lcZ(4,1,"access"),"\n    "))}function he(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",17),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.deleteCollection())})),p._uU(1,"\n      "),p.TgZ(2,"span",20),p._uU(3,"\n        "),p._UZ(4,"i",21),p._uU(5),p.ALo(6,"i18n"),p.qZA(),p._uU(7,"\n    "),p.qZA()}2&e&&(p.xp6(5),p.hij("\n        ",p.lcZ(6,1,"delete"),"\n      "))}const ge=function(){return[]},fe=function(e){return{collectionId:e}};class me{constructor(e){this.i18nService=e,this.RowHeightClass=g.RN,this.onEvent=new p.vpe,this.checkedToggled=new p.vpe}get collectionGroups(){return this.collection instanceof W.e?this.collection.groups:[]}get organization(){return this.organizations.find((e=>e.id===this.collection.organizationId))}get permissionText(){var e,t;if(this.collection.id==X.JK||this.collection.assigned){const i=(0,ee.pZ)(null===(e=this.organization)||void 0===e?void 0:e.flexibleCollections);return this.i18nService.t(null===(t=i.find((e=>e.perm===(0,ee.d4)(this.collection))))||void 0===t?void 0:t.labelId)}return this.i18nService.t("noAccess")}get permissionTooltip(){return this.collection.id==X.JK?this.i18nService.t("collectionAdminConsoleManaged"):""}edit(){this.onEvent.next({type:"editCollection",item:this.collection})}access(){this.onEvent.next({type:"viewCollectionAccess",item:this.collection})}deleteCollection(){this.onEvent.next({type:"delete",items:[{collection:this.collection}]})}}me.ɵfac=function(e){return new(e||me)(p.Y36(te.D))},me.ɵcmp=p.Xpm({type:me,selectors:[["tr","appVaultCollectionRow",""]],inputs:{disabled:"disabled",collection:"collection",showOwner:"showOwner",showCollections:"showCollections",showGroups:"showGroups",canEditCollection:"canEditCollection",canDeleteCollection:"canDeleteCollection",organizations:"organizations",groups:"groups",showPermissionsColumn:"showPermissionsColumn",checked:"checked"},outputs:{onEvent:"onEvent",checkedToggled:"checkedToggled"},attrs:["appVaultCollectionRow",""],decls:43,vars:24,consts:[["bitCell","",1,"tw-min-w-fit",3,"ngClass"],["type","checkbox","bitCheckbox","","appStopProp","",3,"disabled","checked","change",4,"ngIf"],["aria-hidden","true",1,"icon"],[1,"bwi","bwi-fw","bwi-lg","bwi-collection"],["bitCell","",3,"ngClass"],["bitLink","","type","button","linkType","secondary","queryParamsHandling","merge","appStopProp","",1,"tw-w-full","tw-truncate","tw-text-start","tw-leading-snug",3,"disabled","title","routerLink","queryParams"],["bitCell","",3,"ngClass",4,"ngIf"],["bitCell","",1,"tw-text-right",3,"ngClass"],["size","small","bitIconButton","bwi-ellipsis-v","type","button","appStopProp","",3,"disabled","bitMenuTriggerFor","appA11yTitle",4,"ngIf"],["collectionOptions",""],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","checkbox","bitCheckbox","","appStopProp","",3,"disabled","checked","change"],["appStopProp","",3,"disabled","organizationId","organizationName"],[3,"selectedGroups","allGroups",4,"ngIf"],[3,"selectedGroups","allGroups"],[1,"tw-mb-0","tw-text-muted",3,"title"],["size","small","bitIconButton","bwi-ellipsis-v","type","button","appStopProp","",3,"disabled","bitMenuTriggerFor","appA11yTitle"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-pencil-square"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-users"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"]],template:function(e,t){1&e&&(p.TgZ(0,"td",0),p._uU(1,"\n  "),p.YNc(2,se,2,5,"input",1),p._uU(3,"\n"),p.qZA(),p._uU(4,"\n"),p.TgZ(5,"td",0),p._uU(6,"\n  "),p.TgZ(7,"div",2),p._uU(8,"\n    "),p._UZ(9,"i",3),p._uU(10,"\n  "),p.qZA(),p._uU(11,"\n"),p.qZA(),p._uU(12,"\n"),p.TgZ(13,"td",4),p._uU(14,"\n  "),p.TgZ(15,"button",5),p.ALo(16,"i18n"),p._uU(17),p.qZA(),p._uU(18,"\n"),p.qZA(),p._uU(19,"\n"),p.YNc(20,oe,6,7,"td",6),p._uU(21,"\n"),p.YNc(22,re,1,1,"td",6),p._uU(23,"\n"),p.YNc(24,le,4,2,"td",6),p._uU(25,"\n"),p.YNc(26,ce,5,3,"td",6),p._uU(27,"\n"),p.TgZ(28,"td",7),p._uU(29,"\n  "),p.YNc(30,ue,2,5,"button",8),p._uU(31,"\n  "),p.TgZ(32,"bit-menu",null,9),p._uU(34,"\n    "),p.YNc(35,de,5,3,"button",10),p._uU(36,"\n    "),p.YNc(37,pe,5,3,"button",10),p._uU(38,"\n    "),p.YNc(39,he,8,3,"button",10),p._uU(40,"\n  "),p.qZA(),p._uU(41,"\n"),p.qZA(),p._uU(42,"\n")),2&e&&(p.Q6J("ngClass",t.RowHeightClass),p.xp6(2),p.Q6J("ngIf",t.canDeleteCollection),p.xp6(3),p.Q6J("ngClass",t.RowHeightClass),p.xp6(8),p.Q6J("ngClass",t.RowHeightClass),p.xp6(2),p.s9C("title",p.xi3(16,18,"viewCollectionWithName",t.collection.name)),p.Q6J("disabled",t.disabled)("routerLink",p.DdM(21,ge))("queryParams",p.VKq(22,fe,t.collection.id)),p.xp6(2),p.hij("\n    ",t.collection.name,"\n  "),p.xp6(3),p.Q6J("ngIf",t.showOwner),p.xp6(2),p.Q6J("ngIf",t.showCollections),p.xp6(2),p.Q6J("ngIf",t.showGroups),p.xp6(2),p.Q6J("ngIf",t.showPermissionsColumn),p.xp6(2),p.Q6J("ngClass",t.RowHeightClass),p.xp6(2),p.Q6J("ngIf",t.canEditCollection||t.canDeleteCollection),p.xp6(5),p.Q6J("ngIf",t.canEditCollection),p.xp6(2),p.Q6J("ngIf",t.canEditCollection),p.xp6(2),p.Q6J("ngIf",t.canDeleteCollection))},dependencies:[s.mk,s.O5,o.rH,f.B,v._,y.b,w.Q,b._,U.M,_.t,A.e,Z.Y,x.C,ne,P.C,q.l],encapsulation:2});var ve=i(54735),ye=i(26361);class we{}we.ɵfac=function(e){return new(e||we)},we.ɵmod=p.oAB({type:we}),we.ɵinj=p.cJS({imports:[s.ez,o.Bz,n.Cl,a.m,r.U,l.D,u.e,d.x,c.D]}),p.B6R(g.JS,[s.O5,n.xd,n.x0,n.N7,n.LO,f.B,y.b,w.Q,U.M,_.t,A.e,ve.a,Z.Y,ye.v,ve.f,H,me],[P.C])},88409:(e,t,i)=>{"use strict";i.d(t,{m:()=>g});var n=i(3289),s=i(70427),o=i(68134),r=i(43441);class a{}var l=i(95607),c=i(85762),u=i(55602),d=i(76528),p=i(31754),h=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class g{constructor(e,t,i){this.apiService=e,this.cryptoService=t,this.collectionService=i}getAll(e){return h(this,void 0,void 0,(function*(){const t=yield this.apiService.getManyCollectionsWithAccessDetails(e);return null==(null==t?void 0:t.data)||0===t.data.length?[]:yield this.decryptMany(e,t.data)}))}get(e,t){return h(this,void 0,void 0,(function*(){const i=yield this.apiService.getCollectionAccessDetails(e,t);if(null==i)return;const[n]=yield this.decryptMany(e,[i]);return n}))}save(e){return h(this,void 0,void 0,(function*(){const t=yield this.encrypt(e);let i;return null==e.id?(i=yield this.apiService.postCollection(e.organizationId,t),e.id=i.id):i=yield this.apiService.putCollection(e.organizationId,e.id,t),i.assigned?yield this.collectionService.upsert(new o.Z(i)):yield this.collectionService.delete(e.id),i}))}delete(e,t){return h(this,void 0,void 0,(function*(){yield this.apiService.deleteCollection(e,t)}))}bulkAssignAccess(e,t,i,s){return h(this,void 0,void 0,(function*(){const o=new a;o.collectionIds=t,o.users=i.map((e=>new n.d(e.id,e.readOnly,e.hidePasswords,e.manage))),o.groups=s.map((e=>new n.d(e.id,e.readOnly,e.hidePasswords,e.manage))),yield this.apiService.send("POST",`/organizations/${e}/collections/bulk-access`,o,!0,!1)}))}decryptMany(e,t){return h(this,void 0,void 0,(function*(){const i=yield this.cryptoService.getOrgKey(e),n=t.map((e=>h(this,void 0,void 0,(function*(){const t=new l.e;return t.id=e.id,t.name=yield this.cryptoService.decryptToUtf8(new s._(e.name),i),t.externalId=e.externalId,t.organizationId=e.organizationId,function(e){const t=e;return(null==t?void 0:t.groups)instanceof Array&&(null==t?void 0:t.users)instanceof Array}(e)&&(t.groups=e.groups,t.users=e.users,t.assigned=e.assigned,t.readOnly=e.readOnly,t.hidePasswords=e.hidePasswords,t.manage=e.manage),t}))));return yield Promise.all(n)}))}encrypt(e){return h(this,void 0,void 0,(function*(){if(null==e.organizationId)throw new Error("Collection has no organization id.");const t=yield this.cryptoService.getOrgKey(e.organizationId);if(null==t)throw new Error("No key for this collection's organization.");const i=new r.W;return i.externalId=e.externalId,i.name=(yield this.cryptoService.encrypt(e.name,t)).encryptedString,i.groups=e.groups.map((e=>new n.d(e.id,e.readOnly,e.hidePasswords,e.manage))),i.users=e.users.map((e=>new n.d(e.id,e.readOnly,e.hidePasswords,e.manage))),i}))}}g.ɵfac=function(e){return new(e||g)(c.LFG(u.s),c.LFG(d.$),c.LFG(p.a))},g.ɵprov=c.Yz7({token:g,factory:g.ɵfac})},95607:(e,t,i)=>{"use strict";i.d(t,{e:()=>o});var n=i(23666),s=i(50342);class o extends n.n{constructor(e){super(e),this.groups=[],this.users=[],e&&(this.groups=e.groups?e.groups.map((e=>new s.K(e))):[],this.users=e.users?e.users.map((e=>new s.K(e))):[],this.assigned=e.assigned)}canEdit(e,t){return(null==e?void 0:e.flexibleCollections)?(null==e?void 0:e.canEditAnyCollection(t))||this.manage:(null==e?void 0:e.canEditAnyCollection(t))||(null==e?void 0:e.canEditAssignedCollections)&&this.assigned}canDelete(e){return(null==e?void 0:e.flexibleCollections)?(null==e?void 0:e.canDeleteAnyCollection)||!(null==e?void 0:e.limitCollectionCreationDeletion)&&this.manage:(null==e?void 0:e.canDeleteAnyCollection)||(null==e?void 0:e.canDeleteAssignedCollections)&&this.assigned}canEditUserAccess(e,t){return this.canEdit(e,t)||e.permissions.manageUsers}canEditGroupAccess(e,t){return this.canEdit(e,t)||e.permissions.manageGroups}}},78696:(e,t,i)=>{"use strict";i.d(t,{P:()=>M});var n=i(89614),s=i(51303),o=i(27646),r=i(89474),a=(i(53061),i(11612)),l=i(85762),c=i(78627),u=i(87483);class d{constructor(e,t){this.i18nService=e,this.eventCollectionService=t,this.addFieldType=r.fS.Text,this.linkedFieldOptions=[],this.cipherType=r.Ou,this.fieldType=r.fS,this.eventType=s.tw,this.addFieldTypeOptions=[{name:e.t("cfTypeText"),value:r.fS.Text},{name:e.t("cfTypeHidden"),value:r.fS.Hidden},{name:e.t("cfTypeBoolean"),value:r.fS.Boolean}],this.addFieldLinkedTypeOption={name:this.i18nService.t("cfTypeLinked"),value:r.fS.Linked}}ngOnChanges(e){null!=e.thisCipherType&&(this.setLinkedFieldOptions(),e.thisCipherType.firstChange||this.resetCipherLinkedFields())}addField(){null==this.cipher.fields&&(this.cipher.fields=[]);const e=new a.k;e.type=this.addFieldType,e.newField=!0,e.type===r.fS.Linked&&(e.linkedId=this.linkedFieldOptions[0].value),this.cipher.fields.push(e)}removeField(e){const t=this.cipher.fields.indexOf(e);t>-1&&this.cipher.fields.splice(t,1)}toggleFieldValue(e){const t=e;t.showValue=!t.showValue,this.editMode&&t.showValue&&this.eventCollectionService.collect(s.tw.Cipher_ClientToggledHiddenFieldVisible,this.cipher.id)}trackByFunction(e,t){return e}drop(e){(0,n.bA)(this.cipher.fields,e.previousIndex,e.currentIndex)}setLinkedFieldOptions(){if(null==this.cipher.linkedFieldOptions)return;const e=[];this.cipher.linkedFieldOptions.forEach(((t,i)=>e.push({name:this.i18nService.t(t.i18nKey),value:i}))),this.linkedFieldOptions=e.sort(o.c.getSortFunction(this.i18nService,"name"))}resetCipherLinkedFields(){null!=this.cipher.fields&&0!==this.cipher.fields.length&&(null!=this.cipher.linkedFieldOptions?this.cipher.fields.filter((e=>e.type===r.fS.Linked)).forEach((e=>e.linkedId=this.linkedFieldOptions[0].value)):this.cipher.fields=this.cipher.fields.filter((e=>e.type!==r.fS.Linked)))}}d.ɵfac=function(e){return new(e||d)(l.Y36(c.D),l.Y36(u.j))},d.ɵdir=l.lG2({type:d,inputs:{cipher:"cipher",thisCipherType:"thisCipherType",editMode:"editMode"},features:[l.TTD]});var p=i(28508),h=i(37513),g=i(33245),f=i(85356),m=i(2051);class v{constructor(e,t){this.elementRef=e,this.renderer=t,this.trueValue=!0,this.falseValue=!1,this.propagateChange=e=>{}}onHostChange(e){this.propagateChange(e.target.checked?this.trueValue:this.falseValue)}writeValue(e){e===this.trueValue?this.renderer.setProperty(this.elementRef.nativeElement,"checked",!0):this.renderer.setProperty(this.elementRef.nativeElement,"checked",!1)}registerOnChange(e){this.propagateChange=e}registerOnTouched(e){}setDisabledState(e){}}v.ɵfac=function(e){return new(e||v)(l.Y36(l.SBq),l.Y36(l.Qsj))},v.ɵdir=l.lG2({type:v,selectors:[["input","type","checkbox","appTrueFalseValue",""]],hostBindings:function(e,t){1&e&&l.NdJ("change",(function(e){return t.onHostChange(e)}))},inputs:{trueValue:"trueValue",falseValue:"falseValue"},features:[l._Bn([{provide:h.JU,useExisting:(0,l.Gpc)((()=>v)),multi:!0}])]});var y=i(82933);function w(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"div",20),l._uU(1,"\n            "),l.TgZ(2,"input",12),l.NdJ("ngModelChange",(function(t){l.CHM(e);const i=l.oxw().$implicit;return l.KtG(i.value=t)})),l.qZA(),l._uU(3,"\n            "),l.TgZ(4,"div",21),l._uU(5,"\n              "),l.TgZ(6,"button",22),l.NdJ("click",(function(){l.CHM(e);const t=l.oxw().$implicit,i=l.oxw(2);return l.KtG(i.copy(t.value,"value","Field"))})),l.ALo(7,"i18n"),l._uU(8,"\n                "),l._UZ(9,"i",23),l._uU(10,"\n              "),l.qZA(),l._uU(11,"\n            "),l.qZA(),l._uU(12,"\n          "),l.qZA()}if(2&e){const e=l.oxw(),t=e.index,i=e.$implicit,n=l.oxw(2);l.xp6(2),l.MGl("id","fieldValue",t,"")("name","Field.Value",t,""),l.Q2q("aria-describedby","fieldName",t,""),l.Q6J("ngModel",i.value)("disabled",n.cipher.isDeleted||n.viewOnly)("readonly",!n.cipher.edit&&n.editMode),l.xp6(4),l.s9C("appA11yTitle",l.lcZ(7,7,"copyValue"))}}const b=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};function U(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"div",20),l._uU(1,"\n            "),l.TgZ(2,"input",24),l.NdJ("ngModelChange",(function(t){l.CHM(e);const i=l.oxw().$implicit;return l.KtG(i.value=t)})),l.qZA(),l._uU(3,"\n            "),l.TgZ(4,"div",21),l._uU(5,"\n              "),l.TgZ(6,"button",25),l.NdJ("click",(function(){l.CHM(e);const t=l.oxw().$implicit,i=l.oxw(2);return l.KtG(i.toggleFieldValue(t))})),l.ALo(7,"i18n"),l._uU(8,"\n                "),l.TgZ(9,"i",26),l._uU(10,"\n                "),l.qZA(),l._uU(11,"\n              "),l.qZA(),l._uU(12,"\n              "),l.TgZ(13,"button",25),l.NdJ("click",(function(){l.CHM(e);const t=l.oxw().$implicit,i=l.oxw(2);return l.KtG(i.copy(t.value,"value",t.type===i.fieldType.Hidden?"H_Field":"Field"))})),l.ALo(14,"i18n"),l._uU(15,"\n                "),l._UZ(16,"i",23),l._uU(17,"\n              "),l.qZA(),l._uU(18,"\n            "),l.qZA(),l._uU(19,"\n          "),l.qZA()}if(2&e){const e=l.oxw(),t=e.index,i=e.$implicit,n=l.oxw(2);l.xp6(2),l.MGl("id","fieldValue",t,""),l.s9C("type",i.showValue?"text":"password"),l.MGl("name","Field.Value",t,""),l.Q2q("aria-describedby","fieldName",t,""),l.Q6J("ngModel",i.value)("disabled",n.cipher.isDeleted||n.viewOnly||!n.cipher.viewPassword&&!i.newField)("readonly",!n.cipher.edit&&n.editMode),l.xp6(4),l.s9C("appA11yTitle",l.lcZ(7,12,"toggleVisibility")),l.Q6J("disabled",!n.cipher.viewPassword&&!i.newField),l.xp6(3),l.Q6J("ngClass",l.WLB(16,b,!i.showValue,i.showValue)),l.xp6(4),l.s9C("appA11yTitle",l.lcZ(14,14,"copyValue")),l.Q6J("disabled",!n.cipher.viewPassword&&!i.newField)}}function _(e,t){if(1&e&&(l.TgZ(0,"option",30),l._uU(1),l.qZA()),2&e){const e=t.$implicit;l.Q6J("ngValue",e.value),l.xp6(1),l.Oqu(e.name)}}function A(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"select",28),l.NdJ("ngModelChange",(function(t){l.CHM(e);const i=l.oxw(2).$implicit;return l.KtG(i.linkedId=t)})),l._uU(1,"\n              "),l.YNc(2,_,2,2,"option",29),l._uU(3,"\n            "),l.qZA()}if(2&e){const e=l.oxw(2),t=e.index,i=e.$implicit,n=l.oxw(2);l.MGl("id","fieldValue",t,"")("name","Field.Value",t,""),l.Q2q("aria-describedby","fieldName",t,""),l.Q6J("ngModel",i.linkedId)("disabled",n.cipher.isDeleted||n.viewOnly),l.xp6(2),l.Q6J("ngForOf",n.linkedFieldOptions)}}function Z(e,t){if(1&e&&(l.TgZ(0,"div",20),l._uU(1,"\n            "),l.YNc(2,A,4,6,"select",27),l._uU(3,"\n          "),l.qZA()),2&e){const e=l.oxw().$implicit,t=l.oxw(2);l.xp6(2),l.Q6J("ngIf",e.type===t.fieldType.Linked&&null!=t.cipher.linkedFieldOptions)}}function x(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"input",31),l.NdJ("ngModelChange",(function(t){l.CHM(e);const i=l.oxw().$implicit;return l.KtG(i.value=t)})),l.qZA()}if(2&e){const e=l.oxw(),t=e.index,i=e.$implicit,n=l.oxw(2);l.MGl("id","fieldValue",t,"")("name","Field.Value",t,""),l.Q2q("aria-describedby","fieldName",t,""),l.Q6J("ngModel",i.value)("disabled",n.cipher.isDeleted||n.viewOnly)}}function S(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"button",32),l.NdJ("click",(function(){l.CHM(e);const t=l.oxw().$implicit,i=l.oxw(2);return l.KtG(i.removeField(t))})),l.ALo(1,"i18n"),l._uU(2,"\n            "),l._UZ(3,"i",33),l._uU(4,"\n          "),l.qZA()}2&e&&l.s9C("appA11yTitle",l.lcZ(1,1,"remove"))}function T(e,t){1&e&&(l.TgZ(0,"button",34),l.ALo(1,"i18n"),l._uU(2,"\n            "),l._UZ(3,"i",35),l._uU(4,"\n          "),l.qZA()),2&e&&l.s9C("appA11yTitle",l.lcZ(1,1,"dragToSort"))}function C(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"div",6),l._uU(1,"\n      "),l.TgZ(2,"div",7),l._uU(3,"\n        "),l.TgZ(4,"div",8),l._uU(5,"\n          "),l.TgZ(6,"label",9),l._uU(7),l.ALo(8,"i18n"),l.qZA(),l._uU(9,"\n          "),l.TgZ(10,"a",10),l.ALo(11,"i18n"),l._uU(12,"\n            "),l._UZ(13,"i",11),l._uU(14,"\n          "),l.qZA(),l._uU(15,"\n        "),l.qZA(),l._uU(16,"\n        "),l.TgZ(17,"input",12),l.NdJ("ngModelChange",(function(t){const i=l.CHM(e).$implicit;return l.KtG(i.name=t)})),l.qZA(),l._uU(18,"\n      "),l.qZA(),l._uU(19,"\n      "),l.TgZ(20,"div",13),l._uU(21,"\n        "),l.TgZ(22,"label",9),l._uU(23),l.ALo(24,"i18n"),l.qZA(),l._uU(25,"\n        "),l.TgZ(26,"div",14),l._uU(27,"\n          "),l._uU(28,"\n          "),l.YNc(29,w,13,9,"div",15),l._uU(30,"\n          "),l._uU(31,"\n          "),l.YNc(32,U,20,19,"div",15),l._uU(33,"\n          "),l._uU(34,"\n          "),l.YNc(35,Z,4,1,"div",15),l._uU(36,"\n          "),l.TgZ(37,"div",16),l._uU(38,"\n            "),l._uU(39,"\n            "),l.YNc(40,x,1,5,"input",17),l._uU(41,"\n          "),l.qZA(),l._uU(42,"\n          "),l.YNc(43,S,5,3,"button",18),l._uU(44,"\n          "),l.YNc(45,T,5,3,"button",19),l._uU(46,"\n        "),l.qZA(),l._uU(47,"\n      "),l.qZA(),l._uU(48,"\n    "),l.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=l.oxw(2);l.uIk("aria-label",e.name),l.xp6(6),l.MGl("for","fieldName",i,""),l.xp6(1),l.Oqu(l.lcZ(8,17,"name")),l.xp6(3),l.s9C("appA11yTitle",l.lcZ(11,19,"learnMore")),l.xp6(7),l.MGl("id","fieldName",i,"")("name","Field.Name",i,""),l.Q6J("ngModel",e.name)("disabled",n.cipher.isDeleted||n.viewOnly)("readonly",!n.cipher.edit&&n.editMode),l.xp6(5),l.MGl("for","fieldValue",i,""),l.xp6(1),l.Oqu(l.lcZ(24,21,"value")),l.xp6(6),l.Q6J("ngIf",e.type===n.fieldType.Text),l.xp6(3),l.Q6J("ngIf",e.type===n.fieldType.Hidden),l.xp6(3),l.Q6J("ngIf",e.type===n.fieldType.Linked),l.xp6(5),l.Q6J("ngIf",e.type===n.fieldType.Boolean),l.xp6(3),l.Q6J("ngIf",!(n.cipher.isDeleted||n.viewOnly||!n.cipher.edit&&n.editMode)),l.xp6(2),l.Q6J("ngIf",!(n.cipher.isDeleted||n.viewOnly||!n.cipher.edit&&n.editMode))}}function O(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"div",4),l.NdJ("cdkDropListDropped",(function(t){l.CHM(e);const i=l.oxw();return l.KtG(i.drop(t))})),l._uU(1,"\n    "),l.YNc(2,C,49,23,"div",5),l._uU(3,"\n  "),l.qZA()}if(2&e){const e=l.oxw();l.xp6(2),l.Q6J("ngForOf",e.cipher.fields)("ngForTrackBy",e.trackByFunction)}}function k(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"a",36),l.NdJ("click",(function(){l.CHM(e);const t=l.oxw();return l.KtG(t.addField())})),l._uU(1,"\n    "),l._UZ(2,"i",37),l._uU(3),l.ALo(4,"i18n"),l.qZA()}2&e&&(l.xp6(3),l.hij(" ",l.lcZ(4,1,"newCustomField"),"\n  "))}function P(e,t){if(1&e&&(l.TgZ(0,"option",30),l._uU(1),l.qZA()),2&e){const e=t.$implicit;l.Q6J("ngValue",e.value),l.xp6(1),l.Oqu(e.name)}}function q(e,t){if(1&e&&(l.TgZ(0,"option",30),l._uU(1),l.qZA()),2&e){const e=l.oxw(2);l.Q6J("ngValue",e.addFieldLinkedTypeOption.value),l.xp6(1),l.hij("\n          ",e.addFieldLinkedTypeOption.name,"\n        ")}}function I(e,t){if(1&e){const e=l.EpF();l.TgZ(0,"div",38),l._uU(1,"\n    "),l.TgZ(2,"div",39),l._uU(3,"\n      "),l.TgZ(4,"label",40),l._uU(5),l.ALo(6,"i18n"),l.qZA(),l._uU(7,"\n      "),l.TgZ(8,"select",41),l.NdJ("ngModelChange",(function(t){l.CHM(e);const i=l.oxw();return l.KtG(i.addFieldType=t)})),l._uU(9,"\n        "),l.YNc(10,P,2,2,"option",29),l._uU(11,"\n        "),l.YNc(12,q,2,2,"option",42),l._uU(13,"\n      "),l.qZA(),l._uU(14,"\n    "),l.qZA(),l._uU(15,"\n  "),l.qZA()}if(2&e){const e=l.oxw();l.xp6(5),l.Oqu(l.lcZ(6,4,"type")),l.xp6(3),l.Q6J("ngModel",e.addFieldType),l.xp6(2),l.Q6J("ngForOf",e.addFieldTypeOptions),l.xp6(2),l.Q6J("ngIf",null!=e.cipher.linkedFieldOptions)}}class M extends d{constructor(e,t){super(e,t)}}M.ɵfac=function(e){return new(e||M)(l.Y36(c.D),l.Y36(u.j))},M.ɵcmp=l.Xpm({type:M,selectors:[["app-vault-add-edit-custom-fields"]],inputs:{viewOnly:"viewOnly",copy:"copy"},features:[l.qOj],decls:14,vars:6,consts:[[1,"mt-4"],["cdkDropList","",3,"cdkDropListDropped",4,"ngIf"],["href","#","appStopClick","","class","d-inline-block mb-2",3,"click",4,"ngIf"],["class","row",4,"ngIf"],["cdkDropList","",3,"cdkDropListDropped"],["role","group","class","row","cdkDrag","",4,"ngFor","ngForOf","ngForTrackBy"],["role","group","cdkDrag","",1,"row"],[1,"col-5","form-group"],[1,"d-flex"],[3,"for"],["href","https://bitwarden.com/help/custom-fields/","target","_blank","rel","noreferrer",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["type","text","appInputVerbatim","",1,"form-control",3,"id","name","ngModel","disabled","readonly","ngModelChange"],[1,"col-7","form-group"],[1,"d-flex","align-items-center"],["class","input-group",4,"ngIf"],[1,"flex-fill"],["type","checkbox","appTrueFalseValue","","trueValue","true","falseValue","false",3,"id","name","ngModel","disabled","ngModelChange",4,"ngIf"],["type","button","class","btn btn-link text-danger ml-2",3,"appA11yTitle","click",4,"ngIf"],["type","button","class","btn btn-link text-muted cursor-move",3,"appA11yTitle",4,"ngIf"],[1,"input-group"],[1,"input-group-append"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone"],["appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"id","type","name","ngModel","disabled","readonly","ngModelChange"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","disabled","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],["class","form-control",3,"id","name","ngModel","disabled","ngModelChange",4,"ngIf"],[1,"form-control",3,"id","name","ngModel","disabled","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],["type","checkbox","appTrueFalseValue","","trueValue","true","falseValue","false",3,"id","name","ngModel","disabled","ngModelChange"],["type","button",1,"btn","btn-link","text-danger","ml-2",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-minus-circle","bwi-lg"],["type","button",1,"btn","btn-link","text-muted","cursor-move",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-hamburger","bwi-lg"],["href","#","appStopClick","",1,"d-inline-block","mb-2",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus-circle","bwi-fw"],[1,"row"],[1,"col-5"],["for","addFieldType",1,"sr-only"],["id","addFieldType","name","AddFieldType",1,"form-control",3,"ngModel","ngModelChange"],[3,"ngValue",4,"ngIf"]],template:function(e,t){1&e&&(l.ynx(0),l._uU(1,"\n  "),l.TgZ(2,"h3",0),l._uU(3),l.ALo(4,"i18n"),l.qZA(),l._uU(5,"\n  "),l.YNc(6,O,4,2,"div",1),l._uU(7,"\n  "),l._uU(8,"\n  "),l.YNc(9,k,5,3,"a",2),l._uU(10,"\n  "),l.YNc(11,I,16,6,"div",3),l._uU(12,"\n"),l.BQk(),l._uU(13,"\n")),2&e&&(l.xp6(3),l.Oqu(l.lcZ(4,4,"customFields")),l.xp6(3),l.Q6J("ngIf",t.cipher.hasFields),l.xp6(3),l.Q6J("ngIf",!(t.cipher.isDeleted||t.viewOnly||!t.cipher.edit&&t.editMode)),l.xp6(2),l.Q6J("ngIf",!(t.cipher.isDeleted||t.viewOnly||!t.cipher.edit&&t.editMode)))},dependencies:[p.mk,p.sg,p.O5,n.Wj,n.Zt,h.YN,h.Kr,h.Fj,h.Wl,h.EJ,h.JJ,h.On,g.B,f.b,m.O,v,y.C],encapsulation:2})},1018:(e,t,i)=>{"use strict";i.d(t,{Z:()=>at});var n=i(99042),s=i(85762),o=i(54019),r=i(59157),a=i(68362),l=i(58691),c=i(92614),u=i(51303),d=i(59281),p=i(66469),h=i(34961),g=i(27646),f=i(89474),m=i(72285),v=i(57387),y=i(53061),w=i(15091),b=i(95896),U=i(60712),_=i(54976),A=i(25406),Z=i(92236),x=i(23031),S=i(78627),T=i(99721),C=i(98438),O=i(58172),k=i(31754),P=i(87483),q=i(83924),I=i(66459),M=i(88701),N=i(73369),L=i(28508),D=i(65254),E=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class F{get fido2CredentialCreationDateValue(){var e,t,i,n;return`${this.i18nService.t("dateCreated")} ${this.datePipe.transform(null===(n=null===(i=null===(t=null===(e=this.cipher)||void 0===e?void 0:e.login)||void 0===t?void 0:t.fido2Credentials)||void 0===i?void 0:i[0])||void 0===n?void 0:n.creationDate,"short")}`}constructor(e,t,i,n,r,a,l,c,u,d,h,g,m,v,y,w,b,U){this.cipherService=e,this.folderService=t,this.i18nService=i,this.platformUtilsService=n,this.auditService=r,this.stateService=a,this.collectionService=l,this.messagingService=c,this.eventCollectionService=u,this.policyService=d,this.logService=h,this.passwordRepromptService=g,this.organizationService=m,this.sendApiService=v,this.dialogService=y,this.win=w,this.datePipe=b,this.configService=U,this.cloneMode=!1,this.folderId=null,this.organizationId=null,this.onSavedCipher=new s.vpe,this.onDeletedCipher=new s.vpe,this.onRestoredCipher=new s.vpe,this.onCancelled=new s.vpe,this.onEditAttachments=new s.vpe,this.onShareCipher=new s.vpe,this.onEditCollections=new s.vpe,this.onGeneratePassword=new s.vpe,this.onGenerateUsername=new s.vpe,this.editMode=!1,this.collections=[],this.showPassword=!1,this.showTotpSeed=!1,this.showCardNumber=!1,this.showCardCode=!1,this.cipherType=f.Ou,this.ownershipOptions=[],this.currentDate=new Date,this.allowPersonal=!0,this.reprompt=!1,this.canUseReprompt=!0,this.componentName="",this.destroy$=new o.x,this.flexibleCollectionsV1Enabled=!1,this.typeOptions=[{name:i.t("typeLogin"),value:f.Ou.Login},{name:i.t("typeCard"),value:f.Ou.Card},{name:i.t("typeIdentity"),value:f.Ou.Identity},{name:i.t("typeSecureNote"),value:f.Ou.SecureNote}],this.cardBrandOptions=[{name:"-- "+i.t("select")+" --",value:null},{name:"Visa",value:"Visa"},{name:"Mastercard",value:"Mastercard"},{name:"American Express",value:"Amex"},{name:"Discover",value:"Discover"},{name:"Diners Club",value:"Diners Club"},{name:"JCB",value:"JCB"},{name:"Maestro",value:"Maestro"},{name:"UnionPay",value:"UnionPay"},{name:"RuPay",value:"RuPay"},{name:i.t("other"),value:"Other"}],this.cardExpMonthOptions=[{name:"-- "+i.t("select")+" --",value:null},{name:"01 - "+i.t("january"),value:"1"},{name:"02 - "+i.t("february"),value:"2"},{name:"03 - "+i.t("march"),value:"3"},{name:"04 - "+i.t("april"),value:"4"},{name:"05 - "+i.t("may"),value:"5"},{name:"06 - "+i.t("june"),value:"6"},{name:"07 - "+i.t("july"),value:"7"},{name:"08 - "+i.t("august"),value:"8"},{name:"09 - "+i.t("september"),value:"9"},{name:"10 - "+i.t("october"),value:"10"},{name:"11 - "+i.t("november"),value:"11"},{name:"12 - "+i.t("december"),value:"12"}],this.identityTitleOptions=[{name:"-- "+i.t("select")+" --",value:null},{name:i.t("mr"),value:i.t("mr")},{name:i.t("mrs"),value:i.t("mrs")},{name:i.t("ms"),value:i.t("ms")},{name:i.t("mx"),value:i.t("mx")},{name:i.t("dr"),value:i.t("dr")}],this.uriMatchOptions=[{name:i.t("defaultMatchDetection"),value:null},{name:i.t("baseDomain"),value:p.s.Domain},{name:i.t("host"),value:p.s.Host},{name:i.t("startsWith"),value:p.s.StartsWith},{name:i.t("regEx"),value:p.s.RegularExpression},{name:i.t("exact"),value:p.s.Exact},{name:i.t("never"),value:p.s.Never}],this.autofillOnPageLoadOptions=[{name:i.t("autoFillOnPageLoadUseDefault"),value:null},{name:i.t("autoFillOnPageLoadYes"),value:!0},{name:i.t("autoFillOnPageLoadNo"),value:!1}]}ngOnInit(){return E(this,void 0,void 0,(function*(){this.flexibleCollectionsV1Enabled=yield this.configService.getFeatureFlag(d.T.FlexibleCollectionsV1),this.policyService.policyAppliesToActiveUser$(c.Mi.PersonalOwnership).pipe((0,r.b)((e=>E(this,void 0,void 0,(function*(){this.personalOwnershipPolicyAppliesToActiveUser=e,yield this.init()})))),(0,a.R)(this.destroy$)).subscribe(),this.writeableCollections=yield this.loadCollections(),this.canUseReprompt=yield this.passwordRepromptService.enabled()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}init(){return E(this,void 0,void 0,(function*(){if(this.ownershipOptions.length&&(this.ownershipOptions=[]),this.personalOwnershipPolicyAppliesToActiveUser)this.allowPersonal=!1;else{const e=yield this.stateService.getEmail();this.ownershipOptions.push({name:e,value:null})}(yield this.organizationService.getAll()).filter(l.RN).sort(g.c.getSortFunction(this.i18nService,"name")).forEach((e=>{e.enabled&&e.status===c.Dn.Confirmed&&this.ownershipOptions.push({name:e.name,value:e.id})})),this.allowPersonal||null!=this.organizationId||(this.organizationId=this.defaultOwnerId)}))}load(){var e,t;return E(this,void 0,void 0,(function*(){this.editMode=null!=this.cipherId,this.editMode?(this.editMode=!0,this.cloneMode?(this.cloneMode=!0,this.title=this.i18nService.t("addItem")):this.title=this.i18nService.t("editItem")):this.title=this.i18nService.t("addItem");const i=yield this.loadAddEditCipherInfo();if(null==this.cipher)if(this.editMode){const e=yield this.loadCipher();this.cipher=yield e.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(e)),this.cloneMode&&(this.cipher.name+=" - "+this.i18nService.t("clone"),null!=this.cipher.organizationId||this.allowPersonal||(this.cipher.organizationId=this.organizationId))}else this.cipher=new y.$,this.cipher.organizationId=null==this.organizationId?null:this.organizationId,this.cipher.folderId=this.folderId,this.cipher.type=null==this.type?f.Ou.Login:this.type,this.cipher.login=new U.q,this.cipher.login.uris=[new b.E],this.cipher.card=new v._,this.cipher.identity=new w.t,this.cipher.secureNote=new _.z,this.cipher.secureNote.type=f.xs.Generic,this.cipher.reprompt=m.N.None;if(null==this.cipher||this.editMode&&!i&&!this.cloneMode||(yield this.organizationChanged(),null!=this.collectionIds&&this.collectionIds.length>0&&this.collections.length>0&&this.collections.forEach((e=>{this.collectionIds.indexOf(e.id)>-1&&(e.checked=!0)}))),this.cloneMode&&null!=this.cipher.organizationId){const e=(yield(0,n.z)(this.organizationService.memberOrganizations$)).find((e=>e.id===this.cipher.organizationId));null==e||e.isAdmin||e.permissions.editAnyCollection||(this.ownershipOptions=[{name:e.name,value:e.id}])}this.cloneMode&&(null===(t=null===(e=this.cipher)||void 0===e?void 0:e.login)||void 0===t?void 0:t.hasFido2Credentials)&&(this.cipher.login.fido2Credentials=null),this.folders$=this.folderService.folderViews$,this.editMode&&this.previousCipherId!==this.cipherId&&this.eventCollectionService.collect(u.tw.Cipher_ClientViewed,this.cipherId),this.previousCipherId=this.cipherId,this.reprompt=this.cipher.reprompt!==m.N.None,this.reprompt&&(this.cipher.login.autofillOnPageLoad=this.autofillOnPageLoadOptions[2].value)}))}submit(){return E(this,void 0,void 0,(function*(){if(this.cipher.isDeleted)return this.restore();if(null==this.cipher.name||""===this.cipher.name)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nameRequired")),!1;if((!this.editMode||this.cloneMode)&&!this.allowPersonal&&null==this.cipher.organizationId)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("personalOwnershipSubmitError")),!1;this.editMode&&!this.cloneMode||this.cipher.type!==f.Ou.Login||null==this.cipher.login.uris||1!==this.cipher.login.uris.length||null!=this.cipher.login.uris[0].uri&&""!==this.cipher.login.uris[0].uri||(this.cipher.login.uris=[]),this.editMode&&!this.cloneMode||null==this.cipher.organizationId||(this.cipher.collectionIds=null==this.collections?[]:this.collections.filter((e=>e.checked)).map((e=>e.id))),this.cloneMode&&(this.cipher.id=null);const e=yield this.encryptCipher();try{return this.formPromise=this.saveCipher(e),yield this.formPromise,this.cipher.id=e.id,this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode&&!this.cloneMode?"editedItem":"addedItem")),this.onSavedCipher.emit(this.cipher),this.messagingService.send(this.editMode&&!this.cloneMode?"editedCipher":"addedCipher"),!0}catch(t){this.logService.error(t)}return!1}))}addUri(){this.cipher.type===f.Ou.Login&&(null==this.cipher.login.uris&&(this.cipher.login.uris=[]),this.cipher.login.uris.push(new b.E))}removeUri(e){if(this.cipher.type!==f.Ou.Login||null==this.cipher.login.uris)return;const t=this.cipher.login.uris.indexOf(e);t>-1&&this.cipher.login.uris.splice(t,1)}removePasskey(){this.cipher.type===f.Ou.Login&&null!=this.cipher.login.fido2Credentials&&(this.cipher.login.fido2Credentials=null)}onCardNumberChange(){this.cipher.card.brand=v._.getCardBrandByPatterns(this.cipher.card.number)}getCardExpMonthDisplay(){var e;return null===(e=this.cardExpMonthOptions.find((e=>e.value==this.cipher.card.expMonth)))||void 0===e?void 0:e.name}trackByFunction(e,t){return e}cancel(){this.onCancelled.emit(this.cipher)}attachments(){this.onEditAttachments.emit(this.cipher)}share(){this.onShareCipher.emit(this.cipher)}editCollections(){this.onEditCollections.emit(this.cipher)}delete(){return E(this,void 0,void 0,(function*(){if(!(yield this.dialogService.openSimpleDialog({title:{key:"deleteItem"},content:{key:this.cipher.isDeleted?"permanentlyDeleteItemConfirmation":"deleteItemConfirmation"},type:"warning"})))return!1;try{this.deletePromise=this.deleteCipher(),yield this.deletePromise,this.platformUtilsService.showToast("success",null,this.i18nService.t(this.cipher.isDeleted?"permanentlyDeletedItem":"deletedItem")),this.onDeletedCipher.emit(this.cipher),this.messagingService.send(this.cipher.isDeleted?"permanentlyDeletedCipher":"deletedCipher")}catch(e){this.logService.error(e)}return!0}))}restore(){return E(this,void 0,void 0,(function*(){if(!this.cipher.isDeleted)return!1;try{this.restorePromise=this.restoreCipher(),yield this.restorePromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("restoredItem")),this.onRestoredCipher.emit(this.cipher),this.messagingService.send("restoredCipher")}catch(e){this.logService.error(e)}return!0}))}generateUsername(){var e,t;return E(this,void 0,void 0,(function*(){if(null===(t=null===(e=this.cipher.login)||void 0===e?void 0:e.username)||void 0===t?void 0:t.length){if(!(yield this.dialogService.openSimpleDialog({title:{key:"overwriteUsername"},content:{key:"overwriteUsernameConfirmation"},type:"warning"})))return!1}return this.onGenerateUsername.emit(),!0}))}generatePassword(){var e,t;return E(this,void 0,void 0,(function*(){if(null===(t=null===(e=this.cipher.login)||void 0===e?void 0:e.password)||void 0===t?void 0:t.length){if(!(yield this.dialogService.openSimpleDialog({title:{key:"overwritePassword"},content:{key:"overwritePasswordConfirmation"},type:"warning"})))return!1}return this.onGeneratePassword.emit(),!0}))}togglePassword(){var e;this.showPassword=!this.showPassword,this.editMode&&this.showPassword&&(null===(e=document.getElementById("loginPassword"))||void 0===e||e.focus(),this.eventCollectionService.collect(u.tw.Cipher_ClientToggledPasswordVisible,this.cipherId))}toggleTotpSeed(){var e;this.showTotpSeed=!this.showTotpSeed,this.editMode&&this.showTotpSeed&&(null===(e=document.getElementById("loginTotp"))||void 0===e||e.focus(),this.eventCollectionService.collect(u.tw.Cipher_ClientToggledTOTPSeedVisible,this.cipherId))}toggleCardNumber(){return E(this,void 0,void 0,(function*(){this.showCardNumber=!this.showCardNumber,this.showCardNumber&&this.eventCollectionService.collect(u.tw.Cipher_ClientToggledCardNumberVisible,this.cipherId)}))}toggleCardCode(){this.showCardCode=!this.showCardCode,document.getElementById("cardCode").focus(),this.editMode&&this.showCardCode&&this.eventCollectionService.collect(u.tw.Cipher_ClientToggledCardCodeVisible,this.cipherId)}toggleUriOptions(e){const t=e;t.showOptions=(null!=t.showOptions||null==e.match)&&!t.showOptions}loginUriMatchChanged(e){const t=e;t.showOptions=null==t.showOptions||t.showOptions}organizationChanged(){var e;return E(this,void 0,void 0,(function*(){if(null!=this.writeableCollections&&this.writeableCollections.forEach((e=>e.checked=!1)),null!=this.cipher.organizationId){this.collections=null===(e=this.writeableCollections)||void 0===e?void 0:e.filter((e=>e.organizationId===this.cipher.organizationId));const t=yield this.organizationService.get(this.cipher.organizationId);null!=t&&(this.cipher.organizationUseTotp=t.useTotp)}else this.collections=[]}))}checkPassword(){return E(this,void 0,void 0,(function*(){if(null!=this.checkPasswordPromise)return;if(null==this.cipher.login||null==this.cipher.login.password||""===this.cipher.login.password)return;this.checkPasswordPromise=this.auditService.passwordLeaked(this.cipher.login.password);const e=yield this.checkPasswordPromise;this.checkPasswordPromise=null,e>0?this.platformUtilsService.showToast("warning",null,this.i18nService.t("passwordExposed",e.toString())):this.platformUtilsService.showToast("success",null,this.i18nService.t("passwordSafe"))}))}repromptChanged(){this.reprompt=!this.reprompt,this.reprompt?(this.cipher.reprompt=m.N.Password,this.cipher.login.autofillOnPageLoad=this.autofillOnPageLoadOptions[2].value):(this.cipher.reprompt=m.N.None,this.cipher.login.autofillOnPageLoad=this.autofillOnPageLoadOptions[0].value)}loadCollections(){return E(this,void 0,void 0,(function*(){return(yield this.collectionService.getAllDecrypted()).filter((e=>!e.readOnly))}))}loadCipher(){return this.cipherService.get(this.cipherId)}encryptCipher(){return this.cipherService.encrypt(this.cipher)}saveCipher(e){var t,i;const n=this.editMode&&!this.cloneMode;let s=null===(t=this.organization)||void 0===t?void 0:t.canEditAllCiphers(this.flexibleCollectionsV1Enabled);return e.collectionIds||(s=null===(i=this.organization)||void 0===i?void 0:i.canEditUnassignedCiphers()),null==this.cipher.id?this.cipherService.createWithServer(e,s):this.cipherService.updateWithServer(e,s,n)}deleteCipher(){var e;const t=null===(e=this.organization)||void 0===e?void 0:e.canEditAllCiphers(this.flexibleCollectionsV1Enabled);return this.cipher.isDeleted?this.cipherService.deleteWithServer(this.cipher.id,t):this.cipherService.softDeleteWithServer(this.cipher.id,t)}restoreCipher(){var e;const t=null===(e=this.organization)||void 0===e?void 0:e.canEditAllCiphers(this.flexibleCollectionsV1Enabled);return this.cipherService.restoreWithServer(this.cipher.id,t)}get defaultOwnerId(){return this.ownershipOptions[0].value}loadAddEditCipherInfo(){return E(this,void 0,void 0,(function*(){const e=yield(0,n.z)(this.cipherService.addEditCipherInfo$),t=null!=e;return t&&(this.cipher=e.cipher,this.collectionIds=e.collectionIds,this.editMode||this.allowPersonal||null!=this.cipher.organizationId||(this.cipher.organizationId=this.defaultOwnerId)),yield this.cipherService.setAddEditCipherInfo(null),t}))}copy(e,t,i){return E(this,void 0,void 0,(function*(){if(null==e)return!1;const n=null!=this.win?{window:this.win}:null;return this.platformUtilsService.copyToClipboard(e,n),this.platformUtilsService.showToast("info",null,this.i18nService.t("valueCopied",this.i18nService.t(t))),"password"===t?this.eventCollectionService.collect(u.tw.Cipher_ClientCopiedPassword,this.cipherId):"securityCode"===t?this.eventCollectionService.collect(u.tw.Cipher_ClientCopiedCardCode,this.cipherId):"H_Field"===i&&this.eventCollectionService.collect(u.tw.Cipher_ClientCopiedHiddenField,this.cipherId),!0}))}}F.ɵfac=function(e){return new(e||F)(s.Y36(Z.u),s.Y36(x.s),s.Y36(S.D),s.Y36(T.P),s.Y36(C.C),s.Y36(O.b),s.Y36(k.a),s.Y36(h.o),s.Y36(P.j),s.Y36(q.d),s.Y36(I.$),s.Y36(A.C),s.Y36(l.Mn),s.Y36(M.e),s.Y36(N.x),s.Y36(Window),s.Y36(L.uU),s.Y36(D.E))},F.ɵdir=s.lG2({type:F,inputs:{cloneMode:"cloneMode",folderId:"folderId",cipherId:"cipherId",type:"type",collectionIds:"collectionIds",organizationId:"organizationId"},outputs:{onSavedCipher:"onSavedCipher",onDeletedCipher:"onDeletedCipher",onRestoredCipher:"onRestoredCipher",onCancelled:"onCancelled",onEditAttachments:"onEditAttachments",onShareCipher:"onShareCipher",onEditCollections:"onEditCollections",onGeneratePassword:"onGeneratePassword",onGenerateUsername:"onGenerateUsername"}});var R=i(39553),J=i(8067),z=i(62357),Y=i(384),K=i(37513),B=i(33245),Q=i(24610),G=i(53707),j=i(85356),V=i(2051),$=i(66385),H=i(21989),W=i(12492),X=i(78696),ee=i(55039),te=i(82933),ie=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function ne(e,t){1&e&&(s.TgZ(0,"app-callout",26),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n          ",s.lcZ(2,1,"personalOwnershipPolicyInEffect"),"\n        "))}function se(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function oe(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",16),s._uU(1,"\n          "),s.TgZ(2,"div",17),s._uU(3,"\n            "),s.TgZ(4,"label",27),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n            "),s.TgZ(8,"select",28),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.type=t)})),s._uU(9,"\n              "),s.YNc(10,se,2,2,"option",29),s._uU(11,"\n            "),s.qZA(),s._uU(12,"\n          "),s.qZA(),s._uU(13,"\n        "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(s.lcZ(6,4,"whatTypeOfItem")),s.xp6(3),s.Q6J("ngModel",e.cipher.type)("disabled",e.cipher.isDeleted),s.xp6(2),s.Q6J("ngForOf",e.typeOptions)}}function re(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.id),s.xp6(1),s.Oqu(e.name)}}function ae(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",17),s._uU(1,"\n            "),s.TgZ(2,"label",31),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n            "),s.TgZ(6,"select",32),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.folderId=t)})),s._uU(7,"\n              "),s.YNc(8,re,2,2,"option",29),s.ALo(9,"async"),s._uU(10,"\n            "),s.qZA(),s._uU(11,"\n          "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,4,"folder")),s.xp6(3),s.Q6J("ngModel",e.cipher.folderId)("disabled",e.cipher.isDeleted||e.viewOnly),s.xp6(2),s.Q6J("ngForOf",s.lcZ(9,6,e.folders$))}}function le(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",41),s._uU(1,"\n                  "),s.TgZ(2,"button",54),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.copy(t.cipher.login.username,"username","Username"))})),s.ALo(3,"i18n"),s._uU(4,"\n                    "),s._UZ(5,"i",44),s._uU(6,"\n                  "),s.qZA(),s._uU(7,"\n                "),s.qZA()}2&e&&(s.xp6(2),s.s9C("appA11yTitle",s.lcZ(3,1,"copyUsername")))}function ce(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",62),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.generatePassword())})),s.ALo(1,"i18n"),s._uU(2,"\n                    "),s._UZ(3,"i",63),s._uU(4,"\n                  "),s.qZA()}2&e&&s.s9C("appA11yTitle",s.lcZ(1,1,"generatePassword"))}function ue(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",64),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.togglePasswordCount())})),s.ALo(1,"i18n"),s._uU(2,"\n                    "),s._UZ(3,"i",65),s._uU(4,"\n                  "),s.qZA()}2&e&&s.Q6J("appA11yTitle",s.lcZ(1,1,"toggleCharacterCount"))}function de(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",55),s._uU(1,"\n                  "),s.YNc(2,ce,5,3,"a",56),s._uU(3,"\n                  "),s.TgZ(4,"a",57,58),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.checkPassword())})),s.ALo(6,"i18n"),s._uU(7,"\n                    "),s._UZ(8,"i",59),s._uU(9,"\n                    "),s._UZ(10,"i",60),s.ALo(11,"i18n"),s._uU(12,"\n                  "),s.qZA(),s._uU(13,"\n                  "),s.YNc(14,ue,5,3,"a",61),s._uU(15,"\n                "),s.qZA()}if(2&e){const e=s.MAs(5),t=s.oxw(3);s.xp6(2),s.Q6J("ngIf",t.cipher.viewPassword&&!(!t.cipher.edit&&t.editMode)),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(6,7,"checkPassword")),s.Q6J("appApiAction",t.checkPasswordPromise),s.xp6(4),s.Q6J("hidden",e.loading),s.xp6(2),s.s9C("title",s.lcZ(11,9,"loading")),s.Q6J("hidden",!e.loading),s.xp6(4),s.Q6J("ngIf",t.cipher.viewPassword)}}function pe(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",66),s._uU(1,"\n            "),s.TgZ(2,"label"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n            "),s.TgZ(6,"div",67),s._uU(7,"\n              "),s._UZ(8,"bit-color-password",68),s._uU(9,"\n              "),s.TgZ(10,"button",69),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.togglePasswordCount())})),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n            "),s.qZA(),s._uU(14,"\n          "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,4,"passwordCharacterCount")),s.xp6(5),s.Q6J("password",e.cipher.login.password)("showCount",!0),s.xp6(3),s.hij("\n                ",s.lcZ(12,6,"hide"),"\n              ")}}function he(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",74),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.removePasskey())})),s.ALo(1,"i18n"),s._uU(2,"\n                    "),s._UZ(3,"i",75),s._uU(4,"\n                  "),s.qZA()}2&e&&s.s9C("appA11yTitle",s.lcZ(1,1,"removePasskey"))}function ge(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n            "),s.TgZ(2,"div",46),s._uU(3,"\n              "),s.TgZ(4,"div",47),s._uU(5,"\n                "),s.TgZ(6,"label",70),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n                "),s.TgZ(10,"div",71),s.ALo(11,"i18n"),s._uU(12,"\n                  "),s._UZ(13,"input",72),s._uU(14,"\n                  "),s.YNc(15,he,5,3,"button",73),s._uU(16,"\n                "),s.qZA(),s._uU(17,"\n              "),s.qZA(),s._uU(18,"\n            "),s.qZA(),s._uU(19,"\n          "),s.BQk()),2&e){const e=s.oxw(3);s.xp6(7),s.Oqu(s.lcZ(8,5,"typePasskey")),s.xp6(3),s.zWS("aria-label","",s.lcZ(11,7,"typePasskey")," ",e.fido2CredentialCreationDateValue,""),s.xp6(3),s.Q6J("value",e.fido2CredentialCreationDateValue),s.xp6(2),s.Q6J("ngIf",!e.cipher.isDeleted&&!e.viewOnly)}}const fe=function(){return{"stroke-dashoffset.px":40}};function me(e,t){1&e&&(s.TgZ(0,"div",76),s._uU(1,"\n                "),s.TgZ(2,"span",77),s._uU(3,"\n                  "),s.TgZ(4,"span",78),s._uU(5,"15"),s.qZA(),s._uU(6,"\n                  "),s.O4$(),s.TgZ(7,"svg"),s._uU(8,"\n                    "),s.TgZ(9,"g"),s._uU(10,"\n                      "),s._UZ(11,"circle",79),s._uU(12,"\n                      "),s._UZ(13,"circle",80),s._uU(14,"\n                    "),s.qZA(),s._uU(15,"\n                  "),s.qZA(),s._uU(16,"\n                "),s.qZA(),s._uU(17,"\n                "),s.kcU(),s.TgZ(18,"span",81),s.ALo(19,"i18n"),s._uU(20,"--- ---"),s.qZA(),s._uU(21,"\n                "),s._UZ(22,"i",82),s._uU(23,"\n              "),s.qZA()),2&e&&(s.xp6(11),s.Q6J("ngStyle",s.DdM(4,fe)),s.xp6(7),s.s9C("title",s.lcZ(19,2,"verificationCodeTotp")))}function ve(e,t){1&e&&s._UZ(0,"app-premium-badge",86)}function ye(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",87),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.upgradeOrganization())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n                  ",s.lcZ(2,1,"upgrade"),"\n                "))}function we(e,t){if(1&e&&(s.TgZ(0,"div",83),s._uU(1,"\n                "),s.YNc(2,ve,1,0,"app-premium-badge",84),s._uU(3,"\n                "),s.YNc(4,ye,3,3,"a",85),s._uU(5,"\n              "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngIf",!e.organization&&!e.cipher.organizationId),s.xp6(2),s.Q6J("ngIf",e.organization&&!e.organization.useTotp||!e.organization&&!e.canAccessPremium&&e.cipher.organizationId&&!e.cipher.organizationUseTotp)}}const be=function(e){return{"stroke-dashoffset.px":e}};function Ue(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",76),s._uU(1,"\n                "),s.TgZ(2,"span",77),s._uU(3,"\n                  "),s.TgZ(4,"span",88),s._uU(5),s.qZA(),s._uU(6,"\n                  "),s.O4$(),s.TgZ(7,"svg"),s._uU(8,"\n                    "),s.TgZ(9,"g"),s._uU(10,"\n                      "),s._UZ(11,"circle",89),s._uU(12,"\n                      "),s._UZ(13,"circle",90),s._uU(14,"\n                    "),s.qZA(),s._uU(15,"\n                  "),s.qZA(),s._uU(16,"\n                "),s.qZA(),s._uU(17,"\n                "),s.kcU(),s.TgZ(18,"span",91),s.ALo(19,"i18n"),s._uU(20),s.qZA(),s._uU(21,"\n                "),s.TgZ(22,"button",92),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.copy(t.totpCode,"verificationCodeTotp","TOTP"))})),s.ALo(23,"i18n"),s._uU(24,"\n                  "),s._UZ(25,"i",44),s._uU(26,"\n                "),s.qZA(),s._uU(27,"\n              "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(e.totpSec),s.xp6(6),s.Q6J("ngStyle",s.VKq(9,be,e.totpDash)),s.xp6(7),s.s9C("title",s.lcZ(19,5,"verificationCodeTotp")),s.xp6(2),s.Oqu(e.totpCodeFormatted),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(23,7,"copyVerificationCode"))}}function _e(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n                      ",e.name,"\n                    ")}}function Ae(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",104),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(4);return s.KtG(i.removeUri(t))})),s.ALo(1,"i18n"),s._uU(2,"\n                    "),s._UZ(3,"i",105),s._uU(4,"\n                  "),s.qZA()}2&e&&s.s9C("appA11yTitle",s.lcZ(1,1,"remove"))}function Ze(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",94),s.ALo(1,"i18n"),s._uU(2,"\n              "),s.TgZ(3,"div",95),s._uU(4,"\n                "),s.TgZ(5,"label",96),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n                "),s.TgZ(9,"div",34),s._uU(10,"\n                  "),s.TgZ(11,"input",97),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.uri=t)})),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n                  "),s.TgZ(14,"div",41),s._uU(15,"\n                    "),s.TgZ(16,"button",42),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(4);return s.KtG(i.launch(t))})),s.ALo(17,"i18n"),s._uU(18,"\n                      "),s._UZ(19,"i",98),s._uU(20,"\n                    "),s.qZA(),s._uU(21,"\n                    "),s.TgZ(22,"button",54),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(4);return s.KtG(i.copy(t.uri,"uri","URI"))})),s.ALo(23,"i18n"),s._uU(24,"\n                      "),s._UZ(25,"i",44),s._uU(26,"\n                    "),s.qZA(),s._uU(27,"\n                  "),s.qZA(),s._uU(28,"\n                "),s.qZA(),s._uU(29,"\n              "),s.qZA(),s._uU(30,"\n              "),s.TgZ(31,"div",99),s._uU(32,"\n                "),s.TgZ(33,"div",37),s._uU(34,"\n                  "),s.TgZ(35,"label",96),s._uU(36),s.ALo(37,"i18n"),s.qZA(),s._uU(38,"\n                  "),s.TgZ(39,"a",100),s.ALo(40,"i18n"),s._uU(41,"\n                    "),s._UZ(42,"i",101),s._uU(43,"\n                  "),s.qZA(),s._uU(44,"\n                "),s.qZA(),s._uU(45,"\n                "),s.TgZ(46,"div",37),s._uU(47,"\n                  "),s.TgZ(48,"select",102),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.match=t)}))("change",(function(){const t=s.CHM(e).$implicit,i=s.oxw(4);return s.KtG(i.loginUriMatchChanged(t))})),s._uU(49,"\n                    "),s.YNc(50,_e,2,2,"option",29),s._uU(51,"\n                  "),s.qZA(),s._uU(52,"\n                  "),s.YNc(53,Ae,5,3,"button",103),s._uU(54,"\n                "),s.qZA(),s._uU(55,"\n              "),s.qZA(),s._uU(56,"\n            "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=s.oxw(4);s.uIk("aria-label",s.xi3(1,20,"uriPosition",i+1)),s.xp6(5),s.MGl("for","loginUri",i,""),s.xp6(1),s.Oqu(s.xi3(7,23,"uriPosition",i+1)),s.xp6(5),s.MGl("id","loginUri",i,"")("name","Login.Uris[",i,"].Uri")("placeholder","",s.lcZ(12,26,"ex")," https://google.com"),s.Q6J("ngModel",e.uri)("disabled",n.cipher.isDeleted||n.viewOnly),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(17,28,"launch")),s.Q6J("disabled",!e.canLaunch),s.xp6(6),s.s9C("appA11yTitle",s.lcZ(23,30,"copyUri")),s.xp6(13),s.MGl("for","loginUriMatch",i,""),s.xp6(1),s.hij("\n                    ",s.lcZ(37,32,"matchDetection"),"\n                  "),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(40,34,"learnMore")),s.xp6(9),s.MGl("id","loginUriMatch",i,"")("name","Login.Uris[",i,"].Match"),s.Q6J("ngModel",e.match)("disabled",n.cipher.isDeleted||n.viewOnly),s.xp6(2),s.Q6J("ngForOf",n.uriMatchOptions),s.xp6(3),s.Q6J("ngIf",!n.cipher.isDeleted&&!n.viewOnly)}}function xe(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n            "),s.YNc(2,Ze,57,36,"div",93),s._uU(3,"\n          "),s.BQk()),2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngForOf",e.cipher.login.uris)("ngForTrackBy",e.trackByFunction)}}function Se(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",106),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.addUri())})),s._uU(1,"\n            "),s._UZ(2,"i",107),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij(" ",s.lcZ(4,1,"newUri"),"\n          "))}const Te=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}},Ce=function(e){return{low:e}};function Oe(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"div",16),s._uU(3,"\n            "),s.TgZ(4,"div",17),s._uU(5,"\n              "),s.TgZ(6,"label",33),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n              "),s.TgZ(10,"div",34),s._uU(11,"\n                "),s.TgZ(12,"input",35),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.login.username=t)})),s.qZA(),s._uU(13,"\n                "),s.YNc(14,le,8,3,"div",36),s._uU(15,"\n              "),s.qZA(),s._uU(16,"\n            "),s.qZA(),s._uU(17,"\n            "),s.TgZ(18,"div",17),s._uU(19,"\n              "),s.TgZ(20,"div",37),s._uU(21,"\n                "),s.TgZ(22,"label",38),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n                "),s.YNc(26,de,16,11,"div",39),s._uU(27,"\n              "),s.qZA(),s._uU(28,"\n              "),s.TgZ(29,"div",34),s._uU(30,"\n                "),s.TgZ(31,"input",40),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.login.password=t)})),s.qZA(),s._uU(32,"\n                "),s.TgZ(33,"div",41),s._uU(34,"\n                  "),s.TgZ(35,"button",42),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.togglePassword())})),s.ALo(36,"i18n"),s._uU(37,"\n                    "),s._UZ(38,"i",43),s._uU(39,"\n                  "),s.qZA(),s._uU(40,"\n                  "),s.TgZ(41,"button",42),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.copy(t.cipher.login.password,"password","Password"))})),s.ALo(42,"i18n"),s._uU(43,"\n                    "),s._UZ(44,"i",44),s._uU(45,"\n                  "),s.qZA(),s._uU(46,"\n                "),s.qZA(),s._uU(47,"\n              "),s.qZA(),s._uU(48,"\n            "),s.qZA(),s._uU(49,"\n          "),s.qZA(),s._uU(50,"\n          "),s.YNc(51,pe,15,8,"div",45),s._uU(52,"\n          "),s.YNc(53,ge,20,9,"ng-container",21),s._uU(54,"\n          "),s.TgZ(55,"div",46),s._uU(56,"\n            "),s.TgZ(57,"div",47),s._uU(58,"\n              "),s.TgZ(59,"label",48),s._uU(60),s.ALo(61,"i18n"),s.qZA(),s._uU(62,"\n              "),s.TgZ(63,"input",49),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.login.totp=t)})),s.qZA(),s._uU(64,"\n            "),s.qZA(),s._uU(65,"\n            "),s.TgZ(66,"div",50),s._uU(67,"\n              "),s.YNc(68,me,24,5,"div",51),s._uU(69,"\n              "),s.YNc(70,we,6,2,"div",52),s._uU(71,"\n              "),s.YNc(72,Ue,28,11,"div",51),s._uU(73,"\n            "),s.qZA(),s._uU(74,"\n          "),s.qZA(),s._uU(75,"\n          "),s.YNc(76,xe,4,2,"ng-container",21),s._uU(77,"\n          "),s.YNc(78,Se,5,3,"a",53),s._uU(79,"\n        "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,29,"username")),s.xp6(5),s.Q6J("ngModel",e.cipher.login.username)("disabled",e.cipher.isDeleted||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),s.xp6(2),s.Q6J("ngIf",!e.cipher.isDeleted),s.xp6(9),s.Oqu(s.lcZ(24,31,"password")),s.xp6(3),s.Q6J("ngIf",!e.cipher.isDeleted&&!e.viewOnly),s.xp6(5),s.s9C("type",e.showPassword?"text":"password"),s.Q6J("ngModel",e.cipher.login.password)("disabled",e.cipher.isDeleted||!e.cipher.viewPassword||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),s.xp6(4),s.s9C("appA11yTitle",s.lcZ(36,33,"toggleVisibility")),s.Q6J("disabled",!e.cipher.viewPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(39,Te,!e.showPassword,e.showPassword)),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(42,35,"copyPassword")),s.Q6J("disabled",!e.cipher.viewPassword),s.xp6(10),s.Q6J("ngIf",e.showPasswordCount),s.xp6(2),s.Q6J("ngIf",e.cipher.login.hasFido2Credentials),s.xp6(7),s.Oqu(s.lcZ(61,37,"authenticatorKeyTotp")),s.xp6(3),s.s9C("type",e.cipher.viewPassword?"text":"password"),s.Q6J("ngModel",e.cipher.login.totp)("disabled",e.cipher.isDeleted||!e.cipher.viewPassword||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),s.xp6(3),s.Q6J("ngClass",s.VKq(42,Ce,e.totpLow)),s.xp6(2),s.Q6J("ngIf",!e.cipher.login.totp||!e.totpCode),s.xp6(2),s.Q6J("ngIf",!e.cipher.login.totp||!e.totpCode),s.xp6(2),s.Q6J("ngIf",e.cipher.login.totp&&e.totpCode),s.xp6(4),s.Q6J("ngIf",e.cipher.login.hasUris),s.xp6(2),s.Q6J("ngIf",!(e.cipher.isDeleted||e.viewOnly||!e.cipher.edit&&e.editMode))}}function ke(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n                    ",e.name,"\n                  ")}}function Pe(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"span"),s._uU(1,"\n                "),s.TgZ(2,"select",122),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.cipher.card.brand=t)})),s._uU(3,"\n                  "),s.YNc(4,ke,2,2,"option",29),s._uU(5,"\n                "),s.qZA(),s._uU(6,"\n              "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngModel",e.cipher.card.brand)("disabled",e.cipher.isDeleted||e.viewOnly),s.xp6(2),s.Q6J("ngForOf",e.cardBrandOptions)}}function qe(e,t){if(1&e&&(s._uU(0,"\n                "),s._UZ(1,"input",123),s._uU(2,"\n              ")),2&e){const e=s.oxw(3);s.xp6(1),s.Q6J("readonly",!0)("value",e.cipher.card.brand)}}function Ie(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n                    ",e.name,"\n                  ")}}function Me(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"span"),s._uU(1,"\n                "),s.TgZ(2,"select",124),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.cipher.card.expMonth=t)})),s._uU(3,"\n                  "),s.YNc(4,Ie,2,2,"option",29),s._uU(5,"\n                "),s.qZA(),s._uU(6,"\n              "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngModel",e.cipher.card.expMonth)("disabled",e.cipher.isDeleted||e.viewOnly),s.xp6(2),s.Q6J("ngForOf",e.cardExpMonthOptions)}}function Ne(e,t){if(1&e&&(s._uU(0,"\n                "),s._UZ(1,"input",125),s._uU(2,"\n              ")),2&e){const e=s.oxw(3);s.xp6(1),s.Q6J("readonly",!0)("value",e.getCardExpMonthDisplay())}}function Le(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"div",16),s._uU(3,"\n            "),s.TgZ(4,"div",17),s._uU(5,"\n              "),s.TgZ(6,"label",108),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n              "),s.TgZ(10,"input",109),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.cardholderName=t)})),s.qZA(),s._uU(11,"\n            "),s.qZA(),s._uU(12,"\n            "),s.TgZ(13,"div",17),s._uU(14,"\n              "),s.TgZ(15,"label",110),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n              "),s.YNc(19,Pe,7,3,"span",111),s._uU(20,"\n              "),s.YNc(21,qe,3,2,"ng-template",null,112,s.W1O),s._uU(23,"\n            "),s.qZA(),s._uU(24,"\n          "),s.qZA(),s._uU(25,"\n          "),s.TgZ(26,"div",16),s._uU(27,"\n            "),s.TgZ(28,"div",17),s._uU(29,"\n              "),s.TgZ(30,"label",113),s._uU(31),s.ALo(32,"i18n"),s.qZA(),s._uU(33,"\n              "),s.TgZ(34,"div",34),s._uU(35,"\n                "),s.TgZ(36,"input",114),s.NdJ("input",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.onCardNumberChange())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.number=t)})),s.qZA(),s._uU(37,"\n                "),s.TgZ(38,"div",41),s._uU(39,"\n                  "),s.TgZ(40,"button",54),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.toggleCardNumber())})),s.ALo(41,"i18n"),s._uU(42,"\n                    "),s._UZ(43,"i",43),s._uU(44,"\n                  "),s.qZA(),s._uU(45,"\n                  "),s.TgZ(46,"button",54),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.copy(t.cipher.card.number,"number","Number"))})),s.ALo(47,"i18n"),s._uU(48,"\n                    "),s._UZ(49,"i",44),s._uU(50,"\n                  "),s.qZA(),s._uU(51,"\n                "),s.qZA(),s._uU(52,"\n              "),s.qZA(),s._uU(53,"\n            "),s.qZA(),s._uU(54,"\n            "),s.TgZ(55,"div",115),s._uU(56,"\n              "),s.TgZ(57,"label",116),s._uU(58),s.ALo(59,"i18n"),s.qZA(),s._uU(60,"\n              "),s.YNc(61,Me,7,3,"span",111),s._uU(62,"\n              "),s.YNc(63,Ne,3,2,"ng-template",null,117,s.W1O),s._uU(65,"\n            "),s.qZA(),s._uU(66,"\n            "),s.TgZ(67,"div",115),s._uU(68,"\n              "),s.TgZ(69,"label",118),s._uU(70),s.ALo(71,"i18n"),s.qZA(),s._uU(72,"\n              "),s.TgZ(73,"input",119),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.expYear=t)})),s.ALo(74,"i18n"),s.qZA(),s._uU(75,"\n            "),s.qZA(),s._uU(76,"\n          "),s.qZA(),s._uU(77,"\n          "),s.TgZ(78,"div",16),s._uU(79,"\n            "),s.TgZ(80,"div",17),s._uU(81,"\n              "),s.TgZ(82,"label",120),s._uU(83),s.ALo(84,"i18n"),s.qZA(),s._uU(85,"\n              "),s.TgZ(86,"div",34),s._uU(87,"\n                "),s.TgZ(88,"input",121),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.code=t)})),s.qZA(),s._uU(89,"\n                "),s.TgZ(90,"div",41),s._uU(91,"\n                  "),s.TgZ(92,"button",54),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.toggleCardCode())})),s.ALo(93,"i18n"),s._uU(94,"\n                    "),s._UZ(95,"i",43),s._uU(96,"\n                  "),s.qZA(),s._uU(97,"\n                  "),s.TgZ(98,"button",54),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.copy(t.cipher.card.code,"securityCode","Security Code"))})),s.ALo(99,"i18n"),s._uU(100,"\n                    "),s._UZ(101,"i",44),s._uU(102,"\n                  "),s.qZA(),s._uU(103,"\n                "),s.qZA(),s._uU(104,"\n              "),s.qZA(),s._uU(105,"\n            "),s.qZA(),s._uU(106,"\n          "),s.qZA(),s._uU(107,"\n        "),s.BQk()}if(2&e){const e=s.MAs(22),t=s.MAs(64),i=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,31,"cardholderName")),s.xp6(3),s.Q6J("ngModel",i.cipher.card.cardholderName)("disabled",i.cipher.isDeleted||i.viewOnly)("readonly",!i.cipher.edit&&i.editMode),s.xp6(6),s.Oqu(s.lcZ(17,33,"brand")),s.xp6(3),s.Q6J("ngIf",!(!i.cipher.edit&&i.editMode))("ngIfElse",e),s.xp6(12),s.Oqu(s.lcZ(32,35,"number")),s.xp6(5),s.s9C("type",i.showCardNumber?"text":"password"),s.Q6J("ngModel",i.cipher.card.number)("disabled",i.cipher.isDeleted||i.viewOnly)("readonly",!i.cipher.edit&&i.editMode),s.xp6(4),s.s9C("appA11yTitle",s.lcZ(41,37,"toggleVisibility")),s.xp6(3),s.Q6J("ngClass",s.WLB(53,Te,!i.showCardNumber,i.showCardNumber)),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(47,39,"copyNumber")),s.xp6(12),s.Oqu(s.lcZ(59,41,"expirationMonth")),s.xp6(3),s.Q6J("ngIf",!(!i.cipher.edit&&i.editMode))("ngIfElse",t),s.xp6(9),s.Oqu(s.lcZ(71,43,"expirationYear")),s.xp6(3),s.MGl("placeholder","",s.lcZ(74,45,"ex")," 2019"),s.Q6J("ngModel",i.cipher.card.expYear)("disabled",i.cipher.isDeleted||i.viewOnly)("readonly",!i.cipher.edit&&i.editMode),s.xp6(10),s.Oqu(s.lcZ(84,47,"securityCode")),s.xp6(5),s.s9C("type",i.showCardCode?"text":"password"),s.Q6J("ngModel",i.cipher.card.code)("disabled",i.cipher.isDeleted||i.viewOnly)("readonly",!i.cipher.edit&&i.editMode),s.xp6(4),s.s9C("appA11yTitle",s.lcZ(93,49,"toggleVisibility")),s.xp6(3),s.Q6J("ngClass",s.WLB(56,Te,!i.showCardCode,i.showCardCode)),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(99,51,"securityCode"))}}function De(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n                    ",e.name,"\n                  ")}}function Ee(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"span"),s._uU(1,"\n                "),s.TgZ(2,"select",163),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.cipher.identity.title=t)})),s._uU(3,"\n                  "),s.YNc(4,De,2,2,"option",29),s._uU(5,"\n                "),s.qZA(),s._uU(6,"\n              "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngModel",e.cipher.identity.title)("disabled",e.cipher.isDeleted||e.viewOnly),s.xp6(2),s.Q6J("ngForOf",e.identityTitleOptions)}}function Fe(e,t){if(1&e&&(s._uU(0,"\n                "),s._UZ(1,"input",164),s._uU(2,"\n              ")),2&e){const e=s.oxw(3);s.xp6(1),s.Q6J("readonly",!0)("value",e.cipher.identity.title)}}function Re(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"div",16),s._uU(3,"\n            "),s.TgZ(4,"div",126),s._uU(5,"\n              "),s.TgZ(6,"label",127),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n              "),s.YNc(10,Ee,7,3,"span",111),s._uU(11,"\n              "),s.YNc(12,Fe,3,2,"ng-template",null,128,s.W1O),s._uU(14,"\n            "),s.qZA(),s._uU(15,"\n          "),s.qZA(),s._uU(16,"\n          "),s.TgZ(17,"div",16),s._uU(18,"\n            "),s.TgZ(19,"div",126),s._uU(20,"\n              "),s.TgZ(21,"label",129),s._uU(22),s.ALo(23,"i18n"),s.qZA(),s._uU(24,"\n              "),s.TgZ(25,"input",130),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.firstName=t)})),s.qZA(),s._uU(26,"\n            "),s.qZA(),s._uU(27,"\n            "),s.TgZ(28,"div",126),s._uU(29,"\n              "),s.TgZ(30,"label",131),s._uU(31),s.ALo(32,"i18n"),s.qZA(),s._uU(33,"\n              "),s.TgZ(34,"input",132),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.middleName=t)})),s.qZA(),s._uU(35,"\n            "),s.qZA(),s._uU(36,"\n            "),s.TgZ(37,"div",126),s._uU(38,"\n              "),s.TgZ(39,"label",133),s._uU(40),s.ALo(41,"i18n"),s.qZA(),s._uU(42,"\n              "),s.TgZ(43,"input",134),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.lastName=t)})),s.qZA(),s._uU(44,"\n            "),s.qZA(),s._uU(45,"\n          "),s.qZA(),s._uU(46,"\n          "),s.TgZ(47,"div",16),s._uU(48,"\n            "),s.TgZ(49,"div",126),s._uU(50,"\n              "),s.TgZ(51,"label",135),s._uU(52),s.ALo(53,"i18n"),s.qZA(),s._uU(54,"\n              "),s.TgZ(55,"input",136),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.username=t)})),s.qZA(),s._uU(56,"\n            "),s.qZA(),s._uU(57,"\n            "),s.TgZ(58,"div",126),s._uU(59,"\n              "),s.TgZ(60,"label",137),s._uU(61),s.ALo(62,"i18n"),s.qZA(),s._uU(63,"\n              "),s.TgZ(64,"input",138),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.company=t)})),s.qZA(),s._uU(65,"\n            "),s.qZA(),s._uU(66,"\n          "),s.qZA(),s._uU(67,"\n          "),s.TgZ(68,"div",16),s._uU(69,"\n            "),s.TgZ(70,"div",126),s._uU(71,"\n              "),s.TgZ(72,"label",139),s._uU(73),s.ALo(74,"i18n"),s.qZA(),s._uU(75,"\n              "),s.TgZ(76,"input",140),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.ssn=t)})),s.qZA(),s._uU(77,"\n            "),s.qZA(),s._uU(78,"\n            "),s.TgZ(79,"div",126),s._uU(80,"\n              "),s.TgZ(81,"label",141),s._uU(82),s.ALo(83,"i18n"),s.qZA(),s._uU(84,"\n              "),s.TgZ(85,"input",142),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.passportNumber=t)})),s.qZA(),s._uU(86,"\n            "),s.qZA(),s._uU(87,"\n            "),s.TgZ(88,"div",126),s._uU(89,"\n              "),s.TgZ(90,"label",143),s._uU(91),s.ALo(92,"i18n"),s.qZA(),s._uU(93,"\n              "),s.TgZ(94,"input",144),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.licenseNumber=t)})),s.qZA(),s._uU(95,"\n            "),s.qZA(),s._uU(96,"\n          "),s.qZA(),s._uU(97,"\n          "),s.TgZ(98,"div",16),s._uU(99,"\n            "),s.TgZ(100,"div",17),s._uU(101,"\n              "),s.TgZ(102,"label",145),s._uU(103),s.ALo(104,"i18n"),s.qZA(),s._uU(105,"\n              "),s.TgZ(106,"input",146),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.email=t)})),s.qZA(),s._uU(107,"\n            "),s.qZA(),s._uU(108,"\n            "),s.TgZ(109,"div",17),s._uU(110,"\n              "),s.TgZ(111,"label",147),s._uU(112),s.ALo(113,"i18n"),s.qZA(),s._uU(114,"\n              "),s.TgZ(115,"input",148),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.phone=t)})),s.qZA(),s._uU(116,"\n            "),s.qZA(),s._uU(117,"\n          "),s.qZA(),s._uU(118,"\n          "),s.TgZ(119,"div",16),s._uU(120,"\n            "),s.TgZ(121,"div",17),s._uU(122,"\n              "),s.TgZ(123,"label",149),s._uU(124),s.ALo(125,"i18n"),s.qZA(),s._uU(126,"\n              "),s.TgZ(127,"input",150),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.address1=t)})),s.qZA(),s._uU(128,"\n            "),s.qZA(),s._uU(129,"\n            "),s.TgZ(130,"div",17),s._uU(131,"\n              "),s.TgZ(132,"label",151),s._uU(133),s.ALo(134,"i18n"),s.qZA(),s._uU(135,"\n              "),s.TgZ(136,"input",152),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.address2=t)})),s.qZA(),s._uU(137,"\n            "),s.qZA(),s._uU(138,"\n          "),s.qZA(),s._uU(139,"\n          "),s.TgZ(140,"div",16),s._uU(141,"\n            "),s.TgZ(142,"div",17),s._uU(143,"\n              "),s.TgZ(144,"label",153),s._uU(145),s.ALo(146,"i18n"),s.qZA(),s._uU(147,"\n              "),s.TgZ(148,"input",154),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.address3=t)})),s.qZA(),s._uU(149,"\n            "),s.qZA(),s._uU(150,"\n            "),s.TgZ(151,"div",17),s._uU(152,"\n              "),s.TgZ(153,"label",155),s._uU(154),s.ALo(155,"i18n"),s.qZA(),s._uU(156,"\n              "),s.TgZ(157,"input",156),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.city=t)})),s.qZA(),s._uU(158,"\n            "),s.qZA(),s._uU(159,"\n          "),s.qZA(),s._uU(160,"\n          "),s.TgZ(161,"div",16),s._uU(162,"\n            "),s.TgZ(163,"div",17),s._uU(164,"\n              "),s.TgZ(165,"label",157),s._uU(166),s.ALo(167,"i18n"),s.qZA(),s._uU(168,"\n              "),s.TgZ(169,"input",158),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.state=t)})),s.qZA(),s._uU(170,"\n            "),s.qZA(),s._uU(171,"\n            "),s.TgZ(172,"div",17),s._uU(173,"\n              "),s.TgZ(174,"label",159),s._uU(175),s.ALo(176,"i18n"),s.qZA(),s._uU(177,"\n              "),s.TgZ(178,"input",160),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.postalCode=t)})),s.qZA(),s._uU(179,"\n            "),s.qZA(),s._uU(180,"\n          "),s.qZA(),s._uU(181,"\n          "),s.TgZ(182,"div",16),s._uU(183,"\n            "),s.TgZ(184,"div",17),s._uU(185,"\n              "),s.TgZ(186,"label",161),s._uU(187),s.ALo(188,"i18n"),s.qZA(),s._uU(189,"\n              "),s.TgZ(190,"input",162),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.country=t)})),s.qZA(),s._uU(191,"\n            "),s.qZA(),s._uU(192,"\n          "),s.qZA(),s._uU(193,"\n        "),s.BQk()}if(2&e){const e=s.MAs(13),t=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,71,"title")),s.xp6(3),s.Q6J("ngIf",!(!t.cipher.edit&&t.editMode))("ngIfElse",e),s.xp6(12),s.Oqu(s.lcZ(23,73,"firstName")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.firstName)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(32,75,"middleName")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.middleName)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(41,77,"lastName")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.lastName)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(53,79,"username")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.username)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(62,81,"company")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.company)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(74,83,"ssn")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.ssn)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(83,85,"passportNumber")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.passportNumber)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(92,87,"licenseNumber")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.licenseNumber)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(104,89,"email")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.email)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(113,91,"phone")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.phone)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(125,93,"address1")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.address1)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(134,95,"address2")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.address2)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(146,97,"address3")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.address3)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(155,99,"cityTown")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.city)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(167,101,"stateProvince")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.state)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(176,103,"zipPostalCode")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.postalCode)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(188,105,"country")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.country)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode)}}function Je(e,t){if(1&e&&s._UZ(0,"app-vault-add-edit-custom-fields",165),2&e){const e=s.oxw(2);s.Q6J("cipher",e.cipher)("thisCipherType",e.cipher.type)("viewOnly",e.viewOnly)("copy",e.copy.bind(e))("editMode",e.editMode)}}function ze(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function Ye(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"h3",166),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"div",16),s._uU(7,"\n            "),s.TgZ(8,"div",167),s._uU(9,"\n              "),s.TgZ(10,"label",168),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n              "),s.TgZ(14,"select",169),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.organizationId=t)}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.organizationChanged())})),s._uU(15,"\n                "),s.YNc(16,ze,2,2,"option",29),s._uU(17,"\n              "),s.qZA(),s._uU(18,"\n            "),s.qZA(),s._uU(19,"\n          "),s.qZA(),s._uU(20,"\n        "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,5,"ownership")),s.xp6(8),s.Oqu(s.lcZ(12,7,"whoOwnsThisItem")),s.xp6(3),s.Q6J("ngModel",e.cipher.organizationId)("disabled",e.cipher.isDeleted||e.viewOnly),s.xp6(2),s.Q6J("ngForOf",e.ownershipOptions)}}function Ke(e,t){1&e&&(s.TgZ(0,"div"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n            ",s.lcZ(2,1,"noCollectionsInList"),"\n          "))}function Be(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",171),s._uU(1,"\n              "),s.TgZ(2,"input",172),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.checked=t)})),s.qZA(),s._uU(3,"\n              "),s.TgZ(4,"label",173),s._uU(5),s.qZA(),s._uU(6,"\n            "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=s.oxw(4);s.xp6(2),s.MGl("id","collection-",i,"")("name","Collection[",i,"].Checked"),s.Q6J("ngModel",e.checked)("disabled",n.cipher.isDeleted||n.viewOnly),s.xp6(2),s.MGl("for","collection-",i,""),s.xp6(1),s.Oqu(e.name)}}function Qe(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n            "),s.YNc(2,Be,7,6,"div",170),s._uU(3,"\n          "),s.BQk()),2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngForOf",e.collections)}}function Ge(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"h3",166),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.YNc(6,Ke,3,3,"div",21),s._uU(7,"\n          "),s.YNc(8,Qe,4,1,"ng-container",21),s._uU(9,"\n        "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,3,"collections")),s.xp6(3),s.Q6J("ngIf",!e.collections||!e.collections.length),s.xp6(2),s.Q6J("ngIf",e.collections&&e.collections.length)}}function je(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n              "),s.TgZ(2,"b",175),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.ALo(6,"date"),s.qZA()),2&e){const e=s.oxw(3);s.xp6(3),s.hij("",s.lcZ(4,2,"dateCreated"),":"),s.xp6(2),s.hij("\n              ",s.xi3(6,4,e.cipher.creationDate,"medium"),"\n            ")}}function Ve(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n              "),s.TgZ(2,"b",175),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.ALo(6,"date"),s.qZA()),2&e){const e=s.oxw(3);s.xp6(3),s.hij("",s.lcZ(4,2,"datePasswordUpdated"),":"),s.xp6(2),s.hij("\n              ",s.xi3(6,4,e.cipher.passwordRevisionDisplayDate,"medium"),"\n            ")}}function $e(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div"),s._uU(1,"\n              "),s.TgZ(2,"b",175),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n              "),s.TgZ(6,"a",176),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.viewHistory())})),s.ALo(7,"i18n"),s._uU(8),s.qZA(),s._uU(9,"\n            "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.hij("",s.lcZ(4,3,"passwordHistory"),":"),s.xp6(3),s.s9C("title",s.lcZ(7,5,"view")),s.xp6(2),s.hij("\n                ",e.cipher.passwordHistory.length,"\n              ")}}function He(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1),s.ALo(2,"date"),s._UZ(3,"bit-color-password",178),s._uU(4,"\n              "),s.qZA()),2&e){const e=t.$implicit;s.xp6(1),s.hij("\n                ",s.xi3(2,2,e.lastUsedDate,"short")," -\n                "),s.xp6(2),s.Q6J("password",e.password)}}function We(e,t){if(1&e&&(s.TgZ(0,"div",86),s._uU(1,"\n              "),s.YNc(2,He,5,5,"div",177),s._uU(3,"\n            "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngForOf",e.cipher.passwordHistory)}}function Xe(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"div",174),s._uU(3,"\n            "),s.TgZ(4,"div"),s._uU(5,"\n              "),s.TgZ(6,"b",175),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9),s.ALo(10,"date"),s.qZA(),s._uU(11,"\n            "),s.YNc(12,je,7,7,"div",21),s._uU(13,"\n            "),s.YNc(14,Ve,7,7,"div",21),s._uU(15,"\n            "),s.YNc(16,$e,10,7,"div",21),s._uU(17,"\n            "),s.YNc(18,We,4,1,"div",84),s._uU(19,"\n          "),s.qZA(),s._uU(20,"\n        "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(7),s.hij("",s.lcZ(8,6,"dateUpdated"),":"),s.xp6(2),s.hij("\n              ",s.xi3(10,8,e.cipher.revisionDate,"medium"),"\n            "),s.xp6(3),s.Q6J("ngIf",e.cipher.creationDate),s.xp6(2),s.Q6J("ngIf",e.showRevisionDate),s.xp6(2),s.Q6J("ngIf",e.hasPasswordHistory),s.xp6(2),s.Q6J("ngIf",e.viewingPasswordHistory)}}function et(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"h3",166),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"div",171),s._uU(7,"\n            "),s.TgZ(8,"input",179),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.repromptChanged())})),s.qZA(),s._uU(9,"\n            "),s.TgZ(10,"label",180),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n            "),s.TgZ(14,"a",181),s.ALo(15,"i18n"),s._uU(16,"\n              "),s._UZ(17,"i",101),s._uU(18,"\n            "),s.qZA(),s._uU(19,"\n          "),s.qZA(),s._uU(20,"\n        "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,5,"options")),s.xp6(5),s.Q6J("ngModel",e.reprompt)("disabled",e.cipher.isDeleted||e.viewOnly||!e.cipher.edit&&e.editMode),s.xp6(3),s.Oqu(s.lcZ(12,7,"passwordPrompt")),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(15,9,"learnMore"))}}function tt(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",13),s._uU(1,"\n        "),s.YNc(2,ne,3,3,"app-callout",14),s._uU(3,"\n        "),s.YNc(4,oe,14,6,"div",15),s._uU(5,"\n        "),s.TgZ(6,"div",16),s._uU(7,"\n          "),s.TgZ(8,"div",17),s._uU(9,"\n            "),s.TgZ(10,"label",18),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n            "),s.TgZ(14,"input",19),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.cipher.name=t)})),s.qZA(),s._uU(15,"\n          "),s.qZA(),s._uU(16,"\n          "),s.YNc(17,ae,12,8,"div",20),s._uU(18,"\n        "),s.qZA(),s._uU(19,"\n        "),s._uU(20,"\n        "),s.YNc(21,Oe,80,44,"ng-container",21),s._uU(22,"\n        "),s._uU(23,"\n        "),s.YNc(24,Le,108,59,"ng-container",21),s._uU(25,"\n        "),s._uU(26,"\n        "),s.YNc(27,Re,194,107,"ng-container",21),s._uU(28,"\n        "),s.TgZ(29,"div",22),s._uU(30,"\n          "),s.TgZ(31,"label",23),s._uU(32),s.ALo(33,"i18n"),s.qZA(),s._uU(34,"\n          "),s.TgZ(35,"textarea",24),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.cipher.notes=t)})),s.qZA(),s._uU(36,"\n        "),s.qZA(),s._uU(37,"\n        "),s.YNc(38,Je,1,5,"app-vault-add-edit-custom-fields",25),s._uU(39,"\n        "),s.YNc(40,Ye,21,9,"ng-container",21),s._uU(41,"\n        "),s.YNc(42,Ge,10,5,"ng-container",21),s._uU(43,"\n        "),s.YNc(44,Xe,21,11,"ng-container",21),s._uU(45,"\n        "),s.YNc(46,et,21,11,"ng-container",21),s._uU(47,"\n      "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.allowOwnershipAssignment()&&!e.allowPersonal),s.xp6(2),s.Q6J("ngIf",!e.editMode&&!e.viewOnly),s.xp6(7),s.Oqu(s.lcZ(12,19,"name")),s.xp6(3),s.Q6J("ngModel",e.cipher.name)("disabled",e.cipher.isDeleted||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),s.xp6(3),s.Q6J("ngIf",!e.organization),s.xp6(4),s.Q6J("ngIf",e.cipher.type===e.cipherType.Login),s.xp6(3),s.Q6J("ngIf",e.cipher.type===e.cipherType.Card),s.xp6(3),s.Q6J("ngIf",e.cipher.type===e.cipherType.Identity),s.xp6(5),s.Oqu(s.lcZ(33,21,"notes")),s.xp6(3),s.Q6J("ngModel",e.cipher.notes)("disabled",e.cipher.isDeleted||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),s.xp6(3),s.Q6J("ngIf",!(!e.cipher.hasFields&&!e.cipher.edit&&e.editMode)),s.xp6(2),s.Q6J("ngIf",e.allowOwnershipAssignment()),s.xp6(2),s.Q6J("ngIf",(!e.editMode||e.cloneMode)&&e.cipher.organizationId),s.xp6(2),s.Q6J("ngIf",e.editMode),s.xp6(2),s.Q6J("ngIf",e.canUseReprompt)}}function it(e,t){if(1&e&&(s.TgZ(0,"button",182),s._uU(1,"\n          "),s._UZ(2,"i",183),s.ALo(3,"i18n"),s._uU(4,"\n          "),s.TgZ(5,"span"),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n        "),s.qZA()),2&e){const e=s.oxw(),t=s.MAs(5);s.Q6J("disabled",t.loading),s.xp6(2),s.s9C("title",s.lcZ(3,3,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,5,null!=e.cipher&&e.cipher.isDeleted?"restore":"save"))}}const nt=function(e,t){return{"bwi-star-f":e,"bwi-star":t}};function st(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",187),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.toggleFavorite())})),s.ALo(1,"i18n"),s._uU(2,"\n            "),s._UZ(3,"i",43),s._uU(4,"\n          "),s.qZA()}if(2&e){const e=s.oxw(2);s.s9C("appA11yTitle",s.lcZ(1,2,e.cipher.favorite?"unfavorite":"favorite")),s.xp6(3),s.Q6J("ngClass",s.WLB(4,nt,e.cipher.favorite,!e.cipher.favorite))}}function ot(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",188,189),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.delete())})),s.ALo(2,"i18n"),s._uU(3,"\n            "),s._UZ(4,"i",190),s._uU(5,"\n            "),s._UZ(6,"i",191),s.ALo(7,"i18n"),s._uU(8,"\n          "),s.qZA()}if(2&e){const e=s.MAs(1),t=s.oxw(2);s.s9C("appA11yTitle",s.lcZ(2,6,t.cipher.isDeleted?"permanentlyDelete":"delete")),s.Q6J("disabled",e.loading)("appApiAction",t.deletePromise),s.xp6(4),s.Q6J("hidden",e.loading),s.xp6(2),s.s9C("title",s.lcZ(7,8,"loading")),s.Q6J("hidden",!e.loading)}}function rt(e,t){if(1&e&&(s.TgZ(0,"div",184),s._uU(1,"\n          "),s.YNc(2,st,5,7,"button",185),s._uU(3,"\n          "),s.YNc(4,ot,9,10,"button",186),s._uU(5,"\n        "),s.qZA()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",!e.organization&&!e.cipher.isDeleted),s.xp6(2),s.Q6J("ngIf",e.editMode&&!e.cloneMode&&!(!e.cipher.edit&&e.editMode))}}class at extends F{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v,y,w){super(e,t,i,n,s,o,r,c,u,d,h,g,p,f,m,window,v,y),this.totpService=a,this.passwordGenerationService=l,this.messagingService=c,this.policyService=d,this.billingAccountProfileStateService=w,this.showRevisionDate=!1,this.hasPasswordHistory=!1,this.viewingPasswordHistory=!1,this.viewOnly=!1,this.showPasswordCount=!1,this.componentName="app-vault-add-edit"}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return ie(this,void 0,void 0,(function*(){if(yield e.ngOnInit.call(this),yield this.load(),!this.cloneMode&&this.editMode||(this.title=this.i18nService.t("newItem")),this.showRevisionDate=null!=this.cipher.passwordRevisionDisplayDate,this.hasPasswordHistory=this.cipher.hasPasswordHistory,this.cleanUp(),this.canAccessPremium=yield(0,n.z)(this.billingAccountProfileStateService.hasPremiumFromAnySource$),this.showTotp()){yield this.totpUpdateCode();const e=this.totpService.getTimeInterval(this.cipher.login.totp);yield this.totpTick(e),this.totpInterval=window.setInterval((()=>ie(this,void 0,void 0,(function*(){yield this.totpTick(e)}))),1e3)}}))}ngOnDestroy(){super.ngOnDestroy()}toggleFavorite(){this.cipher.favorite=!this.cipher.favorite}togglePassword(){super.togglePassword(),!this.showPassword&&this.showPasswordCount&&this.togglePasswordCount()}togglePasswordCount(){this.showPasswordCount=!this.showPasswordCount,this.editMode&&this.showPasswordCount&&this.eventCollectionService.collect(u.tw.Cipher_ClientToggledPasswordVisible,this.cipherId)}launch(e){e.canLaunch&&this.platformUtilsService.launchUri(e.launchUri)}copy(e,t,i){return ie(this,void 0,void 0,(function*(){return null!=e&&(this.platformUtilsService.copyToClipboard(e,{window}),this.platformUtilsService.showToast("info",null,this.i18nService.t("valueCopied",this.i18nService.t(t))),this.editMode&&("password"===t?this.eventCollectionService.collect(u.tw.Cipher_ClientCopiedPassword,this.cipherId):"securityCode"===t?this.eventCollectionService.collect(u.tw.Cipher_ClientCopiedCardCode,this.cipherId):"H_Field"===i&&this.eventCollectionService.collect(u.tw.Cipher_ClientCopiedHiddenField,this.cipherId)),!0)}))}generatePassword(){const e=Object.create(null,{generatePassword:{get:()=>super.generatePassword}});var t,i;return ie(this,void 0,void 0,(function*(){const n=yield e.generatePassword.call(this);if(n){const e=null!==(i=null===(t=yield this.passwordGenerationService.getOptions())||void 0===t?void 0:t[0])&&void 0!==i?i:{};this.cipher.login.password=yield this.passwordGenerationService.generatePassword(e)}return n}))}premiumRequired(){this.canAccessPremium||this.messagingService.send("premiumRequired")}upgradeOrganization(){this.messagingService.send("upgradeOrganization",{organizationId:this.cipher.organizationId})}showGetPremium(){this.canAccessPremium||(this.cipher.organizationUseTotp?this.upgradeOrganization():this.premiumRequired())}viewHistory(){this.viewingPasswordHistory=!this.viewingPasswordHistory}cleanUp(){this.totpInterval&&window.clearInterval(this.totpInterval)}totpUpdateCode(){return ie(this,void 0,void 0,(function*(){if(null!=this.cipher&&this.cipher.type===f.Ou.Login&&null!=this.cipher.login.totp)if(this.totpCode=yield this.totpService.getCode(this.cipher.login.totp),null!=this.totpCode)if(this.totpCode.length>4){const e=Math.floor(this.totpCode.length/2);this.totpCodeFormatted=this.totpCode.substring(0,e)+" "+this.totpCode.substring(e)}else this.totpCodeFormatted=this.totpCode;else this.totpCodeFormatted=null,this.totpInterval&&window.clearInterval(this.totpInterval);else this.totpInterval&&window.clearInterval(this.totpInterval)}))}allowOwnershipAssignment(){return(!this.editMode||this.cloneMode)&&null!=this.ownershipOptions&&(this.ownershipOptions.length>1||!this.allowPersonal)}showTotp(){var e;return this.cipher.type===f.Ou.Login&&this.cipher.login.totp&&(null===(e=this.organization)||void 0===e?void 0:e.planProductType)!=u.kv.Free&&(this.cipher.organizationUseTotp||this.canAccessPremium)}totpTick(e){return ie(this,void 0,void 0,(function*(){const t=Math.round((new Date).getTime()/1e3)%e;this.totpSec=e-t,this.totpDash=+(Math.round(78.6/e*t+"e+2")+"e-2"),this.totpLow=this.totpSec<=7,0===t&&(yield this.totpUpdateCode())}))}}at.ɵfac=function(e){return new(e||at)(s.Y36(Z.u),s.Y36(x.s),s.Y36(S.D),s.Y36(T.P),s.Y36(C.C),s.Y36(O.b),s.Y36(k.a),s.Y36(J.w),s.Y36(R.UW),s.Y36(h.o),s.Y36(P.j),s.Y36(q.d),s.Y36(l.Mn),s.Y36(I.$),s.Y36(A.C),s.Y36(M.e),s.Y36(N.x),s.Y36(L.uU),s.Y36(D.E),s.Y36(Y.M))},at.ɵcmp=s.Xpm({type:at,selectors:[["app-vault-add-edit"]],features:[s.qOj],decls:36,vars:11,consts:[["role","dialog","aria-modal","true","aria-labelledby","cipherAddEditTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],["ngNativeValidate","","autocomplete","off",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","cipherAddEditTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit",3,"disabled",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["class","ml-auto",4,"ngIf"],[1,"modal-body"],["type","info",4,"ngIf"],["class","row",4,"ngIf"],[1,"row"],[1,"col-6","form-group"],["for","name"],["id","name","type","text","name","Name","required","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["class","col-6 form-group",4,"ngIf"],[4,"ngIf"],[1,"form-group"],["for","notes"],["id","notes","name","Notes","rows","6",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],[3,"cipher","thisCipherType","viewOnly","copy","editMode",4,"ngIf"],["type","info"],["for","type"],["id","type","name","Type","appAutofocus","",1,"form-control",3,"ngModel","disabled","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],["for","folder"],["id","folder","name","FolderId",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","loginUsername"],[1,"input-group"],["id","loginUsername","type","text","name","Login.Username","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["class","input-group-append",4,"ngIf"],[1,"d-flex"],["for","loginPassword"],["class","ml-auto d-flex",4,"ngIf"],["id","loginPassword","name","Login.Password","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","readonly","ngModelChange"],[1,"input-group-append"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","disabled","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone"],["class","tw-mb-4",4,"ngIf"],[1,"tw-flex","tw-flex-row"],[1,"tw-mb-4","tw-w-1/2"],["for","loginTotp"],["id","loginTotp","name","Login.Totp","appInputVerbatim","",1,"form-control","text-monospace",3,"type","ngModel","disabled","readonly","ngModelChange"],[1,"tw-mb-4","tw-ml-4","tw-flex","tw-w-1/2","tw-items-end",3,"ngClass"],["class","totp tw-flex tw-flex-row tw-items-center",4,"ngIf"],["class","tw-pb-2",4,"ngIf"],["href","#","appStopClick","","class","d-inline-block mb-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","click"],[1,"ml-auto","d-flex"],["href","#","class","d-block mr-2 bwi-icon-above-input","appStopClick","",3,"appA11yTitle","click",4,"ngIf"],["href","#","appStopClick","",1,"d-block","bwi-icon-above-input",3,"appA11yTitle","appApiAction","click"],["checkPasswordBtn",""],["aria-hidden","true",1,"bwi","bwi-lg","bwi-fw","bwi-check-circle",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-fw","bwi-spinner","bwi-spin",3,"hidden","title"],["href","#","class","d-block bwi-icon-above-input","appStopClick","",3,"appA11yTitle","click",4,"ngIf"],["href","#","appStopClick","",1,"d-block","mr-2","bwi-icon-above-input",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-fw","bwi-generate"],["href","#","appStopClick","",1,"d-block","bwi-icon-above-input",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-fw","bwi-numbered-list"],[1,"tw-mb-4"],[1,"tw-flex","tw-justify-between"],[3,"password","showCount"],["type","button","bitLink","",3,"click"],["for","loginFido2credential"],["tabindex","0",1,"tw-flex","tw-flex-row"],["id","loginFido2credential","type","text","name","Login.Fido2credential","appInputVerbatim","","disabled","","readonly","",1,"form-control",3,"value"],["type","button","class","tw-items-center tw-border-none tw-bg-transparent tw-text-danger tw-ml-3",3,"appA11yTitle","click",4,"ngIf"],["type","button",1,"tw-items-center","tw-border-none","tw-bg-transparent","tw-text-danger","tw-ml-3",3,"appA11yTitle","click"],[1,"bwi","bwi-lg","bwi-minus-circle"],[1,"totp","tw-flex","tw-flex-row","tw-items-center"],[1,"totp-countdown"],[1,"totp-sec","tw-text-muted"],["r","12.6","cy","16","cx","16","opacity","0.25",1,"totp-circle-muted","inner",3,"ngStyle"],["opacity","0.25","r","14","cy","16","cx","16",1,"totp-circle-muted","outer"],[1,"totp-code","tw-ml-2","tw-mr-3","tw-text-muted",3,"title"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone","tw-text-muted"],[1,"tw-pb-2"],["class","ml-3",4,"ngIf"],["href","#","appStopClick","","bitBadge","","variant","primary","class","tw-ml-4",3,"click",4,"ngIf"],[1,"ml-3"],["href","#","appStopClick","","bitBadge","","variant","primary",1,"tw-ml-4",3,"click"],[1,"totp-sec"],["r","12.6","cy","16","cx","16",1,"totp-circle","inner",3,"ngStyle"],["r","14","cy","16","cx","16",1,"totp-circle","outer"],[1,"totp-code","tw-mx-2","tw-mt-1",3,"title"],["type","button",1,"tw-items-center","tw-border-none","tw-bg-transparent","tw-text-primary-600",3,"appA11yTitle","click"],["role","group","class","row",4,"ngFor","ngForOf","ngForTrackBy"],["role","group",1,"row"],[1,"col-7","form-group"],[3,"for"],["type","text","appInputVerbatim","",1,"form-control",3,"id","name","ngModel","disabled","placeholder","ngModelChange"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-share-square"],[1,"col-5","form-group"],["href","https://bitwarden.com/help/uri-match-detection/","target","_blank","rel","noreferrer",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],[1,"form-control","overflow-hidden",3,"id","name","ngModel","disabled","ngModelChange","change"],["type","button","class","btn btn-link text-danger ml-2",3,"appA11yTitle","click",4,"ngIf"],["type","button",1,"btn","btn-link","text-danger","ml-2",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-minus-circle","bwi-lg"],["href","#","appStopClick","",1,"d-inline-block","mb-3",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus-circle","bwi-fw"],["for","cardCardholderName"],["id","cardCardholderName","type","text","name","Card.CardCardholderName",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","cardBrand"],[4,"ngIf","ngIfElse"],["readonlyCardBrand",""],["for","cardNumber"],["id","cardNumber","name","Card.Number","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","readonly","input","ngModelChange"],[1,"col","form-group"],["for","cardExpMonth"],["readonlyCardExpMonth",""],["for","cardExpYear"],["id","cardExpYear","type","text","name","Card.ExpYear",1,"form-control",3,"ngModel","placeholder","disabled","readonly","ngModelChange"],["for","cardCode"],["id","cardCode","name","Card.Code","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","readonly","ngModelChange"],["id","cardBrand","name","Card.Brand",1,"form-control",3,"ngModel","disabled","ngModelChange"],["id","cardBrand","name","Card.Brand","type","text",1,"form-control",3,"readonly","value"],["id","cardExpMonth","name","Card.ExpMonth",1,"form-control",3,"ngModel","disabled","ngModelChange"],["id","cardExpMonth","type","text","name","Card.ExpMonth",1,"form-control",3,"readonly","value"],[1,"col-4","form-group"],["for","idTitle"],["readonlyIdTitle",""],["for","idFirstName"],["id","idFirstName","type","text","name","Identity.FirstName",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idMiddleName"],["id","idMiddleName","type","text","name","Identity.MiddleName",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idLastName"],["id","idLastName","type","text","name","Identity.LastName",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idUsername"],["id","idUsername","type","text","name","Identity.Username","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idCompany"],["id","idCompany","type","text","name","Identity.Company",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idSsn"],["id","idSsn","type","text","name","Identity.SSN","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idPassportNumber"],["id","idPassportNumber","type","text","name","Identity.PassportNumber","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idLicenseNumber"],["id","idLicenseNumber","type","text","name","Identity.LicenseNumber","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idEmail"],["id","idEmail","type","text","inputmode","email","name","Identity.Email","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idPhone"],["id","idPhone","type","text","inputmode","tel","name","Identity.Phone",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idAddress1"],["id","idAddress1","type","text","name","Identity.Address1",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idAddress2"],["id","idAddress2","type","text","name","Identity.Address2",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idAddress3"],["id","idAddress3","type","text","name","Identity.Address3",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idCity"],["id","idCity","type","text","name","Identity.City",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idState"],["id","idState","type","text","name","Identity.State",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idPostalCode"],["id","idPostalCode","type","text","name","Identity.PostalCode",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idCountry"],["id","idCountry","type","text","name","Identity.Country",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["id","idTitle","name","Identity.Title",1,"form-control",3,"ngModel","disabled","ngModelChange"],["id","idTitle","name","Identity.Title","type","text",1,"form-control",3,"readonly","value"],[3,"cipher","thisCipherType","viewOnly","copy","editMode"],[1,"mt-4"],[1,"col-5"],["for","organizationId"],["id","organizationId","name","OrganizationId",1,"form-control",3,"ngModel","disabled","ngModelChange","change"],["class","form-check",4,"ngFor","ngForOf"],[1,"form-check"],["type","checkbox",1,"form-check-input",3,"ngModel","id","name","disabled","ngModelChange"],[1,"form-check-label",3,"for"],[1,"small","text-muted","mt-4"],[1,"font-weight-semibold"],["href","#","appStopClick","",3,"title","click"],[4,"ngFor","ngForOf"],[3,"password"],["type","checkbox","id","passwordPrompt","name","passwordPrompt",1,"form-check-input",3,"ngModel","disabled","change"],["for","passwordPrompt",1,"form-check-label"],["target","_blank","rel","noreferrer","href","https://bitwarden.com/help/managing-items/#protect-individual-items",3,"appA11yTitle"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],[1,"ml-auto"],["type","button","class","btn btn-link",3,"appA11yTitle","click",4,"ngIf"],["type","button","class","btn btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click",4,"ngIf"],["type","button",1,"btn","btn-link",3,"appA11yTitle","click"],["type","button",1,"btn","btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click"],["deleteBtn",""],["aria-hidden","true",1,"bwi","bwi-trash","bwi-lg","bwi-fw",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-lg","bwi-fw",3,"hidden","title"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"form",2,3),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(6,"\n      "),s.TgZ(7,"div",4),s._uU(8,"\n        "),s.TgZ(9,"h1",5),s._uU(10),s.qZA(),s._uU(11,"\n        "),s.TgZ(12,"button",6),s.ALo(13,"i18n"),s._uU(14,"\n          "),s.TgZ(15,"span",7),s._uU(16,"×"),s.qZA(),s._uU(17,"\n        "),s.qZA(),s._uU(18,"\n      "),s.qZA(),s._uU(19,"\n      "),s.YNc(20,tt,48,23,"div",8),s._uU(21,"\n      "),s.TgZ(22,"div",9),s._uU(23,"\n        "),s.YNc(24,it,9,7,"button",10),s._uU(25,"\n        "),s.TgZ(26,"button",11),s._uU(27),s.ALo(28,"i18n"),s.qZA(),s._uU(29,"\n        "),s.YNc(30,rt,6,2,"div",12),s._uU(31,"\n      "),s.qZA(),s._uU(32,"\n    "),s.qZA(),s._uU(33,"\n  "),s.qZA(),s._uU(34,"\n"),s.qZA(),s._uU(35,"\n")),2&e&&(s.xp6(4),s.Q6J("appApiAction",t.formPromise),s.xp6(6),s.Oqu(t.title),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(13,7,"close")),s.xp6(8),s.Q6J("ngIf",t.cipher),s.xp6(4),s.Q6J("ngIf",!t.viewOnly),s.xp6(3),s.hij("\n          ",s.lcZ(28,9,t.viewOnly?"close":"cancel"),"\n        "),s.xp6(3),s.Q6J("ngIf",t.cipher&&!t.viewOnly))},dependencies:[L.mk,L.sg,L.O5,L.PC,K.YN,K.Kr,K.Fj,K.Wl,K.EJ,K.JJ,K.JL,K.Q7,K.On,K.F,B.B,Q.b,z.U,G.O,j.b,V.O,$.l,H.L,W._,X.P,ee.R,L.Ov,L.uU,te.C],encapsulation:2})},77140:(e,t,i)=>{"use strict";i.d(t,{t:()=>P});var n=i(91548),s=i(85762),o=i(92236),r=i(78627),a=i(76528),l=i(58172),c=i(99721),u=i(55602),d=i(66459),p=i(53481),h=i(73369),g=i(384),f=i(28508),m=i(37513),v=i(33245),y=i(24610),w=i(2051),b=i(82933),U=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function _(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.Oqu(e.cipher.name)}}function A(e,t){1&e&&s._UZ(0,"i",24)}function Z(e,t){1&e&&s._UZ(0,"i",25)}function x(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",26),s._uU(1,"\n                    "),s.TgZ(2,"a",27),s._uU(3,"\n                      "),s._UZ(4,"i",28),s.ALo(5,"i18n"),s._uU(6,"\n                      "),s.TgZ(7,"span",29),s._uU(8),s.ALo(9,"i18n"),s.qZA()(),s._uU(10,"\n                    "),s.TgZ(11,"button",30,31),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(2);return s.KtG(i.reupload(t))})),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n                  "),s.qZA()}if(2&e){const e=s.MAs(12),t=s.oxw().$implicit,i=s.oxw(2);s.xp6(4),s.s9C("title",s.lcZ(5,5,"attachmentFixDescription")),s.xp6(4),s.Oqu(s.lcZ(9,7,"attachmentFixDescription")),s.xp6(3),s.Q6J("appApiAction",i.reuploadPromises[t.id])("disabled",e.loading),s.xp6(2),s.hij("\n                      ",s.lcZ(14,9,"fix"),"\n                    ")}}function S(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"td",32),s._uU(1,"\n                "),s.TgZ(2,"button",33,34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(2);return s.KtG(i.delete(t))})),s.ALo(4,"i18n"),s._uU(5,"\n                  "),s._UZ(6,"i",35),s._uU(7,"\n                  "),s._UZ(8,"i",36),s.ALo(9,"i18n"),s._uU(10,"\n                "),s.qZA(),s._uU(11,"\n              "),s.qZA()}if(2&e){const e=s.MAs(3),t=s.oxw().$implicit,i=s.oxw(2);s.xp6(2),s.s9C("appA11yTitle",s.lcZ(4,6,"delete")),s.Q6J("appApiAction",i.deletePromises[t.id])("disabled",e.loading),s.xp6(4),s.Q6J("hidden",e.loading),s.xp6(2),s.s9C("title",s.lcZ(9,8,"loading")),s.Q6J("hidden",!e.loading)}}function T(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr"),s._uU(1,"\n              "),s.TgZ(2,"td",16),s._uU(3,"\n                "),s.YNc(4,A,1,0,"i",17),s._uU(5,"\n                "),s.YNc(6,Z,1,0,"i",18),s._uU(7,"\n              "),s.qZA(),s._uU(8,"\n              "),s.TgZ(9,"td",19),s._uU(10,"\n                "),s.TgZ(11,"div",20),s._uU(12,"\n                  "),s.TgZ(13,"a",21),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(2);return s.KtG(i.download(t))})),s._uU(14),s.qZA(),s._uU(15,"\n                  "),s.YNc(16,x,16,11,"div",22),s._uU(17,"\n                "),s.qZA(),s._uU(18,"\n                "),s.TgZ(19,"small"),s._uU(20),s.qZA(),s._uU(21,"\n              "),s.qZA(),s._uU(22,"\n              "),s.YNc(23,S,12,10,"td",23),s._uU(24,"\n            "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw(2);s.xp6(4),s.Q6J("ngIf",!e.downloading),s.xp6(2),s.Q6J("ngIf",e.downloading),s.xp6(8),s.Oqu(e.fileName),s.xp6(2),s.Q6J("ngIf",i.showFixOldAttachments(e)),s.xp6(4),s.Oqu(e.sizeName),s.xp6(3),s.Q6J("ngIf",!i.viewOnly)}}function C(e,t){if(1&e&&(s.TgZ(0,"table",14),s._uU(1,"\n          "),s.TgZ(2,"tbody"),s._uU(3,"\n            "),s.YNc(4,T,25,6,"tr",15),s._uU(5,"\n          "),s.qZA(),s._uU(6,"\n        "),s.qZA()),2&e){const e=s.oxw();s.xp6(4),s.Q6J("ngForOf",e.cipher.attachments)}}function O(e,t){1&e&&(s.TgZ(0,"div"),s._uU(1,"\n          "),s.TgZ(2,"h3"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"label",37),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n          "),s._UZ(10,"input",38),s._uU(11,"\n          "),s.TgZ(12,"small",39),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n        "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,3,"newAttachment")),s.xp6(4),s.Oqu(s.lcZ(8,5,"file")),s.xp6(6),s.Oqu(s.lcZ(14,7,"maxFileSize")))}function k(e,t){if(1&e&&(s.TgZ(0,"button",40),s._uU(1,"\n          "),s._UZ(2,"i",41),s.ALo(3,"i18n"),s._uU(4,"\n          "),s.TgZ(5,"span"),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n        "),s.qZA()),2&e){s.oxw();const e=s.MAs(5);s.Q6J("disabled",e.loading),s.xp6(2),s.s9C("title",s.lcZ(3,3,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,5,"save"))}}class P extends n.t{constructor(e,t,i,n,s,o,r,a,l,c){super(e,t,i,s,o,window,r,n,a,l,c),this.viewOnly=!1,this.componentName="app-vault-attachments"}reupload(e){return U(this,void 0,void 0,(function*(){this.showFixOldAttachments(e)&&(yield this.reuploadCipherAttachment(e,!1))}))}showFixOldAttachments(e){return null==e.key&&null==this.cipher.organizationId}}P.ɵfac=function(e){return new(e||P)(s.Y36(o.u),s.Y36(r.D),s.Y36(a.$),s.Y36(l.b),s.Y36(c.P),s.Y36(u.s),s.Y36(d.$),s.Y36(p._),s.Y36(h.x),s.Y36(g.M))},P.ɵcmp=s.Xpm({type:P,selectors:[["app-vault-attachments"]],features:[s.qOj],decls:42,vars:14,consts:[["role","dialog","aria-modal","true","aria-labelledby","attachmentsTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","attachmentsTitle",1,"modal-title"],[4,"ngIf"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["class","table table-hover table-list",4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit",3,"disabled",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"table","table-hover","table-list"],[4,"ngFor","ngForOf"],[1,"table-list-icon"],["class","bwi bwi-fw bwi-lg bwi-file","aria-hidden","true",4,"ngIf"],["class","bwi bwi-spinner bwi-lg bwi-fw bwi-spin","aria-hidden","true",4,"ngIf"],[1,"wrap"],[1,"d-flex"],["href","#","appStopClick","",3,"click"],["class","ml-2",4,"ngIf"],["class","table-list-options",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-lg","bwi-file"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-fw","bwi-spin"],[1,"ml-2"],["href","https://bitwarden.com/help/attachments/#fixing-old-attachments","target","_blank","rel","noreferrer"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle","text-warning",3,"title"],[1,"sr-only"],["type","button",1,"btn","btn-outline-primary","btn-sm","m-0","py-0","px-2",3,"appApiAction","disabled","click"],["reuploadBtn",""],[1,"table-list-options"],["type","button","appStopClick","",1,"btn","btn-outline-danger",3,"appA11yTitle","appApiAction","disabled","click"],["deleteBtn",""],["aria-hidden","true",1,"bwi","bwi-trash","bwi-lg","bwi-fw",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-lg","bwi-fw",3,"hidden","title"],["for","file",1,"sr-only"],["type","file","id","file","name","file","required","",1,"form-control-file"],[1,"form-text","text-muted"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"form",2,3),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(6,"\n      "),s.TgZ(7,"div",4),s._uU(8,"\n        "),s.TgZ(9,"h1",5),s._uU(10),s.ALo(11,"i18n"),s.YNc(12,_,2,1,"small",6),s._uU(13,"\n        "),s.qZA(),s._uU(14,"\n        "),s.TgZ(15,"button",7),s.ALo(16,"i18n"),s._uU(17,"\n          "),s.TgZ(18,"span",8),s._uU(19,"×"),s.qZA(),s._uU(20,"\n        "),s.qZA(),s._uU(21,"\n      "),s.qZA(),s._uU(22,"\n      "),s.TgZ(23,"div",9),s._uU(24,"\n        "),s.YNc(25,C,7,1,"table",10),s._uU(26,"\n        "),s.YNc(27,O,16,9,"div",6),s._uU(28,"\n      "),s.qZA(),s._uU(29,"\n      "),s.TgZ(30,"div",11),s._uU(31,"\n        "),s.YNc(32,k,9,7,"button",12),s._uU(33,"\n        "),s.TgZ(34,"button",13),s._uU(35),s.ALo(36,"i18n"),s.qZA(),s._uU(37,"\n      "),s.qZA(),s._uU(38,"\n    "),s.qZA(),s._uU(39,"\n  "),s.qZA(),s._uU(40,"\n"),s.qZA(),s._uU(41,"\n")),2&e&&(s.xp6(4),s.Q6J("appApiAction",t.formPromise),s.xp6(6),s.hij("\n          ",s.lcZ(11,8,"attachments"),"\n          "),s.xp6(2),s.Q6J("ngIf",t.cipher),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(16,10,"close")),s.xp6(10),s.Q6J("ngIf",t.cipher&&t.cipher.hasAttachments),s.xp6(2),s.Q6J("ngIf",!t.viewOnly),s.xp6(5),s.Q6J("ngIf",!t.viewOnly),s.xp6(3),s.hij("\n          ",s.lcZ(36,12,"close"),"\n        "))},dependencies:[f.sg,f.O5,m.JL,m.F,v.B,y.b,w.O,b.C],encapsulation:2})},91480:(e,t,i)=>{"use strict";i.d(t,{E:()=>x,Jg:()=>n});var n,s=i(28783),o=i(99042),r=i(59281),a=i(97466),l=i(85762),c=i(92236),u=i(99721),d=i(78627),p=i(55602),h=i(31754),g=i(65254),f=i(28508),m=i(98205),v=i(81974),y=i(70094),w=i(82933),b=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function U(e,t){if(1&e&&(l.TgZ(0,"span"),l._uU(1),l.ALo(2,"i18n"),l.qZA()),2&e){const e=l.oxw(2);l.xp6(1),l.hij("\n        ",l.xi3(2,1,"deleteSelectedItemsDesc",e.cipherIds.length),"\n      ")}}function _(e,t){if(1&e&&(l.TgZ(0,"span"),l._uU(1),l.ALo(2,"i18n"),l.qZA()),2&e){const e=l.oxw(2);l.xp6(1),l.hij("\n        ",l.xi3(2,1,"deleteSelectedCollectionsDesc",e.collections.length),"\n      ")}}function A(e,t){if(1&e&&(l.ynx(0),l._uU(1,"\n      "),l.YNc(2,U,3,4,"span",2),l._uU(3,"\n      "),l.YNc(4,_,3,4,"span",2),l._uU(5),l.ALo(6,"i18n"),l.BQk()),2&e){const e=l.oxw();l.xp6(2),l.Q6J("ngIf",null==e.cipherIds?null:e.cipherIds.length),l.xp6(2),l.Q6J("ngIf",null==e.collections?null:e.collections.length),l.xp6(1),l.hij("\n      ",l.lcZ(6,3,"deleteSelectedConfirmation"),"\n    ")}}function Z(e,t){if(1&e&&(l.ynx(0),l._uU(1),l.ALo(2,"i18n"),l.BQk()),2&e){const e=l.oxw();l.xp6(1),l.hij("\n      ",l.xi3(2,1,"permanentlyDeleteSelectedItemsDesc",e.cipherIds.length),"\n    ")}}!function(e){e.Deleted="deleted",e.Canceled="canceled"}(n||(n={}));const x=(e,t)=>e.open(S,t);class S{constructor(e,t,i,s,a,l,c,u){var d;this.dialogRef=t,this.cipherService=i,this.platformUtilsService=s,this.i18nService=a,this.apiService=l,this.collectionService=c,this.configService=u,this.permanent=!1,this.flexibleCollectionsV1Enabled$=this.configService.getFeatureFlag$(r.T.FlexibleCollectionsV1),this.submit=()=>b(this,void 0,void 0,(function*(){const e=[];if(this.cipherIds.length){const t=yield(0,o.z)(this.flexibleCollectionsV1Enabled$);this.organization&&this.organization.canEditAllCiphers(t)?e.push(this.deleteCiphersAdmin()):e.push(this.deleteCiphers())}this.collections.length&&e.push(this.deleteCollections()),yield Promise.all(e),this.cipherIds.length&&this.platformUtilsService.showToast("success",null,this.i18nService.t(this.permanent?"permanentlyDeletedItems":"deletedItems")),this.collections.length&&(yield this.collectionService.delete(this.collections.map((e=>e.id))),this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedCollections"))),this.close(n.Deleted)})),this.cipherIds=null!==(d=e.cipherIds)&&void 0!==d?d:[],this.permanent=e.permanent,this.organization=e.organization,this.organizations=e.organizations,this.collections=e.collections}cancel(){return b(this,void 0,void 0,(function*(){this.close(n.Canceled)}))}deleteCiphers(){var e;return b(this,void 0,void 0,(function*(){const t=yield(0,o.z)(this.flexibleCollectionsV1Enabled$),i=null===(e=this.organization)||void 0===e?void 0:e.canEditAllCiphers(t);this.permanent?yield this.cipherService.deleteManyWithServer(this.cipherIds,i):yield this.cipherService.softDeleteManyWithServer(this.cipherIds,i)}))}deleteCiphersAdmin(){return b(this,void 0,void 0,(function*(){const e=new a.c(this.cipherIds,this.organization.id);return this.permanent?yield this.apiService.deleteManyCiphersAdmin(e):yield this.apiService.putDeleteManyCiphersAdmin(e)}))}deleteCollections(){return b(this,void 0,void 0,(function*(){if(this.organization)return this.collections.some((e=>!e.canDelete(this.organization)))?void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("missingPermissions")):yield this.apiService.deleteManyCollections(this.organization.id,this.collections.map((e=>e.id)));if(this.organizations&&this.collections){const e=[];for(const t of this.organizations){const i=this.collections.filter((e=>e.organizationId===t.id));if(i.some((e=>!e.canDelete(t))))return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("missingPermissions"));const n=i.map((e=>e.id));e.push(this.apiService.deleteManyCollections(t.id,n))}return yield Promise.all(e)}}))}close(e){this.dialogRef.close(e)}}S.ɵfac=function(e){return new(e||S)(l.Y36(s.Kt),l.Y36(s.zj),l.Y36(c.u),l.Y36(u.P),l.Y36(d.D),l.Y36(p.s),l.Y36(h.a),l.Y36(g.E))},S.ɵcmp=l.Xpm({type:S,selectors:[["ng-component"]],decls:25,vars:12,consts:[["bitDialogTitle",""],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","type","submit","buttonType","danger",3,"bitAction"],["bitButton","","type","button",3,"click"]],template:function(e,t){1&e&&(l.TgZ(0,"bit-simple-dialog"),l._uU(1,"\n  "),l.TgZ(2,"span",0),l._uU(3),l.ALo(4,"i18n"),l.qZA(),l._uU(5,"\n  "),l.TgZ(6,"span",1),l._uU(7,"\n    "),l.YNc(8,A,7,5,"ng-container",2),l._uU(9,"\n    "),l.YNc(10,Z,3,4,"ng-container",2),l._uU(11,"\n  "),l.qZA(),l._uU(12,"\n  "),l.ynx(13,3),l._uU(14,"\n    "),l.TgZ(15,"button",4),l._uU(16),l.ALo(17,"i18n"),l.qZA(),l._uU(18,"\n    "),l.TgZ(19,"button",5),l.NdJ("click",(function(){return t.cancel()})),l._uU(20),l.ALo(21,"i18n"),l.qZA(),l._uU(22,"\n  "),l.BQk(),l._uU(23,"\n"),l.qZA(),l._uU(24,"\n")),2&e&&(l.xp6(3),l.hij("\n    ",l.lcZ(4,6,t.permanent?"permanentlyDeleteSelected":"deleteSelected"),"\n  "),l.xp6(5),l.Q6J("ngIf",!t.permanent),l.xp6(2),l.Q6J("ngIf",t.permanent),l.xp6(5),l.Q6J("bitAction",t.submit),l.xp6(1),l.hij("\n      ",l.lcZ(17,8,t.permanent?"permanentlyDelete":"delete"),"\n    "),l.xp6(4),l.Oqu(l.lcZ(21,10,"cancel")))},dependencies:[f.O5,m.Q,v.r,y.r,w.C],encapsulation:2})},17475:(e,t,i)=>{"use strict";i.d(t,{Ur:()=>I,Zl:()=>h,_l:()=>M});var n=i(28783),s=i(85762),o=i(58691),r=i(31754),a=i(99721),l=i(78627),c=i(92236),u=i(66459),d=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class p{constructor(e,t,i,n,o,r){this.collectionService=e,this.platformUtilsService=t,this.i18nService=i,this.cipherService=n,this.organizationService=o,this.logService=r,this.allowSelectNone=!1,this.onSavedCollections=new s.vpe,this.collections=[]}ngOnInit(){return d(this,void 0,void 0,(function*(){yield this.load()}))}load(){return d(this,void 0,void 0,(function*(){this.cipherDomain=yield this.loadCipher(),this.collectionIds=this.loadCipherCollections(),this.cipher=yield this.cipherDomain.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(this.cipherDomain)),this.collections=yield this.loadCollections(),this.collections.forEach((e=>e.checked=!1)),null!=this.collectionIds&&this.collections.forEach((e=>{e.checked=null!=this.collectionIds&&this.collectionIds.indexOf(e.id)>-1})),null==this.organization&&(this.organization=yield this.organizationService.get(this.cipher.organizationId))}))}submit(){return d(this,void 0,void 0,(function*(){const e=this.collections.filter((e=>this.organization.canEditAllCiphers(this.flexibleCollectionsV1Enabled)?!!e.checked:!!e.checked&&null==e.readOnly)).map((e=>e.id));if(!this.allowSelectNone&&0===e.length)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectOneCollection")),!1;this.cipherDomain.collectionIds=e;try{return this.formPromise=this.saveCollections(),yield this.formPromise,this.onSavedCollections.emit(),this.platformUtilsService.showToast("success",null,this.i18nService.t("editedItem")),!0}catch(t){return this.logService.error(t),!1}}))}loadCipher(){return this.cipherService.get(this.cipherId)}loadCipherCollections(){return this.cipherDomain.collectionIds}loadCollections(){return d(this,void 0,void 0,(function*(){return(yield this.collectionService.getAllDecrypted()).filter((e=>!e.readOnly&&e.organizationId===this.cipher.organizationId))}))}saveCollections(){return this.cipherService.saveCollectionsWithServer(this.cipherDomain)}}p.ɵfac=function(e){return new(e||p)(s.Y36(r.a),s.Y36(a.P),s.Y36(l.D),s.Y36(c.u),s.Y36(o.Mn),s.Y36(u.$))},p.ɵdir=s.lG2({type:p,inputs:{cipherId:"cipherId",allowSelectNone:"allowSelectNone"},outputs:{onSavedCollections:"onSavedCollections"}});var h,g=i(28508),f=i(37513),m=i(12963),v=i(81974),y=i(7172),w=i(29465),b=i(18362),U=i(12492),_=i(54735),A=i(50941),Z=i(26361),x=i(82933),S=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function T(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.Oqu(e.cipher.name)}}function C(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",10),s._uU(1,"\n          "),s.TgZ(2,"button",11),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.selectAll(!0))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"button",11),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.selectAll(!1))})),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n        "),s.qZA()}2&e&&(s.xp6(3),s.hij("\n            ",s.lcZ(4,2,"selectAll"),"\n          "),s.xp6(4),s.hij("\n            ",s.lcZ(8,4,"unselectAll"),"\n          "))}function O(e,t){1&e&&(s.TgZ(0,"div"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n        ",s.lcZ(2,1,"noCollectionsInList"),"\n      "))}function k(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr",14),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.check(t))})),s._uU(1,"\n            "),s.TgZ(2,"td",15),s._uU(3,"\n              "),s.TgZ(4,"input",16),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.checked=t)})),s.qZA(),s._uU(5),s.qZA(),s._uU(6,"\n          "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=s.oxw(3);s.xp6(4),s.MGl("name","Collection[",i,"].Checked"),s.Q6J("ngModel",e.checked)("disabled",!e.canEditItems(n.organization,n.flexibleCollectionsV1Enabled)),s.xp6(1),s.hij("\n              ",e.name,"\n            ")}}function P(e,t){if(1&e&&(s._uU(0,"\n          "),s.YNc(1,k,7,4,"tr",13),s._uU(2,"\n        ")),2&e){const e=s.oxw(2);s.xp6(1),s.Q6J("ngForOf",e.collections)}}function q(e,t){1&e&&(s.TgZ(0,"bit-table"),s._uU(1,"\n        "),s.YNc(2,P,3,1,"ng-template",12),s._uU(3,"\n      "),s.qZA())}class I extends p{constructor(e,t,i,n,s,o,r,a){super(e,t,i,n,s,o),this.dialogRef=r,this.cipherId=null==a?void 0:a.cipherId}submit(){const e=Object.create(null,{submit:{get:()=>super.submit}});return S(this,void 0,void 0,(function*(){return!!(yield e.submit.call(this))&&(this.dialogRef.close(h.Saved),!0)}))}check(e,t){e.canEditItems(this.organization,this.flexibleCollectionsV1Enabled)&&(e.checked=null==t?!e.checked:t)}selectAll(e){this.collections.forEach((t=>this.check(t,e)))}ngOnDestroy(){this.selectAll(!1)}}function M(e,t){return e.open(I,t)}I.ɵfac=function(e){return new(e||I)(s.Y36(r.a),s.Y36(a.P),s.Y36(l.D),s.Y36(c.u),s.Y36(o.Mn),s.Y36(u.$),s.Y36(n.zj),s.Y36(n.Kt))},I.ɵcmp=s.Xpm({type:I,selectors:[["app-vault-collections"]],features:[s.qOj],decls:43,vars:19,consts:[[3,"ngSubmit"],["bitDialogTitle",""],[4,"ngIf"],["bitDialogContent",""],[1,"tw-flex"],[1,"tw-mb-1","tw-block","tw-font-semibold","tw-text-main"],["class","tw-ml-auto tw-flex",4,"ngIf"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit"],["bitButton","","bitDialogClose","","buttonType","secondary","type","button"],[1,"tw-ml-auto","tw-flex"],["bitLink","","type","button",1,"tw-px-2",3,"click"],["body",""],["bitRow","",3,"click",4,"ngFor","ngForOf"],["bitRow","",3,"click"],["bitCell",""],["type","checkbox","bitCheckbox","","appStopProp","",3,"ngModel","name","disabled","ngModelChange"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(1,"\n  "),s.TgZ(2,"bit-dialog"),s._uU(3,"\n    "),s.TgZ(4,"span",1),s._uU(5),s.ALo(6,"i18n"),s.YNc(7,T,2,1,"small",2),s._uU(8,"\n    "),s.qZA(),s._uU(9,"\n    "),s.ynx(10,3),s._uU(11,"\n      "),s.TgZ(12,"p"),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n      "),s.TgZ(16,"div",4),s._uU(17,"\n        "),s.TgZ(18,"label",5),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n        "),s.YNc(22,C,10,6,"div",6),s._uU(23,"\n      "),s.qZA(),s._uU(24,"\n      "),s.YNc(25,O,3,3,"div",2),s._uU(26,"\n      "),s.YNc(27,q,4,0,"bit-table",2),s._uU(28,"\n    "),s.BQk(),s._uU(29,"\n    "),s.ynx(30,7),s._uU(31,"\n      "),s.TgZ(32,"button",8),s._uU(33),s.ALo(34,"i18n"),s.qZA(),s._uU(35,"\n      "),s.TgZ(36,"button",9),s._uU(37),s.ALo(38,"i18n"),s.qZA(),s._uU(39,"\n    "),s.BQk(),s._uU(40,"\n  "),s.qZA(),s._uU(41,"\n"),s.qZA(),s._uU(42,"\n")),2&e&&(s.xp6(5),s.hij("\n      ",s.lcZ(6,9,"collections"),"\n      "),s.xp6(2),s.Q6J("ngIf",t.cipher),s.xp6(6),s.Oqu(s.lcZ(14,11,"collectionsDesc")),s.xp6(6),s.Oqu(s.lcZ(20,13,"collections")),s.xp6(3),s.Q6J("ngIf",t.collections&&t.collections.length),s.xp6(3),s.Q6J("ngIf",!t.collections||!t.collections.length),s.xp6(2),s.Q6J("ngIf",t.collections&&t.collections.length),s.xp6(6),s.hij("\n        ",s.lcZ(34,15,"save"),"\n      "),s.xp6(4),s.hij("\n        ",s.lcZ(38,17,"cancel"),"\n      "))},dependencies:[g.sg,g.O5,f._Y,f.Wl,f.JJ,f.JL,f.On,f.F,m._,v.r,y.b,w.a,b.f,U._,_.a,A.Y,Z.v,_.f,x.C],encapsulation:2}),function(e){e.Saved="saved"}(h||(h={}))},63391:(e,t,i)=>{"use strict";i.d(t,{D:()=>o});var n=i(85921),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.m]})},82081:(e,t,i)=>{"use strict";i.d(t,{C:()=>m});var n=i(99042),s=i(27646),o=i(16776),r=i(85762),a=i(78627),l=i(44647),c=i(77097),u=i(8111),d=i(33245),p=i(66385);class h{transform(e,t=25,i=!1,n="..."){return e.length<=t?e:(t-=n.length,i&&e.length>t&&e.indexOf(" ")>0&&(t=e.substring(0,t).lastIndexOf(" ")),e.substring(0,t)+n)}}h.ɵfac=function(e){return new(e||h)},h.ɵpipe=r.Yjl({name:"ellipsis",type:h,pure:!0});var g=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const f=function(e){return{organizationId:e}};class m{constructor(e,t,i){this.i18nService=e,this.avatarService=t,this.tokenService=i}ngOnChanges(){var e;return g(this,void 0,void 0,(function*(){if(this.isMe=null==this.organizationName||""===this.organizationName,this.isMe){if(this.name=this.i18nService.t("me"),this.color=yield(0,n.z)(this.avatarService.avatarColor$),null==this.color){const t=yield this.tokenService.getUserId();if(null!=t)this.color=s.c.stringToColor(t);else{const t=null!==(e=yield this.tokenService.getName())&&void 0!==e?e:yield this.tokenService.getEmail();this.color=s.c.stringToColor(t.toUpperCase())}}}else this.name=this.organizationName,this.color=s.c.stringToColor(this.organizationName.toUpperCase());this.textColor=s.c.pickTextColorBasedOnBgColor(this.color,135,!0)+"!important"}))}get organizationIdLink(){var e;return null!==(e=this.organizationId)&&void 0!==e?e:o.JK}}m.ɵfac=function(e){return new(e||m)(r.Y36(a.D),r.Y36(l.o),r.Y36(c.B))},m.ɵcmp=r.Xpm({type:m,selectors:[["app-org-badge"]],inputs:{organizationId:"organizationId",organizationName:"organizationName",disabled:"disabled"},features:[r.TTD],decls:4,vars:13,consts:[["bitBadge","","type","button","routerLink","","queryParamsHandling","merge",3,"disabled","appA11yTitle","queryParams"]],template:function(e,t){1&e&&(r.TgZ(0,"button",0),r._uU(1),r.ALo(2,"ellipsis"),r.qZA(),r._uU(3,"\n")),2&e&&(r.Udp("color",t.textColor)("background-color",t.color),r.s9C("appA11yTitle",t.organizationName),r.Q6J("disabled",t.disabled)("queryParams",r.VKq(11,f,t.organizationIdLink)),r.xp6(1),r.hij("\n  ",r.xi3(2,8,t.name,13),"\n"))},dependencies:[u.rH,d.B,p.l,h],encapsulation:2})},36409:(e,t,i)=>{"use strict";i.d(t,{l:()=>s});var n=i(85762);class s{transform(e,t){var i;return null===(i=null==t?void 0:t.find((t=>t.id===e)))||void 0===i?void 0:i.name}}s.ɵfac=function(e){return new(e||s)},s.ɵpipe=n.Yjl({name:"orgNameFromId",type:s,pure:!0})},21151:(e,t,i)=>{"use strict";i.d(t,{D:()=>s});var n=i(85762);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=n.oAB({type:s}),s.ɵinj=n.cJS({})},30276:(e,t,i)=>{"use strict";i.d(t,{P:()=>ne});var n=i(85762),s=i(54019),o=i(99042),r=i(92614),a=i(89474),l=i(27643),c=i(92786),u=i(33031),d=i(68362),p=i(78243),h=i(82558),g=i(98157),f=i(33970),m=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class v{constructor(){}static open(e,t,i,n,s,o,r,a){return m(this,void 0,void 0,(function*(){const l=yield f.NK.open(e,{title:"enrollAccountRecovery",calloutOptions:{text:"resetPasswordEnrollmentWarning",type:"warning"}});if("cancel"!==l.userAction&&l.verificationSuccess)try{const e=new h.w;e.resetPasswordKey=yield i.buildRecoveryKey(t.organization.id),yield n.putOrganizationUserResetPasswordEnrollment(t.organization.id,t.organization.userId,e),s.showToast("success",null,o.t("enrollPasswordResetSuccess")),yield r.fullSync(!0)}catch(c){a.error(c)}}))}}var y=i(26187),w=i(99721),b=i(78627),U=i(55602),_=i(4871),A=i(83924),Z=i(66459),x=i(97360),S=i(47244),T=i(73369),C=i(28508),O=i(24610),k=i(73974),P=i(26194),q=i(44234),I=i(45995),M=(i(27263),function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))});class N extends I.o{constructor(){super(...arguments),this.returnUri="/settings/organizations",this.redirectUri=window.location.origin+"/sso-connector.html",this.clientId="web"}onClick(e){return M(this,void 0,void 0,(function*(){e.preventDefault(),yield this.submit(this.returnUri,!0)}))}ngAfterContentInit(){return M(this,void 0,void 0,(function*(){this.identifier=this.organization.identifier}))}}N.ɵfac=function(){let e;return function(t){return(e||(e=n.n5z(N)))(t||N)}}(),N.ɵdir=n.lG2({type:N,selectors:[["","app-link-sso",""]],hostBindings:function(e,t){1&e&&n.NdJ("click",(function(e){return t.onClick(e)}))},inputs:{organization:"organization"},features:[n.qOj]});var L=i(82933),D=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function E(e,t){1&e&&(n.ynx(0),n._uU(1,"\n      "),n._UZ(2,"i",6),n.ALo(3,"i18n"),n._uU(4,"\n      "),n.TgZ(5,"span",7),n._uU(6),n.ALo(7,"i18n"),n.qZA(),n._uU(8,"\n    "),n.BQk()),2&e&&(n.xp6(2),n.s9C("title",n.lcZ(3,2,"loading")),n.xp6(4),n.Oqu(n.lcZ(7,4,"loading")))}function F(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"button",10),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw(3);return n.KtG(t.toggleResetPasswordEnrollment(t.organization))})),n._uU(1,"\n        "),n._UZ(2,"i",11),n._uU(3),n.ALo(4,"i18n"),n.qZA()}2&e&&(n.xp6(3),n.hij("\n        ",n.lcZ(4,1,"enrollAccountRecovery"),"\n      "))}function R(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"button",10),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw(3);return n.KtG(t.toggleResetPasswordEnrollment(t.organization))})),n._uU(1,"\n        "),n._UZ(2,"i",12),n._uU(3),n.ALo(4,"i18n"),n.qZA()}2&e&&(n.xp6(3),n.hij("\n        ",n.lcZ(4,1,"withdrawAccountRecovery"),"\n      "))}function J(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"button",10),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw(4);return n.KtG(t.unlinkSso(t.organization))})),n._uU(1,"\n          "),n._UZ(2,"i",15),n._uU(3),n.ALo(4,"i18n"),n.qZA()}2&e&&(n.xp6(3),n.hij("\n          ",n.lcZ(4,1,"unlinkSso"),"\n        "))}function z(e,t){if(1&e&&(n._uU(0,"\n          "),n.TgZ(1,"a",16),n._uU(2,"\n            "),n._UZ(3,"i",17),n._uU(4),n.ALo(5,"i18n"),n.qZA(),n._uU(6,"\n        ")),2&e){const e=n.oxw(4);n.xp6(1),n.Q6J("organization",e.organization),n.xp6(3),n.hij("\n            ",n.lcZ(5,2,"linkSso"),"\n          ")}}function Y(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n        "),n.YNc(2,J,5,3,"button",13),n._uU(3,"\n        "),n.YNc(4,z,7,4,"ng-template",null,14,n.W1O),n._uU(6,"\n      "),n.BQk()),2&e){const e=n.MAs(5),t=n.oxw(3);n.xp6(2),n.Q6J("ngIf",t.organization.ssoBound)("ngIfElse",e)}}function K(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"button",10),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw(3);return n.KtG(t.leave(t.organization))})),n._uU(1,"\n        "),n._UZ(2,"i",18),n._uU(3,"\n        "),n.TgZ(4,"span",19),n._uU(5),n.ALo(6,"i18n"),n.qZA(),n._uU(7,"\n      "),n.qZA()}2&e&&(n.xp6(5),n.Oqu(n.lcZ(6,1,"leave")))}function B(e,t){if(1&e&&(n.TgZ(0,"div",8),n._uU(1,"\n      "),n.YNc(2,F,5,3,"button",9),n._uU(3,"\n      "),n.YNc(4,R,5,3,"button",9),n._uU(5,"\n      "),n.YNc(6,Y,7,2,"ng-container",0),n._uU(7,"\n      "),n.YNc(8,K,8,3,"button",9),n._uU(9,"\n    "),n.qZA()),2&e){const e=n.oxw(2);n.Q6J("appApiAction",e.actionPromise),n.xp6(2),n.Q6J("ngIf",e.allowEnrollmentChanges(e.organization)&&!e.organization.resetPasswordEnrolled),n.xp6(2),n.Q6J("ngIf",e.allowEnrollmentChanges(e.organization)&&e.organization.resetPasswordEnrolled),n.xp6(2),n.Q6J("ngIf",e.showSsoOptions(e.organization)),n.xp6(2),n.Q6J("ngIf",e.showLeaveOrgOption)}}function Q(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n  "),n.TgZ(2,"button",1),n.ALo(3,"i18n"),n._uU(4,"\n    "),n._UZ(5,"i",2),n._uU(6,"\n  "),n.qZA(),n._uU(7,"\n  "),n.TgZ(8,"bit-menu",3,4),n._uU(10,"\n    "),n.YNc(11,E,9,6,"ng-container",0),n._uU(12,"\n    "),n.YNc(13,B,10,5,"div",5),n._uU(14,"\n  "),n.qZA(),n._uU(15,"\n"),n.BQk()),2&e){const e=n.MAs(9),t=n.oxw();n.xp6(2),n.Q6J("bitMenuTriggerFor",e),n.uIk("aria-label",n.lcZ(3,4,"organizationOptionsMenu")),n.xp6(9),n.Q6J("ngIf",!t.loaded),n.xp6(2),n.Q6J("ngIf",t.loaded)}}class G{constructor(e,t,i,n,o,r,a,l,c,u,d,p){this.organization$=e,this.platformUtilsService=t,this.i18nService=i,this.apiService=n,this.syncService=o,this.policyService=r,this.logService=a,this.organizationApiService=l,this.organizationUserService=c,this.userDecryptionOptionsService=u,this.dialogService=d,this.resetPasswordService=p,this.loaded=!1,this.hideMenu=!1,this.showLeaveOrgOption=!1,this.destroy$=new s.x}ngOnInit(){return D(this,void 0,void 0,(function*(){const e=this.policyService.policies$.pipe((0,c.U)((e=>e.filter((e=>e.type===r.Mi.ResetPassword)))));(0,u.a)([this.organization$,e,this.userDecryptionOptionsService.userDecryptionOptions$]).pipe((0,d.R)(this.destroy$)).subscribe((([e,t,i])=>{this.organization=e,this.resetPasswordPolicy=t.find((t=>t.organizationId===e.id)),this.showLeaveOrgOption=null==i.trustedDeviceOption&&null==i.keyConnectorOption||i.hasMasterPassword,this.hideMenu=!this.showLeaveOrgOption&&!this.showSsoOptions(this.organization)&&!this.allowEnrollmentChanges(this.organization),this.loaded=!0}))}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}allowEnrollmentChanges(e){return!!((null==e?void 0:e.usePolicies)&&(null==e?void 0:e.useResetPassword)&&(null==e?void 0:e.hasPublicAndPrivateKeys)&&null!=this.resetPasswordPolicy&&this.resetPasswordPolicy.enabled)&&!((null==e?void 0:e.resetPasswordEnrolled)&&this.resetPasswordPolicy.data.autoEnrollEnabled)}showSsoOptions(e){return(null==e?void 0:e.useSso)&&(null==e?void 0:e.identifier)}unlinkSso(e){return D(this,void 0,void 0,(function*(){if(!(yield this.dialogService.openSimpleDialog({title:e.name,content:{key:"unlinkSsoConfirmation"},type:"warning"})))return!1;try{this.actionPromise=this.apiService.deleteSsoUser(e.id).then((()=>this.syncService.fullSync(!0))),yield this.actionPromise,this.platformUtilsService.showToast("success",null,"Unlinked SSO")}catch(t){this.logService.error(t)}}))}leave(e){return D(this,void 0,void 0,(function*(){if(!(yield this.dialogService.openSimpleDialog({title:e.name,content:{key:"leaveOrganizationConfirmation"},type:"warning"})))return!1;try{this.actionPromise=this.organizationApiService.leave(e.id),yield this.actionPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("leftOrganization"))}catch(t){this.logService.error(t)}}))}toggleResetPasswordEnrollment(e){return D(this,void 0,void 0,(function*(){if(this.organization.resetPasswordEnrolled){const e=new h.w;e.masterPasswordHash="ignored",e.resetPasswordKey=null,this.actionPromise=this.organizationUserService.putOrganizationUserResetPasswordEnrollment(this.organization.id,this.organization.userId,e);try{yield this.actionPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("withdrawPasswordResetSuccess")),yield this.syncService.fullSync(!0)}catch(t){this.logService.error(t)}}else yield v.open(this.dialogService,{organization:e},this.resetPasswordService,this.organizationUserService,this.platformUtilsService,this.i18nService,this.syncService,this.logService)}))}}G.ɵfac=function(e){return new(e||G)(n.Y36(y.g),n.Y36(w.P),n.Y36(b.D),n.Y36(U.s),n.Y36(_._),n.Y36(A.d),n.Y36(Z.$),n.Y36(x.M),n.Y36(S.t),n.Y36(p.Bb),n.Y36(T.x),n.Y36(g.v))},G.ɵcmp=n.Xpm({type:G,selectors:[["app-organization-options"]],decls:2,vars:1,consts:[[4,"ngIf"],["type","button",1,"filter-options-icon",3,"bitMenuTriggerFor"],["aria-hidden","true",1,"bwi","bwi-ellipsis-v"],[1,"filter-organization-options"],["optionsMenu",""],["class","tw-flex tw-min-w-[200px] tw-max-w-[300px] tw-flex-col",3,"appApiAction",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-m-2","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-flex","tw-min-w-[200px]","tw-max-w-[300px]","tw-flex-col",3,"appApiAction"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-key"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-undo"],["type","button","bitMenuItem","",3,"click",4,"ngIf","ngIfElse"],["linkSso",""],["aria-hidden","true",1,"bwi","bwi-fw","bwi-chain-broken"],["href","#","bitMenuItem","","app-link-sso","",3,"organization"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-link"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-sign-out","tw-text-danger"],[1,"tw-text-danger"]],template:function(e,t){1&e&&(n.YNc(0,Q,16,6,"ng-container",0),n._uU(1,"\n")),2&e&&n.Q6J("ngIf",!t.hideMenu)},dependencies:[C.O5,O.b,k.M,P.t,q.e,N,L.C],encapsulation:2});var j=i(75028),V=i(37513),$=i(33245),H=i(62357),W=i(94239),X=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function ee(e,t){1&e&&(n.TgZ(0,"div",3),n._uU(1,"\n    "),n._UZ(2,"i",4),n._uU(3,"\n  "),n.qZA())}function te(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n        "),n.TgZ(2,"div",12),n._uU(3,"\n          "),n.TgZ(4,"app-filter-section",13),n._uU(5," "),n.qZA(),n._uU(6,"\n        "),n.qZA(),n._uU(7,"\n      "),n.BQk()),2&e){const e=t.$implicit,i=n.oxw(2);n.xp6(4),n.Q6J("activeFilter",i.activeFilter)("section",e)}}function ie(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"div"),n._uU(1,"\n    "),n.TgZ(2,"div",5),n._uU(3),n.ALo(4,"i18n"),n.TgZ(5,"a",6),n.ALo(6,"i18n"),n._uU(7,"\n        "),n._UZ(8,"i",7),n._uU(9,"\n      "),n.qZA(),n._uU(10,"\n    "),n.qZA(),n._uU(11,"\n    "),n.TgZ(12,"div",8),n._uU(13,"\n      "),n.TgZ(14,"div",9),n._uU(15,"\n        "),n.TgZ(16,"bit-search",10),n.NdJ("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.searchText=t)}))("ngModelChange",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.onSearchTextChanged(t))})),n.ALo(17,"i18n"),n.qZA(),n._uU(18,"\n      "),n.qZA(),n._uU(19,"\n      "),n.YNc(20,te,8,2,"ng-container",11),n._uU(21,"\n    "),n.qZA(),n._uU(22,"\n  "),n.qZA()}if(2&e){const e=n.oxw();n.xp6(3),n.hij("\n      ",n.lcZ(4,5,"filters"),"\n      "),n.xp6(2),n.s9C("appA11yTitle",n.lcZ(6,7,"learnMore")),n.xp6(11),n.s9C("placeholder",n.lcZ(17,9,e.searchPlaceholder)),n.Q6J("ngModel",e.searchText),n.xp6(4),n.Q6J("ngForOf",e.filtersList)}}class ne{get filtersList(){return this.filters?Object.values(this.filters):[]}get searchPlaceholder(){var e,t;return this.activeFilter.isFavorites?"searchFavorites":this.activeFilter.isDeleted?"searchTrash":this.activeFilter.cipherType===a.Ou.Login?"searchLogin":this.activeFilter.cipherType===a.Ou.Card?"searchCard":this.activeFilter.cipherType===a.Ou.Identity?"searchIdentity":this.activeFilter.cipherType===a.Ou.SecureNote?"searchSecureNote":(null===(e=this.activeFilter.selectedFolderNode)||void 0===e?void 0:e.node)?"searchFolder":(null===(t=this.activeFilter.selectedCollectionNode)||void 0===t?void 0:t.node)?"searchCollection":"MyVault"===this.activeFilter.organizationId?"searchMyVault":this.activeFilter.organizationId?"searchOrganization":"searchVault"}constructor(e,t,i,o){this.vaultFilterService=e,this.policyService=t,this.i18nService=i,this.platformUtilsService=o,this.activeFilter=new l.l,this.onEditFolder=new n.vpe,this.searchText="",this.searchTextChanged=new n.vpe,this.isLoaded=!1,this.destroy$=new s.x,this.applyOrganizationFilter=e=>X(this,void 0,void 0,(function*(){if(!(null==e?void 0:e.node.enabled))return void this.platformUtilsService.showToast("error",null,this.i18nService.t("disabledOrganizationFilterError"));const t=this.activeFilter;"AllVaults"===(null==e?void 0:e.node.id)?t.resetOrganization():t.selectedOrganizationNode=e,this.vaultFilterService.setOrganizationFilter(e.node),yield this.vaultFilterService.expandOrgFilter()})),this.applyTypeFilter=e=>X(this,void 0,void 0,(function*(){const t=this.activeFilter;t.resetFilter(),t.selectedCipherTypeNode=e})),this.applyFolderFilter=e=>X(this,void 0,void 0,(function*(){const t=this.activeFilter;t.resetFilter(),t.selectedFolderNode=e})),this.applyCollectionFilter=e=>X(this,void 0,void 0,(function*(){const t=this.activeFilter;t.resetFilter(),t.selectedCollectionNode=e})),this.editFolder=e=>X(this,void 0,void 0,(function*(){this.onEditFolder.emit(e)}))}ngOnInit(){return X(this,void 0,void 0,(function*(){this.filters=yield this.buildAllFilters(),this.activeFilter.selectedCipherTypeNode=yield this.getDefaultFilter(),this.isLoaded=!0}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onSearchTextChanged(e){this.searchText=e,this.searchTextChanged.emit(e)}getDefaultFilter(){var e;return X(this,void 0,void 0,(function*(){return yield(0,o.z)(null===(e=this.filters)||void 0===e?void 0:e.typeFilter.data$)}))}buildAllFilters(){return X(this,void 0,void 0,(function*(){const e={};return e.organizationFilter=yield this.addOrganizationFilter(),e.typeFilter=yield this.addTypeFilter(),e.folderFilter=yield this.addFolderFilter(),e.collectionFilter=yield this.addCollectionFilter(),e.trashFilter=yield this.addTrashFilter(),e}))}addOrganizationFilter(){return X(this,void 0,void 0,(function*(){const e=yield this.policyService.policyAppliesToUser(r.Mi.SingleOrg),t=yield this.policyService.policyAppliesToUser(r.Mi.PersonalOwnership),i=e?null:{text:"newOrganization",route:"/create-organization"};return{data$:this.vaultFilterService.organizationTree$,header:{showHeader:!(e&&t),isSelectable:!0},action:this.applyOrganizationFilter,options:{component:G},add:i,divider:!0}}))}addTypeFilter(e=[]){return X(this,void 0,void 0,(function*(){const t=[{id:"favorites",name:this.i18nService.t("favorites"),type:"favorites",icon:"bwi-star"},{id:"login",name:this.i18nService.t("typeLogin"),type:a.Ou.Login,icon:"bwi-globe"},{id:"card",name:this.i18nService.t("typeCard"),type:a.Ou.Card,icon:"bwi-credit-card"},{id:"identity",name:this.i18nService.t("typeIdentity"),type:a.Ou.Identity,icon:"bwi-id-card"},{id:"note",name:this.i18nService.t("typeSecureNote"),type:a.Ou.SecureNote,icon:"bwi-sticky-note"}];return{data$:this.vaultFilterService.buildTypeTree({id:"AllItems",name:"allItems",type:"all",icon:""},t.filter((t=>!e.includes(t.type)))),header:{showHeader:!0,isSelectable:!0},action:this.applyTypeFilter}}))}addFolderFilter(){return X(this,void 0,void 0,(function*(){return{data$:this.vaultFilterService.folderTree$,header:{showHeader:!0,isSelectable:!1},action:this.applyFolderFilter,edit:{text:"editFolder",action:this.editFolder}}}))}addCollectionFilter(){return X(this,void 0,void 0,(function*(){return{data$:this.vaultFilterService.collectionTree$,header:{showHeader:!0,isSelectable:!0},action:this.applyCollectionFilter}}))}addTrashFilter(){return X(this,void 0,void 0,(function*(){return{data$:this.vaultFilterService.buildTypeTree({id:"headTrash",name:"HeadTrash",type:"trash",icon:"bwi-trash"},[{id:"trash",name:this.i18nService.t("trash"),type:"trash",icon:"bwi-trash"}]),header:{showHeader:!1,isSelectable:!0},action:this.applyTypeFilter}}))}}ne.ɵfac=function(e){return new(e||ne)(n.Y36(j.n),n.Y36(A.d),n.Y36(b.D),n.Y36(w.P))},ne.ɵcmp=n.Xpm({type:ne,selectors:[["app-vault-filter"]],inputs:{activeFilter:"activeFilter",searchText:"searchText"},outputs:{onEditFolder:"onEditFolder",searchTextChanged:"searchTextChanged"},decls:7,vars:2,consts:[[1,"card","vault-filters"],["class","container loading-spinner",4,"ngIf"],[4,"ngIf"],[1,"container","loading-spinner"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],[1,"card-header","d-flex"],["href","https://bitwarden.com/help/searching-vault/","target","_blank","rel","noreferrer",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],[1,"card-body"],[1,"tw-mb-4"],["id","search","autocomplete","off","appAutofocus","",3,"placeholder","ngModel","ngModelChange"],[4,"ngFor","ngForOf"],[1,"filter"],[3,"activeFilter","section"]],template:function(e,t){1&e&&(n.TgZ(0,"div",0),n._uU(1,"\n  "),n.YNc(2,ee,4,0,"div",1),n._uU(3,"\n  "),n.YNc(4,ie,23,11,"div",2),n._uU(5,"\n"),n.qZA(),n._uU(6,"\n")),2&e&&(n.xp6(2),n.Q6J("ngIf",!t.isLoaded),n.xp6(2),n.Q6J("ngIf",t.isLoaded))},dependencies:[C.sg,C.O5,V.JJ,V.On,$.B,H.U,y.n,W.g,L.C],encapsulation:2})},75028:(e,t,i)=>{"use strict";i.d(t,{n:()=>n});class n{}},37417:(e,t,i)=>{"use strict";i.d(t,{b:()=>g});var n=i(33031),s=i(92786),o=i(94441),r=i(39194),a=i(16776);class l{constructor(e,t,i){this.routedFilter=e,this.legacyFilter=t,this.bridgeService=i}get collectionBreadcrumbs(){return this.legacyFilter.collectionBreadcrumbs}get isCollectionSelected(){return this.legacyFilter.isCollectionSelected}get isUnassignedCollectionSelected(){return this.legacyFilter.isUnassignedCollectionSelected}get isMyVaultSelected(){return this.legacyFilter.isMyVaultSelected}get selectedOrganizationNode(){return this.legacyFilter.selectedOrganizationNode}set selectedOrganizationNode(e){this.bridgeService.navigate(Object.assign(Object.assign({},this.routedFilter),{organizationId:"MyVault"===(null==e?void 0:e.node.id)?a.JK:null==e?void 0:e.node.id,folderId:void 0,collectionId:void 0}))}get selectedCipherTypeNode(){return this.legacyFilter.selectedCipherTypeNode}set selectedCipherTypeNode(e){let t;"AllItems"===(null==e?void 0:e.node.id)&&"path"===this.routedFilter.organizationIdParamType?t="all":"AllItems"===(null==e?void 0:e.node.id)&&"query"===this.routedFilter.organizationIdParamType?t=void 0:(0,a.aC)(null==e?void 0:e.node.id)&&(t=null==e?void 0:e.node.id),this.bridgeService.navigate(Object.assign(Object.assign({},this.routedFilter),{type:t,folderId:void 0,collectionId:void 0}))}get selectedFolderNode(){return this.legacyFilter.selectedFolderNode}set selectedFolderNode(e){const t=null!=e&&null===e.node.id?a.JK:null==e?void 0:e.node.id;this.bridgeService.navigate(Object.assign(Object.assign({},this.routedFilter),{folderId:t,type:void 0,collectionId:void 0}))}get selectedCollectionNode(){return this.legacyFilter.selectedCollectionNode}set selectedCollectionNode(e){let t;t=null!=e&&null===e.node.id?a.JK:"AllCollections"===(null==e?void 0:e.node.id)&&"path"===this.routedFilter.organizationIdParamType?void 0:"AllCollections"===(null==e?void 0:e.node.id)&&"query"===this.routedFilter.organizationIdParamType?a.oT:null==e?void 0:e.node.id,this.bridgeService.navigate(Object.assign(Object.assign({},this.routedFilter),{collectionId:t,type:void 0,folderId:void 0}))}get isFavorites(){return this.legacyFilter.isFavorites}get isDeleted(){return this.legacyFilter.isDeleted}get organizationId(){return this.legacyFilter.organizationId}get cipherType(){return this.legacyFilter.cipherType}get cipherStatus(){return this.legacyFilter.cipherStatus}get cipherTypeId(){return this.legacyFilter.cipherTypeId}get folderId(){return this.legacyFilter.folderId}get collectionId(){return this.legacyFilter.collectionId}resetFilter(){this.bridgeService.navigate(Object.assign(Object.assign({},this.routedFilter),{collectionId:void 0,folderId:void 0,organizationId:"path"===this.routedFilter.organizationIdParamType?this.routedFilter.organizationId:void 0,type:void 0}))}resetOrganization(){this.bridgeService.navigate(Object.assign(Object.assign({},this.routedFilter),{organizationId:void 0}))}buildFilter(){return this.legacyFilter.buildFilter()}}var c=i(27643),u=i(95638),d=i(85762),p=i(8111),h=i(75028);class g{constructor(e,t,i){this.router=e,this.routedVaultFilterService=t,this.activeFilter$=(0,n.a)([t.filter$,i.collectionTree$,i.folderTree$,i.organizationTree$,i.cipherTypeTree$]).pipe((0,s.U)((([e,t,i,n,s])=>{const u=function(e){return"path"===e.organizationIdParamType}(e)?function(e,t,i){const n=new c.l;void 0===e.collectionId&&void 0===e.type?n.selectedCollectionNode=r.L.getTreeNodeObject(t,"AllCollections"):void 0!==e.collectionId&&e.collectionId===a.JK?n.selectedCollectionNode=r.L.getTreeNodeObject(t,null):void 0!==e.collectionId&&(n.selectedCollectionNode=r.L.getTreeNodeObject(t,e.collectionId));void 0===e.collectionId&&e.type===a.oT?n.selectedCipherTypeNode=r.L.getTreeNodeObject(i,"AllItems"):void 0!==e.type&&"trash"===e.type?n.selectedCipherTypeNode=new o.O({id:"trash",name:"",type:"trash",icon:""},null):void 0!==e.type&&"trash"!==e.type&&(n.selectedCipherTypeNode=r.L.getTreeNodeObject(i,e.type));return n}(e,t,s):function(e,t,i,n,s){const l=new c.l;void 0!==e.collectionId&&e.collectionId===a.JK?l.selectedCollectionNode=r.L.getTreeNodeObject(t,null):void 0!==e.collectionId&&e.collectionId===a.oT?l.selectedCollectionNode=r.L.getTreeNodeObject(t,"AllCollections"):void 0!==e.collectionId&&(l.selectedCollectionNode=r.L.getTreeNodeObject(t,e.collectionId));void 0!==e.folderId&&e.folderId===a.JK?l.selectedFolderNode=r.L.getTreeNodeObject(i,null):void 0!==e.folderId&&e.folderId!==a.JK&&(l.selectedFolderNode=r.L.getTreeNodeObject(i,e.folderId));void 0!==e.organizationId&&e.organizationId===a.JK?l.selectedOrganizationNode=r.L.getTreeNodeObject(n,"MyVault"):void 0!==e.organizationId&&e.organizationId!==a.JK&&(l.selectedOrganizationNode=r.L.getTreeNodeObject(n,e.organizationId));void 0===e.type?l.selectedCipherTypeNode=r.L.getTreeNodeObject(s,"AllItems"):void 0!==e.type&&"trash"===e.type?l.selectedCipherTypeNode=new o.O({id:"trash",name:"",type:"trash",icon:""},null):void 0!==e.type&&"trash"!==e.type&&(l.selectedCipherTypeNode=r.L.getTreeNodeObject(s,e.type));return l}(e,t,i,n,s);return new l(e,u,this)})))}navigate(e){const[t,i]=this.routedVaultFilterService.createRoute(e);this.router.navigate(t,i)}}g.ɵfac=function(e){return new(e||g)(d.LFG(p.F0),d.LFG(u.q),d.LFG(h.n))},g.ɵprov=d.Yz7({token:g,factory:g.ɵfac})},95638:(e,t,i)=>{"use strict";i.d(t,{q:()=>u});var n=i(54019),s=i(33031),o=i(92786),r=i(68362),a=i(16776),l=i(85762),c=i(8111);class u{constructor(e){this.onDestroy=new n.x,this.filter$=(0,s.a)([e.paramMap,e.queryParamMap]).pipe((0,o.U)((([e,t])=>{var i,n,s,o;const r=t.get("type"),l=(0,a.aC)(r)?r:void 0;return{collectionId:null!==(i=t.get("collectionId"))&&void 0!==i?i:void 0,folderId:null!==(n=t.get("folderId"))&&void 0!==n?n:void 0,organizationId:null!==(o=null!==(s=e.get("organizationId"))&&void 0!==s?s:t.get("organizationId"))&&void 0!==o?o:void 0,organizationIdParamType:null!=e.get("organizationId")?"path":"query",type:l}})),(0,r.R)(this.onDestroy))}createRoute(e){var t,i,n,s;return[[],{queryParams:{collectionId:null!==(t=e.collectionId)&&void 0!==t?t:null,folderId:null!==(i=e.folderId)&&void 0!==i?i:null,organizationId:"path"===e.organizationIdParamType?null:null!==(n=e.organizationId)&&void 0!==n?n:null,type:null!==(s=e.type)&&void 0!==s?s:null},queryParamsHandling:"merge"}]}ngOnDestroy(){this.onDestroy.next(),this.onDestroy.complete()}}u.ɵfac=function(e){return new(e||u)(l.LFG(c.gz))},u.ɵprov=l.Yz7({token:u,factory:u.ɵfac})},62212:(e,t,i)=>{"use strict";i.d(t,{n:()=>C});var n=i(30359),s=i(59554),o=i(37260),r=i(92786),a=i(99042),l=i(92716),c=i(58691),u=i(92614),d=i(27263),p=i(36957),h=i(89474),g=i(94441),f=i(23666),m=i(90364),v=i(39194);const y=p.vh.array(p.NQ,"collapsedGroupings",{deserializer:e=>e});var w=i(95607),b=i(85762),U=i(23031),_=i(92236),A=i(83924),Z=i(78627),x=i(31754),S=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const T="/";class C{constructor(e,t,i,a,l,c,u){this.organizationService=e,this.folderService=t,this.cipherService=i,this.policyService=a,this.i18nService=l,this.stateProvider=c,this.collectionService=u,this.organizationTree$=this.organizationService.memberOrganizations$.pipe((0,n.w)((e=>this.buildOrganizationTree(e)))),this._organizationFilter=new s.X(null),this.filteredFolders$=this.folderService.folderViews$.pipe((0,o.V)(this._organizationFilter),(0,n.w)((([e,t])=>this.filterFolders(e,t)))),this.folderTree$=this.filteredFolders$.pipe((0,r.U)((e=>this.buildFolderTree(e)))),this.filteredCollections$=this.collectionService.decryptedCollections$.pipe((0,o.V)(this._organizationFilter),(0,n.w)((([e,t])=>this.filterCollections(e,t)))),this.collectionTree$=this.filteredCollections$.pipe((0,r.U)((e=>this.buildCollectionTree(e)))),this.cipherTypeTree$=this.buildCipherTypeTree(),this.collapsedGroupingsState=this.stateProvider.getActive(y),this.collapsedFilterNodes$=this.collapsedGroupingsState.state$.pipe((0,r.U)((e=>new Set(e))))}getCollectionNodeFromTree(e){return S(this,void 0,void 0,(function*(){const t=yield(0,a.z)(this.collectionTree$);return v.L.getTreeNodeObject(t,e)}))}setCollapsedFilterNodes(e){return S(this,void 0,void 0,(function*(){yield this.collapsedGroupingsState.update((()=>Array.from(e)))}))}getCollapsedFilterNodes(){return S(this,void 0,void 0,(function*(){return yield(0,a.z)(this.collapsedFilterNodes$)}))}getOrganizationFilter(){return this._organizationFilter}setOrganizationFilter(e){"AllVaults"!=(null==e?void 0:e.id)?this._organizationFilter.next(e):this._organizationFilter.next(null)}expandOrgFilter(){return S(this,void 0,void 0,(function*(){const e=yield(0,a.z)(this.collapsedFilterNodes$);e.has("AllVaults")&&(e.delete("AllVaults"),yield this.setCollapsedFilterNodes(e))}))}buildOrganizationTree(e){return S(this,void 0,void 0,(function*(){const t=this.getOrganizationFilterHead();if(!(yield this.policyService.policyAppliesToUser(u.Mi.PersonalOwnership))){const e=this.getOrganizationFilterMyVault();t.children.push(e)}if((yield this.policyService.policyAppliesToUser(u.Mi.SingleOrg))&&(e=e.slice(0,1)),e){const i=[];e.forEach((e=>{const n=e;n.icon="bwi-business";const s=new g.O(n,t,n.name);i.push(s)})),i.sort(((e,t)=>e.node.name.localeCompare(t.node.name))),t.children.push(...i)}return t}))}getOrganizationFilterHead(){const e=new d.c;return e.enabled=!0,new g.O(e,null,"allVaults","AllVaults")}getOrganizationFilterMyVault(){const e=new d.c;return e.id="MyVault",e.icon="bwi-user",e.enabled=!0,e.hideOptions=!0,new g.O(e,null,this.i18nService.t("myVault"))}buildTypeTree(e,t){const i=new g.O(e,null);return null==t||t.forEach((e=>{const t=new g.O(e,i,e.name);i.children.push(t)})),(0,l.of)(i)}filterCollections(e,t){return S(this,void 0,void 0,(function*(){return null!=(null==t?void 0:t.id)?e.filter((e=>e.organizationId===t.id)):e}))}buildCollectionTree(e){const t=this.getCollectionFilterHead();if(!e)return t;const i=[];return e.sort(((e,t)=>this.i18nService.collator.compare(e.name,t.name))).forEach((e=>{const t=new f.n;t.id=e.id,t.organizationId=e.organizationId,t.icon="bwi-collection",e instanceof w.e&&(t.groups=e.groups,t.assigned=e.assigned);const n=null!=e.name?e.name.replace(/^\/+|\/+$/g,"").split(T):[];v.L.nestedTraverse(i,0,n,t,null,T)})),i.forEach((e=>{e.parent=t,t.children.push(e)})),t}getCollectionFilterHead(){const e=new f.n;return new g.O(e,null,"collections","AllCollections")}filterFolders(e,t){return S(this,void 0,void 0,(function*(){if(null==(null==t?void 0:t.id)||"MyVault"==(null==t?void 0:t.id))return e;const i=(yield this.cipherService.getAllDecrypted()).filter((e=>e.organizationId==(null==t?void 0:t.id)));return e.filter((e=>i.some((t=>t.folderId==e.id))||null==e.id))}))}buildFolderTree(e){const t=this.getFolderFilterHead();if(!e)return t;const i=[];return e.forEach((e=>{const t=new m.a;t.id=e.id,t.revisionDate=e.revisionDate,t.icon="bwi-folder";const n=null!=e.name?e.name.replace(/^\/+|\/+$/g,"").split(T):[];v.L.nestedTraverse(i,0,n,t,null,T)})),i.forEach((e=>{e.parent=t,t.children.push(e)})),t}getFolderFilterHead(){const e=new m.a;return new g.O(e,null,"folders","AllFolders")}buildCipherTypeTree(){const e=[{id:"favorites",name:this.i18nService.t("favorites"),type:"favorites",icon:"bwi-star"},{id:"login",name:this.i18nService.t("typeLogin"),type:h.Ou.Login,icon:"bwi-globe"},{id:"card",name:this.i18nService.t("typeCard"),type:h.Ou.Card,icon:"bwi-credit-card"},{id:"identity",name:this.i18nService.t("typeIdentity"),type:h.Ou.Identity,icon:"bwi-id-card"},{id:"note",name:this.i18nService.t("typeSecureNote"),type:h.Ou.SecureNote,icon:"bwi-sticky-note"}];return this.buildTypeTree({id:"AllItems",name:"allItems",type:"all",icon:""},e)}}C.ɵfac=function(e){return new(e||C)(b.LFG(c.Mn),b.LFG(U.s),b.LFG(_.u),b.LFG(A.d),b.LFG(Z.D),b.LFG(p.X9),b.LFG(x.a))},C.ɵprov=b.Yz7({token:C,factory:C.ɵfac})},26187:(e,t,i)=>{"use strict";i.d(t,{g:()=>D,n:()=>L});var n=i(85762),s=i(54019),o=i(68362),r=i(92786),a=i(27263),l=(i(27643),i(75028)),c=i(28508),u=i(8111),d=i(33245),p=i(82933),h=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const g=function(e){return{active:e}};function f(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"button",8),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw(3);return n.KtG(t.onFilterSelect(t.headerNode))})),n.ALo(1,"i18n"),n.ALo(2,"i18n"),n._uU(3,"\n      "),n.TgZ(4,"h3",9),n._uU(5),n.ALo(6,"i18n"),n.qZA(),n._uU(7,"\n    "),n.qZA()}if(2&e){const e=n.oxw(3);n.hYB("appA11yTitle","",n.lcZ(1,4,e.isOrganizationFilter?"vault":"filter"),": ",n.lcZ(2,6,e.headerNode.node.name),""),n.xp6(4),n.Q6J("ngClass",n.VKq(10,g,e.isAllVaultsSelected||e.isNodeSelected(e.headerNode))),n.xp6(1),n.hij("\n         ",n.lcZ(6,8,e.headerNode.node.name),"\n      ")}}function m(e,t){if(1&e&&(n.TgZ(0,"h3",10),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e){const e=n.oxw(3);n.xp6(1),n.hij("\n       ",n.lcZ(2,1,e.headerNode.node.name),"\n    ")}}function v(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"div",3),n._uU(1,"\n    "),n.TgZ(2,"button",4),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw(2);return n.KtG(t.toggleCollapse(t.headerNode.node))})),n.ALo(3,"i18n"),n.ALo(4,"i18n"),n._uU(5,"\n      "),n._UZ(6,"i",5),n._uU(7,"\n    "),n.qZA(),n._uU(8,"\n    "),n.YNc(9,f,8,12,"button",6),n._uU(10,"\n    "),n.YNc(11,m,3,3,"h3",7),n._uU(12,"\n  "),n.qZA()}if(2&e){const e=n.oxw(2);n.xp6(2),n.hYB("appA11yTitle","",n.lcZ(3,6,"toggleCollapse"),": ",n.lcZ(4,8,e.headerNode.node.name),""),n.uIk("aria-expanded",!e.isCollapsed(e.headerNode.node)),n.xp6(4),n.Q6J("ngClass",e.isCollapsed(e.headerNode.node)?"bwi-angle-right":"bwi-angle-down"),n.xp6(3),n.Q6J("ngIf",e.headerInfo.isSelectable),n.xp6(2),n.Q6J("ngIf",!e.headerInfo.isSelectable)}}const y=function(e,t){return{"bwi-angle-right":e,"bwi-angle-down":t}};function w(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"button",25),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw().$implicit,i=n.oxw(4);return n.KtG(i.toggleCollapse(t.node))})),n.ALo(1,"i18n"),n._uU(2,"\n            "),n._UZ(3,"i",5),n._uU(4,"\n          "),n.qZA()}if(2&e){const e=n.oxw().$implicit,t=n.oxw(4);n.hYB("appA11yTitle","",n.lcZ(1,5,"toggleCollapse"),": ",e.node.name,""),n.uIk("aria-expanded",!t.isCollapsed(e.node))("aria-controls",e.node.name+"_children"),n.xp6(3),n.Q6J("ngClass",n.WLB(7,y,t.isCollapsed(e.node),!t.isCollapsed(e.node)))}}function b(e,t){if(1&e&&n._UZ(0,"i",26),2&e){const e=n.oxw().$implicit;n.Gre("bwi bwi-fw ",e.node.icon,"")}}function U(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"button",27),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw().$implicit,i=n.oxw(4);return n.KtG(i.onEdit(t))})),n.ALo(1,"i18n"),n._uU(2,"\n              "),n._UZ(3,"i",28),n._uU(4,"\n            "),n.qZA()}if(2&e){const e=n.oxw(5);n.s9C("appA11yTitle",n.lcZ(1,1,e.editInfo.text))}}function _(e,t){1&e&&(n._UZ(0,"i",29),n.ALo(1,"i18n"),n.ALo(2,"i18n")),2&e&&(n.s9C("appA11yTitle",n.lcZ(2,4,"organizationIsDisabled")),n.uIk("aria-label",n.lcZ(1,2,"organizationIsDisabled")))}function A(e,t){1&e&&n.GkF(0)}function Z(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n              "),n.YNc(2,A,1,0,"ng-container",30),n._uU(3,"\n            "),n.BQk()),2&e){const e=n.oxw().$implicit,t=n.oxw(4);n.xp6(2),n.Q6J("ngComponentOutlet",t.optionsInfo.component)("ngComponentOutletInjector",t.createInjector(e.node))}}function x(e,t){1&e&&(n.ynx(0),n._uU(1,"\n          "),n.BQk())}const S=function(e){return{$implicit:e}};function T(e,t){if(1&e&&(n.TgZ(0,"ul",31),n._uU(1,"\n          "),n.YNc(2,x,2,0,"ng-container",13),n._uU(3,"\n        "),n.qZA()),2&e){const e=n.oxw().$implicit;n.oxw(2);const t=n.MAs(3);n.Q6J("id",e.node.name+"_children"),n.xp6(2),n.Q6J("ngTemplateOutlet",t)("ngTemplateOutletContext",n.VKq(3,S,e.children))}}const C=function(e){return{"disabled-organization":e}};function O(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"li",16),n._uU(1,"\n        "),n.TgZ(2,"span",17),n._uU(3,"\n          "),n.YNc(4,w,5,10,"button",18),n._uU(5,"\n          "),n.TgZ(6,"button",19),n.NdJ("click",(function(){const t=n.CHM(e).$implicit,i=n.oxw(4);return n.KtG(i.onFilterSelect(t))})),n.ALo(7,"i18n"),n._uU(8,"\n            "),n.YNc(9,b,1,3,"i",20),n._uU(10),n.qZA(),n._uU(11,"\n          "),n.TgZ(12,"span",21),n._uU(13,"\n            "),n.YNc(14,U,5,3,"button",22),n._uU(15,"\n            "),n.YNc(16,_,3,6,"i",23),n._uU(17,"\n            "),n.YNc(18,Z,4,2,"ng-container",0),n._uU(19,"\n          "),n.qZA(),n._uU(20,"\n        "),n.qZA(),n._uU(21,"\n        "),n.YNc(22,T,4,5,"ul",24),n._uU(23,"\n      "),n.qZA()}if(2&e){const e=t.$implicit,i=n.oxw(4);n.Q6J("ngClass",n.VKq(13,g,i.isNodeSelected(e))),n.xp6(4),n.Q6J("ngIf",e.children.length),n.xp6(2),n.hYB("appA11yTitle","",i.isOrganizationFilter?"vault":n.lcZ(7,11,"filter"),": ",e.node.name,""),n.Q6J("ngClass",n.VKq(15,C,i.isOrganizationFilter&&!e.node.enabled)),n.xp6(3),n.Q6J("ngIf",0===e.children.length),n.xp6(1),n.hij("\n             ",e.node.name,"\n          "),n.xp6(4),n.Q6J("ngIf",i.editInfo&&e.node.id),n.xp6(2),n.Q6J("ngIf",i.isOrganizationFilter&&!e.node.enabled),n.xp6(2),n.Q6J("ngIf",i.optionsInfo&&!e.node.hideOptions),n.xp6(4),n.Q6J("ngIf",e.children.length&&!i.isCollapsed(e.node))}}function k(e,t){if(1&e&&(n._uU(0,"\n      "),n.YNc(1,O,24,17,"li",15),n._uU(2,"\n    ")),2&e){const e=t.$implicit;n.xp6(1),n.Q6J("ngForOf",e)}}function P(e,t){1&e&&n.GkF(0)}function q(e,t){if(1&e&&(n.TgZ(0,"li",32),n._uU(1,"\n      "),n.TgZ(2,"span",17),n._uU(3,"\n        "),n.TgZ(4,"a",33),n._uU(5,"\n          "),n._UZ(6,"i",34),n._uU(7),n.ALo(8,"i18n"),n.qZA(),n._uU(9,"\n      "),n.qZA(),n._uU(10,"\n    "),n.qZA()),2&e){const e=n.oxw(3);n.xp6(4),n.s9C("routerLink",e.addInfo.route),n.xp6(3),n.hij("\n           ",n.lcZ(8,2,e.addInfo.text),"\n        ")}}function I(e,t){if(1&e&&(n.TgZ(0,"ul",11),n._uU(1,"\n    "),n.YNc(2,k,3,1,"ng-template",null,12,n.W1O),n._uU(4,"\n    "),n.YNc(5,P,1,0,"ng-container",13),n._uU(6,"\n    "),n.YNc(7,q,11,4,"li",14),n._uU(8,"\n  "),n.qZA()),2&e){const e=n.MAs(3),t=n.oxw(2);n.MGl("id","",t.headerNode.node.name,"-filters"),n.xp6(5),n.Q6J("ngTemplateOutlet",e)("ngTemplateOutletContext",n.VKq(4,S,t.filters)),n.xp6(2),n.Q6J("ngIf",t.showAddLink)}}function M(e,t){1&e&&n._UZ(0,"hr")}function N(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n  "),n.YNc(2,v,13,10,"div",1),n._uU(3,"\n  "),n.YNc(4,I,9,6,"ul",2),n._uU(5,"\n  "),n.YNc(6,M,1,0,"hr",0),n._uU(7,"\n"),n.BQk()),2&e){const e=n.oxw();n.xp6(2),n.Q6J("ngIf",e.headerInfo.showHeader),n.xp6(2),n.Q6J("ngIf",!e.isCollapsed(e.headerNode.node)),n.xp6(2),n.Q6J("ngIf",e.divider)}}class L{constructor(e,t){this.vaultFilterService=e,this.injector=t,this.destroy$=new s.x,this.collapsedFilterNodes=new Set,this.injectors=new Map,this.vaultFilterService.collapsedFilterNodes$.pipe((0,o.R)(this.destroy$)).subscribe((e=>{this.collapsedFilterNodes=e}))}ngOnInit(){var e,t;return h(this,void 0,void 0,(function*(){null===(t=null===(e=this.section)||void 0===e?void 0:e.data$)||void 0===t||t.pipe((0,o.R)(this.destroy$)).subscribe((e=>{this.data=e})),this.vaultFilterService.getOrganizationFilter().pipe((0,o.R)(this.destroy$)).subscribe((e=>{this.flexibleCollectionsEnabled=null!=e&&e.flexibleCollections}))}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get headerNode(){return this.data}get headerInfo(){return this.section.header}get filters(){var e;return null===(e=this.data)||void 0===e?void 0:e.children}get isOrganizationFilter(){return this.data.node instanceof a.c}get isAllVaultsSelected(){return this.isOrganizationFilter&&!this.activeFilter.selectedOrganizationNode}isNodeSelected(e){const{organizationId:t,cipherTypeId:i,folderId:n,collectionId:s,isCollectionSelected:o}=this.activeFilter,r=this.flexibleCollectionsEnabled?"AllCollections"===(null==e?void 0:e.node.id)&&(o||"AllCollections"===s):s===(null==e?void 0:e.node.id);return t===(null==e?void 0:e.node.id)||i===(null==e?void 0:e.node.id)||n===(null==e?void 0:e.node.id)||r}onFilterSelect(e){var t;return h(this,void 0,void 0,(function*(){yield null===(t=this.section)||void 0===t?void 0:t.action(e)}))}get editInfo(){var e;return null===(e=this.section)||void 0===e?void 0:e.edit}onEdit(e){var t,i;null===(i=null===(t=this.section)||void 0===t?void 0:t.edit)||void 0===i||i.action(e.node)}get addInfo(){return this.section.add}get showAddLink(){return this.section.add&&this.section.add.route}onAdd(){var e,t;return h(this,void 0,void 0,(function*(){null===(t=null===(e=this.section)||void 0===e?void 0:e.add)||void 0===t||t.action()}))}get optionsInfo(){var e;return null===(e=this.section)||void 0===e?void 0:e.options}get divider(){var e;return null===(e=this.section)||void 0===e?void 0:e.divider}isCollapsed(e){return this.collapsedFilterNodes.has(e.id)}toggleCollapse(e){return h(this,void 0,void 0,(function*(){this.collapsedFilterNodes.has(e.id)?this.collapsedFilterNodes.delete(e.id):this.collapsedFilterNodes.add(e.id),yield this.vaultFilterService.setCollapsedFilterNodes(this.collapsedFilterNodes)}))}createInjector(e){let t=this.injectors.get(e.id);if(!t){const i=this.section.data$.pipe((0,r.U)((t=>{var i,n;return null===(n=null===(i=null==t?void 0:t.children)||void 0===i?void 0:i.find((t=>t.node.id===e.id)))||void 0===n?void 0:n.node})));t=n.zs3.create({providers:[{provide:D,useValue:i}],parent:this.injector}),this.injectors.set(e.id,t)}return t}}L.ɵfac=function(e){return new(e||L)(n.Y36(l.n),n.Y36(n.zs3))},L.ɵcmp=n.Xpm({type:L,selectors:[["app-filter-section"]],inputs:{activeFilter:"activeFilter",section:"section"},decls:2,vars:1,consts:[[4,"ngIf"],["class","filter-heading",4,"ngIf"],["class","filter-options",3,"id",4,"ngIf"],[1,"filter-heading"],["type","button","aria-controls","sub-filters",1,"toggle-button",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-fw",3,"ngClass"],["type","button","class","filter-button",3,"appA11yTitle","click",4,"ngIf"],["class","filter-title",4,"ngIf"],["type","button",1,"filter-button",3,"appA11yTitle","click"],[3,"ngClass"],[1,"filter-title"],[1,"filter-options",3,"id"],["recursiveFilters",""],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","filter-option",4,"ngIf"],["class","filter-option",3,"ngClass",4,"ngFor","ngForOf"],[1,"filter-option",3,"ngClass"],[1,"filter-buttons"],["type","button","class","toggle-button",3,"appA11yTitle","click",4,"ngIf"],["type","button",1,"filter-button",3,"appA11yTitle","ngClass","click"],["aria-hidden","true",3,"class",4,"ngIf"],[1,"ml-auto","tw-flex","tw-items-center"],["type","button","class","edit-button",3,"appA11yTitle","click",4,"ngIf"],["class","org-options bwi bwi-fw bwi-exclamation-triangle text-danger",3,"appA11yTitle",4,"ngIf"],["class","nested-filter-options",3,"id",4,"ngIf"],["type","button",1,"toggle-button",3,"appA11yTitle","click"],["aria-hidden","true"],["type","button",1,"edit-button",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-pencil","bwi-fw"],[1,"org-options","bwi","bwi-fw","bwi-exclamation-triangle","text-danger",3,"appA11yTitle"],[4,"ngComponentOutlet","ngComponentOutletInjector"],[1,"nested-filter-options",3,"id"],[1,"filter-option"],["href","#",1,"filter-button",3,"routerLink"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-fw"]],template:function(e,t){1&e&&(n.YNc(0,N,8,3,"ng-container",0),n._uU(1,"\n")),2&e&&n.Q6J("ngIf",t.filters&&t.filters.length)},dependencies:[c.mk,c.$G,c.sg,c.O5,c.tP,u.rH,d.B,p.C],encapsulation:2});const D=new n.OlP("OptionsInput")},4003:(e,t,i)=>{"use strict";i.d(t,{E:()=>o});var n=i(89474),s=i(16776);function o(e){return t=>!("favorites"===e.type&&!t.favorite)&&(("card"!==e.type||t.type===n.Ou.Card)&&(("identity"!==e.type||t.type===n.Ou.Identity)&&(("login"!==e.type||t.type===n.Ou.Login)&&(("note"!==e.type||t.type===n.Ou.SecureNote)&&(!("trash"===e.type&&!t.isDeleted)&&(("trash"===e.type||!t.isDeleted)&&((e.folderId!==s.JK||null===t.folderId)&&((void 0===e.folderId||e.folderId===s.oT||e.folderId===s.JK||t.folderId===e.folderId)&&(e.collectionId!==s.oT&&((e.collectionId!==s.JK||!(null==t.organizationId||null!=t.collectionIds&&t.collectionIds.length>0))&&(!!(void 0===e.collectionId||e.collectionId===s.oT||e.collectionId===s.JK||null!=t.collectionIds&&t.collectionIds.includes(e.collectionId))&&((e.organizationId!==s.JK||null==t.organizationId)&&(void 0===e.organizationId||e.organizationId===s.JK||t.organizationId===e.organizationId)))))))))))))}},16776:(e,t,i)=>{"use strict";i.d(t,{JK:()=>n,aC:()=>r,oT:()=>s});const n="unassigned",s="all",o=["favorites","login","card","identity","note","trash",s];function r(e){return o.includes(e)}},27643:(e,t,i)=>{"use strict";i.d(t,{l:()=>s});var n=i(89474);class s{get collectionBreadcrumbs(){if(!this.isCollectionSelected)return[];const e=[this.selectedCollectionNode];for(;null!=e[e.length-1].parent;)e.push(e[e.length-1].parent);return e.slice(1).reverse()}get isCollectionSelected(){return null!=this.selectedCollectionNode&&"AllCollections"!==this.selectedCollectionNode.node.id}get isUnassignedCollectionSelected(){return null!=this.selectedCollectionNode&&null===this.selectedCollectionNode.node.id}get isMyVaultSelected(){var e;return"MyVault"===(null===(e=this.selectedOrganizationNode)||void 0===e?void 0:e.node.id)}get isFavorites(){var e;return"favorites"===(null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.type)}get isDeleted(){var e;return"trash"===(null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.type)||null}get organizationId(){var e;return null===(e=this.selectedOrganizationNode)||void 0===e?void 0:e.node.id}get cipherType(){var e,t;return(null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.type)in n.Ou?null===(t=this.selectedCipherTypeNode)||void 0===t?void 0:t.node.type:null}get cipherStatus(){var e;return null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.type}get cipherTypeId(){var e;return null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.id}get folderId(){var e;return null===(e=this.selectedFolderNode)||void 0===e?void 0:e.node.id}get collectionId(){var e;return null===(e=this.selectedCollectionNode)||void 0===e?void 0:e.node.id}constructor(e){Object.assign(this,e)}resetFilter(){this.selectedCipherTypeNode=null,this.selectedFolderNode=null,this.selectedCollectionNode=null}resetOrganization(){this.selectedOrganizationNode=null}buildFilter(){return e=>{let t=!0;return this.isFavorites&&t&&(t=e.favorite),this.isDeleted&&t&&(t=e.isDeleted),this.cipherType&&t&&(t=e.type===this.cipherType),this.selectedFolderNode&&(null===this.folderId&&t&&(t=null===e.folderId),null!==this.folderId&&t&&(t=e.folderId===this.folderId)),this.selectedCollectionNode&&("AllCollections"===this.collectionId&&t&&(t=!1),null===this.collectionId&&t&&(t=null!=e.organizationId&&(null==e.collectionIds||0===e.collectionIds.length)),null!==this.collectionId&&"AllCollections"!==this.collectionId&&t&&(t=null!=e.collectionIds&&e.collectionIds.includes(this.collectionId))),this.selectedOrganizationNode&&("MyVault"===this.organizationId&&t?t=null===e.organizationId:null!==this.organizationId&&t&&(t=e.organizationId===this.organizationId)),t}}}},98913:(e,t,i)=>{"use strict";i.d(t,{d:()=>r});var n=i(27420),s=i(71146),o=i(85762);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵmod=o.oAB({type:r}),r.ɵinj=o.cJS({imports:[s.m,n.t,s.m,n.t]})},24415:(e,t,i)=>{"use strict";i.d(t,{Z:()=>Qe});var n=i(58691),s=i(34961),o=i(39553),r=i(61265),a=i(19572),l=i(25406),c=i(1018),u=i(85762),d=i(92236),p=i(23031),h=i(78627),g=i(99721),f=i(98438),m=i(58172),v=i(31754),y=i(8067),w=i(55602),b=i(87483),U=i(83924),_=i(66459),A=i(88701),Z=i(73369),x=i(62357),S=i(28508),T=i(65254),C=i(384),O=i(37513),k=i(33245),P=i(24610),q=i(53707),I=i(85356),M=i(2051),N=i(66385),L=i(21989),D=i(12492),E=i(78696),F=i(55039),R=i(82933),J=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function z(e,t){1&e&&(u.TgZ(0,"app-callout",26),u._uU(1),u.ALo(2,"i18n"),u.qZA()),2&e&&(u.xp6(1),u.hij("\n          ",u.lcZ(2,1,"personalOwnershipPolicyInEffect"),"\n        "))}function Y(e,t){if(1&e&&(u.TgZ(0,"option",30),u._uU(1),u.qZA()),2&e){const e=t.$implicit;u.Q6J("ngValue",e.value),u.xp6(1),u.Oqu(e.name)}}function K(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"div",16),u._uU(1,"\n          "),u.TgZ(2,"div",17),u._uU(3,"\n            "),u.TgZ(4,"label",27),u._uU(5),u.ALo(6,"i18n"),u.qZA(),u._uU(7,"\n            "),u.TgZ(8,"select",28),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.type=t)})),u._uU(9,"\n              "),u.YNc(10,Y,2,2,"option",29),u._uU(11,"\n            "),u.qZA(),u._uU(12,"\n          "),u.qZA(),u._uU(13,"\n        "),u.qZA()}if(2&e){const e=u.oxw(2);u.xp6(5),u.Oqu(u.lcZ(6,4,"whatTypeOfItem")),u.xp6(3),u.Q6J("ngModel",e.cipher.type)("disabled",e.cipher.isDeleted),u.xp6(2),u.Q6J("ngForOf",e.typeOptions)}}function B(e,t){if(1&e&&(u.TgZ(0,"option",30),u._uU(1),u.qZA()),2&e){const e=t.$implicit;u.Q6J("ngValue",e.id),u.xp6(1),u.Oqu(e.name)}}function Q(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"div",17),u._uU(1,"\n            "),u.TgZ(2,"label",31),u._uU(3),u.ALo(4,"i18n"),u.qZA(),u._uU(5,"\n            "),u.TgZ(6,"select",32),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.folderId=t)})),u._uU(7,"\n              "),u.YNc(8,B,2,2,"option",29),u.ALo(9,"async"),u._uU(10,"\n            "),u.qZA(),u._uU(11,"\n          "),u.qZA()}if(2&e){const e=u.oxw(2);u.xp6(3),u.Oqu(u.lcZ(4,4,"folder")),u.xp6(3),u.Q6J("ngModel",e.cipher.folderId)("disabled",e.cipher.isDeleted||e.viewOnly),u.xp6(2),u.Q6J("ngForOf",u.lcZ(9,6,e.folders$))}}function G(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"div",41),u._uU(1,"\n                  "),u.TgZ(2,"button",54),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(3);return u.KtG(t.copy(t.cipher.login.username,"username","Username"))})),u.ALo(3,"i18n"),u._uU(4,"\n                    "),u._UZ(5,"i",44),u._uU(6,"\n                  "),u.qZA(),u._uU(7,"\n                "),u.qZA()}2&e&&(u.xp6(2),u.s9C("appA11yTitle",u.lcZ(3,1,"copyUsername")))}function j(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"a",62),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(4);return u.KtG(t.generatePassword())})),u.ALo(1,"i18n"),u._uU(2,"\n                    "),u._UZ(3,"i",63),u._uU(4,"\n                  "),u.qZA()}2&e&&u.s9C("appA11yTitle",u.lcZ(1,1,"generatePassword"))}function V(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"a",64),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(4);return u.KtG(t.togglePasswordCount())})),u.ALo(1,"i18n"),u._uU(2,"\n                    "),u._UZ(3,"i",65),u._uU(4,"\n                  "),u.qZA()}2&e&&u.Q6J("appA11yTitle",u.lcZ(1,1,"toggleCharacterCount"))}function $(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"div",55),u._uU(1,"\n                  "),u.YNc(2,j,5,3,"a",56),u._uU(3,"\n                  "),u.TgZ(4,"a",57,58),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(3);return u.KtG(t.checkPassword())})),u.ALo(6,"i18n"),u._uU(7,"\n                    "),u._UZ(8,"i",59),u._uU(9,"\n                    "),u._UZ(10,"i",60),u.ALo(11,"i18n"),u._uU(12,"\n                  "),u.qZA(),u._uU(13,"\n                  "),u.YNc(14,V,5,3,"a",61),u._uU(15,"\n                "),u.qZA()}if(2&e){const e=u.MAs(5),t=u.oxw(3);u.xp6(2),u.Q6J("ngIf",t.cipher.viewPassword&&!(!t.cipher.edit&&t.editMode)),u.xp6(2),u.s9C("appA11yTitle",u.lcZ(6,7,"checkPassword")),u.Q6J("appApiAction",t.checkPasswordPromise),u.xp6(4),u.Q6J("hidden",e.loading),u.xp6(2),u.s9C("title",u.lcZ(11,9,"loading")),u.Q6J("hidden",!e.loading),u.xp6(4),u.Q6J("ngIf",t.cipher.viewPassword)}}function H(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"div",66),u._uU(1,"\n            "),u.TgZ(2,"label"),u._uU(3),u.ALo(4,"i18n"),u.qZA(),u._uU(5,"\n            "),u.TgZ(6,"div",67),u._uU(7,"\n              "),u._UZ(8,"bit-color-password",68),u._uU(9,"\n              "),u.TgZ(10,"button",69),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(3);return u.KtG(t.togglePasswordCount())})),u._uU(11),u.ALo(12,"i18n"),u.qZA(),u._uU(13,"\n            "),u.qZA(),u._uU(14,"\n          "),u.qZA()}if(2&e){const e=u.oxw(3);u.xp6(3),u.Oqu(u.lcZ(4,4,"passwordCharacterCount")),u.xp6(5),u.Q6J("password",e.cipher.login.password)("showCount",!0),u.xp6(3),u.hij("\n                ",u.lcZ(12,6,"hide"),"\n              ")}}function W(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"button",74),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(4);return u.KtG(t.removePasskey())})),u.ALo(1,"i18n"),u._uU(2,"\n                    "),u._UZ(3,"i",75),u._uU(4,"\n                  "),u.qZA()}2&e&&u.s9C("appA11yTitle",u.lcZ(1,1,"removePasskey"))}function X(e,t){if(1&e&&(u.ynx(0),u._uU(1,"\n            "),u.TgZ(2,"div",46),u._uU(3,"\n              "),u.TgZ(4,"div",47),u._uU(5,"\n                "),u.TgZ(6,"label",70),u._uU(7),u.ALo(8,"i18n"),u.qZA(),u._uU(9,"\n                "),u.TgZ(10,"div",71),u.ALo(11,"i18n"),u._uU(12,"\n                  "),u._UZ(13,"input",72),u._uU(14,"\n                  "),u.YNc(15,W,5,3,"button",73),u._uU(16,"\n                "),u.qZA(),u._uU(17,"\n              "),u.qZA(),u._uU(18,"\n            "),u.qZA(),u._uU(19,"\n          "),u.BQk()),2&e){const e=u.oxw(3);u.xp6(7),u.Oqu(u.lcZ(8,5,"typePasskey")),u.xp6(3),u.zWS("aria-label","",u.lcZ(11,7,"typePasskey")," ",e.fido2CredentialCreationDateValue,""),u.xp6(3),u.Q6J("value",e.fido2CredentialCreationDateValue),u.xp6(2),u.Q6J("ngIf",!e.cipher.isDeleted&&!e.viewOnly)}}const ee=function(){return{"stroke-dashoffset.px":40}};function te(e,t){1&e&&(u.TgZ(0,"div",76),u._uU(1,"\n                "),u.TgZ(2,"span",77),u._uU(3,"\n                  "),u.TgZ(4,"span",78),u._uU(5,"15"),u.qZA(),u._uU(6,"\n                  "),u.O4$(),u.TgZ(7,"svg"),u._uU(8,"\n                    "),u.TgZ(9,"g"),u._uU(10,"\n                      "),u._UZ(11,"circle",79),u._uU(12,"\n                      "),u._UZ(13,"circle",80),u._uU(14,"\n                    "),u.qZA(),u._uU(15,"\n                  "),u.qZA(),u._uU(16,"\n                "),u.qZA(),u._uU(17,"\n                "),u.kcU(),u.TgZ(18,"span",81),u.ALo(19,"i18n"),u._uU(20,"--- ---"),u.qZA(),u._uU(21,"\n                "),u._UZ(22,"i",82),u._uU(23,"\n              "),u.qZA()),2&e&&(u.xp6(11),u.Q6J("ngStyle",u.DdM(4,ee)),u.xp6(7),u.s9C("title",u.lcZ(19,2,"verificationCodeTotp")))}function ie(e,t){1&e&&u._UZ(0,"app-premium-badge",86)}function ne(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"a",87),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(4);return u.KtG(t.upgradeOrganization())})),u._uU(1),u.ALo(2,"i18n"),u.qZA()}2&e&&(u.xp6(1),u.hij("\n                  ",u.lcZ(2,1,"upgrade"),"\n                "))}function se(e,t){if(1&e&&(u.TgZ(0,"div",83),u._uU(1,"\n                "),u.YNc(2,ie,1,0,"app-premium-badge",84),u._uU(3,"\n                "),u.YNc(4,ne,3,3,"a",85),u._uU(5,"\n              "),u.qZA()),2&e){const e=u.oxw(3);u.xp6(2),u.Q6J("ngIf",!e.organization&&!e.cipher.organizationId),u.xp6(2),u.Q6J("ngIf",e.organization&&!e.organization.useTotp||!e.organization&&!e.canAccessPremium&&e.cipher.organizationId&&!e.cipher.organizationUseTotp)}}const oe=function(e){return{"stroke-dashoffset.px":e}};function re(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"div",76),u._uU(1,"\n                "),u.TgZ(2,"span",77),u._uU(3,"\n                  "),u.TgZ(4,"span",88),u._uU(5),u.qZA(),u._uU(6,"\n                  "),u.O4$(),u.TgZ(7,"svg"),u._uU(8,"\n                    "),u.TgZ(9,"g"),u._uU(10,"\n                      "),u._UZ(11,"circle",89),u._uU(12,"\n                      "),u._UZ(13,"circle",90),u._uU(14,"\n                    "),u.qZA(),u._uU(15,"\n                  "),u.qZA(),u._uU(16,"\n                "),u.qZA(),u._uU(17,"\n                "),u.kcU(),u.TgZ(18,"span",91),u.ALo(19,"i18n"),u._uU(20),u.qZA(),u._uU(21,"\n                "),u.TgZ(22,"button",92),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(3);return u.KtG(t.copy(t.totpCode,"verificationCodeTotp","TOTP"))})),u.ALo(23,"i18n"),u._uU(24,"\n                  "),u._UZ(25,"i",44),u._uU(26,"\n                "),u.qZA(),u._uU(27,"\n              "),u.qZA()}if(2&e){const e=u.oxw(3);u.xp6(5),u.Oqu(e.totpSec),u.xp6(6),u.Q6J("ngStyle",u.VKq(9,oe,e.totpDash)),u.xp6(7),u.s9C("title",u.lcZ(19,5,"verificationCodeTotp")),u.xp6(2),u.Oqu(e.totpCodeFormatted),u.xp6(2),u.s9C("appA11yTitle",u.lcZ(23,7,"copyVerificationCode"))}}function ae(e,t){if(1&e&&(u.TgZ(0,"option",30),u._uU(1),u.qZA()),2&e){const e=t.$implicit;u.Q6J("ngValue",e.value),u.xp6(1),u.hij("\n                      ",e.name,"\n                    ")}}function le(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"button",104),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw().$implicit,i=u.oxw(4);return u.KtG(i.removeUri(t))})),u.ALo(1,"i18n"),u._uU(2,"\n                    "),u._UZ(3,"i",105),u._uU(4,"\n                  "),u.qZA()}2&e&&u.s9C("appA11yTitle",u.lcZ(1,1,"remove"))}function ce(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"div",94),u.ALo(1,"i18n"),u._uU(2,"\n              "),u.TgZ(3,"div",95),u._uU(4,"\n                "),u.TgZ(5,"label",96),u._uU(6),u.ALo(7,"i18n"),u.qZA(),u._uU(8,"\n                "),u.TgZ(9,"div",34),u._uU(10,"\n                  "),u.TgZ(11,"input",97),u.NdJ("ngModelChange",(function(t){const i=u.CHM(e).$implicit;return u.KtG(i.uri=t)})),u.ALo(12,"i18n"),u.qZA(),u._uU(13,"\n                  "),u.TgZ(14,"div",41),u._uU(15,"\n                    "),u.TgZ(16,"button",42),u.NdJ("click",(function(){const t=u.CHM(e).$implicit,i=u.oxw(4);return u.KtG(i.launch(t))})),u.ALo(17,"i18n"),u._uU(18,"\n                      "),u._UZ(19,"i",98),u._uU(20,"\n                    "),u.qZA(),u._uU(21,"\n                    "),u.TgZ(22,"button",54),u.NdJ("click",(function(){const t=u.CHM(e).$implicit,i=u.oxw(4);return u.KtG(i.copy(t.uri,"uri","URI"))})),u.ALo(23,"i18n"),u._uU(24,"\n                      "),u._UZ(25,"i",44),u._uU(26,"\n                    "),u.qZA(),u._uU(27,"\n                  "),u.qZA(),u._uU(28,"\n                "),u.qZA(),u._uU(29,"\n              "),u.qZA(),u._uU(30,"\n              "),u.TgZ(31,"div",99),u._uU(32,"\n                "),u.TgZ(33,"div",37),u._uU(34,"\n                  "),u.TgZ(35,"label",96),u._uU(36),u.ALo(37,"i18n"),u.qZA(),u._uU(38,"\n                  "),u.TgZ(39,"a",100),u.ALo(40,"i18n"),u._uU(41,"\n                    "),u._UZ(42,"i",101),u._uU(43,"\n                  "),u.qZA(),u._uU(44,"\n                "),u.qZA(),u._uU(45,"\n                "),u.TgZ(46,"div",37),u._uU(47,"\n                  "),u.TgZ(48,"select",102),u.NdJ("ngModelChange",(function(t){const i=u.CHM(e).$implicit;return u.KtG(i.match=t)}))("change",(function(){const t=u.CHM(e).$implicit,i=u.oxw(4);return u.KtG(i.loginUriMatchChanged(t))})),u._uU(49,"\n                    "),u.YNc(50,ae,2,2,"option",29),u._uU(51,"\n                  "),u.qZA(),u._uU(52,"\n                  "),u.YNc(53,le,5,3,"button",103),u._uU(54,"\n                "),u.qZA(),u._uU(55,"\n              "),u.qZA(),u._uU(56,"\n            "),u.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=u.oxw(4);u.uIk("aria-label",u.xi3(1,20,"uriPosition",i+1)),u.xp6(5),u.MGl("for","loginUri",i,""),u.xp6(1),u.Oqu(u.xi3(7,23,"uriPosition",i+1)),u.xp6(5),u.MGl("id","loginUri",i,"")("name","Login.Uris[",i,"].Uri")("placeholder","",u.lcZ(12,26,"ex")," https://google.com"),u.Q6J("ngModel",e.uri)("disabled",n.cipher.isDeleted||n.viewOnly),u.xp6(5),u.s9C("appA11yTitle",u.lcZ(17,28,"launch")),u.Q6J("disabled",!e.canLaunch),u.xp6(6),u.s9C("appA11yTitle",u.lcZ(23,30,"copyUri")),u.xp6(13),u.MGl("for","loginUriMatch",i,""),u.xp6(1),u.hij("\n                    ",u.lcZ(37,32,"matchDetection"),"\n                  "),u.xp6(3),u.s9C("appA11yTitle",u.lcZ(40,34,"learnMore")),u.xp6(9),u.MGl("id","loginUriMatch",i,"")("name","Login.Uris[",i,"].Match"),u.Q6J("ngModel",e.match)("disabled",n.cipher.isDeleted||n.viewOnly),u.xp6(2),u.Q6J("ngForOf",n.uriMatchOptions),u.xp6(3),u.Q6J("ngIf",!n.cipher.isDeleted&&!n.viewOnly)}}function ue(e,t){if(1&e&&(u.ynx(0),u._uU(1,"\n            "),u.YNc(2,ce,57,36,"div",93),u._uU(3,"\n          "),u.BQk()),2&e){const e=u.oxw(3);u.xp6(2),u.Q6J("ngForOf",e.cipher.login.uris)("ngForTrackBy",e.trackByFunction)}}function de(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"a",106),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(3);return u.KtG(t.addUri())})),u._uU(1,"\n            "),u._UZ(2,"i",107),u._uU(3),u.ALo(4,"i18n"),u.qZA()}2&e&&(u.xp6(3),u.hij(" ",u.lcZ(4,1,"newUri"),"\n          "))}const pe=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}},he=function(e){return{low:e}};function ge(e,t){if(1&e){const e=u.EpF();u.ynx(0),u._uU(1,"\n          "),u.TgZ(2,"div",16),u._uU(3,"\n            "),u.TgZ(4,"div",17),u._uU(5,"\n              "),u.TgZ(6,"label",33),u._uU(7),u.ALo(8,"i18n"),u.qZA(),u._uU(9,"\n              "),u.TgZ(10,"div",34),u._uU(11,"\n                "),u.TgZ(12,"input",35),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.login.username=t)})),u.qZA(),u._uU(13,"\n                "),u.YNc(14,G,8,3,"div",36),u._uU(15,"\n              "),u.qZA(),u._uU(16,"\n            "),u.qZA(),u._uU(17,"\n            "),u.TgZ(18,"div",17),u._uU(19,"\n              "),u.TgZ(20,"div",37),u._uU(21,"\n                "),u.TgZ(22,"label",38),u._uU(23),u.ALo(24,"i18n"),u.qZA(),u._uU(25,"\n                "),u.YNc(26,$,16,11,"div",39),u._uU(27,"\n              "),u.qZA(),u._uU(28,"\n              "),u.TgZ(29,"div",34),u._uU(30,"\n                "),u.TgZ(31,"input",40),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.login.password=t)})),u.qZA(),u._uU(32,"\n                "),u.TgZ(33,"div",41),u._uU(34,"\n                  "),u.TgZ(35,"button",42),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(2);return u.KtG(t.togglePassword())})),u.ALo(36,"i18n"),u._uU(37,"\n                    "),u._UZ(38,"i",43),u._uU(39,"\n                  "),u.qZA(),u._uU(40,"\n                  "),u.TgZ(41,"button",42),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(2);return u.KtG(t.copy(t.cipher.login.password,"password","Password"))})),u.ALo(42,"i18n"),u._uU(43,"\n                    "),u._UZ(44,"i",44),u._uU(45,"\n                  "),u.qZA(),u._uU(46,"\n                "),u.qZA(),u._uU(47,"\n              "),u.qZA(),u._uU(48,"\n            "),u.qZA(),u._uU(49,"\n          "),u.qZA(),u._uU(50,"\n          "),u.YNc(51,H,15,8,"div",45),u._uU(52,"\n          "),u.YNc(53,X,20,9,"ng-container",21),u._uU(54,"\n          "),u.TgZ(55,"div",46),u._uU(56,"\n            "),u.TgZ(57,"div",47),u._uU(58,"\n              "),u.TgZ(59,"label",48),u._uU(60),u.ALo(61,"i18n"),u.qZA(),u._uU(62,"\n              "),u.TgZ(63,"input",49),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.login.totp=t)})),u.qZA(),u._uU(64,"\n            "),u.qZA(),u._uU(65,"\n            "),u.TgZ(66,"div",50),u._uU(67,"\n              "),u.YNc(68,te,24,5,"div",51),u._uU(69,"\n              "),u.YNc(70,se,6,2,"div",52),u._uU(71,"\n              "),u.YNc(72,re,28,11,"div",51),u._uU(73,"\n            "),u.qZA(),u._uU(74,"\n          "),u.qZA(),u._uU(75,"\n          "),u.YNc(76,ue,4,2,"ng-container",21),u._uU(77,"\n          "),u.YNc(78,de,5,3,"a",53),u._uU(79,"\n        "),u.BQk()}if(2&e){const e=u.oxw(2);u.xp6(7),u.Oqu(u.lcZ(8,29,"username")),u.xp6(5),u.Q6J("ngModel",e.cipher.login.username)("disabled",e.cipher.isDeleted||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),u.xp6(2),u.Q6J("ngIf",!e.cipher.isDeleted),u.xp6(9),u.Oqu(u.lcZ(24,31,"password")),u.xp6(3),u.Q6J("ngIf",!e.cipher.isDeleted&&!e.viewOnly),u.xp6(5),u.s9C("type",e.showPassword?"text":"password"),u.Q6J("ngModel",e.cipher.login.password)("disabled",e.cipher.isDeleted||!e.cipher.viewPassword||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),u.xp6(4),u.s9C("appA11yTitle",u.lcZ(36,33,"toggleVisibility")),u.Q6J("disabled",!e.cipher.viewPassword),u.xp6(3),u.Q6J("ngClass",u.WLB(39,pe,!e.showPassword,e.showPassword)),u.xp6(3),u.s9C("appA11yTitle",u.lcZ(42,35,"copyPassword")),u.Q6J("disabled",!e.cipher.viewPassword),u.xp6(10),u.Q6J("ngIf",e.showPasswordCount),u.xp6(2),u.Q6J("ngIf",e.cipher.login.hasFido2Credentials),u.xp6(7),u.Oqu(u.lcZ(61,37,"authenticatorKeyTotp")),u.xp6(3),u.s9C("type",e.cipher.viewPassword?"text":"password"),u.Q6J("ngModel",e.cipher.login.totp)("disabled",e.cipher.isDeleted||!e.cipher.viewPassword||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),u.xp6(3),u.Q6J("ngClass",u.VKq(42,he,e.totpLow)),u.xp6(2),u.Q6J("ngIf",!e.cipher.login.totp||!e.totpCode),u.xp6(2),u.Q6J("ngIf",!e.cipher.login.totp||!e.totpCode),u.xp6(2),u.Q6J("ngIf",e.cipher.login.totp&&e.totpCode),u.xp6(4),u.Q6J("ngIf",e.cipher.login.hasUris),u.xp6(2),u.Q6J("ngIf",!(e.cipher.isDeleted||e.viewOnly||!e.cipher.edit&&e.editMode))}}function fe(e,t){if(1&e&&(u.TgZ(0,"option",30),u._uU(1),u.qZA()),2&e){const e=t.$implicit;u.Q6J("ngValue",e.value),u.xp6(1),u.hij("\n                    ",e.name,"\n                  ")}}function me(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"span"),u._uU(1,"\n                "),u.TgZ(2,"select",122),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(3);return u.KtG(i.cipher.card.brand=t)})),u._uU(3,"\n                  "),u.YNc(4,fe,2,2,"option",29),u._uU(5,"\n                "),u.qZA(),u._uU(6,"\n              "),u.qZA()}if(2&e){const e=u.oxw(3);u.xp6(2),u.Q6J("ngModel",e.cipher.card.brand)("disabled",e.cipher.isDeleted||e.viewOnly),u.xp6(2),u.Q6J("ngForOf",e.cardBrandOptions)}}function ve(e,t){if(1&e&&(u._uU(0,"\n                "),u._UZ(1,"input",123),u._uU(2,"\n              ")),2&e){const e=u.oxw(3);u.xp6(1),u.Q6J("readonly",!0)("value",e.cipher.card.brand)}}function ye(e,t){if(1&e&&(u.TgZ(0,"option",30),u._uU(1),u.qZA()),2&e){const e=t.$implicit;u.Q6J("ngValue",e.value),u.xp6(1),u.hij("\n                    ",e.name,"\n                  ")}}function we(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"span"),u._uU(1,"\n                "),u.TgZ(2,"select",124),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(3);return u.KtG(i.cipher.card.expMonth=t)})),u._uU(3,"\n                  "),u.YNc(4,ye,2,2,"option",29),u._uU(5,"\n                "),u.qZA(),u._uU(6,"\n              "),u.qZA()}if(2&e){const e=u.oxw(3);u.xp6(2),u.Q6J("ngModel",e.cipher.card.expMonth)("disabled",e.cipher.isDeleted||e.viewOnly),u.xp6(2),u.Q6J("ngForOf",e.cardExpMonthOptions)}}function be(e,t){if(1&e&&(u._uU(0,"\n                "),u._UZ(1,"input",125),u._uU(2,"\n              ")),2&e){const e=u.oxw(3);u.xp6(1),u.Q6J("readonly",!0)("value",e.getCardExpMonthDisplay())}}function Ue(e,t){if(1&e){const e=u.EpF();u.ynx(0),u._uU(1,"\n          "),u.TgZ(2,"div",16),u._uU(3,"\n            "),u.TgZ(4,"div",17),u._uU(5,"\n              "),u.TgZ(6,"label",108),u._uU(7),u.ALo(8,"i18n"),u.qZA(),u._uU(9,"\n              "),u.TgZ(10,"input",109),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.card.cardholderName=t)})),u.qZA(),u._uU(11,"\n            "),u.qZA(),u._uU(12,"\n            "),u.TgZ(13,"div",17),u._uU(14,"\n              "),u.TgZ(15,"label",110),u._uU(16),u.ALo(17,"i18n"),u.qZA(),u._uU(18,"\n              "),u.YNc(19,me,7,3,"span",111),u._uU(20,"\n              "),u.YNc(21,ve,3,2,"ng-template",null,112,u.W1O),u._uU(23,"\n            "),u.qZA(),u._uU(24,"\n          "),u.qZA(),u._uU(25,"\n          "),u.TgZ(26,"div",16),u._uU(27,"\n            "),u.TgZ(28,"div",17),u._uU(29,"\n              "),u.TgZ(30,"label",113),u._uU(31),u.ALo(32,"i18n"),u.qZA(),u._uU(33,"\n              "),u.TgZ(34,"div",34),u._uU(35,"\n                "),u.TgZ(36,"input",114),u.NdJ("input",(function(){u.CHM(e);const t=u.oxw(2);return u.KtG(t.onCardNumberChange())}))("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.card.number=t)})),u.qZA(),u._uU(37,"\n                "),u.TgZ(38,"div",41),u._uU(39,"\n                  "),u.TgZ(40,"button",54),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(2);return u.KtG(t.toggleCardNumber())})),u.ALo(41,"i18n"),u._uU(42,"\n                    "),u._UZ(43,"i",43),u._uU(44,"\n                  "),u.qZA(),u._uU(45,"\n                  "),u.TgZ(46,"button",54),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(2);return u.KtG(t.copy(t.cipher.card.number,"number","Number"))})),u.ALo(47,"i18n"),u._uU(48,"\n                    "),u._UZ(49,"i",44),u._uU(50,"\n                  "),u.qZA(),u._uU(51,"\n                "),u.qZA(),u._uU(52,"\n              "),u.qZA(),u._uU(53,"\n            "),u.qZA(),u._uU(54,"\n            "),u.TgZ(55,"div",115),u._uU(56,"\n              "),u.TgZ(57,"label",116),u._uU(58),u.ALo(59,"i18n"),u.qZA(),u._uU(60,"\n              "),u.YNc(61,we,7,3,"span",111),u._uU(62,"\n              "),u.YNc(63,be,3,2,"ng-template",null,117,u.W1O),u._uU(65,"\n            "),u.qZA(),u._uU(66,"\n            "),u.TgZ(67,"div",115),u._uU(68,"\n              "),u.TgZ(69,"label",118),u._uU(70),u.ALo(71,"i18n"),u.qZA(),u._uU(72,"\n              "),u.TgZ(73,"input",119),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.card.expYear=t)})),u.ALo(74,"i18n"),u.qZA(),u._uU(75,"\n            "),u.qZA(),u._uU(76,"\n          "),u.qZA(),u._uU(77,"\n          "),u.TgZ(78,"div",16),u._uU(79,"\n            "),u.TgZ(80,"div",17),u._uU(81,"\n              "),u.TgZ(82,"label",120),u._uU(83),u.ALo(84,"i18n"),u.qZA(),u._uU(85,"\n              "),u.TgZ(86,"div",34),u._uU(87,"\n                "),u.TgZ(88,"input",121),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.card.code=t)})),u.qZA(),u._uU(89,"\n                "),u.TgZ(90,"div",41),u._uU(91,"\n                  "),u.TgZ(92,"button",54),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(2);return u.KtG(t.toggleCardCode())})),u.ALo(93,"i18n"),u._uU(94,"\n                    "),u._UZ(95,"i",43),u._uU(96,"\n                  "),u.qZA(),u._uU(97,"\n                  "),u.TgZ(98,"button",54),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(2);return u.KtG(t.copy(t.cipher.card.code,"securityCode","Security Code"))})),u.ALo(99,"i18n"),u._uU(100,"\n                    "),u._UZ(101,"i",44),u._uU(102,"\n                  "),u.qZA(),u._uU(103,"\n                "),u.qZA(),u._uU(104,"\n              "),u.qZA(),u._uU(105,"\n            "),u.qZA(),u._uU(106,"\n          "),u.qZA(),u._uU(107,"\n        "),u.BQk()}if(2&e){const e=u.MAs(22),t=u.MAs(64),i=u.oxw(2);u.xp6(7),u.Oqu(u.lcZ(8,31,"cardholderName")),u.xp6(3),u.Q6J("ngModel",i.cipher.card.cardholderName)("disabled",i.cipher.isDeleted||i.viewOnly)("readonly",!i.cipher.edit&&i.editMode),u.xp6(6),u.Oqu(u.lcZ(17,33,"brand")),u.xp6(3),u.Q6J("ngIf",!(!i.cipher.edit&&i.editMode))("ngIfElse",e),u.xp6(12),u.Oqu(u.lcZ(32,35,"number")),u.xp6(5),u.s9C("type",i.showCardNumber?"text":"password"),u.Q6J("ngModel",i.cipher.card.number)("disabled",i.cipher.isDeleted||i.viewOnly)("readonly",!i.cipher.edit&&i.editMode),u.xp6(4),u.s9C("appA11yTitle",u.lcZ(41,37,"toggleVisibility")),u.xp6(3),u.Q6J("ngClass",u.WLB(53,pe,!i.showCardNumber,i.showCardNumber)),u.xp6(3),u.s9C("appA11yTitle",u.lcZ(47,39,"copyNumber")),u.xp6(12),u.Oqu(u.lcZ(59,41,"expirationMonth")),u.xp6(3),u.Q6J("ngIf",!(!i.cipher.edit&&i.editMode))("ngIfElse",t),u.xp6(9),u.Oqu(u.lcZ(71,43,"expirationYear")),u.xp6(3),u.MGl("placeholder","",u.lcZ(74,45,"ex")," 2019"),u.Q6J("ngModel",i.cipher.card.expYear)("disabled",i.cipher.isDeleted||i.viewOnly)("readonly",!i.cipher.edit&&i.editMode),u.xp6(10),u.Oqu(u.lcZ(84,47,"securityCode")),u.xp6(5),u.s9C("type",i.showCardCode?"text":"password"),u.Q6J("ngModel",i.cipher.card.code)("disabled",i.cipher.isDeleted||i.viewOnly)("readonly",!i.cipher.edit&&i.editMode),u.xp6(4),u.s9C("appA11yTitle",u.lcZ(93,49,"toggleVisibility")),u.xp6(3),u.Q6J("ngClass",u.WLB(56,pe,!i.showCardCode,i.showCardCode)),u.xp6(3),u.s9C("appA11yTitle",u.lcZ(99,51,"securityCode"))}}function _e(e,t){if(1&e&&(u.TgZ(0,"option",30),u._uU(1),u.qZA()),2&e){const e=t.$implicit;u.Q6J("ngValue",e.value),u.xp6(1),u.hij("\n                    ",e.name,"\n                  ")}}function Ae(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"span"),u._uU(1,"\n                "),u.TgZ(2,"select",163),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(3);return u.KtG(i.cipher.identity.title=t)})),u._uU(3,"\n                  "),u.YNc(4,_e,2,2,"option",29),u._uU(5,"\n                "),u.qZA(),u._uU(6,"\n              "),u.qZA()}if(2&e){const e=u.oxw(3);u.xp6(2),u.Q6J("ngModel",e.cipher.identity.title)("disabled",e.cipher.isDeleted||e.viewOnly),u.xp6(2),u.Q6J("ngForOf",e.identityTitleOptions)}}function Ze(e,t){if(1&e&&(u._uU(0,"\n                "),u._UZ(1,"input",164),u._uU(2,"\n              ")),2&e){const e=u.oxw(3);u.xp6(1),u.Q6J("readonly",!0)("value",e.cipher.identity.title)}}function xe(e,t){if(1&e){const e=u.EpF();u.ynx(0),u._uU(1,"\n          "),u.TgZ(2,"div",16),u._uU(3,"\n            "),u.TgZ(4,"div",126),u._uU(5,"\n              "),u.TgZ(6,"label",127),u._uU(7),u.ALo(8,"i18n"),u.qZA(),u._uU(9,"\n              "),u.YNc(10,Ae,7,3,"span",111),u._uU(11,"\n              "),u.YNc(12,Ze,3,2,"ng-template",null,128,u.W1O),u._uU(14,"\n            "),u.qZA(),u._uU(15,"\n          "),u.qZA(),u._uU(16,"\n          "),u.TgZ(17,"div",16),u._uU(18,"\n            "),u.TgZ(19,"div",126),u._uU(20,"\n              "),u.TgZ(21,"label",129),u._uU(22),u.ALo(23,"i18n"),u.qZA(),u._uU(24,"\n              "),u.TgZ(25,"input",130),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.firstName=t)})),u.qZA(),u._uU(26,"\n            "),u.qZA(),u._uU(27,"\n            "),u.TgZ(28,"div",126),u._uU(29,"\n              "),u.TgZ(30,"label",131),u._uU(31),u.ALo(32,"i18n"),u.qZA(),u._uU(33,"\n              "),u.TgZ(34,"input",132),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.middleName=t)})),u.qZA(),u._uU(35,"\n            "),u.qZA(),u._uU(36,"\n            "),u.TgZ(37,"div",126),u._uU(38,"\n              "),u.TgZ(39,"label",133),u._uU(40),u.ALo(41,"i18n"),u.qZA(),u._uU(42,"\n              "),u.TgZ(43,"input",134),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.lastName=t)})),u.qZA(),u._uU(44,"\n            "),u.qZA(),u._uU(45,"\n          "),u.qZA(),u._uU(46,"\n          "),u.TgZ(47,"div",16),u._uU(48,"\n            "),u.TgZ(49,"div",126),u._uU(50,"\n              "),u.TgZ(51,"label",135),u._uU(52),u.ALo(53,"i18n"),u.qZA(),u._uU(54,"\n              "),u.TgZ(55,"input",136),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.username=t)})),u.qZA(),u._uU(56,"\n            "),u.qZA(),u._uU(57,"\n            "),u.TgZ(58,"div",126),u._uU(59,"\n              "),u.TgZ(60,"label",137),u._uU(61),u.ALo(62,"i18n"),u.qZA(),u._uU(63,"\n              "),u.TgZ(64,"input",138),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.company=t)})),u.qZA(),u._uU(65,"\n            "),u.qZA(),u._uU(66,"\n          "),u.qZA(),u._uU(67,"\n          "),u.TgZ(68,"div",16),u._uU(69,"\n            "),u.TgZ(70,"div",126),u._uU(71,"\n              "),u.TgZ(72,"label",139),u._uU(73),u.ALo(74,"i18n"),u.qZA(),u._uU(75,"\n              "),u.TgZ(76,"input",140),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.ssn=t)})),u.qZA(),u._uU(77,"\n            "),u.qZA(),u._uU(78,"\n            "),u.TgZ(79,"div",126),u._uU(80,"\n              "),u.TgZ(81,"label",141),u._uU(82),u.ALo(83,"i18n"),u.qZA(),u._uU(84,"\n              "),u.TgZ(85,"input",142),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.passportNumber=t)})),u.qZA(),u._uU(86,"\n            "),u.qZA(),u._uU(87,"\n            "),u.TgZ(88,"div",126),u._uU(89,"\n              "),u.TgZ(90,"label",143),u._uU(91),u.ALo(92,"i18n"),u.qZA(),u._uU(93,"\n              "),u.TgZ(94,"input",144),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.licenseNumber=t)})),u.qZA(),u._uU(95,"\n            "),u.qZA(),u._uU(96,"\n          "),u.qZA(),u._uU(97,"\n          "),u.TgZ(98,"div",16),u._uU(99,"\n            "),u.TgZ(100,"div",17),u._uU(101,"\n              "),u.TgZ(102,"label",145),u._uU(103),u.ALo(104,"i18n"),u.qZA(),u._uU(105,"\n              "),u.TgZ(106,"input",146),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.email=t)})),u.qZA(),u._uU(107,"\n            "),u.qZA(),u._uU(108,"\n            "),u.TgZ(109,"div",17),u._uU(110,"\n              "),u.TgZ(111,"label",147),u._uU(112),u.ALo(113,"i18n"),u.qZA(),u._uU(114,"\n              "),u.TgZ(115,"input",148),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.phone=t)})),u.qZA(),u._uU(116,"\n            "),u.qZA(),u._uU(117,"\n          "),u.qZA(),u._uU(118,"\n          "),u.TgZ(119,"div",16),u._uU(120,"\n            "),u.TgZ(121,"div",17),u._uU(122,"\n              "),u.TgZ(123,"label",149),u._uU(124),u.ALo(125,"i18n"),u.qZA(),u._uU(126,"\n              "),u.TgZ(127,"input",150),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.address1=t)})),u.qZA(),u._uU(128,"\n            "),u.qZA(),u._uU(129,"\n            "),u.TgZ(130,"div",17),u._uU(131,"\n              "),u.TgZ(132,"label",151),u._uU(133),u.ALo(134,"i18n"),u.qZA(),u._uU(135,"\n              "),u.TgZ(136,"input",152),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.address2=t)})),u.qZA(),u._uU(137,"\n            "),u.qZA(),u._uU(138,"\n          "),u.qZA(),u._uU(139,"\n          "),u.TgZ(140,"div",16),u._uU(141,"\n            "),u.TgZ(142,"div",17),u._uU(143,"\n              "),u.TgZ(144,"label",153),u._uU(145),u.ALo(146,"i18n"),u.qZA(),u._uU(147,"\n              "),u.TgZ(148,"input",154),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.address3=t)})),u.qZA(),u._uU(149,"\n            "),u.qZA(),u._uU(150,"\n            "),u.TgZ(151,"div",17),u._uU(152,"\n              "),u.TgZ(153,"label",155),u._uU(154),u.ALo(155,"i18n"),u.qZA(),u._uU(156,"\n              "),u.TgZ(157,"input",156),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.city=t)})),u.qZA(),u._uU(158,"\n            "),u.qZA(),u._uU(159,"\n          "),u.qZA(),u._uU(160,"\n          "),u.TgZ(161,"div",16),u._uU(162,"\n            "),u.TgZ(163,"div",17),u._uU(164,"\n              "),u.TgZ(165,"label",157),u._uU(166),u.ALo(167,"i18n"),u.qZA(),u._uU(168,"\n              "),u.TgZ(169,"input",158),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.state=t)})),u.qZA(),u._uU(170,"\n            "),u.qZA(),u._uU(171,"\n            "),u.TgZ(172,"div",17),u._uU(173,"\n              "),u.TgZ(174,"label",159),u._uU(175),u.ALo(176,"i18n"),u.qZA(),u._uU(177,"\n              "),u.TgZ(178,"input",160),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.postalCode=t)})),u.qZA(),u._uU(179,"\n            "),u.qZA(),u._uU(180,"\n          "),u.qZA(),u._uU(181,"\n          "),u.TgZ(182,"div",16),u._uU(183,"\n            "),u.TgZ(184,"div",17),u._uU(185,"\n              "),u.TgZ(186,"label",161),u._uU(187),u.ALo(188,"i18n"),u.qZA(),u._uU(189,"\n              "),u.TgZ(190,"input",162),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.identity.country=t)})),u.qZA(),u._uU(191,"\n            "),u.qZA(),u._uU(192,"\n          "),u.qZA(),u._uU(193,"\n        "),u.BQk()}if(2&e){const e=u.MAs(13),t=u.oxw(2);u.xp6(7),u.Oqu(u.lcZ(8,71,"title")),u.xp6(3),u.Q6J("ngIf",!(!t.cipher.edit&&t.editMode))("ngIfElse",e),u.xp6(12),u.Oqu(u.lcZ(23,73,"firstName")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.firstName)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(6),u.Oqu(u.lcZ(32,75,"middleName")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.middleName)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(6),u.Oqu(u.lcZ(41,77,"lastName")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.lastName)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(9),u.Oqu(u.lcZ(53,79,"username")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.username)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(6),u.Oqu(u.lcZ(62,81,"company")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.company)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(9),u.Oqu(u.lcZ(74,83,"ssn")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.ssn)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(6),u.Oqu(u.lcZ(83,85,"passportNumber")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.passportNumber)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(6),u.Oqu(u.lcZ(92,87,"licenseNumber")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.licenseNumber)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(9),u.Oqu(u.lcZ(104,89,"email")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.email)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(6),u.Oqu(u.lcZ(113,91,"phone")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.phone)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(9),u.Oqu(u.lcZ(125,93,"address1")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.address1)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(6),u.Oqu(u.lcZ(134,95,"address2")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.address2)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(9),u.Oqu(u.lcZ(146,97,"address3")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.address3)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(6),u.Oqu(u.lcZ(155,99,"cityTown")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.city)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(9),u.Oqu(u.lcZ(167,101,"stateProvince")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.state)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(6),u.Oqu(u.lcZ(176,103,"zipPostalCode")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.postalCode)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),u.xp6(9),u.Oqu(u.lcZ(188,105,"country")),u.xp6(3),u.Q6J("ngModel",t.cipher.identity.country)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode)}}function Se(e,t){if(1&e&&u._UZ(0,"app-vault-add-edit-custom-fields",165),2&e){const e=u.oxw(2);u.Q6J("cipher",e.cipher)("thisCipherType",e.cipher.type)("viewOnly",e.viewOnly)("copy",e.copy.bind(e))("editMode",e.editMode)}}function Te(e,t){if(1&e&&(u.TgZ(0,"option",30),u._uU(1),u.qZA()),2&e){const e=t.$implicit;u.Q6J("ngValue",e.value),u.xp6(1),u.Oqu(e.name)}}function Ce(e,t){if(1&e){const e=u.EpF();u.ynx(0),u._uU(1,"\n          "),u.TgZ(2,"h3",166),u._uU(3),u.ALo(4,"i18n"),u.qZA(),u._uU(5,"\n          "),u.TgZ(6,"div",16),u._uU(7,"\n            "),u.TgZ(8,"div",167),u._uU(9,"\n              "),u.TgZ(10,"label",168),u._uU(11),u.ALo(12,"i18n"),u.qZA(),u._uU(13,"\n              "),u.TgZ(14,"select",169),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw(2);return u.KtG(i.cipher.organizationId=t)}))("change",(function(){u.CHM(e);const t=u.oxw(2);return u.KtG(t.organizationChanged())})),u._uU(15,"\n                "),u.YNc(16,Te,2,2,"option",29),u._uU(17,"\n              "),u.qZA(),u._uU(18,"\n            "),u.qZA(),u._uU(19,"\n          "),u.qZA(),u._uU(20,"\n        "),u.BQk()}if(2&e){const e=u.oxw(2);u.xp6(3),u.Oqu(u.lcZ(4,5,"ownership")),u.xp6(8),u.Oqu(u.lcZ(12,7,"whoOwnsThisItem")),u.xp6(3),u.Q6J("ngModel",e.cipher.organizationId)("disabled",e.cipher.isDeleted||e.viewOnly),u.xp6(2),u.Q6J("ngForOf",e.ownershipOptions)}}function Oe(e,t){1&e&&(u.TgZ(0,"div"),u._uU(1),u.ALo(2,"i18n"),u.qZA()),2&e&&(u.xp6(1),u.hij("\n            ",u.lcZ(2,1,"noCollectionsInList"),"\n          "))}function ke(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"div",171),u._uU(1,"\n              "),u.TgZ(2,"input",172),u.NdJ("ngModelChange",(function(t){const i=u.CHM(e).$implicit;return u.KtG(i.checked=t)})),u.qZA(),u._uU(3,"\n              "),u.TgZ(4,"label",173),u._uU(5),u.qZA(),u._uU(6,"\n            "),u.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=u.oxw(4);u.xp6(2),u.MGl("id","collection-",i,"")("name","Collection[",i,"].Checked"),u.Q6J("ngModel",e.checked)("disabled",n.cipher.isDeleted||n.viewOnly),u.xp6(2),u.MGl("for","collection-",i,""),u.xp6(1),u.Oqu(e.name)}}function Pe(e,t){if(1&e&&(u.ynx(0),u._uU(1,"\n            "),u.YNc(2,ke,7,6,"div",170),u._uU(3,"\n          "),u.BQk()),2&e){const e=u.oxw(3);u.xp6(2),u.Q6J("ngForOf",e.collections)}}function qe(e,t){if(1&e&&(u.ynx(0),u._uU(1,"\n          "),u.TgZ(2,"h3",166),u._uU(3),u.ALo(4,"i18n"),u.qZA(),u._uU(5,"\n          "),u.YNc(6,Oe,3,3,"div",21),u._uU(7,"\n          "),u.YNc(8,Pe,4,1,"ng-container",21),u._uU(9,"\n        "),u.BQk()),2&e){const e=u.oxw(2);u.xp6(3),u.Oqu(u.lcZ(4,3,"collections")),u.xp6(3),u.Q6J("ngIf",!e.collections||!e.collections.length),u.xp6(2),u.Q6J("ngIf",e.collections&&e.collections.length)}}function Ie(e,t){if(1&e&&(u.TgZ(0,"div"),u._uU(1,"\n              "),u.TgZ(2,"b",175),u._uU(3),u.ALo(4,"i18n"),u.qZA(),u._uU(5),u.ALo(6,"date"),u.qZA()),2&e){const e=u.oxw(3);u.xp6(3),u.hij("",u.lcZ(4,2,"dateCreated"),":"),u.xp6(2),u.hij("\n              ",u.xi3(6,4,e.cipher.creationDate,"medium"),"\n            ")}}function Me(e,t){if(1&e&&(u.TgZ(0,"div"),u._uU(1,"\n              "),u.TgZ(2,"b",175),u._uU(3),u.ALo(4,"i18n"),u.qZA(),u._uU(5),u.ALo(6,"date"),u.qZA()),2&e){const e=u.oxw(3);u.xp6(3),u.hij("",u.lcZ(4,2,"datePasswordUpdated"),":"),u.xp6(2),u.hij("\n              ",u.xi3(6,4,e.cipher.passwordRevisionDisplayDate,"medium"),"\n            ")}}function Ne(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"div"),u._uU(1,"\n              "),u.TgZ(2,"b",175),u._uU(3),u.ALo(4,"i18n"),u.qZA(),u._uU(5,"\n              "),u.TgZ(6,"a",176),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(3);return u.KtG(t.viewHistory())})),u.ALo(7,"i18n"),u._uU(8),u.qZA(),u._uU(9,"\n            "),u.qZA()}if(2&e){const e=u.oxw(3);u.xp6(3),u.hij("",u.lcZ(4,3,"passwordHistory"),":"),u.xp6(3),u.s9C("title",u.lcZ(7,5,"view")),u.xp6(2),u.hij("\n                ",e.cipher.passwordHistory.length,"\n              ")}}function Le(e,t){if(1&e&&(u.TgZ(0,"div"),u._uU(1),u.ALo(2,"date"),u._UZ(3,"bit-color-password",178),u._uU(4,"\n              "),u.qZA()),2&e){const e=t.$implicit;u.xp6(1),u.hij("\n                ",u.xi3(2,2,e.lastUsedDate,"short")," -\n                "),u.xp6(2),u.Q6J("password",e.password)}}function De(e,t){if(1&e&&(u.TgZ(0,"div",86),u._uU(1,"\n              "),u.YNc(2,Le,5,5,"div",177),u._uU(3,"\n            "),u.qZA()),2&e){const e=u.oxw(3);u.xp6(2),u.Q6J("ngForOf",e.cipher.passwordHistory)}}function Ee(e,t){if(1&e&&(u.ynx(0),u._uU(1,"\n          "),u.TgZ(2,"div",174),u._uU(3,"\n            "),u.TgZ(4,"div"),u._uU(5,"\n              "),u.TgZ(6,"b",175),u._uU(7),u.ALo(8,"i18n"),u.qZA(),u._uU(9),u.ALo(10,"date"),u.qZA(),u._uU(11,"\n            "),u.YNc(12,Ie,7,7,"div",21),u._uU(13,"\n            "),u.YNc(14,Me,7,7,"div",21),u._uU(15,"\n            "),u.YNc(16,Ne,10,7,"div",21),u._uU(17,"\n            "),u.YNc(18,De,4,1,"div",84),u._uU(19,"\n          "),u.qZA(),u._uU(20,"\n        "),u.BQk()),2&e){const e=u.oxw(2);u.xp6(7),u.hij("",u.lcZ(8,6,"dateUpdated"),":"),u.xp6(2),u.hij("\n              ",u.xi3(10,8,e.cipher.revisionDate,"medium"),"\n            "),u.xp6(3),u.Q6J("ngIf",e.cipher.creationDate),u.xp6(2),u.Q6J("ngIf",e.showRevisionDate),u.xp6(2),u.Q6J("ngIf",e.hasPasswordHistory),u.xp6(2),u.Q6J("ngIf",e.viewingPasswordHistory)}}function Fe(e,t){if(1&e){const e=u.EpF();u.ynx(0),u._uU(1,"\n          "),u.TgZ(2,"h3",166),u._uU(3),u.ALo(4,"i18n"),u.qZA(),u._uU(5,"\n          "),u.TgZ(6,"div",171),u._uU(7,"\n            "),u.TgZ(8,"input",179),u.NdJ("change",(function(){u.CHM(e);const t=u.oxw(2);return u.KtG(t.repromptChanged())})),u.qZA(),u._uU(9,"\n            "),u.TgZ(10,"label",180),u._uU(11),u.ALo(12,"i18n"),u.qZA(),u._uU(13,"\n            "),u.TgZ(14,"a",181),u.ALo(15,"i18n"),u._uU(16,"\n              "),u._UZ(17,"i",101),u._uU(18,"\n            "),u.qZA(),u._uU(19,"\n          "),u.qZA(),u._uU(20,"\n        "),u.BQk()}if(2&e){const e=u.oxw(2);u.xp6(3),u.Oqu(u.lcZ(4,5,"options")),u.xp6(5),u.Q6J("ngModel",e.reprompt)("disabled",e.cipher.isDeleted||e.viewOnly||!e.cipher.edit&&e.editMode),u.xp6(3),u.Oqu(u.lcZ(12,7,"passwordPrompt")),u.xp6(3),u.s9C("appA11yTitle",u.lcZ(15,9,"learnMore"))}}function Re(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"div",13),u._uU(1,"\n        "),u.YNc(2,z,3,3,"app-callout",14),u._uU(3,"\n        "),u.YNc(4,K,14,6,"div",15),u._uU(5,"\n        "),u.TgZ(6,"div",16),u._uU(7,"\n          "),u.TgZ(8,"div",17),u._uU(9,"\n            "),u.TgZ(10,"label",18),u._uU(11),u.ALo(12,"i18n"),u.qZA(),u._uU(13,"\n            "),u.TgZ(14,"input",19),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw();return u.KtG(i.cipher.name=t)})),u.qZA(),u._uU(15,"\n          "),u.qZA(),u._uU(16,"\n          "),u.YNc(17,Q,12,8,"div",20),u._uU(18,"\n        "),u.qZA(),u._uU(19,"\n        "),u._uU(20,"\n        "),u.YNc(21,ge,80,44,"ng-container",21),u._uU(22,"\n        "),u._uU(23,"\n        "),u.YNc(24,Ue,108,59,"ng-container",21),u._uU(25,"\n        "),u._uU(26,"\n        "),u.YNc(27,xe,194,107,"ng-container",21),u._uU(28,"\n        "),u.TgZ(29,"div",22),u._uU(30,"\n          "),u.TgZ(31,"label",23),u._uU(32),u.ALo(33,"i18n"),u.qZA(),u._uU(34,"\n          "),u.TgZ(35,"textarea",24),u.NdJ("ngModelChange",(function(t){u.CHM(e);const i=u.oxw();return u.KtG(i.cipher.notes=t)})),u.qZA(),u._uU(36,"\n        "),u.qZA(),u._uU(37,"\n        "),u.YNc(38,Se,1,5,"app-vault-add-edit-custom-fields",25),u._uU(39,"\n        "),u.YNc(40,Ce,21,9,"ng-container",21),u._uU(41,"\n        "),u.YNc(42,qe,10,5,"ng-container",21),u._uU(43,"\n        "),u.YNc(44,Ee,21,11,"ng-container",21),u._uU(45,"\n        "),u.YNc(46,Fe,21,11,"ng-container",21),u._uU(47,"\n      "),u.qZA()}if(2&e){const e=u.oxw();u.xp6(2),u.Q6J("ngIf",e.allowOwnershipAssignment()&&!e.allowPersonal),u.xp6(2),u.Q6J("ngIf",!e.editMode&&!e.viewOnly),u.xp6(7),u.Oqu(u.lcZ(12,19,"name")),u.xp6(3),u.Q6J("ngModel",e.cipher.name)("disabled",e.cipher.isDeleted||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),u.xp6(3),u.Q6J("ngIf",!e.organization),u.xp6(4),u.Q6J("ngIf",e.cipher.type===e.cipherType.Login),u.xp6(3),u.Q6J("ngIf",e.cipher.type===e.cipherType.Card),u.xp6(3),u.Q6J("ngIf",e.cipher.type===e.cipherType.Identity),u.xp6(5),u.Oqu(u.lcZ(33,21,"notes")),u.xp6(3),u.Q6J("ngModel",e.cipher.notes)("disabled",e.cipher.isDeleted||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),u.xp6(3),u.Q6J("ngIf",!(!e.cipher.hasFields&&!e.cipher.edit&&e.editMode)),u.xp6(2),u.Q6J("ngIf",e.allowOwnershipAssignment()),u.xp6(2),u.Q6J("ngIf",(!e.editMode||e.cloneMode)&&e.cipher.organizationId),u.xp6(2),u.Q6J("ngIf",e.editMode),u.xp6(2),u.Q6J("ngIf",e.canUseReprompt)}}function Je(e,t){if(1&e&&(u.TgZ(0,"button",182),u._uU(1,"\n          "),u._UZ(2,"i",183),u.ALo(3,"i18n"),u._uU(4,"\n          "),u.TgZ(5,"span"),u._uU(6),u.ALo(7,"i18n"),u.qZA(),u._uU(8,"\n        "),u.qZA()),2&e){const e=u.oxw(),t=u.MAs(5);u.Q6J("disabled",t.loading),u.xp6(2),u.s9C("title",u.lcZ(3,3,"loading")),u.xp6(4),u.Oqu(u.lcZ(7,5,null!=e.cipher&&e.cipher.isDeleted?"restore":"save"))}}const ze=function(e,t){return{"bwi-star-f":e,"bwi-star":t}};function Ye(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"button",187),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(2);return u.KtG(t.toggleFavorite())})),u.ALo(1,"i18n"),u._uU(2,"\n            "),u._UZ(3,"i",43),u._uU(4,"\n          "),u.qZA()}if(2&e){const e=u.oxw(2);u.s9C("appA11yTitle",u.lcZ(1,2,e.cipher.favorite?"unfavorite":"favorite")),u.xp6(3),u.Q6J("ngClass",u.WLB(4,ze,e.cipher.favorite,!e.cipher.favorite))}}function Ke(e,t){if(1&e){const e=u.EpF();u.TgZ(0,"button",188,189),u.NdJ("click",(function(){u.CHM(e);const t=u.oxw(2);return u.KtG(t.delete())})),u.ALo(2,"i18n"),u._uU(3,"\n            "),u._UZ(4,"i",190),u._uU(5,"\n            "),u._UZ(6,"i",191),u.ALo(7,"i18n"),u._uU(8,"\n          "),u.qZA()}if(2&e){const e=u.MAs(1),t=u.oxw(2);u.s9C("appA11yTitle",u.lcZ(2,6,t.cipher.isDeleted?"permanentlyDelete":"delete")),u.Q6J("disabled",e.loading)("appApiAction",t.deletePromise),u.xp6(4),u.Q6J("hidden",e.loading),u.xp6(2),u.s9C("title",u.lcZ(7,8,"loading")),u.Q6J("hidden",!e.loading)}}function Be(e,t){if(1&e&&(u.TgZ(0,"div",184),u._uU(1,"\n          "),u.YNc(2,Ye,5,7,"button",185),u._uU(3,"\n          "),u.YNc(4,Ke,9,10,"button",186),u._uU(5,"\n        "),u.qZA()),2&e){const e=u.oxw();u.xp6(2),u.Q6J("ngIf",!e.organization&&!e.cipher.isDeleted),u.xp6(2),u.Q6J("ngIf",e.editMode&&!e.cloneMode&&!(!e.cipher.edit&&e.editMode))}}class Qe extends c.Z{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v,y,w,b){super(e,t,i,n,s,o,r,a,l,u,d,p,f,h,g,m,v,y,w,b),this.apiService=c,this.originalCipher=null,this.componentName="app-org-vault-add-edit"}loadCollections(){return this.organization.canEditAllCiphers(this.flexibleCollectionsV1Enabled)?Promise.resolve(this.collections):super.loadCollections()}loadCipher(){const e=Object.create(null,{loadCipher:{get:()=>super.loadCipher}});return J(this,void 0,void 0,(function*(){const t=yield e.loadCipher.call(this);if(!this.organization.canEditAllCiphers(this.flexibleCollectionsV1Enabled)&&null!=t)return t;const i=yield this.apiService.getCipherAdmin(this.cipherId),n=new r.O(i);n.edit=!0;const s=new a.t(n);return this.originalCipher=s,s}))}encryptCipher(){return this.organization.canEditAllCiphers(this.flexibleCollectionsV1Enabled)?this.cipherService.encrypt(this.cipher,null,null,this.originalCipher):super.encryptCipher()}deleteCipher(){const e=Object.create(null,{deleteCipher:{get:()=>super.deleteCipher}});return J(this,void 0,void 0,(function*(){return this.organization.canEditAllCiphers(this.flexibleCollectionsV1Enabled)?this.cipher.isDeleted?this.apiService.deleteCipherAdmin(this.cipherId):this.apiService.putDeleteCipherAdmin(this.cipherId):e.deleteCipher.call(this)}))}}Qe.ɵfac=function(e){return new(e||Qe)(u.Y36(d.u),u.Y36(p.s),u.Y36(h.D),u.Y36(g.P),u.Y36(f.C),u.Y36(m.b),u.Y36(v.a),u.Y36(y.w),u.Y36(o.UW),u.Y36(w.s),u.Y36(s.o),u.Y36(b.j),u.Y36(U.d),u.Y36(_.$),u.Y36(l.C),u.Y36(n.Mn),u.Y36(A.e),u.Y36(Z.x),u.Y36(S.uU),u.Y36(T.E),u.Y36(C.M))},Qe.ɵcmp=u.Xpm({type:Qe,selectors:[["app-org-vault-add-edit"]],features:[u.qOj],decls:36,vars:11,consts:[["role","dialog","aria-modal","true","aria-labelledby","cipherAddEditTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],["ngNativeValidate","","autocomplete","off",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","cipherAddEditTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit",3,"disabled",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["class","ml-auto",4,"ngIf"],[1,"modal-body"],["type","info",4,"ngIf"],["class","row",4,"ngIf"],[1,"row"],[1,"col-6","form-group"],["for","name"],["id","name","type","text","name","Name","required","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["class","col-6 form-group",4,"ngIf"],[4,"ngIf"],[1,"form-group"],["for","notes"],["id","notes","name","Notes","rows","6",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],[3,"cipher","thisCipherType","viewOnly","copy","editMode",4,"ngIf"],["type","info"],["for","type"],["id","type","name","Type","appAutofocus","",1,"form-control",3,"ngModel","disabled","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],["for","folder"],["id","folder","name","FolderId",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","loginUsername"],[1,"input-group"],["id","loginUsername","type","text","name","Login.Username","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["class","input-group-append",4,"ngIf"],[1,"d-flex"],["for","loginPassword"],["class","ml-auto d-flex",4,"ngIf"],["id","loginPassword","name","Login.Password","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","readonly","ngModelChange"],[1,"input-group-append"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","disabled","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone"],["class","tw-mb-4",4,"ngIf"],[1,"tw-flex","tw-flex-row"],[1,"tw-mb-4","tw-w-1/2"],["for","loginTotp"],["id","loginTotp","name","Login.Totp","appInputVerbatim","",1,"form-control","text-monospace",3,"type","ngModel","disabled","readonly","ngModelChange"],[1,"tw-mb-4","tw-ml-4","tw-flex","tw-w-1/2","tw-items-end",3,"ngClass"],["class","totp tw-flex tw-flex-row tw-items-center",4,"ngIf"],["class","tw-pb-2",4,"ngIf"],["href","#","appStopClick","","class","d-inline-block mb-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","click"],[1,"ml-auto","d-flex"],["href","#","class","d-block mr-2 bwi-icon-above-input","appStopClick","",3,"appA11yTitle","click",4,"ngIf"],["href","#","appStopClick","",1,"d-block","bwi-icon-above-input",3,"appA11yTitle","appApiAction","click"],["checkPasswordBtn",""],["aria-hidden","true",1,"bwi","bwi-lg","bwi-fw","bwi-check-circle",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-fw","bwi-spinner","bwi-spin",3,"hidden","title"],["href","#","class","d-block bwi-icon-above-input","appStopClick","",3,"appA11yTitle","click",4,"ngIf"],["href","#","appStopClick","",1,"d-block","mr-2","bwi-icon-above-input",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-fw","bwi-generate"],["href","#","appStopClick","",1,"d-block","bwi-icon-above-input",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-fw","bwi-numbered-list"],[1,"tw-mb-4"],[1,"tw-flex","tw-justify-between"],[3,"password","showCount"],["type","button","bitLink","",3,"click"],["for","loginFido2credential"],["tabindex","0",1,"tw-flex","tw-flex-row"],["id","loginFido2credential","type","text","name","Login.Fido2credential","appInputVerbatim","","disabled","","readonly","",1,"form-control",3,"value"],["type","button","class","tw-items-center tw-border-none tw-bg-transparent tw-text-danger tw-ml-3",3,"appA11yTitle","click",4,"ngIf"],["type","button",1,"tw-items-center","tw-border-none","tw-bg-transparent","tw-text-danger","tw-ml-3",3,"appA11yTitle","click"],[1,"bwi","bwi-lg","bwi-minus-circle"],[1,"totp","tw-flex","tw-flex-row","tw-items-center"],[1,"totp-countdown"],[1,"totp-sec","tw-text-muted"],["r","12.6","cy","16","cx","16","opacity","0.25",1,"totp-circle-muted","inner",3,"ngStyle"],["opacity","0.25","r","14","cy","16","cx","16",1,"totp-circle-muted","outer"],[1,"totp-code","tw-ml-2","tw-mr-3","tw-text-muted",3,"title"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone","tw-text-muted"],[1,"tw-pb-2"],["class","ml-3",4,"ngIf"],["href","#","appStopClick","","bitBadge","","variant","primary","class","tw-ml-4",3,"click",4,"ngIf"],[1,"ml-3"],["href","#","appStopClick","","bitBadge","","variant","primary",1,"tw-ml-4",3,"click"],[1,"totp-sec"],["r","12.6","cy","16","cx","16",1,"totp-circle","inner",3,"ngStyle"],["r","14","cy","16","cx","16",1,"totp-circle","outer"],[1,"totp-code","tw-mx-2","tw-mt-1",3,"title"],["type","button",1,"tw-items-center","tw-border-none","tw-bg-transparent","tw-text-primary-600",3,"appA11yTitle","click"],["role","group","class","row",4,"ngFor","ngForOf","ngForTrackBy"],["role","group",1,"row"],[1,"col-7","form-group"],[3,"for"],["type","text","appInputVerbatim","",1,"form-control",3,"id","name","ngModel","disabled","placeholder","ngModelChange"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-share-square"],[1,"col-5","form-group"],["href","https://bitwarden.com/help/uri-match-detection/","target","_blank","rel","noreferrer",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],[1,"form-control","overflow-hidden",3,"id","name","ngModel","disabled","ngModelChange","change"],["type","button","class","btn btn-link text-danger ml-2",3,"appA11yTitle","click",4,"ngIf"],["type","button",1,"btn","btn-link","text-danger","ml-2",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-minus-circle","bwi-lg"],["href","#","appStopClick","",1,"d-inline-block","mb-3",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus-circle","bwi-fw"],["for","cardCardholderName"],["id","cardCardholderName","type","text","name","Card.CardCardholderName",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","cardBrand"],[4,"ngIf","ngIfElse"],["readonlyCardBrand",""],["for","cardNumber"],["id","cardNumber","name","Card.Number","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","readonly","input","ngModelChange"],[1,"col","form-group"],["for","cardExpMonth"],["readonlyCardExpMonth",""],["for","cardExpYear"],["id","cardExpYear","type","text","name","Card.ExpYear",1,"form-control",3,"ngModel","placeholder","disabled","readonly","ngModelChange"],["for","cardCode"],["id","cardCode","name","Card.Code","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","readonly","ngModelChange"],["id","cardBrand","name","Card.Brand",1,"form-control",3,"ngModel","disabled","ngModelChange"],["id","cardBrand","name","Card.Brand","type","text",1,"form-control",3,"readonly","value"],["id","cardExpMonth","name","Card.ExpMonth",1,"form-control",3,"ngModel","disabled","ngModelChange"],["id","cardExpMonth","type","text","name","Card.ExpMonth",1,"form-control",3,"readonly","value"],[1,"col-4","form-group"],["for","idTitle"],["readonlyIdTitle",""],["for","idFirstName"],["id","idFirstName","type","text","name","Identity.FirstName",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idMiddleName"],["id","idMiddleName","type","text","name","Identity.MiddleName",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idLastName"],["id","idLastName","type","text","name","Identity.LastName",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idUsername"],["id","idUsername","type","text","name","Identity.Username","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idCompany"],["id","idCompany","type","text","name","Identity.Company",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idSsn"],["id","idSsn","type","text","name","Identity.SSN","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idPassportNumber"],["id","idPassportNumber","type","text","name","Identity.PassportNumber","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idLicenseNumber"],["id","idLicenseNumber","type","text","name","Identity.LicenseNumber","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idEmail"],["id","idEmail","type","text","inputmode","email","name","Identity.Email","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idPhone"],["id","idPhone","type","text","inputmode","tel","name","Identity.Phone",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idAddress1"],["id","idAddress1","type","text","name","Identity.Address1",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idAddress2"],["id","idAddress2","type","text","name","Identity.Address2",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idAddress3"],["id","idAddress3","type","text","name","Identity.Address3",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idCity"],["id","idCity","type","text","name","Identity.City",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idState"],["id","idState","type","text","name","Identity.State",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idPostalCode"],["id","idPostalCode","type","text","name","Identity.PostalCode",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idCountry"],["id","idCountry","type","text","name","Identity.Country",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["id","idTitle","name","Identity.Title",1,"form-control",3,"ngModel","disabled","ngModelChange"],["id","idTitle","name","Identity.Title","type","text",1,"form-control",3,"readonly","value"],[3,"cipher","thisCipherType","viewOnly","copy","editMode"],[1,"mt-4"],[1,"col-5"],["for","organizationId"],["id","organizationId","name","OrganizationId",1,"form-control",3,"ngModel","disabled","ngModelChange","change"],["class","form-check",4,"ngFor","ngForOf"],[1,"form-check"],["type","checkbox",1,"form-check-input",3,"ngModel","id","name","disabled","ngModelChange"],[1,"form-check-label",3,"for"],[1,"small","text-muted","mt-4"],[1,"font-weight-semibold"],["href","#","appStopClick","",3,"title","click"],[4,"ngFor","ngForOf"],[3,"password"],["type","checkbox","id","passwordPrompt","name","passwordPrompt",1,"form-check-input",3,"ngModel","disabled","change"],["for","passwordPrompt",1,"form-check-label"],["target","_blank","rel","noreferrer","href","https://bitwarden.com/help/managing-items/#protect-individual-items",3,"appA11yTitle"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],[1,"ml-auto"],["type","button","class","btn btn-link",3,"appA11yTitle","click",4,"ngIf"],["type","button","class","btn btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click",4,"ngIf"],["type","button",1,"btn","btn-link",3,"appA11yTitle","click"],["type","button",1,"btn","btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click"],["deleteBtn",""],["aria-hidden","true",1,"bwi","bwi-trash","bwi-lg","bwi-fw",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-lg","bwi-fw",3,"hidden","title"]],template:function(e,t){1&e&&(u.TgZ(0,"div",0),u._uU(1,"\n  "),u.TgZ(2,"div",1),u._uU(3,"\n    "),u.TgZ(4,"form",2,3),u.NdJ("ngSubmit",(function(){return t.submit()})),u._uU(6,"\n      "),u.TgZ(7,"div",4),u._uU(8,"\n        "),u.TgZ(9,"h1",5),u._uU(10),u.qZA(),u._uU(11,"\n        "),u.TgZ(12,"button",6),u.ALo(13,"i18n"),u._uU(14,"\n          "),u.TgZ(15,"span",7),u._uU(16,"×"),u.qZA(),u._uU(17,"\n        "),u.qZA(),u._uU(18,"\n      "),u.qZA(),u._uU(19,"\n      "),u.YNc(20,Re,48,23,"div",8),u._uU(21,"\n      "),u.TgZ(22,"div",9),u._uU(23,"\n        "),u.YNc(24,Je,9,7,"button",10),u._uU(25,"\n        "),u.TgZ(26,"button",11),u._uU(27),u.ALo(28,"i18n"),u.qZA(),u._uU(29,"\n        "),u.YNc(30,Be,6,2,"div",12),u._uU(31,"\n      "),u.qZA(),u._uU(32,"\n    "),u.qZA(),u._uU(33,"\n  "),u.qZA(),u._uU(34,"\n"),u.qZA(),u._uU(35,"\n")),2&e&&(u.xp6(4),u.Q6J("appApiAction",t.formPromise),u.xp6(6),u.Oqu(t.title),u.xp6(2),u.s9C("appA11yTitle",u.lcZ(13,7,"close")),u.xp6(8),u.Q6J("ngIf",t.cipher),u.xp6(4),u.Q6J("ngIf",!t.viewOnly),u.xp6(3),u.hij("\n          ",u.lcZ(28,9,t.viewOnly?"close":"cancel"),"\n        "),u.xp6(3),u.Q6J("ngIf",t.cipher&&!t.viewOnly))},dependencies:[S.mk,S.sg,S.O5,S.PC,O.YN,O.Kr,O.Fj,O.Wl,O.EJ,O.JJ,O.JL,O.Q7,O.On,O.F,k.B,P.b,x.U,q.O,I.b,M.O,N.l,L.L,D._,E.P,F.R,S.Ov,S.uU,R.C],encapsulation:2})},16857:(e,t,i)=>{"use strict";i.d(t,{e:()=>r});var n=i(85921),s=i(21151),o=i(85762);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵmod=o.oAB({type:r}),r.ɵinj=o.cJS({imports:[n.m,s.D]})},6242:(e,t,i)=>{"use strict";i.d(t,{x:()=>r});var n=i(85921),s=i(21151),o=i(85762);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵmod=o.oAB({type:r}),r.ɵinj=o.cJS({imports:[n.m,s.D]})},45213:(e,t,i)=>{"use strict";i.d(t,{$:()=>y});var n=i(85762),s=i(55602),o=i(78627),r=i(99721),a=i(42304),l=i(8111),c=i(66459),u=i(4871),d=i(37513),p=i(33245),h=i(24610),g=i(53707),f=i(94516),m=i(82933),v=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class y{constructor(e,t,i,n,s,o,r){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.userVerificationService=n,this.router=s,this.logService=o,this.syncService=r,this.organizationId=null}submit(){return v(this,void 0,void 0,(function*(){try{this.formPromise=this.userVerificationService.buildRequest(this.masterPassword).then((e=>this.apiService.postPurgeCiphers(e,this.organizationId))),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("vaultPurged")),this.syncService.fullSync(!0),null!=this.organizationId?this.router.navigate(["organizations",this.organizationId,"vault"]):this.router.navigate(["vault"])}catch(e){this.logService.error(e)}}))}}y.ɵfac=function(e){return new(e||y)(n.Y36(s.s),n.Y36(o.D),n.Y36(r.P),n.Y36(a.i),n.Y36(l.F0),n.Y36(c.$),n.Y36(u._))},y.ɵcmp=n.Xpm({type:y,selectors:[["app-purge-vault"]],inputs:{organizationId:"organizationId"},decls:55,vars:24,consts:[["role","dialog","aria-modal","true","aria-labelledby","purgeVaultTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","purgeVaultTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["type","warning"],["ngDefaultControl","","name","secret",3,"ngModel","ngModelChange"],[1,"modal-footer"],["type","submit",1,"btn","btn-danger","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"]],template:function(e,t){if(1&e&&(n.TgZ(0,"div",0),n._uU(1,"\n  "),n.TgZ(2,"div",1),n._uU(3,"\n    "),n.TgZ(4,"form",2,3),n.NdJ("ngSubmit",(function(){return t.submit()})),n._uU(6,"\n      "),n.TgZ(7,"div",4),n._uU(8,"\n        "),n.TgZ(9,"h1",5),n._uU(10),n.ALo(11,"i18n"),n.qZA(),n._uU(12,"\n        "),n.TgZ(13,"button",6),n.ALo(14,"i18n"),n._uU(15,"\n          "),n.TgZ(16,"span",7),n._uU(17,"×"),n.qZA(),n._uU(18,"\n        "),n.qZA(),n._uU(19,"\n      "),n.qZA(),n._uU(20,"\n      "),n.TgZ(21,"div",8),n._uU(22,"\n        "),n.TgZ(23,"p"),n._uU(24),n.ALo(25,"i18n"),n.qZA(),n._uU(26,"\n        "),n.TgZ(27,"app-callout",9),n._uU(28),n.ALo(29,"i18n"),n.qZA(),n._uU(30,"\n        "),n.TgZ(31,"app-user-verification",10),n.NdJ("ngModelChange",(function(e){return t.masterPassword=e})),n._uU(32,"\n        "),n.qZA(),n._uU(33,"\n      "),n.qZA(),n._uU(34,"\n      "),n.TgZ(35,"div",11),n._uU(36,"\n        "),n.TgZ(37,"button",12),n._uU(38,"\n          "),n._UZ(39,"i",13),n.ALo(40,"i18n"),n._uU(41,"\n          "),n.TgZ(42,"span"),n._uU(43),n.ALo(44,"i18n"),n.qZA(),n._uU(45,"\n        "),n.qZA(),n._uU(46,"\n        "),n.TgZ(47,"button",14),n._uU(48),n.ALo(49,"i18n"),n.qZA(),n._uU(50,"\n      "),n.qZA(),n._uU(51,"\n    "),n.qZA(),n._uU(52,"\n  "),n.qZA(),n._uU(53,"\n"),n.qZA(),n._uU(54,"\n")),2&e){const e=n.MAs(5);n.xp6(4),n.Q6J("appApiAction",t.formPromise),n.xp6(6),n.Oqu(n.lcZ(11,10,"purgeVault")),n.xp6(3),n.s9C("appA11yTitle",n.lcZ(14,12,"close")),n.xp6(11),n.Oqu(n.lcZ(25,14,t.organizationId?"purgeOrgVaultDesc":"purgeVaultDesc")),n.xp6(4),n.Oqu(n.lcZ(29,16,"purgeVaultWarning")),n.xp6(3),n.Q6J("ngModel",t.masterPassword),n.xp6(6),n.Q6J("disabled",e.loading),n.xp6(2),n.s9C("title",n.lcZ(40,18,"loading")),n.xp6(4),n.Oqu(n.lcZ(44,20,"purgeVault")),n.xp6(5),n.hij("\n          ",n.lcZ(49,22,"close"),"\n        ")}},dependencies:[d.Fj,d.JJ,d.JL,d.On,d.F,p.B,h.b,g.O,f.W,m.C],encapsulation:2})},75230:(e,t,i)=>{"use strict";i.d(t,{o:()=>r});var n=i(23666),s=i(39194),o=i(95607);function r(e){const t=e.sort(((e,t)=>e.name.localeCompare(t.name))).map(a),i=[];return t.forEach((e=>{const t=null!=e.name?e.name.replace(/^\/+|\/+$/g,"").split(n.k):[];s.L.nestedTraverse(i,0,t,e,null,n.k)})),i}function a(e){let t;return e instanceof o.e?(t=new o.e,t.groups=[...e.groups],t.users=[...e.users],t.assigned=e.assigned):t=new n.n,t.id=e.id,t.externalId=e.externalId,t.hidePasswords=e.hidePasswords,t.name=e.name,t.organizationId=e.organizationId,t.readOnly=e.readOnly,t.manage=e.manage,t}},62525:(e,t,i)=>{"use strict";var n=i(68088),s=i(85762),o=(i(83936),i(36200)),r=i(89614),a=i(78384),l=i(37513),c=i(35997),u=i(8724),d=i(28508),p=i(8111),h=i(54019),g=i(68362),f=i(99042),m=i(67775),v=i(91246),y=i(92786),w=i(58691),b=i(67855),U=i(37017),_=i(36957),A=i(39553),Z=i(96963),x=i(7323),S=i(23031),T=i(4871),C=i(92236),O=i(2184);const k=e=>{const t=(Array.isArray(e)?e:[e]).map((e=>e.split(/\s+/).filter((e=>""!==e)))).flat().length;return 5e3+1e3*Math.floor(t/120)};var P=i(3769);class q{constructor(e){this.toastrService=e}showToast(e){const t={payload:{message:e.message,variant:e.variant,title:e.title},timeOut:null!=e.timeout&&e.timeout>0?e.timeout:k(e.message)};this.toastrService.show(null,e.title,t)}_showToast(e){var t;this.showToast({message:e.text,variant:e.type,title:e.title,timeout:null===(t=e.options)||void 0===t?void 0:t.timeout})}}q.ɵfac=function(e){return new(e||q)(s.LFG(P._W))},q.ɵprov=s.Yz7({token:q,factory:q.ɵfac,providedIn:"root"});var I=i(73369),M=i(78627),N=i(99721),L=i(52297),D=i(76528),E=i(31754),F=i(51430),R=i(46226),J=i(58172),z=i(54538),Y=i(83924),K=i(28753),B=i(1008),Q=i(65254),G=i(47724),j=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const V="AppComponent";class ${constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,g,f,m,v,y,w,b,U,_,A,Z,x,S,T,C){this.document=e,this.broadcasterService=t,this.folderService=i,this.syncService=n,this.passwordGenerationService=s,this.cipherService=o,this.authService=r,this.router=a,this.toastService=l,this.i18nService=c,this.platformUtilsService=u,this.ngZone=d,this.vaultTimeoutService=p,this.cryptoService=g,this.collectionService=f,this.searchService=m,this.notificationsService=v,this.stateService=y,this.eventUploadService=w,this.policyService=b,this.policyListService=U,this.keyConnectorService=_,this.configService=A,this.dialogService=Z,this.biometricStateService=x,this.stateEventRunnerService=S,this.organizationService=T,this.accountService=C,this.lastActivity=null,this.idleTimer=null,this.isIdle=!1,this.destroy$=new h.x}ngOnInit(){this.i18nService.locale$.pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.document.documentElement.lang=e})),this.ngZone.runOutsideAngular((()=>{window.onmousemove=()=>this.recordActivity(),window.onmousedown=()=>this.recordActivity(),window.ontouchstart=()=>this.recordActivity(),window.onclick=()=>this.recordActivity(),window.onscroll=()=>this.recordActivity(),window.onkeypress=()=>this.recordActivity()})),this.broadcasterService.subscribe(V,(e=>j(this,void 0,void 0,(function*(){this.ngZone.run((()=>j(this,void 0,void 0,(function*(){switch(e.command){case"loggedIn":case"loggedOut":case"unlocked":this.notificationsService.updateConnection(!1);break;case"authBlocked":this.router.navigate(["/"]);break;case"logout":yield this.logOut(!!e.expired,e.redirect);break;case"lockVault":yield this.vaultTimeoutService.lock();break;case"locked":this.notificationsService.updateConnection(!1),this.router.navigate(["lock"]);break;case"lockedUrl":case"syncStarted":default:break;case"syncCompleted":e.successfully&&(yield this.configService.ensureConfigFetched());break;case"upgradeOrganization":(yield this.dialogService.openSimpleDialog({title:{key:"upgradeOrganization"},content:{key:"upgradeOrganizationDesc"},acceptButtonText:{key:"upgradeOrganization"},type:"info"}))&&this.router.navigate(["organizations",e.organizationId,"billing","subscription"]);break;case"premiumRequired":(yield this.dialogService.openSimpleDialog({title:{key:"premiumRequired"},content:{key:"premiumRequiredDesc"},acceptButtonText:{key:"upgrade"},type:"success"}))&&this.router.navigate(["settings/subscription/premium"]);break;case"emailVerificationRequired":(yield this.dialogService.openSimpleDialog({title:{key:"emailVerificationRequired"},content:{key:"emailVerificationRequiredDesc"},acceptButtonText:{key:"learnMore"},type:"info"}))&&this.platformUtilsService.launchUri("https://bitwarden.com/help/create-bitwarden-account/");break;case"showToast":"string"==typeof e.text&&void 0===crypto.subtle&&(e.title="This browser requires HTTPS to use the web vault",e.text="Check the Vaultwarden wiki for details on how to enable it"),this.toastService._showToast(e);break;case"convertAccountToKeyConnector":this.router.navigate(["/remove-password"])}}))))})))),this.router.events.pipe((0,g.R)(this.destroy$)).subscribe((e=>{if(e instanceof p.m2){const e=Array.from(document.querySelectorAll(".modal"));for(const t of e)o(t).modal("hide")}})),this.policyListService.addPolicies([new Z.n6,new Z.WS,new Z.jR,new Z.bT,new Z.qT,new Z.UG,new Z.tc,new Z.v2,new Z.mD])}ngOnDestroy(){this.broadcasterService.unsubscribe(V),this.destroy$.next(),this.destroy$.complete()}logOut(e,t=!0){return j(this,void 0,void 0,(function*(){yield this.eventUploadService.uploadEvents();const i=yield this.stateService.getUserId(),n=(0,f.z)(this.authService.authStatusFor$(i).pipe((0,m.h)((e=>e===b.y.LoggedOut)),(0,v.V)({first:5e3,with:()=>{throw new Error("The logout process did not complete in a reasonable amount of time.")}})));yield Promise.all([this.syncService.setLastSync(new Date(0)),this.cryptoService.clearKeys(),this.cipherService.clear(i),this.folderService.clear(i),this.collectionService.clear(i),this.passwordGenerationService.clear(),this.biometricStateService.logout(i)]),yield this.stateEventRunnerService.handleEvent("logout",i),yield this.searchService.clearIndex(),this.authService.logOut((()=>j(this,void 0,void 0,(function*(){e&&this.platformUtilsService.showToast("warning",this.i18nService.t("loggedOut"),this.i18nService.t("loginExpired")),yield this.stateService.clean({userId:i}),yield this.accountService.clean(i),yield n,t&&this.router.navigate(["/"])}))))}))}recordActivity(){return j(this,void 0,void 0,(function*(){const e=yield(0,f.z)(this.accountService.activeAccount$.pipe((0,y.U)((e=>null==e?void 0:e.id)))),t=new Date;null!=this.lastActivity&&t.getTime()-this.lastActivity.getTime()<250||(this.lastActivity=t,yield this.accountService.setAccountActivity(e,t),this.isIdle&&(this.isIdle=!1,this.idleStateChanged()),null!=this.idleTimer&&(window.clearTimeout(this.idleTimer),this.idleTimer=null),this.idleTimer=window.setTimeout((()=>{this.isIdle||(this.isIdle=!0,this.idleStateChanged())}),6e5))}))}idleStateChanged(){this.isIdle?this.notificationsService.disconnectFromInactivity():this.notificationsService.reconnectFromActivity()}}$.ɵfac=function(e){return new(e||$)(s.Y36(d.K0),s.Y36(x.A),s.Y36(S.G),s.Y36(T._),s.Y36(A.UW),s.Y36(C.u),s.Y36(O.e),s.Y36(p.F0),s.Y36(q),s.Y36(M.D),s.Y36(N.P),s.Y36(s.R0b),s.Y36(L.Q),s.Y36(D.$),s.Y36(E.a),s.Y36(F.o),s.Y36(R.T),s.Y36(J.b),s.Y36(z.k),s.Y36(Y.W),s.Y36(K.x),s.Y36(B.J),s.Y36(Q.E),s.Y36(I.x),s.Y36(U.d),s.Y36(_.q4),s.Y36(w.eC),s.Y36(G.BR))},$.ɵcmp=s.Xpm({type:$,selectors:[["app-root"]],decls:2,vars:0,template:function(e,t){1&e&&(s._UZ(0,"router-outlet"),s._uU(1,"\n"))},dependencies:[p.lC],encapsulation:2});var H=i(6841),W=i(66463),X=i(23306),ee=i(82933),te=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function ie(e,t){1&e&&(s.TgZ(0,"div",1),s._uU(1,"\n  "),s.TgZ(2,"div"),s._uU(3,"\n    "),s._UZ(4,"img",2),s._uU(5,"\n    "),s.TgZ(6,"p",3),s._uU(7,"\n      "),s._UZ(8,"i",4),s.ALo(9,"i18n"),s._uU(10,"\n      "),s.TgZ(11,"span",5),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n    "),s.qZA(),s._uU(15,"\n  "),s.qZA(),s._uU(16,"\n"),s.qZA()),2&e&&(s.xp6(8),s.s9C("title",s.lcZ(9,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(13,4,"loading")))}class ne extends X.o{constructor(){super(...arguments),this.failedShortMessage="inviteAcceptFailedShort",this.failedMessage="inviteAcceptFailed",this.requiredParameters=["email","token"]}authedHandler(e){return te(this,void 0,void 0,(function*(){this.router.navigate(["/setup/families-for-enterprise"],{queryParams:e})}))}unauthedHandler(e){return te(this,void 0,void 0,(function*(){e.register?this.router.navigate(["/register"],{queryParams:{email:e.email}}):this.router.navigate(["/login"],{queryParams:{email:e.email}})}))}}ne.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(ne)))(t||ne)}}(),ne.ɵcmp=s.Xpm({type:ne,selectors:[["app-accept-family-sponsorship"]],features:[s.qOj],decls:2,vars:1,consts:[["class","mt-5 d-flex justify-content-center",4,"ngIf"],[1,"mt-5","d-flex","justify-content-center"],["alt","Bitwarden",1,"mb-4","logo","logo-themed"],[1,"text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","text-muted",3,"title"],[1,"sr-only"]],template:function(e,t){1&e&&(s.YNc(0,ie,17,6,"div",0),s._uU(1,"\n")),2&e&&s.Q6J("ngIf",t.loading)},dependencies:[d.O5,ee.C],encapsulation:2});var se=i(70032),oe=i(19887);class re{}var ae=i(69485),le=i(51303),ce=i(92614),ue=i(36076),de=i(44882);class pe{}class he{constructor(e,t){this.clientOwnerEmail=e,this.organizationCreateRequest=t}}var ge=i(95608),fe=i(34961),me=i(71146);class ve{}ve.ɵfac=function(e){return new(e||ve)},ve.ɵmod=s.oAB({type:ve}),ve.ɵinj=s.cJS({imports:[me.m]});var ye=i(48641),we=i(42759),be=i(34279),Ue=i(55602),_e=i(66459),Ae=i(97360),Ze=i(31361),xe=i(24610),Se=i(53707),Te=i(81974),Ce=i(7644),Oe=i(24637),ke=i(11512),Pe=i(36179),qe=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Ie(e,t){if(1&e&&(s.TgZ(0,"form",1,2),s._uU(2,"\n  "),s.TgZ(3,"bit-form-field"),s._uU(4,"\n    "),s.TgZ(5,"bit-label"),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n    "),s._UZ(9,"input",3),s._uU(10,"\n  "),s.qZA(),s._uU(11,"\n"),s.qZA()),2&e){const e=s.oxw();s.Q6J("formGroup",e.formGroup),s.xp6(6),s.Oqu(s.lcZ(7,2,"organizationName"))}}function Me(e,t){1&e&&(s.TgZ(0,"bit-form-field",6),s._uU(1,"\n      "),s.TgZ(2,"bit-label"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n      "),s._UZ(6,"input",9),s._uU(7,"\n    "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,1,"clientOwnerEmail")))}function Ne(e,t){if(1&e&&(s.TgZ(0,"div",5),s._uU(1,"\n    "),s.TgZ(2,"bit-form-field",6),s._uU(3,"\n      "),s.TgZ(4,"bit-label"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n      "),s._UZ(8,"input",3),s._uU(9,"\n    "),s.qZA(),s._uU(10,"\n    "),s.TgZ(11,"bit-form-field",6),s._uU(12,"\n      "),s.TgZ(13,"bit-label"),s._uU(14),s.ALo(15,"i18n"),s.qZA(),s._uU(16,"\n      "),s._UZ(17,"input",7),s._uU(18,"\n    "),s.qZA(),s._uU(19,"\n    "),s.YNc(20,Me,8,3,"bit-form-field",8),s._uU(21,"\n  "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(s.lcZ(6,3,"organizationName")),s.xp6(9),s.Oqu(s.lcZ(15,5,"email")),s.xp6(6),s.Q6J("ngIf",e.isProvider)}}function Le(e,t){if(1&e&&(s.TgZ(0,"form",1,2),s._uU(2,"\n  "),s.TgZ(3,"h2"),s._uU(4),s.ALo(5,"i18n"),s.qZA(),s._uU(6,"\n  "),s.YNc(7,Ne,22,7,"div",4),s._uU(8,"\n"),s.qZA()),2&e){const e=s.oxw();s.Q6J("formGroup",e.formGroup),s.xp6(4),s.Oqu(s.lcZ(5,3,"generalInformation")),s.xp6(3),s.Q6J("ngIf",e.createOrganization)}}class De{constructor(e){this.accountService=e,this.nameOnly=!1,this.createOrganization=!0,this.isProvider=!1,this.acceptingSponsorship=!1,this.changedBusinessOwned=new s.vpe}ngOnInit(){return qe(this,void 0,void 0,(function*(){if(this.formGroup.controls.billingEmail.value)return;const e=yield(0,f.z)(this.accountService.activeAccount$);(null==e?void 0:e.email)&&this.formGroup.controls.billingEmail.setValue(e.email)}))}}De.ɵfac=function(e){return new(e||De)(s.Y36(G.BR))},De.ɵcmp=s.Xpm({type:De,selectors:[["app-org-info"]],inputs:{nameOnly:"nameOnly",createOrganization:"createOrganization",isProvider:"isProvider",acceptingSponsorship:"acceptingSponsorship",formGroup:"formGroup"},outputs:{changedBusinessOwned:"changedBusinessOwned"},decls:4,vars:2,consts:[[3,"formGroup",4,"ngIf"],[3,"formGroup"],["form",""],["bitInput","","type","text","formControlName","name"],["class","tw-flex tw-w-full tw-space-x-4",4,"ngIf"],[1,"tw-flex","tw-w-full","tw-space-x-4"],[1,"tw-w-1/2"],["bitInput","","type","email","formControlName","billingEmail"],["class","tw-w-1/2",4,"ngIf"],["bitInput","","type","email","formControlName","clientOwnerEmail"]],template:function(e,t){1&e&&(s.YNc(0,Ie,12,4,"form",0),s._uU(1,"\n"),s.YNc(2,Le,9,5,"form",0),s._uU(3,"\n")),2&e&&(s.Q6J("ngIf",t.nameOnly),s.xp6(2),s.Q6J("ngIf",!t.nameOnly))},dependencies:[d.O5,l._Y,l.Fj,l.JJ,l.JL,l.sg,l.u,Oe.d,ke.G,Pe.u,ee.C],encapsulation:2});var Ee=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Fe(e,t){1&e&&(s.ynx(0),s._uU(1,"\n  "),s._UZ(2,"i",2),s.ALo(3,"i18n"),s._uU(4,"\n  "),s.TgZ(5,"span",3),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n"),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function Re(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n  "),s.TgZ(2,"p"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n  "),s.TgZ(6,"form",4,5),s.NdJ("ngSubmit",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.submit())})),s._uU(8,"\n    "),s.TgZ(9,"div",6),s._uU(10,"\n      "),s.TgZ(11,"label",7),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n      "),s._UZ(15,"input",8),s._uU(16,"\n      "),s.TgZ(17,"small",9),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n    "),s.qZA(),s._uU(21,"\n    "),s.TgZ(22,"button",10),s._uU(23,"\n      "),s._UZ(24,"i",11),s.ALo(25,"i18n"),s._uU(26,"\n      "),s.TgZ(27,"span"),s._uU(28),s.ALo(29,"i18n"),s.qZA(),s._uU(30,"\n    "),s.qZA(),s._uU(31,"\n  "),s.qZA(),s._uU(32,"\n"),s.BQk()}if(2&e){const e=s.MAs(7),t=s.oxw();s.xp6(3),s.Oqu(s.lcZ(4,7,"uploadLicenseFileOrg")),s.xp6(3),s.Q6J("appApiAction",t.formPromise),s.xp6(6),s.Oqu(s.lcZ(13,9,"licenseFile")),s.xp6(6),s.Oqu(s.xi3(19,11,"licenseFileDesc","bitwarden_organization_license.json")),s.xp6(4),s.Q6J("disabled",e.loading),s.xp6(2),s.s9C("title",s.lcZ(25,14,"loading")),s.xp6(4),s.Oqu(s.lcZ(29,16,"submit"))}}function Je(e,t){1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("• ",s.lcZ(2,1,"onPremHostingOptional"),""))}function ze(e,t){1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("• ",s.lcZ(2,1,"includeSsoAuthentication"),""))}function Ye(e,t){1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("• ",s.lcZ(2,1,"includeEnterprisePolicies"),""))}function Ke(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw(2).$implicit;s.xp6(1),s.hij("•\n          ",s.xi3(2,1,"xDayFreeTrial",e.trialPeriodDays),"\n        ")}}function Be(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"small"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n        "),s.YNc(6,Je,3,3,"small",0),s._uU(7,"\n        "),s.YNc(8,ze,3,3,"small",0),s._uU(9,"\n        "),s.YNc(10,Ye,3,3,"small",0),s._uU(11,"\n        "),s.YNc(12,Ke,3,4,"small",0),s._uU(13,"\n      "),s.BQk()),2&e){const e=s.oxw().$implicit,t=s.oxw(2);s.xp6(3),s.hij("• ",s.lcZ(4,5,"includeAllTeamsFeatures"),""),s.xp6(3),s.Q6J("ngIf",e.hasSelfHost),s.xp6(2),s.Q6J("ngIf",e.hasSso),s.xp6(2),s.Q6J("ngIf",e.hasPolicies),s.xp6(2),s.Q6J("ngIf",e.trialPeriodDays&&t.createOrganization)}}function Qe(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw(3).$implicit;s.xp6(1),s.hij("\n            • ",s.xi3(2,1,"xDayFreeTrial",e.trialPeriodDays),"\n          ")}}function Ge(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"small"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"small"),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n          "),s.TgZ(10,"small"),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n          "),s.YNc(14,Qe,3,4,"small",0),s._uU(15,"\n        "),s.BQk()),2&e){const e=s.oxw(2).$implicit,t=s.oxw(2);s.xp6(3),s.hij("• ",s.lcZ(4,4,"includeAllTeamsStarterFeatures"),""),s.xp6(4),s.hij("• ",s.lcZ(8,6,"chooseMonthlyOrAnnualBilling"),""),s.xp6(4),s.hij("• ",s.xi3(12,8,"abilityToAddMoreThanNMembers",10),""),s.xp6(3),s.Q6J("ngIf",e.trialPeriodDays&&t.createOrganization)}}function je(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw(3).$implicit;s.xp6(1),s.hij("• ",s.xi3(2,1,"limitedUsers",e.PasswordManager.maxSeats),"")}}function Ve(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw(3).$implicit;s.xp6(1),s.hij("•\n            ",s.xi3(2,1,"addShareLimitedUsers",e.PasswordManager.maxSeats),"")}}function $e(e,t){1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("• ",s.lcZ(2,1,"addShareUnlimitedUsers"),""))}function He(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw(3).$implicit;s.xp6(1),s.hij("•\n            ",s.xi3(2,1,"limitedCollections",e.PasswordManager.maxCollections),"")}}function We(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw(3).$implicit;s.xp6(1),s.hij("•\n            ",s.xi3(2,1,"addShareLimitedUsers",e.PasswordManager.maxAdditionalSeats),"")}}function Xe(e,t){1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("• ",s.lcZ(2,1,"createUnlimitedCollections"),""))}function et(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw(3).$implicit;s.xp6(1),s.hij("•\n            ",s.xi3(2,1,"gbEncryptedFileStorage",e.PasswordManager.baseStorageGb+"GB"),"")}}function tt(e,t){1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("• ",s.lcZ(2,1,"controlAccessWithGroups"),""))}function it(e,t){1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("• ",s.lcZ(2,1,"trackAuditLogs"),""))}function nt(e,t){1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("• ",s.lcZ(2,1,"syncUsersFromDirectory"),""))}function st(e,t){1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("• ",s.lcZ(2,1,"onPremHostingOptional"),""))}function ot(e,t){1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("• ",s.lcZ(2,1,"usersGetPremium"),""))}function rt(e,t){1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("• ",s.lcZ(2,1,"priorityCustomerSupport"),""))}function at(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw(3).$implicit;s.xp6(1),s.hij("•\n            ",s.xi3(2,1,"xDayFreeTrial",e.trialPeriodDays),"\n          ")}}function lt(e,t){if(1&e&&(s._uU(0,"\n          "),s.YNc(1,je,3,4,"small",0),s._uU(2,"\n          "),s.YNc(3,Ve,3,4,"small",0),s._uU(4,"\n          "),s.YNc(5,$e,3,3,"small",0),s._uU(6,"\n          "),s.YNc(7,He,3,4,"small",0),s._uU(8,"\n          "),s.YNc(9,We,3,4,"small",0),s._uU(10,"\n          "),s.YNc(11,Xe,3,3,"small",0),s._uU(12,"\n          "),s.YNc(13,et,3,4,"small",0),s._uU(14,"\n          "),s.YNc(15,tt,3,3,"small",0),s._uU(16,"\n          "),s.YNc(17,it,3,3,"small",0),s._uU(18,"\n          "),s.YNc(19,nt,3,3,"small",0),s._uU(20,"\n          "),s.YNc(21,st,3,3,"small",0),s._uU(22,"\n          "),s.YNc(23,ot,3,3,"small",0),s._uU(24,"\n          "),s.YNc(25,rt,3,3,"small",0),s._uU(26,"\n          "),s.YNc(27,at,3,4,"small",0),s._uU(28,"\n        ")),2&e){const e=s.oxw(2).$implicit,t=s.oxw(2);s.xp6(1),s.Q6J("ngIf",e.product==t.productTypes.Free),s.xp6(2),s.Q6J("ngIf",e.product!=t.productTypes.Free&&e.product!=t.productTypes.TeamsStarter&&e.PasswordManager.maxSeats),s.xp6(2),s.Q6J("ngIf",!e.PasswordManager.maxSeats),s.xp6(2),s.Q6J("ngIf",e.PasswordManager.maxCollections),s.xp6(2),s.Q6J("ngIf",e.PasswordManager.maxAdditionalSeats),s.xp6(2),s.Q6J("ngIf",!e.PasswordManager.maxCollections),s.xp6(2),s.Q6J("ngIf",e.PasswordManager.baseStorageGb),s.xp6(2),s.Q6J("ngIf",e.hasGroups),s.xp6(2),s.Q6J("ngIf",e.hasApi),s.xp6(2),s.Q6J("ngIf",e.hasDirectory),s.xp6(2),s.Q6J("ngIf",e.hasSelfHost),s.xp6(2),s.Q6J("ngIf",e.usersGetPremium),s.xp6(2),s.Q6J("ngIf",e.product!=t.productTypes.Free),s.xp6(2),s.Q6J("ngIf",e.trialPeriodDays&&t.createOrganization)}}function ct(e,t){if(1&e&&(s._uU(0,"\n        "),s.YNc(1,Ge,16,11,"ng-container",26),s._uU(2,"\n        "),s.YNc(3,lt,29,14,"ng-template",null,28,s.W1O),s._uU(5,"\n      ")),2&e){const e=s.MAs(4),t=s.oxw().$implicit,i=s.oxw(2);s.xp6(1),s.Q6J("ngIf",t.product===i.productTypes.Teams)("ngIfElse",e)}}function ut(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"currency"),s.ALo(4,"i18n"),s.BQk()),2&e){const e=s.oxw(3).$implicit;s.xp6(1),s.lnq("\n            ",s.lcZ(2,3,"additionalUsers").toLowerCase(),"\n            ",s.xi3(3,5,e.isAnnual?e.PasswordManager.seatPrice/12:e.PasswordManager.seatPrice,"$"),"\n            /",s.lcZ(4,8,"month"),"\n          ")}}function dt(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.ALo(2,"currency"),s.ALo(3,"i18n"),s.ALo(4,"i18n"),s.YNc(5,ut,5,10,"ng-container",0),s._uU(6,"\n        "),s.BQk()),2&e){const e=s.oxw(2).$implicit;s.xp6(1),s.lnq("\n          ",s.xi3(2,4,e.isAnnual?e.PasswordManager.basePrice/12:e.PasswordManager.basePrice,"$"),"\n          /",s.lcZ(3,7,"month"),",\n          ",s.xi3(4,9,"includesXUsers",e.PasswordManager.baseSeats),"\n          "),s.xp6(4),s.Q6J("ngIf",e.PasswordManager.hasAdditionalSeatsOption)}}function pt(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1,"\n        "),s.YNc(2,dt,7,12,"ng-container",0),s._uU(3,"\n      "),s.qZA()),2&e){const e=s.oxw().$implicit,t=s.oxw(2);s.xp6(2),s.Q6J("ngIf",e.PasswordManager.basePrice&&!t.acceptingSponsorship)}}function ht(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"currency"),s.ALo(4,"i18n"),s.qZA()),2&e){const e=s.oxw().$implicit;s.xp6(1),s.AsE("\n        ",s.xi3(2,2,"costPerUser",s.xi3(3,5,e.isAnnual?e.PasswordManager.seatPrice/12:e.PasswordManager.seatPrice,"$")),"\n        /",s.lcZ(4,8,"month"),"\n      ")}}function gt(e,t){1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"freeForever")))}function ft(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",22),s._uU(1,"\n    "),s.TgZ(2,"input",23),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.changedProduct())})),s.qZA(),s._uU(3,"\n    "),s.TgZ(4,"label",24),s._uU(5),s.ALo(6,"i18n"),s.TgZ(7,"small",25),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.YNc(11,Be,14,7,"ng-container",26),s._uU(12,"\n      "),s.YNc(13,ct,6,2,"ng-template",null,27,s.W1O),s._uU(15,"\n      "),s.YNc(16,pt,4,1,"span",0),s._uU(17,"\n      "),s.YNc(18,ht,5,10,"span",0),s._uU(19,"\n      "),s.YNc(20,gt,3,3,"span",0),s._uU(21,"\n    "),s.qZA(),s._uU(22,"\n  "),s.qZA()}if(2&e){const e=t.$implicit,i=s.MAs(14),n=s.oxw(2);s.xp6(2),s.MGl("id","product",e.product,""),s.Q6J("value",e.product),s.xp6(2),s.MGl("for","product",e.product,""),s.xp6(1),s.hij("\n      ",s.lcZ(6,10,e.nameLocalizationKey),"\n      "),s.xp6(3),s.Oqu(s.xi3(9,12,e.descriptionLocalizationKey,"1")),s.xp6(3),s.Q6J("ngIf",e.product===n.productTypes.Enterprise)("ngIfElse",i),s.xp6(5),s.Q6J("ngIf",e.product!=n.productTypes.Free),s.xp6(2),s.Q6J("ngIf",!e.PasswordManager.basePrice&&e.PasswordManager.hasAdditionalSeatsOption),s.xp6(2),s.Q6J("ngIf",e.product==n.productTypes.Free)}}function mt(e,t){1&e&&(s.ynx(0),s._uU(1,"\n      "),s.TgZ(2,"h2",14),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n      "),s.TgZ(6,"div",30),s._uU(7,"\n        "),s.TgZ(8,"div",37),s._uU(9,"\n          "),s.TgZ(10,"label",38),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n          "),s._UZ(14,"input",39),s.ALo(15,"i18n"),s._uU(16,"\n          "),s.TgZ(17,"small",34),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n        "),s.qZA(),s._uU(21,"\n      "),s.qZA(),s._uU(22,"\n    "),s.BQk()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,4,"users")),s.xp6(8),s.Oqu(s.lcZ(12,6,"userSeats")),s.xp6(3),s.s9C("placeholder",s.lcZ(15,8,"userSeatsDesc")),s.xp6(4),s.Oqu(s.lcZ(19,10,"userSeatsHowManyDesc")))}function vt(e,t){if(1&e&&(s.TgZ(0,"div",30),s._uU(1,"\n      "),s.TgZ(2,"div",31),s._uU(3,"\n        "),s.TgZ(4,"label",38),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n        "),s._UZ(8,"input",40),s.ALo(9,"i18n"),s._uU(10,"\n        "),s.TgZ(11,"small",34),s._uU(12),s.ALo(13,"i18n"),s.ALo(14,"currency"),s.qZA(),s._uU(15,"\n      "),s.qZA(),s._uU(16,"\n    "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,3,"additionalUserSeats")),s.xp6(3),s.s9C("placeholder",s.lcZ(9,5,"userSeatsDesc")),s.xp6(4),s.Oqu(s.Dn7(13,7,"userSeatsAdditionalDesc",e.selectedPlan.PasswordManager.baseSeats,s.xi3(14,11,e.seatPriceMonthly(e.selectedPlan),"$")))}}function yt(e,t){1&e&&(s.TgZ(0,"div",31),s._uU(1,"\n        "),s.TgZ(2,"div",41),s._uU(3,"\n          "),s._UZ(4,"input",42),s._uU(5,"\n          "),s.TgZ(6,"label",43),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n        "),s.qZA(),s._uU(10,"\n        "),s.TgZ(11,"small",34),s._uU(12),s.ALo(13,"i18n"),s.ALo(14,"currency"),s.ALo(15,"i18n"),s.qZA(),s._uU(16,"\n      "),s.qZA()),2&e&&(s.xp6(7),s.Oqu(s.lcZ(8,2,"premiumAccess")),s.xp6(5),s.Oqu(s.Dn7(13,4,"premiumAccessDesc",s.xi3(14,8,3.33,"$"),s.lcZ(15,11,"month"))))}function wt(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n              "),s.TgZ(2,"span",46),s._uU(3),s.ALo(4,"currency"),s.qZA(),s._uU(5),s.ALo(6,"i18n"),s.BQk()),2&e){const e=s.oxw(3).$implicit;s.xp6(3),s.Oqu(s.xi3(4,2,e.PasswordManager.basePrice,"$")),s.xp6(2),s.hij("\n              ",s.lcZ(6,5,"freeWithSponsorship"),"\n            ")}}function bt(e,t){if(1&e&&(s._uU(0),s.ALo(1,"currency"),s.ALo(2,"i18n")),2&e){const e=s.oxw(3).$implicit;s.AsE("\n              ",s.xi3(1,2,e.PasswordManager.basePrice,"$"),"\n              /",s.lcZ(2,5,"year"),"\n            ")}}function Ut(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"currency"),s.ALo(4,"i18n"),s.YNc(5,wt,7,7,"ng-container",26),s._uU(6,"\n            "),s.YNc(7,bt,3,7,"ng-template",null,45,s.W1O),s._uU(9,"\n          "),s.qZA()),2&e){const e=s.MAs(8),t=s.oxw(2).$implicit,i=s.oxw(3);s.xp6(1),s.lnq("\n            ",s.lcZ(2,5,"basePrice"),":\n            ",s.xi3(3,7,t.isAnnual?t.PasswordManager.basePrice/12:t.PasswordManager.basePrice,"$"),"\n            × 12\n            ",s.lcZ(4,10,"monthAbbr"),"\n            =\n            "),s.xp6(4),s.Q6J("ngIf",i.acceptingSponsorship)("ngIfElse",e)}}function _t(e,t){1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("",s.lcZ(2,1,"additionalUsers"),":"))}function At(e,t){1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("",s.lcZ(2,1,"users"),":"))}function Zt(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1,"\n            "),s.YNc(2,_t,3,3,"span",0),s._uU(3,"\n            "),s.YNc(4,At,3,3,"span",0),s._uU(5),s.ALo(6,"currency"),s.ALo(7,"i18n"),s.ALo(8,"currency"),s.ALo(9,"i18n"),s.qZA()),2&e){const e=s.oxw(2).$implicit,t=s.oxw(3);s.xp6(2),s.Q6J("ngIf",e.PasswordManager.baseSeats),s.xp6(2),s.Q6J("ngIf",!e.PasswordManager.baseSeats),s.xp6(1),s.xDo("\n            ",t.formGroup.controls.additionalSeats.value||0," ×\n            ",s.xi3(6,7,e.isAnnual?e.PasswordManager.seatPrice/12:e.PasswordManager.seatPrice,"$"),"\n            × 12 ",s.lcZ(7,10,"monthAbbr")," =\n            ",s.xi3(8,12,t.passwordManagerSeatTotal(e,t.formGroup.value.additionalSeats),"$"),"\n            /",s.lcZ(9,15,"year"),"\n          ")}}function xt(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"currency"),s.ALo(4,"i18n"),s.ALo(5,"currency"),s.ALo(6,"i18n"),s.qZA()),2&e){const e=s.oxw(2).$implicit,t=s.oxw(3);s.xp6(1),s.gL8("\n            ",s.lcZ(2,6,"additionalStorageGb"),":\n            ",t.formGroup.controls.additionalStorage.value||0," ×\n            ",s.xi3(3,8,e.isAnnual?e.PasswordManager.additionalStoragePricePerGb/12:e.PasswordManager.additionalStoragePricePerGb,"$"),"\n            × 12 ",s.lcZ(4,11,"monthAbbr")," =\n            ",s.xi3(5,13,t.additionalStorageTotal(e),"$")," /",s.lcZ(6,16,"year"),"\n          ")}}function St(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.ALo(2,"i18n"),s.YNc(3,Ut,10,12,"small",0),s._uU(4,"\n          "),s.YNc(5,Zt,10,17,"small",0),s._uU(6,"\n          "),s.YNc(7,xt,7,18,"small",0),s._uU(8,"\n        "),s.BQk()),2&e){const e=s.oxw().$implicit;s.xp6(1),s.hij("\n          ",s.lcZ(2,4,"annually"),"\n          "),s.xp6(2),s.Q6J("ngIf",e.PasswordManager.basePrice),s.xp6(2),s.Q6J("ngIf",e.PasswordManager.hasAdditionalSeatsOption),s.xp6(2),s.Q6J("ngIf",e.PasswordManager.hasAdditionalStorageOption)}}function Tt(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"currency"),s.ALo(4,"i18n"),s.ALo(5,"currency"),s.ALo(6,"i18n"),s.qZA()),2&e){const e=s.oxw(2).$implicit;s.xp6(1),s.xDo("\n            ",s.lcZ(2,5,"basePrice"),":\n            ",s.xi3(3,7,e.PasswordManager.basePrice,"$"),"\n            ",s.lcZ(4,10,"monthAbbr"),"\n            =\n            ",s.xi3(5,12,e.PasswordManager.basePrice,"$"),"\n            /",s.lcZ(6,15,"month"),"\n          ")}}function Ct(e,t){1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("",s.lcZ(2,1,"additionalUsers"),":"))}function Ot(e,t){1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("",s.lcZ(2,1,"users"),":"))}function kt(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1,"\n            "),s.YNc(2,Ct,3,3,"span",0),s._uU(3,"\n            "),s.YNc(4,Ot,3,3,"span",0),s._uU(5),s.ALo(6,"currency"),s.ALo(7,"i18n"),s.ALo(8,"currency"),s.ALo(9,"i18n"),s.qZA()),2&e){const e=s.oxw(2).$implicit,t=s.oxw(3);s.xp6(2),s.Q6J("ngIf",e.PasswordManager.baseSeats),s.xp6(2),s.Q6J("ngIf",!e.PasswordManager.baseSeats),s.xp6(1),s.xDo("\n            ",t.formGroup.controls.additionalSeats.value||0," ×\n            ",s.xi3(6,7,e.PasswordManager.seatPrice,"$"),"\n            ",s.lcZ(7,10,"monthAbbr")," =\n            ",s.xi3(8,12,t.passwordManagerSeatTotal(e,t.formGroup.value.additionalSeats),"$"),"\n            /",s.lcZ(9,15,"month"),"\n          ")}}function Pt(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"currency"),s.ALo(4,"i18n"),s.ALo(5,"currency"),s.ALo(6,"i18n"),s.qZA()),2&e){const e=s.oxw(2).$implicit,t=s.oxw(3);s.xp6(1),s.gL8("\n            ",s.lcZ(2,6,"additionalStorageGb"),":\n            ",t.formGroup.controls.additionalStorage.value||0," ×\n            ",s.xi3(3,8,e.PasswordManager.additionalStoragePricePerGb,"$"),"\n            ",s.lcZ(4,11,"monthAbbr")," =\n            ",s.xi3(5,13,t.additionalStorageTotal(e),"$")," /",s.lcZ(6,16,"month"),"\n          ")}}function qt(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.ALo(2,"i18n"),s.YNc(3,Tt,7,17,"small",0),s._uU(4,"\n          "),s.YNc(5,kt,10,17,"small",0),s._uU(6,"\n          "),s.YNc(7,Pt,7,18,"small",0),s._uU(8,"\n        "),s.BQk()),2&e){const e=s.oxw().$implicit;s.xp6(1),s.hij("\n          ",s.lcZ(2,4,"monthly"),"\n          "),s.xp6(2),s.Q6J("ngIf",e.PasswordManager.basePrice),s.xp6(2),s.Q6J("ngIf",e.PasswordManager.hasAdditionalSeatsOption),s.xp6(2),s.Q6J("ngIf",e.PasswordManager.hasAdditionalStorageOption)}}function It(e,t){if(1&e&&(s.TgZ(0,"div",22),s._uU(1,"\n      "),s._UZ(2,"input",44),s._uU(3,"\n      "),s.TgZ(4,"label",24),s._uU(5,"\n        "),s.YNc(6,St,9,6,"ng-container",0),s._uU(7,"\n        "),s.YNc(8,qt,9,6,"ng-container",0),s._uU(9,"\n      "),s.qZA(),s._uU(10,"\n    "),s.qZA()),2&e){const e=t.$implicit;s.xp6(2),s.MGl("id","interval",e.type,""),s.Q6J("value",e.type),s.xp6(2),s.MGl("for","interval",e.type,""),s.xp6(2),s.Q6J("ngIf",e.isAnnual),s.xp6(2),s.Q6J("ngIf",!e.isAnnual)}}function Mt(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n    "),s.YNc(2,mt,23,12,"ng-container",0),s._uU(3,"\n    "),s.TgZ(4,"h2",14),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n    "),s.YNc(8,vt,17,14,"div",29),s._uU(9,"\n    "),s.TgZ(10,"div",30),s._uU(11,"\n      "),s.TgZ(12,"div",31),s._uU(13,"\n        "),s.TgZ(14,"label",32),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n        "),s._UZ(18,"input",33),s.ALo(19,"i18n"),s._uU(20,"\n        "),s.TgZ(21,"small",34),s._uU(22),s.ALo(23,"i18n"),s.ALo(24,"currency"),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n      "),s.qZA(),s._uU(27,"\n    "),s.qZA(),s._uU(28,"\n    "),s.TgZ(29,"div",30),s._uU(30,"\n      "),s.YNc(31,yt,17,13,"div",35),s._uU(32,"\n    "),s.qZA(),s._uU(33,"\n    "),s.TgZ(34,"h2",36),s._uU(35),s.ALo(36,"i18n"),s.qZA(),s._uU(37,"\n    "),s.YNc(38,It,11,5,"div",15),s._uU(39,"\n  "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(2),s.Q6J("ngIf",e.selectedPlan.PasswordManager.hasAdditionalSeatsOption&&!e.selectedPlan.PasswordManager.baseSeats),s.xp6(3),s.Oqu(s.lcZ(6,9,"addons")),s.xp6(3),s.Q6J("ngIf",e.selectedPlan.PasswordManager.hasAdditionalSeatsOption&&e.selectedPlan.PasswordManager.baseSeats),s.xp6(7),s.Oqu(s.lcZ(16,11,"additionalStorageGb")),s.xp6(3),s.s9C("placeholder",s.lcZ(19,13,"additionalStorageGbDesc")),s.xp6(4),s.Oqu(s.gM2(23,15,"additionalStorageIntervalDesc","1 GB",s.xi3(24,20,e.additionalStoragePriceMonthly(e.selectedPlan),"$"),s.lcZ(25,23,"month"))),s.xp6(9),s.Q6J("ngIf",e.selectedPlan.PasswordManager.hasPremiumAccessOption),s.xp6(4),s.Oqu(s.lcZ(36,25,"summary")),s.xp6(3),s.Q6J("ngForOf",e.selectablePlans)}}function Nt(e,t){if(1&e&&s._UZ(0,"sm-subscribe",47),2&e){const e=s.oxw(2);s.Q6J("formGroup",e.formGroup.controls.secretsManager)("selectedPlan",e.selectedSecretsManagerPlan)("upgradeOrganization",!e.createOrganization)}}function Lt(e,t){1&e&&s._UZ(0,"app-payment",56),2&e&&s.Q6J("hideCredit",!0)}function Dt(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"currency"),s._UZ(4,"br"),s._uU(5,"\n        "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(1),s.AsE("\n          ",s.lcZ(2,2,"secretsManagerPlanPrice"),": ",s.xi3(3,4,e.secretsManagerSubtotal,"USD $"),"\n          ")}}function Et(e,t){1&e&&(s.ynx(0),s._uU(1,"\n      "),s._UZ(2,"app-payment",57),s._uU(3,"\n    "),s.BQk()),2&e&&(s.xp6(2),s.Q6J("showMethods",!1))}function Ft(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div"),s._uU(1,"\n    "),s.TgZ(2,"h2",48),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n    "),s.TgZ(6,"small",49),s._uU(7),s.qZA(),s._uU(8,"\n    "),s.YNc(9,Lt,1,1,"app-payment",50),s._uU(10,"\n    "),s.TgZ(11,"app-tax-info",51),s.NdJ("onCountryChanged",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.changedCountry())})),s.qZA(),s._uU(12,"\n    "),s.TgZ(13,"div",52),s._uU(14,"\n      "),s.TgZ(15,"div",53),s._uU(16),s.ALo(17,"i18n"),s.ALo(18,"currency"),s._UZ(19,"br"),s._uU(20,"\n        "),s.YNc(21,Dt,6,7,"span",0),s._uU(22,"\n        "),s.ynx(23),s._uU(24),s.ALo(25,"i18n"),s.ALo(26,"currency"),s.BQk(),s._uU(27,"\n      "),s.qZA(),s._uU(28,"\n      "),s._UZ(29,"hr",54),s._uU(30,"\n      "),s.TgZ(31,"p",55),s._uU(32,"\n        "),s.TgZ(33,"strong"),s._uU(34),s.ALo(35,"i18n"),s.qZA(),s._uU(36),s.ALo(37,"currency"),s.ALo(38,"i18n"),s.qZA(),s._uU(39,"\n    "),s.qZA(),s._uU(40,"\n    "),s.YNc(41,Et,4,1,"ng-container",0),s._uU(42,"\n  "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n      ",s.lcZ(4,12,e.createOrganization?"paymentInformation":"billingInformation"),"\n    "),s.xp6(4),s.hij("\n      ",e.paymentDesc,"\n    "),s.xp6(2),s.Q6J("ngIf",e.createOrganization||e.upgradeRequiresPaymentMethod),s.xp6(7),s.AsE("\n        ",s.lcZ(17,14,"passwordManagerPlanPrice"),": ",s.xi3(18,16,e.passwordManagerSubtotal,"USD $"),"\n        "),s.xp6(5),s.Q6J("ngIf",e.planOffersSecretsManager&&e.formGroup.value.secretsManager.enabled),s.xp6(3),s.AsE("\n          ",s.lcZ(25,19,"estimatedTax"),": ",s.xi3(26,21,e.taxCharges,"USD $"),"\n        "),s.xp6(10),s.hij("",s.lcZ(35,24,"total"),":"),s.xp6(2),s.AsE(" ",s.xi3(37,26,e.total,"USD $"),"/",s.lcZ(38,29,e.selectedPlanInterval),"\n      "),s.xp6(5),s.Q6J("ngIf",!e.createOrganization)}}function Rt(e,t){1&e&&(s.TgZ(0,"div",19),s._uU(1,"\n    "),s.TgZ(2,"app-callout",58),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n  "),s.qZA()),2&e&&(s.xp6(2),s.Q6J("type","error"),s.xp6(1),s.Oqu(s.lcZ(4,2,"singleOrgBlockCreateMessage")))}function Jt(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",59),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.cancel())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n      ",s.lcZ(2,1,"cancel"),"\n    "))}function zt(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"form",12,5),s.NdJ("ngSubmit",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.submit())})),s._uU(2,"\n  "),s.TgZ(3,"app-org-info",13),s.NdJ("changedBusinessOwned",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.changedOwnedBusiness())})),s.qZA(),s._uU(4,"\n  "),s.TgZ(5,"h2",14),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n  "),s.YNc(9,ft,23,15,"div",15),s._uU(10,"\n  "),s.YNc(11,Mt,40,27,"div",0),s._uU(12,"\n\n  "),s._uU(13,"\n  "),s.TgZ(14,"div",16),s._uU(15,"\n    "),s.YNc(16,Nt,1,3,"sm-subscribe",17),s._uU(17,"\n  "),s.qZA(),s._uU(18,"\n\n  "),s._uU(19,"\n  "),s.YNc(20,Ft,43,31,"div",0),s._uU(21,"\n  "),s.YNc(22,Rt,6,4,"div",18),s._uU(23,"\n  "),s.TgZ(24,"div",19),s._uU(25,"\n    "),s.TgZ(26,"button",20),s._uU(27),s.ALo(28,"i18n"),s.qZA(),s._uU(29,"\n    "),s.YNc(30,Jt,3,3,"button",21),s._uU(31,"\n  "),s.qZA(),s._uU(32,"\n"),s.qZA()}if(2&e){const e=s.MAs(1),t=s.oxw();s.Q6J("formGroup",t.formGroup)("appApiAction",t.formPromise),s.xp6(3),s.Q6J("formGroup",t.formGroup)("createOrganization",t.createOrganization)("isProvider",!!t.providerId)("acceptingSponsorship",t.acceptingSponsorship),s.xp6(3),s.Oqu(s.lcZ(7,16,"chooseYourPlan")),s.xp6(3),s.Q6J("ngForOf",t.selectableProducts),s.xp6(2),s.Q6J("ngIf",t.formGroup.value.product!==t.productTypes.Free),s.xp6(5),s.Q6J("ngIf",t.planOffersSecretsManager&&!t.hasProvider),s.xp6(4),s.Q6J("ngIf",t.formGroup.value.product!==t.productTypes.Free),s.xp6(2),s.Q6J("ngIf",t.singleOrgPolicyBlock),s.xp6(4),s.Q6J("loading",e.loading)("disabled",!t.formGroup.valid),s.xp6(1),s.hij("\n      ",s.lcZ(28,18,"submit"),"\n    "),s.xp6(3),s.Q6J("ngIf",t.showCancel)}}ae.k9.TeamsMonthly2020,ae.k9.TeamsAnnually2020,ae.k9.EnterpriseAnnually2020,ae.k9.EnterpriseMonthly2020;class Yt{get product(){return this._product}set product(e){var t,i,n;this._product=e,null===(n=null===(i=null===(t=this.formGroup)||void 0===t?void 0:t.controls)||void 0===i?void 0:i.product)||void 0===n||n.setValue(e)}get plan(){return this._plan}set plan(e){var t,i,n;this._plan=e,null===(n=null===(i=null===(t=this.formGroup)||void 0===t?void 0:t.controls)||void 0===i?void 0:i.plan)||void 0===n||n.setValue(e)}constructor(e,t,i,n,o,r,a,c,u,d,p,g,f){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.cryptoService=n,this.router=o,this.syncService=r,this.policyService=a,this.organizationService=c,this.logService=u,this.messagingService=d,this.formBuilder=p,this.organizationApiService=g,this.providerApiService=f,this.showFree=!0,this.showCancel=!1,this.acceptingSponsorship=!1,this._product=le.kv.Free,this._plan=ae.k9.Free,this.onSuccess=new s.vpe,this.onCanceled=new s.vpe,this.onTrialBillingSuccess=new s.vpe,this.loading=!0,this.selfHosted=!1,this.productTypes=le.kv,this.singleOrgPolicyAppliesToActiveUser=!1,this.isInTrialFlow=!1,this.discount=0,this.secretsManagerSubscription=(0,ye.DT)(this.formBuilder),this.formGroup=this.formBuilder.group({name:[""],billingEmail:["",[l.kI.email]],businessOwned:[!1],premiumAccessAddon:[!1],additionalStorage:[0,[l.kI.min(0),l.kI.max(99)]],additionalSeats:[0,[l.kI.min(0),l.kI.max(1e5)]],clientOwnerEmail:["",[l.kI.email]],plan:[this.plan],product:[this.product],secretsManager:this.secretsManagerSubscription}),this.destroy$=new h.x,this.selfHosted=i.isSelfHost()}ngOnInit(){return Ee(this,void 0,void 0,(function*(){this.organizationId&&(this.organization=yield this.organizationService.get(this.organizationId),this.billing=null,this.sub=null),this.createOrganization?(this.formGroup.controls.name.addValidators([l.kI.required,l.kI.maxLength(50)]),this.formGroup.controls.billingEmail.addValidators(l.kI.required)):this.upgradeFlowPrefillForm(),this.policyService.policyAppliesToActiveUser$(ce.Mi.SingleOrg).pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.singleOrgPolicyAppliesToActiveUser=e})),this.selfHosted||this.changedProduct(),this.loading=!1}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get singleOrgPolicyBlock(){return this.singleOrgPolicyAppliesToActiveUser&&!this.hasProvider}get createOrganization(){return null==this.organizationId}get upgradeRequiresPaymentMethod(){var e,t;return(null===(e=this.organization)||void 0===e?void 0:e.planProductType)===le.kv.Free&&!this.showFree&&!(null===(t=this.billing)||void 0===t?void 0:t.paymentSource)}get selectedPlan(){return this.passwordManagerPlans.find((e=>e.type===this.formGroup.controls.plan.value))}get selectedSecretsManagerPlan(){return this.secretsManagerPlans.find((e=>e.type===this.formGroup.controls.plan.value))}get selectedPlanInterval(){return this.selectedPlan.isAnnual?"year":"month"}isProviderQualifiedFor2020Plan(){const e=new Date("2023-11-06");if(!this.provider||!this.provider.creationDate)return!1;return new Date(this.provider.creationDate)<e}get selectableProducts(){return null}get selectablePlans(){return null}get hasProvider(){return null!=this.providerId}additionalStoragePriceMonthly(e){return e.isAnnual?e.PasswordManager.additionalStoragePricePerGb/12:e.PasswordManager.additionalStoragePricePerGb}seatPriceMonthly(e){return e.isAnnual?e.PasswordManager.seatPrice/12:e.PasswordManager.seatPrice}additionalStorageTotal(e){return e.PasswordManager.hasAdditionalStorageOption?e.PasswordManager.additionalStoragePricePerGb*Math.abs(this.formGroup.controls.additionalStorage.value||0):0}passwordManagerSeatTotal(e,t){return e.PasswordManager.hasAdditionalSeatsOption?e.PasswordManager.seatPrice*Math.abs(t||0):0}secretsManagerSeatTotal(e,t){return e.SecretsManager.hasAdditionalSeatsOption?e.SecretsManager.seatPrice*Math.abs(t||0):0}additionalServiceAccountTotal(e){return e.SecretsManager.hasAdditionalServiceAccountOption?e.SecretsManager.additionalPricePerServiceAccount*Math.abs(this.secretsManagerForm.value.additionalServiceAccounts||0):0}get passwordManagerSubtotal(){let e=this.selectedPlan.PasswordManager.basePrice;return this.selectedPlan.PasswordManager.hasAdditionalSeatsOption&&this.formGroup.controls.additionalSeats.value&&(e+=this.passwordManagerSeatTotal(this.selectedPlan,this.formGroup.value.additionalSeats)),this.selectedPlan.PasswordManager.hasAdditionalStorageOption&&this.formGroup.controls.additionalStorage.value&&(e+=this.additionalStorageTotal(this.selectedPlan)),this.selectedPlan.PasswordManager.hasPremiumAccessOption&&this.formGroup.controls.premiumAccessAddon.value&&(e+=this.selectedPlan.PasswordManager.premiumAccessOptionPrice),e-this.discount}get secretsManagerSubtotal(){const e=this.selectedSecretsManagerPlan,t=this.secretsManagerForm.value;return this.planOffersSecretsManager&&t.enabled?e.SecretsManager.basePrice+this.secretsManagerSeatTotal(e,t.userSeats)+this.additionalServiceAccountTotal(e):0}get freeTrial(){return null!=this.selectedPlan.trialPeriodDays}get taxCharges(){return null!=this.taxComponent&&null!=this.taxComponent.taxRate?this.taxComponent.taxRate/100*(this.passwordManagerSubtotal+this.secretsManagerSubtotal):0}get total(){return this.passwordManagerSubtotal+this.secretsManagerSubtotal+this.taxCharges||0}get paymentDesc(){return this.acceptingSponsorship?this.i18nService.t("paymentSponsored"):this.freeTrial&&this.createOrganization?this.i18nService.t("paymentChargedWithTrial"):this.i18nService.t("paymentCharged",this.i18nService.t(this.selectedPlanInterval))}get secretsManagerForm(){return this.formGroup.controls.secretsManager}get planOffersSecretsManager(){return!1}changedProduct(){}setPlanType(e){this.formGroup.controls.plan.setValue(e)}handlePremiumAddonAccess(e){this.formGroup.controls.premiumAccessAddon.setValue(!e)}handleAdditionalStorage(e){var t;e&&this.currentPlan?(null===(t=this.organization)||void 0===t?void 0:t.maxStorageGb)&&this.formGroup.controls.additionalStorage.setValue(this.organization.maxStorageGb-this.currentPlan.PasswordManager.baseStorageGb):this.formGroup.controls.additionalStorage.setValue(0)}handleAdditionalSeats(e){e?!this.currentPlan||this.currentPlan.PasswordManager.hasAdditionalSeatsOption?this.organization?this.formGroup.controls.additionalSeats.setValue(this.organization.seats):this.formGroup.controls.additionalSeats.setValue(1):this.formGroup.controls.additionalSeats.setValue(this.currentPlan.PasswordManager.baseSeats):this.formGroup.controls.additionalSeats.setValue(0)}handleSecretsManagerForm(){var e,t,i,n;this.planOffersSecretsManager&&this.secretsManagerForm.enable(),(null===(e=this.organization)||void 0===e?void 0:e.useSecretsManager)&&this.secretsManagerForm.controls.enabled.setValue(!0),this.secretsManagerForm.controls.enabled.value&&(this.secretsManagerForm.controls.userSeats.setValue((null===(t=this.sub)||void 0===t?void 0:t.smSeats)||1),this.secretsManagerForm.controls.additionalServiceAccounts.setValue((null===(i=this.sub)||void 0===i?void 0:i.smServiceAccounts)-(null===(n=this.currentPlan.SecretsManager)||void 0===n?void 0:n.baseServiceAccount)||0)),this.secretsManagerForm.updateValueAndValidity()}changedOwnedBusiness(){this.formGroup.controls.businessOwned.value&&!this.selectedPlan.canBeUsedByBusiness&&(this.formGroup.controls.product.setValue(le.kv.TeamsStarter),this.formGroup.controls.plan.setValue(ae.k9.TeamsStarter),this.changedProduct())}changedCountry(){this.paymentComponent.hideBank="US"!==this.taxComponent.taxInfo.country,this.paymentComponent.hideBank&&this.paymentComponent.method===ae.Lt.BankAccount&&(this.paymentComponent.method=ae.Lt.Card,this.paymentComponent.changeMethod())}cancel(){this.onCanceled.emit()}submit(){return Ee(this,void 0,void 0,(function*(){if(!this.singleOrgPolicyBlock)try{const e=()=>Ee(this,void 0,void 0,(function*(){let e=null;if(this.createOrganization){const t=yield this.cryptoService.makeOrgKey(),i=t[0].encryptedString,n=(yield this.cryptoService.encrypt(this.i18nService.t("defaultCollection"),t[1])).encryptedString,s=yield this.cryptoService.makeKeyPair(t[1]);e=(this.selfHosted,yield this.createCloudHosted(i,n,s,t[1])),this.platformUtilsService.showToast("success",this.i18nService.t("organizationCreated"),this.i18nService.t("organizationReadyToGo"))}else e=yield this.updateOrganization(e),this.platformUtilsService.showToast("success",null,this.i18nService.t("organizationUpgraded"));return yield this.apiService.refreshIdentityToken(),yield this.syncService.fullSync(!0),this.acceptingSponsorship||this.isInTrialFlow||this.router.navigate(["/organizations/"+e]),this.isInTrialFlow&&this.onTrialBillingSuccess.emit({orgId:e,subLabelText:this.billingSubLabelText()}),e}));this.formPromise=e();const t=yield this.formPromise;this.onSuccess.emit({organizationId:t}),this.messagingService.send("organizationCreated",{organizationId:t})}catch(e){this.logService.error(e)}}))}updateOrganization(e){return Ee(this,void 0,void 0,(function*(){const e=new pe;if(e.additionalSeats=this.formGroup.controls.additionalSeats.value,e.additionalStorageGb=this.formGroup.controls.additionalStorage.value,e.premiumAccessAddon=this.selectedPlan.PasswordManager.hasPremiumAccessOption&&this.formGroup.controls.premiumAccessAddon.value,e.planType=this.selectedPlan.type,e.billingAddressCountry=this.taxComponent.taxInfo.country,e.billingAddressPostalCode=this.taxComponent.taxInfo.postalCode,this.buildSecretsManagerRequest(e),this.upgradeRequiresPaymentMethod){const e=yield this.paymentComponent.createPaymentToken(),t=new ge.t;t.paymentToken=e[0],t.paymentMethodType=e[1],t.country=this.taxComponent.taxInfo.country,t.postalCode=this.taxComponent.taxInfo.postalCode,yield this.organizationApiService.updatePayment(this.organizationId,t)}if(!this.organization.hasPublicAndPrivateKeys){const t=yield this.cryptoService.getOrgKey(this.organizationId),i=yield this.cryptoService.makeKeyPair(t);e.keys=new de.u(i[0],i[1].encryptedString)}const t=yield this.organizationApiService.upgrade(this.organizationId,e);return t.success||null==t.paymentIntentClientSecret||(yield this.paymentComponent.handleStripeCardPayment(t.paymentIntentClientSecret,null)),this.organizationId}))}createCloudHosted(e,t,i,n){return Ee(this,void 0,void 0,(function*(){const s=new ue.a;if(s.key=e,s.collectionName=t,s.name=this.formGroup.controls.name.value,s.billingEmail=this.formGroup.controls.billingEmail.value,s.initiationPath="New organization creation in-product",s.keys=new de.u(i[0],i[1].encryptedString),s.planType=ae.k9.Free,this.hasProvider){const e=new he(this.formGroup.controls.clientOwnerEmail.value,s),t=yield this.cryptoService.getProviderKey(this.providerId);e.organizationCreateRequest.key=(yield this.cryptoService.encrypt(n.key,t)).encryptedString;return(yield this.apiService.postProviderCreateOrganization(this.providerId,e)).organizationId}return(yield this.organizationApiService.create(s)).id}))}createSelfHosted(e,t,i){return Ee(this,void 0,void 0,(function*(){const n=document.getElementById("file").files;if(null==n||0===n.length)throw new Error(this.i18nService.t("selectFile"));const s=new FormData;s.append("license",n[0]),s.append("key",e),s.append("collectionName",t);const o=(yield this.organizationApiService.createLicense(s)).id;yield this.apiService.refreshIdentityToken();const r=new de.u(i[0],i[1].encryptedString);return yield this.organizationApiService.updateKeys(o,r),o}))}billingSubLabelText(){const e=this.selectedPlan,t=0===e.PasswordManager.basePrice?e.PasswordManager.seatPrice:e.PasswordManager.basePrice;let i="";return e.isAnnual?i+=`${this.i18nService.t("annual")} ($${t}/${this.i18nService.t("yr")})`:i+=`${this.i18nService.t("monthly")} ($${t}/${this.i18nService.t("monthAbbr")})`,i}buildSecretsManagerRequest(e){const t=this.secretsManagerForm.value;e.useSecretsManager=this.planOffersSecretsManager&&t.enabled,e.useSecretsManager&&(this.selectedSecretsManagerPlan.SecretsManager.hasAdditionalSeatsOption&&(e.additionalSmSeats=t.userSeats),this.selectedSecretsManagerPlan.SecretsManager.hasAdditionalServiceAccountOption&&(e.additionalServiceAccounts=t.additionalServiceAccounts))}upgradeFlowPrefillForm(){}planIsEnabled(e){return!e.disabled&&!e.legacyYear}}Yt.ɵfac=function(e){return new(e||Yt)(s.Y36(Ue.s),s.Y36(M.D),s.Y36(N.P),s.Y36(D.$),s.Y36(p.F0),s.Y36(T._),s.Y36(Y.d),s.Y36(w.Mn),s.Y36(_e.$),s.Y36(fe.o),s.Y36(l.qu),s.Y36(Ae.M),s.Y36(Ze.L))},Yt.ɵcmp=s.Xpm({type:Yt,selectors:[["app-organization-plans"]],viewQuery:function(e,t){if(1&e&&(s.Gf(we.p,5),s.Gf(be.F,5)),2&e){let e;s.iGM(e=s.CRH())&&(t.paymentComponent=e.first),s.iGM(e=s.CRH())&&(t.taxComponent=e.first)}},inputs:{organizationId:"organizationId",showFree:"showFree",showCancel:"showCancel",acceptingSponsorship:"acceptingSponsorship",currentPlan:"currentPlan",product:"product",plan:"plan",providerId:"providerId"},outputs:{onSuccess:"onSuccess",onCanceled:"onCanceled",onTrialBillingSuccess:"onTrialBillingSuccess"},standalone:!0,features:[s.jDz],decls:6,vars:3,consts:[[4,"ngIf"],["ngNativeValidate","","class","tw-pt-6",3,"formGroup","appApiAction","ngSubmit",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],["ngNativeValidate","",3,"appApiAction","ngSubmit"],["form",""],[1,"form-group"],["for","file"],["type","file","id","file","name","file","required","",1,"form-control-file"],[1,"form-text","text-muted"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["ngNativeValidate","",1,"tw-pt-6",3,"formGroup","appApiAction","ngSubmit"],[3,"formGroup","createOrganization","isProvider","acceptingSponsorship","changedBusinessOwned"],[1,"mt-5"],["class","form-check form-check-block",4,"ngFor","ngForOf"],[1,"tw-my-10"],[3,"formGroup","selectedPlan","upgradeOrganization",4,"ngIf"],["class","mt-4",4,"ngIf"],[1,"mt-4"],["type","submit","buttonType","primary","bitButton","",3,"loading","disabled"],["type","button","buttonType","secondary","bitButton","",3,"click",4,"ngIf"],[1,"form-check","form-check-block"],["type","radio","name","product","formControlName","product",1,"form-check-input",3,"id","value","change"],[1,"form-check-label",3,"for"],[1,"mb-1"],[4,"ngIf","ngIfElse"],["nonEnterprisePlans",""],["fullFeatureList",""],["class","row",4,"ngIf"],[1,"row"],[1,"form-group","col-6"],["for","additionalStorage"],["id","additionalStorage","type","number","name","additionalStorageGb","formControlName","additionalStorage","step","1",1,"form-control",3,"placeholder"],[1,"text-muted","form-text"],["class","form-group col-6",4,"ngIf"],[1,"spaced-header"],[1,"col-6"],["for","additionalSeats"],["id","additionalSeats","type","number","name","additionalSeats","formControlName","additionalSeats","required","",1,"form-control",3,"placeholder"],["id","additionalSeats","type","number","name","additionalSeats","formControlName","additionalSeats",1,"form-control",3,"placeholder"],[1,"form-check"],["id","premiumAccess","type","checkbox","name","premiumAccessAddon","formControlName","premiumAccessAddon",1,"form-check-input"],["for","premiumAccess",1,"form-check-label","bold"],["type","radio","name","plan","formControlName","plan",1,"form-check-input",3,"id","value"],["notAcceptingSponsorship",""],[2,"text-decoration","line-through"],[3,"formGroup","selectedPlan","upgradeOrganization"],[1,"mb-4"],[1,"text-muted","font-italic","mb-3","d-block"],[3,"hideCredit",4,"ngIf"],[3,"onCountryChanged"],["id","price",1,"my-4"],[1,"text-muted","text-sm"],[1,"my-1","col-3","ml-0"],[1,"text-lg"],[3,"hideCredit"],[3,"showMethods"],[3,"type"],["type","button","buttonType","secondary","bitButton","",3,"click"]],template:function(e,t){1&e&&(s.YNc(0,Fe,9,6,"ng-container",0),s._uU(1,"\n"),s.YNc(2,Re,33,18,"ng-container",0),s._uU(3,"\n"),s.YNc(4,zt,33,20,"form",1),s._uU(5,"\n")),2&e&&(s.Q6J("ngIf",t.loading),s.xp6(2),s.Q6J("ngIf",t.createOrganization&&!1),s.xp6(2),s.Q6J("ngIf",!t.loading))},dependencies:[ye.ql,d.sg,d.O5,l.Fj,l.wV,l.Wl,l._,l.JJ,l.JL,l.Q7,l.F,l.sg,l.u,xe.b,Se.O,Te.r,we.p,be.F,Ce.G,d.H9,ee.C,ve,De],encapsulation:2});var Kt=i(13159),Bt=i(14494),Qt=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Gt(e,t){1&e&&(s.TgZ(0,"div",4),s._uU(1,"\n    "),s._UZ(2,"i",5),s.ALo(3,"i18n"),s._uU(4,"\n    "),s.TgZ(5,"span",6),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n  "),s.qZA()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function jt(e,t){1&e&&(s.TgZ(0,"div",4),s._uU(1,"\n    "),s.TgZ(2,"span"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n  "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,1,"badToken")))}function Vt(e,t){if(1&e&&(s.TgZ(0,"option",17),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.id),s.xp6(1),s.hij("\n          ",e.name,"\n        ")}}function $t(e,t){1&e&&(s.TgZ(0,"div",18),s._uU(1,"\n      "),s._UZ(2,"app-organization-plans"),s._uU(3,"\n    "),s.qZA())}function Ht(e,t){if(1&e&&(s.TgZ(0,"div",9),s._uU(1,"\n      "),s.TgZ(2,"button",19),s._uU(3,"\n        "),s._UZ(4,"i",20),s.ALo(5,"i18n"),s._uU(6,"\n        "),s.TgZ(7,"span"),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.qZA(),s._uU(11,"\n    "),s.qZA()),2&e){s.oxw();const e=s.MAs(1);s.xp6(2),s.Q6J("disabled",e.loading),s.xp6(2),s.s9C("title",s.lcZ(5,3,"loading")),s.xp6(4),s.Oqu(s.lcZ(9,5,"acceptOffer"))}}function Wt(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"form",7,8),s.NdJ("ngSubmit",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.submit())})),s._uU(2,"\n    "),s.TgZ(3,"p"),s._uU(4,"\n      "),s.TgZ(5,"span"),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n    "),s.qZA(),s._uU(9,"\n    "),s.TgZ(10,"div",9),s._uU(11,"\n      "),s.TgZ(12,"label",10),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n      "),s.TgZ(16,"select",11),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.selectedFamilyOrganizationId=t)})),s._uU(17,"\n        "),s.TgZ(18,"option",12),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n        "),s.TgZ(22,"option",13),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n        "),s.YNc(26,Vt,2,2,"option",14),s.ALo(27,"async"),s._uU(28,"\n      "),s.qZA(),s._uU(29,"\n    "),s.qZA(),s._uU(30,"\n    "),s.YNc(31,$t,4,0,"div",15),s._uU(32,"\n    "),s.YNc(33,Ht,12,7,"div",16),s._uU(34,"\n  "),s.qZA()}if(2&e){const e=s.oxw();s.Q6J("appApiAction",e.formPromise),s.xp6(6),s.Oqu(s.lcZ(7,9,"acceptBitwardenFamiliesHelp")),s.xp6(7),s.Oqu(s.lcZ(14,11,"sponsoredFamiliesSelectOffer")),s.xp6(3),s.Q6J("ngModel",e.selectedFamilyOrganizationId),s.xp6(3),s.hij("-- ",s.lcZ(20,13,"select")," --"),s.xp6(4),s.Oqu(s.lcZ(24,15,"newFamiliesOrganization")),s.xp6(3),s.Q6J("ngForOf",s.lcZ(27,17,e.existingFamilyOrganizations$)),s.xp6(5),s.Q6J("ngIf",e.showNewOrganization),s.xp6(2),s.Q6J("ngIf",!e.showNewOrganization)}}class Xt{set organizationPlansComponent(e){e&&(e.plan=ae.k9.FamiliesAnnually,e.product=le.kv.Families,e.acceptingSponsorship=!0,e.onSuccess.subscribe(this.onOrganizationCreateSuccess.bind(this)))}constructor(e,t,i,n,s,o,r,a,l){this.router=e,this.platformUtilsService=t,this.i18nService=i,this.route=n,this.apiService=s,this.syncService=o,this.validationService=r,this.organizationService=a,this.dialogService=l,this.loading=!0,this.badToken=!1,this.showNewOrganization=!1,this._selectedFamilyOrganizationId="",this._destroy=new h.x}ngOnInit(){return Qt(this,void 0,void 0,(function*(){document.body.classList.remove("layout_frontend"),this.route.queryParams.pipe((0,oe.P)()).subscribe((e=>Qt(this,void 0,void 0,(function*(){if(null==e.token)return this.platformUtilsService.showToast("error",null,this.i18nService.t("sponsoredFamiliesAcceptFailed"),{timeout:1e4}),void this.router.navigate(["/"]);this.token=e.token,yield this.syncService.fullSync(!0),this.badToken=!(yield this.apiService.postPreValidateSponsorshipToken(this.token)),this.loading=!1})))),this.existingFamilyOrganizations$=this.organizationService.organizations$.pipe((0,y.U)((e=>e.filter((e=>e.planProductType===le.kv.Families))))),this.existingFamilyOrganizations$.pipe((0,g.R)(this._destroy)).subscribe((e=>{0===e.length&&(this.selectedFamilyOrganizationId="createNew")}))}))}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}submit(){return Qt(this,void 0,void 0,(function*(){this.formPromise=this.doSubmit(this._selectedFamilyOrganizationId),yield this.formPromise,this.formPromise=null}))}get selectedFamilyOrganizationId(){return this._selectedFamilyOrganizationId}set selectedFamilyOrganizationId(e){this._selectedFamilyOrganizationId=e,this.showNewOrganization="createNew"===e}doSubmit(e){return Qt(this,void 0,void 0,(function*(){try{const t=new re;t.planSponsorshipType=ae.qz.FamiliesForEnterprise,t.sponsoredOrganizationId=e,yield this.apiService.postRedeemSponsorship(this.token,t),this.platformUtilsService.showToast("success",null,this.i18nService.t("sponsoredFamiliesOfferRedeemed")),yield this.syncService.fullSync(!0),this.router.navigate(["/"])}catch(t){if(this.showNewOrganization){const t=(0,Kt.j1)(this.dialogService,{data:{organizationId:e,requestType:"InvalidFamiliesForEnterprise"}});(yield(0,se.n)(t.closed))===Kt._P.Deleted&&this.router.navigate(["/"])}this.validationService.showError(this.i18nService.t("sponsorshipTokenHasExpired"))}}))}onOrganizationCreateSuccess(e){return Qt(this,void 0,void 0,(function*(){yield this.doSubmit(e.organizationId)}))}}Xt.ɵfac=function(e){return new(e||Xt)(s.Y36(p.F0),s.Y36(N.P),s.Y36(M.D),s.Y36(p.gz),s.Y36(Ue.s),s.Y36(T._),s.Y36(Bt.R),s.Y36(w.Mn),s.Y36(I.x))},Xt.ɵcmp=s.Xpm({type:Xt,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&s.Gf(Yt,5),2&e){let e;s.iGM(e=s.CRH())&&(t.organizationPlansComponent=e.first)}},standalone:!0,features:[s.jDz],decls:16,vars:6,consts:[[1,"container","page-content"],[1,"page-header"],["class","mt-5 d-flex justify-content-center",4,"ngIf"],["ngNativeValidate","",3,"appApiAction","ngSubmit",4,"ngIf"],[1,"mt-5","d-flex","justify-content-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","text-muted",3,"title"],[1,"sr-only"],["ngNativeValidate","",3,"appApiAction","ngSubmit"],["form",""],[1,"form-group","col-6"],["for","availableSponsorshipOrg"],["id","availableSponsorshipOrg","name","Available Sponsorship Organization","required","",1,"form-control",3,"ngModel","ngModelChange"],["value","","disabled",""],["value","createNew"],[3,"ngValue",4,"ngFor","ngForOf"],["class","col-12",4,"ngIf"],["class","form-group col-6",4,"ngIf"],[3,"ngValue"],[1,"col-12"],["type","submit",1,"btn","btn-primary","mt-2","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"h1"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n  "),s.qZA(),s._uU(8,"\n  "),s.YNc(9,Gt,9,6,"div",2),s._uU(10,"\n  "),s.YNc(11,jt,6,3,"div",2),s._uU(12,"\n  "),s.YNc(13,Wt,35,19,"form",3),s._uU(14,"\n"),s.qZA(),s._uU(15,"\n")),2&e&&(s.xp6(5),s.Oqu(s.lcZ(6,4,"sponsoredFamiliesOffer")),s.xp6(4),s.Q6J("ngIf",t.loading),s.xp6(2),s.Q6J("ngIf",!t.loading&&t.badToken),s.xp6(2),s.Q6J("ngIf",!t.loading&&!t.badToken))},dependencies:[me.m,d.sg,d.O5,l.YN,l.Kr,l.EJ,l.JJ,l.JL,l.Q7,l.On,l.F,xe.b,d.Ov,ee.C,Yt],encapsulation:2});class ei{constructor(e){this.token=e}}var ti=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ii{constructor(e,t,i,n,s,o){this.router=e,this.providerApiService=t,this.platformUtilsService=i,this.i18nService=n,this.route=s,this.logService=o}ngOnInit(){return ti(this,void 0,void 0,(function*(){const e=yield(0,f.z)(this.route.queryParams);null!=e.providerId&&null!=e.token&&null!=e.name?(this.providerId=e.providerId,this.token=e.token,this.name=e.name):yield this.router.navigate(["/"])}))}submit(){return ti(this,void 0,void 0,(function*(){try{const e=new ei(this.token);this.formPromise=this.providerApiService.providerRecoverDeleteToken(this.providerId,e),yield this.formPromise,this.platformUtilsService.showToast("success",this.i18nService.t("providerDeleted"),this.i18nService.t("providerDeletedDesc")),yield this.router.navigate(["/"])}catch(e){this.logService.error(e)}}))}}ii.ɵfac=function(e){return new(e||ii)(s.Y36(p.F0),s.Y36(Ze.L),s.Y36(N.P),s.Y36(M.D),s.Y36(p.gz),s.Y36(_e.$))},ii.ɵcmp=s.Xpm({type:ii,selectors:[["app-verify-recover-delete-provider"]],decls:53,vars:21,consts:[["ngNativeValidate","",1,"container",3,"appApiAction","ngSubmit"],["form",""],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],[1,"lead","text-center","mb-4"],[1,"card"],[1,"card-body"],["type","warning"],[1,"text-center"],[1,"d-flex"],["type","submit",1,"btn","btn-danger","btn-block","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["routerLink","/login",1,"btn","btn-outline-secondary","btn-block","ml-2","mt-0"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n  "),s.TgZ(3,"div",2),s._uU(4,"\n    "),s.TgZ(5,"div",3),s._uU(6,"\n      "),s.TgZ(7,"p",4),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.TgZ(11,"div",5),s._uU(12,"\n        "),s.TgZ(13,"div",6),s._uU(14,"\n          "),s.TgZ(15,"app-callout",7),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n          "),s.TgZ(19,"p",8),s._uU(20,"\n            "),s.TgZ(21,"strong"),s._uU(22),s.qZA(),s._uU(23,"\n          "),s.qZA(),s._uU(24,"\n          "),s.TgZ(25,"p"),s._uU(26),s.ALo(27,"i18n"),s.qZA(),s._uU(28,"\n          "),s._UZ(29,"hr"),s._uU(30,"\n          "),s.TgZ(31,"div",9),s._uU(32,"\n            "),s.TgZ(33,"button",10),s._uU(34,"\n              "),s.TgZ(35,"span"),s._uU(36),s.ALo(37,"i18n"),s.qZA(),s._uU(38,"\n              "),s._UZ(39,"i",11),s.ALo(40,"i18n"),s._uU(41,"\n            "),s.qZA(),s._uU(42,"\n            "),s.TgZ(43,"a",12),s._uU(44),s.ALo(45,"i18n"),s.qZA(),s._uU(46,"\n          "),s.qZA(),s._uU(47,"\n        "),s.qZA(),s._uU(48,"\n      "),s.qZA(),s._uU(49,"\n    "),s.qZA(),s._uU(50,"\n  "),s.qZA(),s._uU(51,"\n"),s.qZA(),s._uU(52,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,9,"deleteProvider")),s.xp6(8),s.Oqu(s.lcZ(17,11,"deleteProviderWarning")),s.xp6(6),s.Oqu(t.name),s.xp6(4),s.Oqu(s.lcZ(27,13,"deleteProviderRecoverConfirmDesc")),s.xp6(7),s.Q6J("disabled",e.loading),s.xp6(3),s.Oqu(s.lcZ(37,15,"deleteProvider")),s.xp6(3),s.s9C("title",s.lcZ(40,17,"loading")),s.xp6(5),s.hij("\n              ",s.lcZ(45,19,"cancel"),"\n            ")}},dependencies:[l.JL,l.F,p.rH,xe.b,Se.O,ee.C],encapsulation:2});var ni=i(95379),si=i(81168),oi=i(58618),ri=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ai{constructor(e){this.route=e}ngOnInit(){this.route.queryParams.pipe((0,oe.P)()).subscribe((e=>ri(this,void 0,void 0,(function*(){"families"===e.plan?(this.orgPlansComponent.plan=ae.k9.FamiliesAnnually,this.orgPlansComponent.product=le.kv.Families):"teams"===e.plan?(this.orgPlansComponent.plan=ae.k9.TeamsAnnually,this.orgPlansComponent.product=le.kv.Teams):"teamsStarter"===e.plan?(this.orgPlansComponent.plan=ae.k9.TeamsStarter,this.orgPlansComponent.product=le.kv.TeamsStarter):"enterprise"===e.plan&&(this.orgPlansComponent.plan=ae.k9.EnterpriseAnnually,this.orgPlansComponent.product=le.kv.Enterprise)}))))}}ai.ɵfac=function(e){return new(e||ai)(s.Y36(p.gz))},ai.ɵcmp=s.Xpm({type:ai,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&s.Gf(Yt,7),2&e){let e;s.iGM(e=s.CRH())&&(t.orgPlansComponent=e.first)}},standalone:!0,features:[s.jDz],decls:11,vars:3,template:function(e,t){1&e&&(s._UZ(0,"app-header"),s._uU(1,"\n\n"),s.TgZ(2,"bit-container"),s._uU(3,"\n  "),s.TgZ(4,"p"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n  "),s._UZ(8,"app-organization-plans"),s._uU(9,"\n"),s.qZA(),s._uU(10,"\n")),2&e&&(s.xp6(5),s.Oqu(s.lcZ(6,1,"newOrganizationDesc")))},dependencies:[me.m,si.e,ee.C,Yt,ni.O,oi.k],encapsulation:2});var li=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function ci(e,t=!1){return i=>li(this,void 0,void 0,(function*(){let n=yield e(),s=i.value;if(t&&(n=n.toLowerCase(),s=s.toLowerCase()),s===n)return{notAllowedValue:!0}}))}i(27263);var ui=i(33245),di=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function pi(e,t){1&e&&(s.TgZ(0,"button",9),s.ALo(1,"i18n"),s._uU(2,"\n      "),s._UZ(3,"i",10),s._uU(4,"\n    "),s.qZA()),2&e&&s.s9C("appA11yTitle",s.lcZ(1,1,"options"))}function hi(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",11,12),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.resendEmail())})),s.ALo(2,"i18n"),s._uU(3,"\n        "),s._UZ(4,"i",8),s.ALo(5,"i18n"),s._uU(6,"\n        "),s.TgZ(7,"span"),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.qZA()}if(2&e){const e=s.MAs(1),t=s.oxw();s.Q6J("appApiAction",t.resendEmailPromise)("disabled",e.loading),s.uIk("aria-label",s.xi3(2,5,"resendEmailLabel",t.sponsoringOrg.familySponsorshipFriendlyName)),s.xp6(4),s.s9C("title",s.lcZ(5,8,"loading")),s.xp6(4),s.Oqu(s.lcZ(9,10,"resendEmail"))}}class gi{constructor(e,t,i,n,o){this.apiService=e,this.i18nService=t,this.logService=i,this.platformUtilsService=n,this.dialogService=o,this.sponsoringOrg=null,this.isSelfHosted=!1,this.sponsorshipRemoved=new s.vpe,this.statusMessage="loading",this.statusClass="text-success",this.locale=""}ngOnInit(){return di(this,void 0,void 0,(function*(){this.locale=yield(0,f.z)(this.i18nService.locale$),this.setStatus(this.isSelfHosted,this.sponsoringOrg.familySponsorshipToDelete,this.sponsoringOrg.familySponsorshipValidUntil,this.sponsoringOrg.familySponsorshipLastSyncDate)}))}revokeSponsorship(){return di(this,void 0,void 0,(function*(){try{this.revokeSponsorshipPromise=this.doRevokeSponsorship(),yield this.revokeSponsorshipPromise}catch(e){this.logService.error(e)}this.revokeSponsorshipPromise=null}))}resendEmail(){return di(this,void 0,void 0,(function*(){this.resendEmailPromise=this.apiService.postResendSponsorshipOffer(this.sponsoringOrg.id),yield this.resendEmailPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("emailSent")),this.resendEmailPromise=null}))}get isSentAwaitingSync(){return this.isSelfHosted&&!this.sponsoringOrg.familySponsorshipLastSyncDate}doRevokeSponsorship(){return di(this,void 0,void 0,(function*(){(yield this.dialogService.openSimpleDialog({title:`${this.i18nService.t("remove")} ${this.sponsoringOrg.familySponsorshipFriendlyName}?`,content:{key:"revokeSponsorshipConfirmation"},acceptButtonText:{key:"remove"},type:"warning"}))&&(yield this.apiService.deleteRevokeSponsorship(this.sponsoringOrg.id),this.platformUtilsService.showToast("success",null,this.i18nService.t("reclaimedFreePlan")),this.sponsorshipRemoved.emit())}))}setStatus(e,t,i,n){t&&i?(this.statusMessage=this.i18nService.t("revokeWhenExpired",(0,d.p6)(i,"MM/dd/yyyy",this.locale)),this.statusClass="text-danger"):t?(this.statusMessage=this.i18nService.t("requestRemoved"),this.statusClass="text-danger"):i?(this.statusMessage=this.i18nService.t("active"),this.statusClass="text-success"):e&&n?(this.statusMessage=this.i18nService.t("sent"),this.statusClass="text-success"):e?(this.statusMessage=this.i18nService.t("requested"),this.statusClass="text-success"):(this.statusMessage=this.i18nService.t("sent"),this.statusClass="text-success")}}gi.ɵfac=function(e){return new(e||gi)(s.Y36(Ue.s),s.Y36(M.D),s.Y36(_e.$),s.Y36(N.P),s.Y36(I.x))},gi.ɵcmp=s.Xpm({type:gi,selectors:[["","sponsoring-org-row",""]],inputs:{sponsoringOrg:"sponsoringOrg",isSelfHosted:"isSelfHosted"},outputs:{sponsorshipRemoved:"sponsorshipRemoved"},attrs:["sponsoring-org-row",""],decls:37,vars:18,consts:[[3,"ngClass"],[1,"table-action-right"],["appListDropdown","",1,"dropdown"],["class","btn btn-outline-secondary dropdown-toggle","type","button","id","dropdownMenuButton","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",3,"appA11yTitle",4,"ngIf"],["aria-labelledby","dropdownMenuButton",1,"dropdown-menu","dropdown-menu-right"],["type","button","class","dropdown-item btn-submit",3,"appApiAction","disabled","click",4,"ngIf"],["type","button",1,"dropdown-item","text-danger","btn-submit",3,"appApiAction","disabled","click"],["revokeSponsorshipBtn",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button","id","dropdownMenuButton","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-cog","bwi-lg"],["type","button",1,"dropdown-item","btn-submit",3,"appApiAction","disabled","click"],["resendEmailBtn",""]],template:function(e,t){if(1&e&&(s.TgZ(0,"td"),s._uU(1),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"td"),s._uU(4),s.qZA(),s._uU(5,"\n"),s.TgZ(6,"td"),s._uU(7,"\n  "),s.TgZ(8,"span",0),s._uU(9),s.qZA(),s._uU(10,"\n"),s.qZA(),s._uU(11,"\n"),s.TgZ(12,"td",1),s._uU(13,"\n  "),s.TgZ(14,"div",2),s._uU(15,"\n    "),s.YNc(16,pi,5,3,"button",3),s._uU(17,"\n    "),s.TgZ(18,"div",4),s._uU(19,"\n      "),s.YNc(20,hi,11,12,"button",5),s._uU(21,"\n      "),s.TgZ(22,"button",6,7),s.NdJ("click",(function(){return t.revokeSponsorship()})),s.ALo(24,"i18n"),s._uU(25,"\n        "),s._UZ(26,"i",8),s.ALo(27,"i18n"),s._uU(28,"\n        "),s.TgZ(29,"span"),s._uU(30),s.ALo(31,"i18n"),s.qZA(),s._uU(32,"\n      "),s.qZA(),s._uU(33,"\n    "),s.qZA(),s._uU(34,"\n  "),s.qZA(),s._uU(35,"\n"),s.qZA(),s._uU(36,"\n")),2&e){const e=s.MAs(23);s.xp6(1),s.hij("\n  ",t.sponsoringOrg.familySponsorshipFriendlyName,"\n"),s.xp6(3),s.Oqu(t.sponsoringOrg.name),s.xp6(4),s.Q6J("ngClass",t.statusClass),s.xp6(1),s.Oqu(t.statusMessage),s.xp6(7),s.Q6J("ngIf",!t.sponsoringOrg.familySponsorshipToDelete),s.xp6(4),s.Q6J("ngIf",!t.isSelfHosted&&!t.sponsoringOrg.familySponsorshipValidUntil),s.xp6(2),s.Q6J("appApiAction",t.revokeSponsorshipPromise)("disabled",e.loading),s.uIk("aria-label",s.xi3(24,11,"revokeAccount",t.sponsoringOrg.familySponsorshipFriendlyName)),s.xp6(4),s.s9C("title",s.lcZ(27,14,"loading")),s.xp6(4),s.Oqu(s.lcZ(31,16,"remove"))}},dependencies:[d.mk,d.O5,ui.B,xe.b,ee.C],encapsulation:2});var fi=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function mi(e,t){1&e&&(s.ynx(0),s._uU(1,"\n    "),s._UZ(2,"i",1),s.ALo(3,"i18n"),s._uU(4,"\n    "),s.TgZ(5,"span",2),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n  "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function vi(e,t){if(1&e&&(s.TgZ(0,"option",17),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.id),s.xp6(1),s.hij("\n            ",e.name,"\n          ")}}function yi(e,t){1&e&&(s.TgZ(0,"small",18),s._uU(1,"\n          "),s._UZ(2,"i",19),s._uU(3),s.ALo(4,"i18n"),s.qZA()),2&e&&(s.xp6(3),s.hij("\n          ",s.lcZ(4,1,"cannotSponsorSelf"),"\n        "))}function wi(e,t){1&e&&(s.TgZ(0,"small",18),s._uU(1,"\n          "),s._UZ(2,"i",19),s._uU(3),s.ALo(4,"i18n"),s.qZA()),2&e&&(s.xp6(3),s.hij("\n          ",s.lcZ(4,1,"invalidEmail"),"\n        "))}function bi(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"form",5,6),s.NdJ("ngSubmit",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.submit())})),s._uU(2,"\n      "),s.TgZ(3,"div",7),s._uU(4,"\n        "),s.TgZ(5,"label",8),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n        "),s.TgZ(9,"select",9),s._uU(10,"\n          "),s.TgZ(11,"option",10),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n          "),s.YNc(15,vi,2,2,"option",11),s.ALo(16,"async"),s._uU(17,"\n        "),s.qZA(),s._uU(18,"\n      "),s.qZA(),s._uU(19,"\n      "),s.TgZ(20,"div",7),s._uU(21,"\n        "),s.TgZ(22,"label",12),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n        "),s._UZ(26,"input",13),s._uU(27,"\n        "),s.YNc(28,yi,5,3,"small",14),s._uU(29,"\n        "),s.YNc(30,wi,5,3,"small",14),s._uU(31,"\n      "),s.qZA(),s._uU(32,"\n      "),s.TgZ(33,"div",7),s._uU(34,"\n        "),s.TgZ(35,"button",15),s._uU(36,"\n          "),s._UZ(37,"i",16),s.ALo(38,"i18n"),s._uU(39,"\n          "),s.TgZ(40,"span"),s._uU(41),s.ALo(42,"i18n"),s.qZA(),s._uU(43,"\n        "),s.qZA(),s._uU(44,"\n      "),s.qZA(),s._uU(45,"\n    "),s.qZA()}if(2&e){const e=s.MAs(1),t=s.oxw(2);s.Q6J("appApiAction",t.formPromise)("formGroup",t.sponsorshipForm),s.xp6(6),s.Oqu(s.lcZ(7,12,"familiesSponsoringOrgSelect")),s.xp6(6),s.hij("-- ",s.lcZ(13,14,"select")," --"),s.xp6(3),s.Q6J("ngForOf",s.lcZ(16,16,t.availableSponsorshipOrgs$)),s.xp6(8),s.hij("",s.lcZ(24,18,"sponsoredFamiliesEmail"),":"),s.xp6(3),s.uIk("aria-invalid",t.sponsorshipEmailControl.invalid),s.xp6(2),s.Q6J("ngIf",null==t.sponsorshipEmailControl.errors?null:t.sponsorshipEmailControl.errors.notAllowedValue),s.xp6(2),s.Q6J("ngIf",null==t.sponsorshipEmailControl.errors?null:t.sponsorshipEmailControl.errors.email),s.xp6(5),s.Q6J("disabled",e.loading),s.xp6(2),s.s9C("title",s.lcZ(38,20,"loading")),s.xp6(4),s.Oqu(s.lcZ(42,22,"redeem"))}}function Ui(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n              "),s.TgZ(2,"tr",23),s.NdJ("sponsorshipRemoved",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.forceReload())})),s.qZA(),s._uU(3,"\n            "),s.BQk()}if(2&e){const e=t.$implicit,i=s.oxw(3);s.xp6(2),s.Q6J("sponsoringOrg",e)("isSelfHosted",i.isSelfHosted)}}function _i(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n      "),s.TgZ(2,"div",20),s._uU(3,"\n        "),s.TgZ(4,"table",21),s._uU(5,"\n          "),s.TgZ(6,"thead"),s._uU(7,"\n            "),s.TgZ(8,"tr"),s._uU(9,"\n              "),s.TgZ(10,"th"),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n              "),s.TgZ(14,"th"),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n              "),s.TgZ(18,"th"),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n              "),s._UZ(22,"th"),s._uU(23,"\n            "),s.qZA(),s._uU(24,"\n          "),s.qZA(),s._uU(25,"\n          "),s.TgZ(26,"tbody"),s._uU(27,"\n            "),s.YNc(28,Ui,4,2,"ng-container",22),s.ALo(29,"async"),s._uU(30,"\n          "),s.qZA(),s._uU(31,"\n        "),s.qZA(),s._uU(32,"\n      "),s.qZA(),s._uU(33,"\n      "),s.TgZ(34,"small"),s._uU(35),s.ALo(36,"i18n"),s.qZA(),s._uU(37,"\n    "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(11),s.Oqu(s.lcZ(12,5,"recipient")),s.xp6(4),s.Oqu(s.lcZ(16,7,"sponsoringOrg")),s.xp6(4),s.Oqu(s.lcZ(20,9,"status")),s.xp6(9),s.Q6J("ngForOf",s.lcZ(29,11,e.activeSponsorshipOrgs$)),s.xp6(7),s.Oqu(s.lcZ(36,13,"sponsoredFamiliesLeaveCopy"))}}function Ai(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n    "),s.TgZ(2,"p"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n    "),s.TgZ(6,"div"),s._uU(7),s.ALo(8,"i18n"),s.TgZ(9,"ul",3),s._uU(10,"\n        "),s.TgZ(11,"li"),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n        "),s.TgZ(15,"li"),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n      "),s.qZA(),s._uU(19,"\n    "),s.qZA(),s._uU(20,"\n    "),s.YNc(21,bi,46,24,"form",4),s.ALo(22,"async"),s._uU(23,"\n    "),s.YNc(24,_i,38,15,"ng-container",0),s.ALo(25,"async"),s._uU(26,"\n  "),s.BQk()),2&e){const e=s.oxw();s.xp6(3),s.hij("\n      ",s.lcZ(4,6,"sponsoredFamiliesEligible"),"\n    "),s.xp6(4),s.hij("\n      ",s.lcZ(8,8,"sponsoredFamiliesInclude"),":\n      "),s.xp6(5),s.Oqu(s.lcZ(13,10,"sponsoredFamiliesPremiumAccess")),s.xp6(4),s.Oqu(s.lcZ(17,12,"sponsoredFamiliesSharedCollections")),s.xp6(5),s.Q6J("ngIf",s.lcZ(22,14,e.anyOrgsAvailable$)),s.xp6(3),s.Q6J("ngIf",s.lcZ(25,16,e.anyActiveSponsorships$))}}class Zi{constructor(e,t,i,n,s,o,r){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.syncService=n,this.organizationService=s,this.formBuilder=o,this.stateService=r,this.loading=!1,this._destroy=new h.x,this.sponsorshipForm=this.formBuilder.group({selectedSponsorshipOrgId:new l.NI("",{validators:[l.kI.required]}),sponsorshipEmail:new l.NI("",{validators:[l.kI.email],asyncValidators:[ci((()=>fi(this,void 0,void 0,(function*(){return yield this.stateService.getEmail()}))),!0)],updateOn:"blur"})})}ngOnInit(){return fi(this,void 0,void 0,(function*(){this.availableSponsorshipOrgs$=this.organizationService.organizations$.pipe((0,y.U)((e=>e.filter((e=>e.familySponsorshipAvailable))))),this.availableSponsorshipOrgs$.pipe((0,g.R)(this._destroy)).subscribe((e=>{1===e.length&&this.sponsorshipForm.patchValue({selectedSponsorshipOrgId:e[0].id})})),this.anyOrgsAvailable$=this.availableSponsorshipOrgs$.pipe((0,y.U)((e=>e.length>0))),this.activeSponsorshipOrgs$=this.organizationService.organizations$.pipe((0,y.U)((e=>e.filter((e=>null!==e.familySponsorshipFriendlyName))))),this.anyActiveSponsorships$=this.activeSponsorshipOrgs$.pipe((0,y.U)((e=>e.length>0))),this.loading=!1}))}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}submit(){return fi(this,void 0,void 0,(function*(){this.formPromise=this.apiService.postCreateSponsorship(this.sponsorshipForm.value.selectedSponsorshipOrgId,{sponsoredEmail:this.sponsorshipForm.value.sponsorshipEmail,planSponsorshipType:ae.qz.FamiliesForEnterprise,friendlyName:this.sponsorshipForm.value.sponsorshipEmail}),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("sponsorshipCreated")),this.formPromise=null,this.resetForm(),yield this.forceReload()}))}forceReload(){return fi(this,void 0,void 0,(function*(){this.loading=!0,yield this.syncService.fullSync(!0),this.loading=!1}))}get sponsorshipEmailControl(){return this.sponsorshipForm.controls.sponsorshipEmail}resetForm(){return fi(this,void 0,void 0,(function*(){this.sponsorshipForm.reset()}))}get isSelfHosted(){return this.platformUtilsService.isSelfHost()}}Zi.ɵfac=function(e){return new(e||Zi)(s.Y36(Ue.s),s.Y36(M.D),s.Y36(N.P),s.Y36(T._),s.Y36(w.Mn),s.Y36(l.qu),s.Y36(J.b))},Zi.ɵcmp=s.Xpm({type:Zi,selectors:[["app-sponsored-families"]],decls:9,vars:2,consts:[[4,"ngIf"],[1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],[1,"inset-list"],["ngNativeValidate","",3,"appApiAction","formGroup","ngSubmit",4,"ngIf"],["ngNativeValidate","",3,"appApiAction","formGroup","ngSubmit"],["form",""],[1,"form-group","col-7"],["for","availableSponsorshipOrg"],["id","availableSponsorshipOrg","name","Available Sponsorship Organization","formControlName","selectedSponsorshipOrgId","required","",1,"form-control"],["disabled","true","value",""],[3,"ngValue",4,"ngFor","ngForOf"],["for","sponsorshipEmail"],["id","sponsorshipEmail","inputmode","email","formControlName","sponsorshipEmail","name","sponsorshipEmail","required","",1,"form-control"],["aria-errormessage","sponsorshipEmail","class","error-inline","role","alert",4,"ngIf"],["type","submit",1,"btn","btn-primary","btn-submit","mt-2",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],[3,"ngValue"],["aria-errormessage","sponsorshipEmail","role","alert",1,"error-inline"],["aria-hidden","true",1,"bwi","bwi-error"],[1,"border-bottom"],[1,"table","table-hover","table-list"],[4,"ngFor","ngForOf"],["sponsoring-org-row","",3,"sponsoringOrg","isSelfHosted","sponsorshipRemoved"]],template:function(e,t){1&e&&(s._UZ(0,"app-header"),s._uU(1,"\n\n"),s.TgZ(2,"bit-container"),s._uU(3,"\n  "),s.YNc(4,mi,9,6,"ng-container",0),s._uU(5,"\n  "),s.YNc(6,Ai,27,18,"ng-container",0),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n")),2&e&&(s.xp6(4),s.Q6J("ngIf",t.loading),s.xp6(2),s.Q6J("ngIf",!t.loading))},dependencies:[d.sg,d.O5,l.YN,l.Kr,l.Fj,l.EJ,l.JJ,l.JL,l.Q7,l.sg,l.u,xe.b,si.e,oi.k,gi,d.Ov,ee.C],encapsulation:2});class xi{}class Si{}var Ti=i(90692),Ci=i(27646),Oi=i(50137),ki=i(47244),Pi=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function qi(e,t){1&e&&(s.TgZ(0,"div",2),s._uU(1,"\n  "),s.TgZ(2,"div"),s._uU(3,"\n    "),s._UZ(4,"img",3),s._uU(5,"\n    "),s.TgZ(6,"p",4),s._uU(7,"\n      "),s._UZ(8,"i",5),s.ALo(9,"i18n"),s._uU(10,"\n      "),s.TgZ(11,"span",6),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n    "),s.qZA(),s._uU(15,"\n  "),s.qZA(),s._uU(16,"\n"),s.qZA()),2&e&&(s.xp6(8),s.s9C("title",s.lcZ(9,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(13,4,"loading")))}const Ii=function(e){return{email:e}};function Mi(e,t){if(1&e&&(s.TgZ(0,"div",7),s._uU(1,"\n  "),s.TgZ(2,"div",8),s._uU(3,"\n    "),s.TgZ(4,"div",9),s._uU(5,"\n      "),s.TgZ(6,"p",10),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n      "),s.TgZ(10,"div",11),s._uU(11,"\n        "),s.TgZ(12,"div",12),s._uU(13,"\n          "),s.TgZ(14,"p",4),s._uU(15),s.TgZ(16,"strong",13),s._uU(17),s.qZA(),s._uU(18,"\n          "),s.qZA(),s._uU(19,"\n          "),s.TgZ(20,"p"),s._uU(21),s.ALo(22,"i18n"),s.qZA(),s._uU(23,"\n          "),s._UZ(24,"hr"),s._uU(25,"\n          "),s.TgZ(26,"div",14),s._uU(27,"\n            "),s.TgZ(28,"a",15),s._uU(29),s.ALo(30,"i18n"),s.qZA(),s._uU(31,"\n            "),s.TgZ(32,"a",16),s._uU(33),s.ALo(34,"i18n"),s.qZA(),s._uU(35,"\n          "),s.qZA(),s._uU(36,"\n        "),s.qZA(),s._uU(37,"\n      "),s.qZA(),s._uU(38,"\n    "),s.qZA(),s._uU(39,"\n  "),s.qZA(),s._uU(40,"\n"),s.qZA()),2&e){const e=s.oxw();s.xp6(7),s.Oqu(s.lcZ(8,8,"joinOrganization")),s.xp6(8),s.hij("\n            ",e.orgName,"\n            "),s.xp6(2),s.Oqu(e.email),s.xp6(4),s.Oqu(s.lcZ(22,10,"joinOrganizationDesc")),s.xp6(7),s.Q6J("queryParams",s.VKq(16,Ii,e.email)),s.xp6(1),s.hij("\n              ",s.lcZ(30,12,"logIn"),"\n            "),s.xp6(3),s.Q6J("queryParams",s.VKq(18,Ii,e.email)),s.xp6(1),s.hij("\n              ",s.lcZ(34,14,"createAccount"),"\n            ")}}class Ni extends X.o{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p){super(e,t,i,n,s),this.cryptoService=o,this.policyApiService=r,this.policyService=a,this.logService=l,this.organizationApiService=c,this.organizationUserService=u,this.messagingService=d,this.apiService=p,this.requiredParameters=["organizationId","organizationUserId","token"]}authedHandler(e){return Pi(this,void 0,void 0,(function*(){const t=null!=e.initOrganization&&"true"===e.initOrganization.toLocaleLowerCase();if(t)this.actionPromise=this.acceptInitOrganizationFlow(e);else{if(null==(yield this.stateService.getOrganizationInvitation()))return this.messagingService.send("logout",{redirect:!1}),void(yield this.prepareOrganizationInvitation(e));this.actionPromise=this.acceptFlow(e)}yield this.actionPromise,yield this.apiService.refreshIdentityToken(),yield this.stateService.setOrganizationInvitation(null),this.platformUtilService.showToast("success",this.i18nService.t("inviteAccepted"),t?this.i18nService.t("inviteInitAcceptedDesc"):this.i18nService.t("inviteAcceptedDesc"),{timeout:1e4}),this.router.navigate(["/vault"])}))}unauthedHandler(e){return Pi(this,void 0,void 0,(function*(){yield this.prepareOrganizationInvitation(e),yield this.accelerateInviteAcceptIfPossible(e)}))}acceptInitOrganizationFlow(e){return Pi(this,void 0,void 0,(function*(){return this.prepareAcceptInitRequest(e).then((t=>this.organizationUserService.postOrganizationUserAcceptInit(e.organizationId,e.organizationUserId,t)))}))}acceptFlow(e){return Pi(this,void 0,void 0,(function*(){return this.prepareAcceptRequest(e).then((t=>this.organizationUserService.postOrganizationUserAccept(e.organizationId,e.organizationUserId,t)))}))}prepareAcceptInitRequest(e){return Pi(this,void 0,void 0,(function*(){const t=new xi;t.token=e.token;const[i,n]=yield this.cryptoService.makeOrgKey(),[s,o]=yield this.cryptoService.makeKeyPair(n),r=yield this.cryptoService.encrypt(this.i18nService.t("defaultCollection"),n);return t.key=i.encryptedString,t.keys=new de.u(s,o.encryptedString),t.collectionName=r.encryptedString,t}))}prepareAcceptRequest(e){return Pi(this,void 0,void 0,(function*(){const t=new Si;if(t.token=e.token,yield this.performResetPasswordAutoEnroll(e)){const i=yield this.organizationApiService.getKeys(e.organizationId);if(null==i)throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));const n=Ci.c.fromB64ToArray(i.publicKey),s=yield this.cryptoService.getUserKey(),o=yield this.cryptoService.rsaEncrypt(s.key,n);t.resetPasswordKey=o.encryptedString}return t}))}performResetPasswordAutoEnroll(e){return Pi(this,void 0,void 0,(function*(){let t=null;try{const i=yield this.policyApiService.getPoliciesByToken(e.organizationId,e.token,e.email,e.organizationUserId);t=Ti.G.fromListResponse(i)}catch(i){this.logService.error(i)}if(null!=t){const i=this.policyService.getResetPasswordPolicyOptions(t,e.organizationId);return i[1]&&i[0].autoEnrollEnabled}return!1}))}prepareOrganizationInvitation(e){return Pi(this,void 0,void 0,(function*(){this.orgName=e.organizationName,null!=this.orgName&&(this.orgName=this.orgName.replace(/\+/g," ")),yield this.stateService.setOrganizationInvitation(e)}))}accelerateInviteAcceptIfPossible(e){return Pi(this,void 0,void 0,(function*(){const t=e.orgSsoIdentifier,i=this.stringToNullOrBool(e.orgUserHasExistingUser);null!=i&&(i?this.router.navigate(["/login"],{queryParams:{email:e.email}}):t?this.router.navigate(["/sso"],{queryParams:{email:e.email,identifier:t}}):this.router.navigate(["/register"],{queryParams:{email:e.email,fromOrgInvite:!0}}))}))}stringToNullOrBool(e){return void 0===e?null:"true"===e.toLowerCase()}}Ni.ɵfac=function(e){return new(e||Ni)(s.Y36(p.F0),s.Y36(N.P),s.Y36(M.D),s.Y36(p.gz),s.Y36(J.b),s.Y36(D.$),s.Y36(Oi.P),s.Y36(Y.d),s.Y36(_e.$),s.Y36(Ae.M),s.Y36(ki.t),s.Y36(fe.o),s.Y36(Ue.s))},Ni.ɵcmp=s.Xpm({type:Ni,selectors:[["app-accept-organization"]],features:[s.qOj],decls:4,vars:2,consts:[["class","mt-5 d-flex justify-content-center",4,"ngIf"],["class","container",4,"ngIf"],[1,"mt-5","d-flex","justify-content-center"],["src","../../images/logo-dark@2x.png","alt","Bitwarden",1,"mb-4","logo"],[1,"text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","text-muted",3,"title"],[1,"sr-only"],[1,"container"],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],[1,"lead","text-center","mb-4"],[1,"card","d-block"],[1,"card-body"],[1,"d-block","mt-2"],[1,"d-flex"],["routerLink","/login",1,"btn","btn-primary","btn-block",3,"queryParams"],["routerLink","/register",1,"btn","btn-primary","btn-block","ml-2","mt-0",3,"queryParams"]],template:function(e,t){1&e&&(s.YNc(0,qi,17,6,"div",0),s._uU(1,"\n"),s.YNc(2,Mi,41,20,"div",1),s._uU(3,"\n")),2&e&&(s.Q6J("ngIf",t.loading),s.xp6(2),s.Q6J("ngIf",!t.loading))},dependencies:[d.O5,p.rH,ee.C],encapsulation:2});var Li=i(82421),Di=i(78243);class Ei{constructor(e){this.email=e}}var Fi=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ri{constructor(e,t,i,n,s,o){this.router=e,this.i18nService=t,this.apiService=i,this.platformUtilsService=n,this.logService=s,this.loginEmailService=o,this.email="",this.successRoute="login"}ngOnInit(){var e;this.email=null!==(e=this.loginEmailService.getEmail())&&void 0!==e?e:""}submit(){return Fi(this,void 0,void 0,(function*(){if(null!=this.email&&""!==this.email)if(-1!==this.email.indexOf("@"))try{this.formPromise=this.apiService.postPasswordHint(new Ei(this.email)),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("masterPassSent")),null!=this.onSuccessfulSubmit?this.onSuccessfulSubmit():null!=this.router&&this.router.navigate([this.successRoute])}catch(e){this.logService.error(e)}else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidEmail"));else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("emailRequired"))}))}}Ri.ɵfac=function(e){return new(e||Ri)(s.Y36(p.F0),s.Y36(M.D),s.Y36(Ue.s),s.Y36(N.P),s.Y36(_e.$),s.Y36(Di.rh))},Ri.ɵdir=s.lG2({type:Ri});var Ji=i(62357),zi=i(85356);class Yi extends Ri{constructor(e,t,i,n,s,o){super(e,t,i,n,s,o)}}Yi.ɵfac=function(e){return new(e||Yi)(s.Y36(p.F0),s.Y36(M.D),s.Y36(Ue.s),s.Y36(N.P),s.Y36(_e.$),s.Y36(Di.rh))},Yi.ɵcmp=s.Xpm({type:Yi,selectors:[["app-hint"]],features:[s.qOj],decls:52,vars:22,consts:[["ngNativeValidate","",1,"container",3,"appApiAction","ngSubmit"],["form",""],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],[1,"lead","text-center","mb-4"],[1,"card","d-block"],[1,"card-body"],[1,"form-group"],["for","email"],["id","email","type","text","name","Email","required","","appAutofocus","","inputmode","email","appInputVerbatim","false",1,"form-control",3,"ngModel","ngModelChange"],[1,"form-text","text-muted"],[1,"d-flex"],["type","submit",1,"btn","btn-primary","btn-block","btn-submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["routerLink","/login",1,"btn","btn-outline-secondary","btn-block","ml-2","mt-0"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n  "),s.TgZ(3,"div",2),s._uU(4,"\n    "),s.TgZ(5,"div",3),s._uU(6,"\n      "),s.TgZ(7,"p",4),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.TgZ(11,"div",5),s._uU(12,"\n        "),s.TgZ(13,"div",6),s._uU(14,"\n          "),s.TgZ(15,"div",7),s._uU(16,"\n            "),s.TgZ(17,"label",8),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n            "),s.TgZ(21,"input",9),s.NdJ("ngModelChange",(function(e){return t.email=e})),s.qZA(),s._uU(22,"\n            "),s.TgZ(23,"small",10),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n          "),s.qZA(),s._uU(27,"\n          "),s._UZ(28,"hr"),s._uU(29,"\n          "),s.TgZ(30,"div",11),s._uU(31,"\n            "),s.TgZ(32,"button",12),s._uU(33,"\n              "),s.TgZ(34,"span",13),s._uU(35),s.ALo(36,"i18n"),s.qZA(),s._uU(37,"\n              "),s._UZ(38,"i",14),s.ALo(39,"i18n"),s._uU(40,"\n            "),s.qZA(),s._uU(41,"\n            "),s.TgZ(42,"a",15),s._uU(43),s.ALo(44,"i18n"),s.qZA(),s._uU(45,"\n          "),s.qZA(),s._uU(46,"\n        "),s.qZA(),s._uU(47,"\n      "),s.qZA(),s._uU(48,"\n    "),s.qZA(),s._uU(49,"\n  "),s.qZA(),s._uU(50,"\n"),s.qZA(),s._uU(51,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,10,"passwordHint")),s.xp6(10),s.Oqu(s.lcZ(19,12,"emailAddress")),s.xp6(3),s.Q6J("ngModel",t.email),s.xp6(3),s.Oqu(s.lcZ(25,14,"enterEmailToGetHint")),s.xp6(8),s.Q6J("disabled",e.loading),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(36,16,"submit")),s.xp6(3),s.s9C("title",s.lcZ(39,18,"loading")),s.xp6(5),s.hij("\n              ",s.lcZ(44,20,"cancel"),"\n            ")}},dependencies:[l.Fj,l.JJ,l.JL,l.Q7,l.On,l.F,p.rH,xe.b,Ji.U,zi.b,ee.C],encapsulation:2});var Ki=i(59157),Bi=i(2097),Qi=i(85623),Gi=i(36788),ji=i(91667),Vi=i(27059),$i=i(56934),Hi=i(44879),Wi=i(51453),Xi=i(42842),en=i(7203),tn=i(51651),nn=i(42304),sn=i(85420),on=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class rn{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,g,f,m,v,y,w,b,U,_,A,Z){this.masterPasswordService=e,this.router=t,this.i18nService=i,this.platformUtilsService=n,this.messagingService=s,this.cryptoService=o,this.vaultTimeoutService=r,this.vaultTimeoutSettingsService=a,this.environmentService=l,this.stateService=c,this.apiService=u,this.logService=d,this.ngZone=p,this.policyApiService=g,this.policyService=f,this.passwordStrengthService=m,this.dialogService=v,this.deviceTrustService=y,this.userVerificationService=w,this.pinCryptoService=b,this.biometricStateService=U,this.accountService=_,this.authService=A,this.kdfConfigService=Z,this.masterPassword="",this.pin="",this.showPassword=!1,this.pinEnabled=!1,this.masterPasswordEnabled=!1,this.webVaultHostname="",this.successRoute="vault",this.forcePasswordResetRoute="update-temp-password",this.invalidPinAttempts=0,this.enforcedMasterPasswordOptions=void 0,this.destroy$=new h.x}ngOnInit(){return on(this,void 0,void 0,(function*(){this.accountService.activeAccount$.pipe((0,Ki.b)((e=>on(this,void 0,void 0,(function*(){this.activeUserId=null==e?void 0:e.id,yield this.load(null==e?void 0:e.id)})))),(0,g.R)(this.destroy$)).subscribe()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}submit(){return on(this,void 0,void 0,(function*(){if(this.pinEnabled)return yield this.handlePinRequiredUnlock();yield this.handleMasterPasswordRequiredUnlock()}))}logOut(){return on(this,void 0,void 0,(function*(){(yield this.dialogService.openSimpleDialog({title:{key:"logOut"},content:{key:"logOutConfirmation"},acceptButtonText:{key:"logOut"},type:"warning"}))&&this.messagingService.send("logout",{userId:this.activeUserId})}))}unlockBiometric(){return on(this,void 0,void 0,(function*(){if(!this.biometricLock)return;yield this.biometricStateService.setUserPromptCancelled();const e=yield this.cryptoService.getUserKeyFromStorage(Hi.l1.Biometric);return e&&(yield this.setUserKeyAndContinue(e,!1)),!!e}))}togglePassword(){this.showPassword=!this.showPassword;const e=document.getElementById(this.pinEnabled?"pin":"masterPassword");this.ngZone.isStable?e.focus():this.ngZone.onStable.pipe((0,Bi.q)(1)).subscribe((()=>e.focus()))}handlePinRequiredUnlock(){return on(this,void 0,void 0,(function*(){if(null!=this.pin&&""!==this.pin)return yield this.doUnlockWithPin();this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("pinRequired"))}))}doUnlockWithPin(){return on(this,void 0,void 0,(function*(){try{const e=yield this.pinCryptoService.decryptUserKeyWithPin(this.pin);if(e)return void(yield this.setUserKeyAndContinue(e));if(this.invalidPinAttempts++,this.invalidPinAttempts>=5)return this.platformUtilsService.showToast("error",null,this.i18nService.t("tooManyInvalidPinEntryAttemptsLoggingOut")),void this.messagingService.send("logout");this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidPin"))}catch(e){this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("unexpectedError"))}}))}handleMasterPasswordRequiredUnlock(){return on(this,void 0,void 0,(function*(){null!=this.masterPassword&&""!==this.masterPassword?yield this.doUnlockWithMasterPassword():this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPasswordRequired"))}))}doUnlockWithMasterPassword(){var e;return on(this,void 0,void 0,(function*(){const t=yield this.kdfConfigService.getKdfConfig(),i=null===(e=yield(0,f.z)(this.accountService.activeAccount$))||void 0===e?void 0:e.id,n=yield this.cryptoService.makeMasterKey(this.masterPassword,this.email,t);let s=!1;if(null!=(yield(0,f.z)(this.masterPasswordService.masterKeyHash$(i))))s=yield this.cryptoService.compareAndUpdateKeyHash(this.masterPassword,n);else{const e=new ji.Y,t=yield this.cryptoService.hashMasterKey(this.masterPassword,n,Hi.RR.ServerAuthorization);e.masterPasswordHash=t;try{this.formPromise=this.apiService.postAccountVerifyPassword(e);const t=yield this.formPromise;this.enforcedMasterPasswordOptions=Qi.v.fromResponse(t),s=!0;const o=yield this.cryptoService.hashMasterKey(this.masterPassword,n,Hi.RR.LocalAuthorization);yield this.masterPasswordService.setMasterKeyHash(o,i)}catch(r){this.logService.error(r)}finally{this.formPromise=null}}if(!s)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidMasterPassword"));const o=yield this.cryptoService.decryptUserKeyWithMasterKey(n);yield this.masterPasswordService.setMasterKey(n,i),yield this.setUserKeyAndContinue(o,!0)}))}setUserKeyAndContinue(e,t=!1){return on(this,void 0,void 0,(function*(){yield this.cryptoService.setUserKey(e);const i=yield(0,f.z)(this.accountService.activeAccount$);yield this.deviceTrustService.trustDeviceIfRequired(i.id),yield this.doContinue(t)}))}doContinue(e){var t;return on(this,void 0,void 0,(function*(){if(yield this.biometricStateService.resetUserPromptCancelled(),this.messagingService.send("unlocked"),e)try{if(null==this.enforcedMasterPasswordOptions&&(this.enforcedMasterPasswordOptions=yield(0,f.z)(this.policyService.masterPasswordPolicyOptions$())),this.requirePasswordChange()){const e=null===(t=yield(0,f.z)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;return yield this.masterPasswordService.setForceSetPasswordReason(Gi.w.WeakMasterPassword,e),void this.router.navigate([this.forcePasswordResetRoute])}}catch(i){this.logService.error(i)}null!=this.onSuccessfulSubmit?yield this.onSuccessfulSubmit():null!=this.router&&this.router.navigate([this.successRoute])}))}load(e){return on(this,void 0,void 0,(function*(){if(yield(0,f.z)(this.authService.authStatusFor$(e).pipe((0,y.U)((e=>e===b.y.Unlocked)))))return void(yield this.router.navigate(["/"]));if(!(yield(0,f.z)(this.vaultTimeoutSettingsService.availableVaultTimeoutActions$(e))).includes(Vi.B.Lock))return yield this.vaultTimeoutService.logOut(e);this.pinStatus=yield this.vaultTimeoutSettingsService.isPinLockSet();let t=yield this.stateService.getPinKeyEncryptedUserKeyEphemeral();t||(t=yield this.stateService.getDecryptedPinProtected()),this.pinEnabled="TRANSIENT"===this.pinStatus&&!!t||"PERSISTANT"===this.pinStatus,this.masterPasswordEnabled=yield this.userVerificationService.hasMasterPassword(),this.supportsBiometric=yield this.platformUtilsService.supportsBiometric(),this.biometricLock=(yield this.vaultTimeoutSettingsService.isBiometricLockSet())&&((yield this.cryptoService.hasUserKeyStored(Hi.l1.Biometric))||!this.platformUtilsService.supportsSecureStorage()),this.email=yield this.stateService.getEmail(),this.webVaultHostname=(yield this.environmentService.getEnvironment()).getHostname()}))}requirePasswordChange(){var e;if(null==this.enforcedMasterPasswordOptions||!this.enforcedMasterPasswordOptions.enforceOnLogin)return!1;const t=null===(e=this.passwordStrengthService.getPasswordStrength(this.masterPassword,this.email))||void 0===e?void 0:e.score;return!this.policyService.evaluateMasterPassword(t,this.masterPassword,this.enforcedMasterPasswordOptions)}}rn.ɵfac=function(e){return new(e||rn)(s.Y36(Xi.R),s.Y36(p.F0),s.Y36(M.D),s.Y36(N.P),s.Y36(fe.o),s.Y36(D.$),s.Y36(L.Q),s.Y36(en.E),s.Y36($i.L),s.Y36(J.b),s.Y36(Ue.s),s.Y36(_e.$),s.Y36(s.R0b),s.Y36(Oi.P),s.Y36(Y.W),s.Y36(Wi.A),s.Y36(I.x),s.Y36(tn.U),s.Y36(nn.i),s.Y36(Di.Rv),s.Y36(U.d),s.Y36(G.BR),s.Y36(O.e),s.Y36(sn.d))},rn.ɵdir=s.lG2({type:rn});var an=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ln=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};class cn extends rn{ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return an(this,void 0,void 0,(function*(){yield e.ngOnInit.call(this),this.onSuccessfulSubmit=()=>an(this,void 0,void 0,(function*(){this.router.navigateByUrl(this.successRoute)}))}))}}cn.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(cn)))(t||cn)}}(),cn.ɵcmp=s.Xpm({type:cn,selectors:[["app-lock"]],features:[s.qOj],decls:68,vars:31,consts:[["ngNativeValidate","",1,"container",3,"appApiAction","ngSubmit"],["form",""],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],[1,"text-center","mb-4"],["aria-hidden","true",1,"bwi","bwi-lock","bwi-4x","text-muted"],[1,"lead","text-center","mx-4","mb-4"],[1,"card","d-block"],[1,"card-body"],[1,"form-group"],["for","masterPassword"],[1,"d-flex"],["id","masterPassword","name","MasterPassword","required","","appAutofocus","","appInputVerbatim","",1,"text-monospace","form-control",3,"type","ngModel","ngModelChange"],["type","button",1,"ml-1","btn","btn-link",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],[1,"text-muted","form-text"],["type","submit",1,"btn","btn-primary","btn-block","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-unlock"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button",1,"btn","btn-outline-secondary","btn-block","ml-2","mt-0",3,"click"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n  "),s.TgZ(3,"div",2),s._uU(4,"\n    "),s.TgZ(5,"div",3),s._uU(6,"\n      "),s.TgZ(7,"p",4),s._uU(8,"\n        "),s._UZ(9,"i",5),s._uU(10,"\n      "),s.qZA(),s._uU(11,"\n      "),s.TgZ(12,"p",6),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n      "),s.TgZ(16,"div",7),s._uU(17,"\n        "),s.TgZ(18,"div",8),s._uU(19,"\n          "),s.TgZ(20,"div",9),s._uU(21,"\n            "),s.TgZ(22,"label",10),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n            "),s.TgZ(26,"div",11),s._uU(27,"\n              "),s.TgZ(28,"input",12),s.NdJ("ngModelChange",(function(e){return t.masterPassword=e})),s.qZA(),s._uU(29,"\n              "),s.TgZ(30,"button",13),s.NdJ("click",(function(){return t.togglePassword()})),s.ALo(31,"i18n"),s._uU(32,"\n                "),s._UZ(33,"i",14),s._uU(34,"\n              "),s.qZA(),s._uU(35,"\n            "),s.qZA(),s._uU(36,"\n            "),s.TgZ(37,"small",15),s._uU(38),s.ALo(39,"i18n"),s.qZA(),s._uU(40,"\n          "),s.qZA(),s._uU(41,"\n          "),s._UZ(42,"hr"),s._uU(43,"\n          "),s.TgZ(44,"div",11),s._uU(45,"\n            "),s.TgZ(46,"button",16),s._uU(47,"\n              "),s.TgZ(48,"span"),s._uU(49," "),s._UZ(50,"i",17),s._uU(51),s.ALo(52,"i18n"),s.qZA(),s._uU(53,"\n              "),s._UZ(54,"i",18),s.ALo(55,"i18n"),s._uU(56,"\n            "),s.qZA(),s._uU(57,"\n            "),s.TgZ(58,"button",19),s.NdJ("click",(function(){return t.logOut()})),s._uU(59),s.ALo(60,"i18n"),s.qZA(),s._uU(61,"\n          "),s.qZA(),s._uU(62,"\n        "),s.qZA(),s._uU(63,"\n      "),s.qZA(),s._uU(64,"\n    "),s.qZA(),s._uU(65,"\n  "),s.qZA(),s._uU(66,"\n"),s.qZA(),s._uU(67,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(13),s.Oqu(s.lcZ(14,12,"yourVaultIsLocked")),s.xp6(10),s.Oqu(s.lcZ(24,14,"masterPass")),s.xp6(5),s.s9C("type",t.showPassword?"text":"password"),s.Q6J("ngModel",t.masterPassword),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(31,16,"toggleVisibility")),s.xp6(3),s.Q6J("ngClass",s.WLB(28,ln,!t.showPassword,t.showPassword)),s.xp6(5),s.hij("\n              ",s.Dn7(39,18,"loggedInAsEmailOn",t.email,t.webVaultHostname),"\n            "),s.xp6(8),s.Q6J("disabled",e.loading),s.xp6(5),s.hij(" ",s.lcZ(52,22,"unlock")," "),s.xp6(3),s.s9C("title",s.lcZ(55,24,"loading")),s.xp6(5),s.hij("\n              ",s.lcZ(60,26,"logOut"),"\n            ")}},dependencies:[d.mk,l.Fj,l.JJ,l.JL,l.Q7,l.On,l.F,ui.B,xe.b,Ji.U,zi.b,ee.C],encapsulation:2});var un,dn=i(30359),pn=i(8241),hn=i(92936),gn=i(59260),fn=i(79596),mn=i(92716),vn=i(59459),yn=i(98405),wn=i(19326),bn=i(77097),Un=i(77685),_n=i(1153),An=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.NewUser=0]="NewUser",e[e.ExistingUserUntrustedDevice=1]="ExistingUserUntrustedDevice"}(un||(un={}));class Zn{get rememberDevice(){var e;return null===(e=this.rememberDeviceForm)||void 0===e?void 0:e.controls.rememberDevice}constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,g,f,m,v,y,w,b){this.formBuilder=e,this.devicesService=t,this.stateService=i,this.router=n,this.activatedRoute=s,this.messagingService=o,this.tokenService=r,this.loginEmailService=a,this.organizationApiService=l,this.cryptoService=c,this.organizationUserService=u,this.apiService=d,this.i18nService=p,this.validationService=g,this.deviceTrustService=f,this.platformUtilsService=m,this.userDecryptionOptionsService=v,this.passwordResetEnrollmentService=y,this.ssoLoginService=w,this.accountService=b,this.destroy$=new h.x,this.State=un,this.loading=!0,this.rememberDeviceForm=this.formBuilder.group({rememberDevice:[!0]})}ngOnInit(){var e,t;return An(this,void 0,void 0,(function*(){this.loading=!0,this.activeAccountId=null===(e=yield(0,f.z)(this.accountService.activeAccount$))||void 0===e?void 0:e.id,this.setupRememberDeviceValueChanges(),yield this.setRememberDeviceDefaultValue();try{const e=yield(0,f.z)(this.userDecryptionOptionsService.userDecryptionOptions$);(null===(t=null==e?void 0:e.trustedDeviceOption)||void 0===t?void 0:t.hasAdminApproval)||(null==e?void 0:e.hasMasterPassword)?this.loadUntrustedDeviceData(e):this.loadNewUserData()}catch(i){this.validationService.showError(i)}}))}setRememberDeviceDefaultValue(){return An(this,void 0,void 0,(function*(){const e=yield this.deviceTrustService.getShouldTrustDevice(this.activeAccountId),t=null==e||e;this.rememberDevice.setValue(t)}))}setupRememberDeviceValueChanges(){this.rememberDevice.valueChanges.pipe((0,dn.w)((e=>(0,pn.P)((()=>this.deviceTrustService.setShouldTrustDevice(this.activeAccountId,e))))),(0,g.R)(this.destroy$)).subscribe()}loadNewUserData(){return An(this,void 0,void 0,(function*(){const e=(0,pn.P)((()=>this.ssoLoginService.getActiveUserOrganizationSsoIdentifier())).pipe((0,dn.w)((e=>null==e?(0,hn._)((()=>new Error(this.i18nService.t("ssoIdentifierRequired")))):(0,gn.D)(this.organizationApiService.getAutoEnrollStatus(e)))),(0,fn.K)((e=>(this.validationService.showError(e),(0,mn.of)(void 0))))),t=(0,gn.D)(this.stateService.getEmail()).pipe((0,fn.K)((e=>(this.validationService.showError(e),(0,mn.of)(void 0)))),(0,g.R)(this.destroy$)),i=yield(0,f.z)(e),n=yield(0,f.z)(t);this.data={state:un.NewUser,organizationId:i.id,userEmail:n},this.loading=!1}))}loadUntrustedDeviceData(e){this.loading=!0;(0,gn.D)(this.stateService.getEmail()).pipe((0,fn.K)((e=>(this.validationService.showError(e),(0,mn.of)(void 0)))),(0,g.R)(this.destroy$)).pipe((0,g.R)(this.destroy$),(0,vn.x)((()=>{this.loading=!1}))).subscribe((t=>{var i,n;const s=(null===(i=null==e?void 0:e.trustedDeviceOption)||void 0===i?void 0:i.hasLoginApprovingDevice)||!1,o=!!(null===(n=null==e?void 0:e.trustedDeviceOption)||void 0===n?void 0:n.hasAdminApproval)||!1,r=(null==e?void 0:e.hasMasterPassword)||!1,a=t;this.data={state:un.ExistingUserUntrustedDevice,showApproveFromOtherDeviceBtn:s,showReqAdminApprovalBtn:o,showApproveWithMasterPasswordBtn:r,userEmail:a}}))}approveFromOtherDevice(){return An(this,void 0,void 0,(function*(){this.data.state===un.ExistingUserUntrustedDevice&&(this.loginEmailService.setEmail(this.data.userEmail),yield this.router.navigate(["/login-with-device"]))}))}requestAdminApproval(){return An(this,void 0,void 0,(function*(){this.loginEmailService.setEmail(this.data.userEmail),yield this.router.navigate(["/admin-approval-requested"])}))}approveWithMasterPassword(){return An(this,void 0,void 0,(function*(){yield this.router.navigate(["/lock"],{queryParams:{from:"login-initiated"}})}))}createUser(){return An(this,void 0,void 0,(function*(){if(this.data.state===un.NewUser){this.loading=!0;try{const{publicKey:e,privateKey:t}=yield this.cryptoService.initAccount(),i=new yn.C(e,t.encryptedString);yield this.apiService.postAccountKeys(i),this.platformUtilsService.showToast("success",null,this.i18nService.t("accountSuccessfullyCreated")),yield this.passwordResetEnrollmentService.enroll(this.data.organizationId),this.rememberDeviceForm.value.rememberDevice&&(yield this.deviceTrustService.trustDevice(this.activeAccountId))}finally{this.loading=!1}}}))}logOut(){this.loading=!0,this.messagingService.send("logout")}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Zn.ɵfac=function(e){return new(e||Zn)(s.Y36(l.qu),s.Y36(wn.m),s.Y36(J.b),s.Y36(p.F0),s.Y36(p.gz),s.Y36(fe.o),s.Y36(bn.B),s.Y36(Di.rh),s.Y36(Ae.M),s.Y36(D.$),s.Y36(ki.t),s.Y36(Ue.s),s.Y36(M.D),s.Y36(Bt.R),s.Y36(tn.U),s.Y36(N.P),s.Y36(Di.Bb),s.Y36(Un.U),s.Y36(_n.F),s.Y36(G.BR))},Zn.ɵdir=s.lG2({type:Zn});var xn=i(98205),Sn=i(7172),Tn=i(75734),Cn=i(44358),On=i(28315),kn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Pn(e,t){1&e&&(s.ynx(0),s._uU(1,"\n      "),s.TgZ(2,"p",6),s._uU(3,"\n        "),s._UZ(4,"i",7),s.ALo(5,"i18n"),s._uU(6,"\n        "),s.TgZ(7,"span",8),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.qZA(),s._uU(11,"\n    "),s.BQk()),2&e&&(s.xp6(4),s.s9C("title",s.lcZ(5,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(9,4,"loading")))}function qn(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",23),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.approveFromOtherDevice())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n            ",s.lcZ(2,1,"approveFromYourOtherDevice"),"\n          "))}function In(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",24),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.requestAdminApproval())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n            ",s.lcZ(2,1,"requestAdminApproval"),"\n          "))}function Mn(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",25),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.approveWithMasterPassword())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n            ",s.lcZ(2,1,"approveWithMasterPassword"),"\n          "))}function Nn(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"h2",14),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n\n        "),s.TgZ(6,"p",15),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n\n        "),s.TgZ(10,"form",16),s._uU(11,"\n          "),s.TgZ(12,"bit-form-control"),s._uU(13,"\n            "),s._UZ(14,"input",17),s._uU(15,"\n            "),s.TgZ(16,"bit-label"),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n            "),s.TgZ(20,"bit-hint",18),s._uU(21),s.ALo(22,"i18n"),s.qZA(),s._uU(23,"\n          "),s.qZA(),s._uU(24,"\n        "),s.qZA(),s._uU(25,"\n\n        "),s.TgZ(26,"div",19),s._uU(27,"\n          "),s.YNc(28,qn,3,3,"button",20),s._uU(29,"\n\n          "),s.YNc(30,In,3,3,"button",21),s._uU(31,"\n\n          "),s.YNc(32,Mn,3,3,"button",22),s._uU(33,"\n        "),s.qZA(),s._uU(34,"\n      "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,8,"loginInitiated")),s.xp6(4),s.hij("\n          ",s.lcZ(8,10,"deviceApprovalRequired"),"\n        "),s.xp6(3),s.Q6J("formGroup",e.rememberDeviceForm),s.xp6(7),s.hij("",s.lcZ(18,12,"rememberThisDevice")," "),s.xp6(4),s.Oqu(s.lcZ(22,14,"uncheckIfPublicDevice")),s.xp6(7),s.Q6J("ngIf",e.data.showApproveFromOtherDeviceBtn),s.xp6(2),s.Q6J("ngIf",e.data.showReqAdminApprovalBtn),s.xp6(2),s.Q6J("ngIf",e.data.showApproveWithMasterPasswordBtn)}}function Ln(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"h2",14),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n\n        "),s.TgZ(6,"form",16),s._uU(7,"\n          "),s.TgZ(8,"bit-form-control"),s._uU(9,"\n            "),s._UZ(10,"input",17),s._uU(11,"\n            "),s.TgZ(12,"bit-label"),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n            "),s.TgZ(16,"bit-hint",18),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n          "),s.qZA(),s._uU(20,"\n        "),s.qZA(),s._uU(21,"\n\n        "),s.TgZ(22,"button",26),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n      "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,6,"loggedInExclamation")),s.xp6(3),s.Q6J("formGroup",e.rememberDeviceForm),s.xp6(7),s.hij("",s.lcZ(14,8,"rememberThisDevice")," "),s.xp6(4),s.Oqu(s.lcZ(18,10,"uncheckIfPublicDevice")),s.xp6(5),s.Q6J("bitAction",e.createUserAction),s.xp6(1),s.hij("\n          ",s.lcZ(24,12,"continue"),"\n        ")}}const Dn=function(){return[]};function En(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",9),s._uU(1,"\n      "),s.YNc(2,Nn,35,16,"ng-container",4),s._uU(3,"\n\n      "),s.YNc(4,Ln,26,14,"ng-container",4),s._uU(5,"\n\n      "),s._UZ(6,"hr",10),s._uU(7,"\n\n      "),s.TgZ(8,"div",11),s._uU(9,"\n        "),s.TgZ(10,"p",12),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n        "),s.TgZ(14,"a",13),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.logOut())})),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n      "),s.qZA(),s._uU(18,"\n    "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.data.state==e.State.ExistingUserUntrustedDevice),s.xp6(2),s.Q6J("ngIf",e.data.state==e.State.NewUser),s.xp6(7),s.AsE("",s.lcZ(12,6,"loggingInAs")," ",e.data.userEmail,""),s.xp6(3),s.Q6J("routerLink",s.DdM(10,Dn)),s.xp6(1),s.Oqu(s.lcZ(16,8,"notYou"))}}class Fn extends Zn{constructor(){super(...arguments),this.createUserAction=()=>kn(this,void 0,void 0,(function*(){return this.createUser()}))}createUser(){const e=Object.create(null,{createUser:{get:()=>super.createUser}});return kn(this,void 0,void 0,(function*(){try{yield e.createUser.call(this),yield this.router.navigate(["/vault"])}catch(t){this.validationService.showError(t)}}))}}var Rn;Fn.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(Fn)))(t||Fn)}}(),Fn.ɵcmp=s.Xpm({type:Fn,selectors:[["web-login-decryption-options"]],features:[s.qOj],decls:15,vars:2,consts:[[1,"tw-container","tw-mx-auto"],[1,"tw-mx-auto","tw-mt-5","tw-flex","tw-max-w-lg","tw-flex-col","tw-items-center","tw-justify-center","tw-p-8"],[1,"tw-mb-6"],["alt","Bitwarden",1,"logo","logo-themed"],[4,"ngIf"],["class","tw-w-full tw-rounded-md tw-border tw-border-solid tw-border-secondary-300 tw-bg-background tw-p-6",4,"ngIf"],[1,"text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","text-muted",3,"title"],[1,"sr-only"],[1,"tw-w-full","tw-rounded-md","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background","tw-p-6"],[1,"tw-mb-6","tw-mt-0"],[1,"tw-m-0","tw-text-sm"],[1,"tw-mb-1"],[3,"routerLink","click"],["bitTypography","h2",1,"tw-mb-6"],["bitTypography","body1",1,"tw-mb-6"],[3,"formGroup"],["type","checkbox","bitCheckbox","","formControlName","rememberDevice"],["bitTypography","body2"],[1,"tw-mb-6","tw-flex","tw-flex-col","tw-space-y-3"],["bitButton","","type","button","buttonType","primary","block","",3,"click",4,"ngIf"],["bitButton","","type","button","buttonType","secondary",3,"click",4,"ngIf"],["bitButton","","type","button","buttonType","secondary","block","",3,"click",4,"ngIf"],["bitButton","","type","button","buttonType","primary","block","",3,"click"],["bitButton","","type","button","buttonType","secondary",3,"click"],["bitButton","","type","button","buttonType","secondary","block","",3,"click"],["bitButton","","type","button","buttonType","primary","block","",1,"tw-mb-6",3,"bitAction"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"div",2),s._uU(5,"\n      "),s._UZ(6,"img",3),s._uU(7,"\n    "),s.qZA(),s._uU(8,"\n\n    "),s.YNc(9,Pn,12,6,"ng-container",4),s._uU(10,"\n\n    "),s.YNc(11,En,19,11,"div",5),s._uU(12,"\n  "),s.qZA(),s._uU(13,"\n"),s.qZA(),s._uU(14,"\n")),2&e&&(s.xp6(9),s.Q6J("ngIf",t.loading),s.xp6(2),s.Q6J("ngIf",!t.loading))},dependencies:[d.O5,l._Y,l.Wl,l.JJ,l.JL,l.sg,l.u,p.rH,xn.Q,Te.r,Sn.b,Tn.A,Pe.u,Cn.M,On.t,ee.C],encapsulation:2}),function(e){e[e.AuthenticateAndUnlock=0]="AuthenticateAndUnlock",e[e.Unlock=1]="Unlock",e[e.AdminApproval=2]="AdminApproval"}(Rn||(Rn={}));var Jn=i(7985);class zn{constructor(e,t,i,n,s){this.email=e,this.deviceIdentifier=t,this.publicKey=i,this.type=n,this.accessCode=s}}var Yn=i(256),Kn=i(25679);class Bn{constructor(e,t,i,n,s,o,r){this.win=e,this.webVaultUrl=t,this.path=i,this.iframeId=n,this.successCallback=s,this.errorCallback=o,this.infoCallback=r,this.parseFunction=this.parseMessage.bind(this),this.connectorLink=e.document.createElement("a")}stop(){this.sendMessage("stop")}start(){this.sendMessage("start")}sendMessage(e){this.iframe&&this.iframe.src&&this.iframe.contentWindow&&this.iframe.contentWindow.postMessage(e,this.iframe.src)}base64Encode(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode("0x"+t))))}cleanup(){this.win.removeEventListener("message",this.parseFunction,!1)}createParams(e,t){return new URLSearchParams({data:this.base64Encode(JSON.stringify(e)),parent:encodeURIComponent(this.win.document.location.href),v:t.toString()})}initComponent(e){this.connectorLink.href=`${this.webVaultUrl}/${this.path}?${e}`,this.iframe=this.win.document.getElementById(this.iframeId),this.iframe.src=this.connectorLink.href,this.win.addEventListener("message",this.parseFunction,!1)}parseMessage(e){if(!this.validMessage(e))return;const t=e.data.split("|");"success"===t[0]&&this.successCallback?this.successCallback(t[1]):"error"===t[0]&&this.errorCallback?this.errorCallback(t[1]):"info"===t[0]&&this.infoCallback&&this.infoCallback(t[1])}validMessage(e){return null!=e.origin&&""!==e.origin&&e.origin===this.connectorLink.origin&&null!=e.data&&"string"==typeof e.data&&(0===e.data.indexOf("success|")||0===e.data.indexOf("error|")||0===e.data.indexOf("info|"))}}class Qn extends Bn{constructor(e,t,i,n,s,o){super(e,t,"captcha-connector.html","hcaptcha_iframe",n,s,(e=>{const t=JSON.parse(e);"string"!=typeof t?(this.iframe.height=t.height.toString(),this.iframe.width=t.width.toString()):o(t)})),this.i18nService=i}init(e){super.initComponent(this.createParams({siteKey:e,locale:this.i18nService.translationLocale},1))}}var Gn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class jn{constructor(e,t,i){this.environmentService=e,this.i18nService=t,this.platformUtilsService=i,this.captchaSiteKey=null,this.captchaToken=null}setupCaptcha(){return Gn(this,void 0,void 0,(function*(){const e=(yield(0,f.z)(this.environmentService.environment$)).getWebVaultUrl();this.captcha=new Qn(window,e,this.i18nService,(e=>{this.captchaToken=e}),(e=>{this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e)}),(e=>{this.platformUtilsService.showToast("info",this.i18nService.t("info"),e)}))}))}showCaptcha(){return!Ci.c.isNullOrWhitespace(this.captchaSiteKey)}handleCaptchaRequired(e){return!Ci.c.isNullOrWhitespace(e.captchaSiteKey)&&(this.captchaSiteKey=e.captchaSiteKey,this.captcha.init(e.captchaSiteKey),!0)}}jn.ɵfac=function(e){return new(e||jn)(s.Y36($i.L),s.Y36(M.D),s.Y36(N.P))},jn.ɵdir=s.lG2({type:jn,inputs:{captchaSiteKey:"captchaSiteKey"}});var Vn,$n=i(79865),Hn=i(13973),Wn=i(29491),Xn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.StandardAuthRequest=0]="StandardAuthRequest",e[e.AdminAuthRequest=1]="AdminAuthRequest"}(Vn||(Vn={}));class es extends jn{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,f,m,v,y,w,b){super(l,c,u),this.router=e,this.cryptoService=t,this.cryptoFunctionService=i,this.appIdService=n,this.passwordGenerationService=s,this.apiService=o,this.authService=r,this.logService=a,this.anonymousHubService=d,this.validationService=p,this.stateService=f,this.loginEmailService=m,this.deviceTrustService=v,this.authRequestService=y,this.loginStrategyService=w,this.accountService=b,this.destroy$=new h.x,this.showResendNotification=!1,this.adminApprovalRoute="admin-approval-requested",this.StateEnum=Vn,this.state=Vn.StandardAuthRequest,this.twoFactorRoute="2fa",this.successRoute="vault",this.forcePasswordResetRoute="update-temp-password",this.resendTimeout=12e3;this.router.getCurrentNavigation()&&(this.email=this.loginEmailService.getEmail()),this.authRequestService.authRequestPushNotification$.pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.verifyAndHandleApprovedAuthReq(e).catch((e=>{this.platformUtilsService.showToast("error",this.i18nService.t("error"),e.message),this.logService.error("Failed to use approved auth request: "+e.message)}))}))}ngOnInit(){return Xn(this,void 0,void 0,(function*(){this.userAuthNStatus=yield this.authService.getAuthStatus();if(this.router.isActive(this.adminApprovalRoute,{paths:"exact",queryParams:"ignored",fragment:"ignored",matrixParams:"ignored"})&&(this.state=Vn.AdminAuthRequest),this.state===Vn.AdminAuthRequest){this.email=yield this.stateService.getEmail();const e=(yield(0,f.z)(this.accountService.activeAccount$)).id;if(!this.email)return this.platformUtilsService.showToast("error",null,this.i18nService.t("userEmailMissing")),void this.router.navigate(["/login-initiated"]);const t=yield this.authRequestService.getAdminAuthRequest(e);t?yield this.handleExistingAdminAuthRequest(t,e):yield this.startAuthRequestLogin()}else{if(this.email=this.loginEmailService.getEmail(),!this.email)return this.platformUtilsService.showToast("error",null,this.i18nService.t("userEmailMissing")),void this.router.navigate(["/login"]);yield this.startAuthRequestLogin()}}))}ngOnDestroy(){return Xn(this,void 0,void 0,(function*(){yield this.anonymousHubService.stopHubConnection(),this.destroy$.next(),this.destroy$.complete()}))}handleExistingAdminAuthRequest(e,t){return Xn(this,void 0,void 0,(function*(){let i;try{i=yield this.apiService.getAuthRequest(e.id)}catch(s){if(s instanceof Kn.i&&s.statusCode===Yn.W.NotFound)return yield this.handleExistingAdminAuthReqDeletedOrDenied(t)}if(!i)return yield this.handleExistingAdminAuthReqDeletedOrDenied(t);const n=yield this.cryptoFunctionService.rsaExtractPublicKey(e.privateKey);return this.fingerprintPhrase=(yield this.cryptoService.getFingerprint(this.email,n)).join("-"),i.isAnswered&&!i.requestApproved?yield this.handleExistingAdminAuthReqDeletedOrDenied(t):i.requestApproved?yield this.handleApprovedAdminAuthRequest(i,e.privateKey,t):(this.authRequestKeyPair={privateKey:e.privateKey,publicKey:null},void(yield this.anonymousHubService.createHubConnection(e.id)))}))}handleExistingAdminAuthReqDeletedOrDenied(e){return Xn(this,void 0,void 0,(function*(){yield this.authRequestService.clearAdminAuthRequest(e),this.startAuthRequestLogin()}))}buildAuthRequest(e){return Xn(this,void 0,void 0,(function*(){const t=yield this.cryptoFunctionService.rsaGenerateKeyPair(2048);this.authRequestKeyPair={publicKey:t[0],privateKey:t[1]};const i=yield this.appIdService.getAppId(),n=Ci.c.fromBufferToB64(this.authRequestKeyPair.publicKey),s=yield this.passwordGenerationService.generatePassword({length:25});this.fingerprintPhrase=(yield this.cryptoService.getFingerprint(this.email,this.authRequestKeyPair.publicKey)).join("-"),this.authRequest=new zn(this.email,i,n,e,s)}))}startAuthRequestLogin(){return Xn(this,void 0,void 0,(function*(){this.showResendNotification=!1;try{let e;if(this.state===Vn.AdminAuthRequest){yield this.buildAuthRequest(Rn.AdminApproval),e=yield this.apiService.postAdminAuthRequest(this.authRequest);const t=new Jn.$({id:e.id,privateKey:this.authRequestKeyPair.privateKey}),i=(yield(0,f.z)(this.accountService.activeAccount$)).id;yield this.authRequestService.setAdminAuthRequest(t,i)}else yield this.buildAuthRequest(Rn.AuthenticateAndUnlock),e=yield this.apiService.postAuthRequest(this.authRequest);e.id&&(yield this.anonymousHubService.createHubConnection(e.id))}catch(e){this.logService.error(e)}setTimeout((()=>{this.showResendNotification=!0}),this.resendTimeout)}))}verifyAndHandleApprovedAuthReq(e){return Xn(this,void 0,void 0,(function*(){try{let t;switch(this.state){case Vn.StandardAuthRequest:t=yield this.apiService.getAuthResponse(e,this.authRequest.accessCode);break;case Vn.AdminAuthRequest:t=yield this.apiService.getAuthRequest(e)}if(!t.requestApproved)return;if(this.userAuthNStatus===b.y.Locked){const e=(yield(0,f.z)(this.accountService.activeAccount$)).id;return yield this.handleApprovedAdminAuthRequest(t,this.authRequestKeyPair.privateKey,e)}const i=yield this.loginViaAuthRequestStrategy(e,t);yield this.handlePostLoginNavigation(i)}catch(t){if(t instanceof Kn.i){let e="/login";return this.state===Vn.AdminAuthRequest&&(e="/login-initiated"),this.router.navigate([e]),void this.validationService.showError(t)}this.logService.error(t)}}))}handleApprovedAdminAuthRequest(e,t,i){return Xn(this,void 0,void 0,(function*(){e.masterPasswordHash?yield this.authRequestService.setKeysAfterDecryptingSharedMasterKeyAndHash(e,t):yield this.authRequestService.setUserKeyAfterDecryptingSharedUserKey(e,t),yield this.authRequestService.clearAdminAuthRequest(i),this.platformUtilsService.showToast("success",null,this.i18nService.t("loginApproved"));const n=yield(0,f.z)(this.accountService.activeAccount$);yield this.deviceTrustService.trustDeviceIfRequired(n.id),yield this.handleSuccessfulLoginNavigation()}))}buildAuthRequestLoginCredentials(e,t){return Xn(this,void 0,void 0,(function*(){if(t.masterPasswordHash){const{masterKey:i,masterKeyHash:n}=yield this.authRequestService.decryptPubKeyEncryptedMasterKeyAndHash(t.key,t.masterPasswordHash,this.authRequestKeyPair.privateKey);return new Di.U1(this.email,this.authRequest.accessCode,e,null,i,n)}{const i=yield this.authRequestService.decryptPubKeyEncryptedUserKey(t.key,this.authRequestKeyPair.privateKey);return new Di.U1(this.email,this.authRequest.accessCode,e,i,null,null)}}))}loginViaAuthRequestStrategy(e,t){return Xn(this,void 0,void 0,(function*(){const i=yield this.buildAuthRequestLoginCredentials(e,t);return yield this.loginStrategyService.logIn(i)}))}handlePostLoginNavigation(e){return Xn(this,void 0,void 0,(function*(){e.requiresTwoFactor?null!=this.onSuccessfulLoginTwoFactorNavigate?this.onSuccessfulLoginTwoFactorNavigate():this.router.navigate([this.twoFactorRoute]):e.forcePasswordReset!=Gi.w.None?null!=this.onSuccessfulLoginForceResetNavigate?this.onSuccessfulLoginForceResetNavigate():this.router.navigate([this.forcePasswordResetRoute]):yield this.handleSuccessfulLoginNavigation()}))}handleSuccessfulLoginNavigation(){return Xn(this,void 0,void 0,(function*(){this.state===Vn.StandardAuthRequest&&(yield this.loginEmailService.saveEmailSettings()),null!=this.onSuccessfulLogin&&this.onSuccessfulLogin(),null!=this.onSuccessfulLoginNavigate?this.onSuccessfulLoginNavigate():this.router.navigate([this.successRoute])}))}}es.ɵfac=function(e){return new(e||es)(s.Y36(p.F0),s.Y36(D.$),s.Y36($n.O),s.Y36(Hn.s),s.Y36(A.UW),s.Y36(Ue.s),s.Y36(O.e),s.Y36(_e.$),s.Y36($i.L),s.Y36(M.D),s.Y36(N.P),s.Y36(Wn.r),s.Y36(Bt.R),s.Y36(J.b),s.Y36(Di.rh),s.Y36(tn.U),s.Y36(Di.JD),s.Y36(Di.m),s.Y36(G.BR))},es.ɵdir=s.lG2({type:es,features:[s.qOj]});const ts=function(){return[]};function is(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n          "),s.TgZ(2,"a",13),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.startAuthRequestLogin())})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n        "),s.qZA()}2&e&&(s.xp6(2),s.Q6J("routerLink",s.DdM(4,ts)),s.xp6(1),s.Oqu(s.lcZ(4,2,"resendNotification")))}function ns(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n      "),s.TgZ(2,"p",3),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n\n      "),s.TgZ(6,"div",4),s._uU(7,"\n        "),s.TgZ(8,"h2",5),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n\n        "),s.TgZ(12,"div",6),s._uU(13,"\n          "),s.TgZ(14,"p",7),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n\n          "),s.TgZ(18,"p",7),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n        "),s.qZA(),s._uU(22,"\n\n        "),s.TgZ(23,"div",7),s._uU(24,"\n          "),s.TgZ(25,"h4",8),s._uU(26),s.ALo(27,"i18n"),s.qZA(),s._uU(28,"\n          "),s.TgZ(29,"p"),s._uU(30,"\n            "),s.TgZ(31,"code"),s._uU(32),s.qZA(),s._uU(33,"\n          "),s.qZA(),s._uU(34,"\n        "),s.qZA(),s._uU(35,"\n\n        "),s.YNc(36,is,6,5,"div",9),s._uU(37,"\n\n        "),s._UZ(38,"hr"),s._uU(39,"\n\n        "),s.TgZ(40,"div",10),s._uU(41),s.ALo(42,"i18n"),s.TgZ(43,"a",11),s._uU(44),s.ALo(45,"i18n"),s.qZA(),s._uU(46,"\n        "),s.qZA(),s._uU(47,"\n      "),s.qZA(),s._uU(48,"\n    "),s.BQk()),2&e){const e=s.oxw();s.xp6(3),s.hij("\n        ",s.lcZ(4,9,"loginOrCreateNewAccount"),"\n      "),s.xp6(6),s.Oqu(s.lcZ(10,11,"loginInitiated")),s.xp6(6),s.Oqu(s.lcZ(16,13,"notificationSentDevice")),s.xp6(4),s.hij("\n            ",s.lcZ(20,15,"fingerprintMatchInfo"),"\n          "),s.xp6(7),s.Oqu(s.lcZ(27,17,"fingerprintPhraseHeader")),s.xp6(6),s.Oqu(e.fingerprintPhrase),s.xp6(4),s.Q6J("ngIf",e.showResendNotification),s.xp6(5),s.hij("\n          ",s.lcZ(42,19,"loginWithDeviceEnabledNote"),"\n          "),s.xp6(3),s.Oqu(s.lcZ(45,21,"viewAllLoginOptions"))}}function ss(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n      "),s.TgZ(2,"div",4),s._uU(3,"\n        "),s.TgZ(4,"h2",5),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n\n        "),s.TgZ(8,"div",6),s._uU(9,"\n          "),s.TgZ(10,"p",7),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n          "),s.TgZ(14,"p",7),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n        "),s.qZA(),s._uU(18,"\n\n        "),s.TgZ(19,"div",7),s._uU(20,"\n          "),s.TgZ(21,"h4",8),s._uU(22),s.ALo(23,"i18n"),s.qZA(),s._uU(24,"\n          "),s.TgZ(25,"p"),s._uU(26,"\n            "),s.TgZ(27,"code"),s._uU(28),s.qZA(),s._uU(29,"\n          "),s.qZA(),s._uU(30,"\n        "),s.qZA(),s._uU(31,"\n\n        "),s._UZ(32,"hr"),s._uU(33,"\n\n        "),s.TgZ(34,"div",10),s._uU(35),s.ALo(36,"i18n"),s.TgZ(37,"a",14),s._uU(38),s.ALo(39,"i18n"),s.qZA(),s._uU(40,"\n        "),s.qZA(),s._uU(41,"\n      "),s.qZA(),s._uU(42,"\n    "),s.BQk()),2&e){const e=s.oxw();s.xp6(5),s.Oqu(s.lcZ(6,7,"adminApprovalRequested")),s.xp6(6),s.Oqu(s.lcZ(12,9,"adminApprovalRequestSentToAdmins")),s.xp6(4),s.Oqu(s.lcZ(16,11,"youWillBeNotifiedOnceApproved")),s.xp6(7),s.Oqu(s.lcZ(23,13,"fingerprintPhraseHeader")),s.xp6(6),s.Oqu(e.fingerprintPhrase),s.xp6(7),s.hij("\n          ",s.lcZ(36,15,"troubleLoggingIn"),"\n          "),s.xp6(3),s.Oqu(s.lcZ(39,17,"viewAllLoginOptions"))}}class os extends es{}os.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(os)))(t||os)}}(),os.ɵcmp=s.Xpm({type:os,selectors:[["app-login-via-auth-request"]],features:[s.qOj],decls:14,vars:2,consts:[[1,"tw-mx-auto","tw-mt-5","tw-flex","tw-max-w-lg","tw-flex-col","tw-items-center","tw-justify-center","tw-p-8"],["alt","Bitwarden",1,"logo","logo-themed"],[4,"ngIf"],[1,"tw-mx-4","tw-mb-4","tw-mt-3","tw-text-center","tw-text-xl"],[1,"tw-mt-3","tw-rounded-md","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background","tw-p-6"],[1,"tw-mb-6","tw-text-xl","tw-font-semibold"],[1,"tw-text-light"],[1,"tw-mb-6"],[1,"tw-font-semibold"],["class","tw-my-10",4,"ngIf"],[1,"tw-text-light","tw-mt-3"],["routerLink","/login"],[1,"tw-my-10"],["disabled","true",3,"routerLink","click"],["routerLink","/login-initiated"]],template:function(e,t){1&e&&(s._uU(0,"\n"),s._uU(1,"\n"),s.TgZ(2,"div",0),s._uU(3,"\n  "),s.TgZ(4,"div"),s._uU(5,"\n    "),s._UZ(6,"img",1),s._uU(7,"\n\n    "),s.YNc(8,ns,49,23,"ng-container",2),s._uU(9,"\n    "),s.YNc(10,ss,43,19,"ng-container",2),s._uU(11,"\n  "),s.qZA(),s._uU(12,"\n"),s.qZA(),s._uU(13,"\n")),2&e&&(s.xp6(8),s.Q6J("ngIf",t.state==t.StateEnum.StandardAuthRequest),s.xp6(2),s.Q6J("ngIf",t.state==t.StateEnum.AdminAuthRequest))},dependencies:[d.O5,p.rH,ee.C],encapsulation:2});var rs=i(21452),as=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ls{constructor(e,t,i,n,s){this.webAuthnLoginService=e,this.router=t,this.logService=i,this.validationService=n,this.i18nService=s,this.currentState="assert",this.successRoute="/vault",this.forcePasswordResetRoute="/update-temp-password"}ngOnInit(){this.authenticate()}retry(){this.currentState="assert",this.authenticate()}authenticate(){return as(this,void 0,void 0,(function*(){let e;try{const t=yield this.webAuthnLoginService.getCredentialAssertionOptions();e=yield this.webAuthnLoginService.assertCredential(t)}catch(t){return this.validationService.showError(t),void(this.currentState="assertFailed")}try{const t=yield this.webAuthnLoginService.logIn(e);t.requiresTwoFactor?(this.validationService.showError(this.i18nService.t("twoFactorForPasskeysNotSupportedOnClientUpdateToLogIn")),this.currentState="assertFailed"):t.forcePasswordReset==Gi.w.AdminForcePasswordReset?yield this.router.navigate([this.forcePasswordResetRoute]):yield this.router.navigate([this.successRoute])}catch(t){t instanceof Kn.i&&this.validationService.showError(this.i18nService.t("invalidPasskeyPleaseTryAgain")),this.logService.error(t),this.currentState="assertFailed"}}))}}ls.ɵfac=function(e){return new(e||ls)(s.Y36(rs.V),s.Y36(p.F0),s.Y36(_e.$),s.Y36(Bt.R),s.Y36(M.D))},ls.ɵdir=s.lG2({type:ls});var cs=i(66997);const us=cs.W4`
<svg xmlns="http://www.w3.org/2000/svg" width="163" height="115" fill="none">
  <path class="tw-fill-secondary-600" fill-rule="evenodd" d="M31 19.46H9v22h22v-22Zm-24-2v26h26v-26H7Z"
    clip-rule="evenodd" />
  <path class="tw-fill-secondary-600" fill-rule="evenodd"
    d="M0 43.46a4 4 0 0 1 4-4h32a4 4 0 0 1 4 4v7h-4v-7H4v16.747l1.705 2.149a4 4 0 0 1 .866 2.486v22.205a4 4 0 0 1-1 2.645L4 91.475v17.985h32V91.475l-1.572-1.783a4 4 0 0 1-1-2.645V64.842a4 4 0 0 1 .867-2.486L36 60.207V56.46h4v3.747a4 4 0 0 1-.867 2.487l-1.704 2.148v22.205L39 88.83a4 4 0 0 1 1 2.645v17.985a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V91.475a4 4 0 0 1 1-2.645l1.571-1.783V64.842L.867 62.694A4 4 0 0 1 0 60.207V43.46Z"
    clip-rule="evenodd" />
  <path class="tw-fill-secondary-600" fill-rule="evenodd"
    d="M19.74 63.96a.5.5 0 0 1 .355.147l2.852 2.866a.5.5 0 0 1 .146.353V77.56c2.585 1.188 4.407 3.814 4.407 6.865 0 4.183-3.357 7.534-7.5 7.534-4.144 0-7.5-3.376-7.5-7.534a7.546 7.546 0 0 1 4.478-6.894v-1.443a.5.5 0 0 1 .146-.353l1.275-1.281-1.322-1.33a.5.5 0 0 1 0-.705l.332-.334-.262-.263a.5.5 0 0 1-.005-.7l1.332-1.377-1.445-1.452a.5.5 0 0 1-.145-.352v-1.114a.5.5 0 0 1 .145-.352l2.357-2.369a.5.5 0 0 1 .355-.147Zm-1.856 3.075v.7l1.645 1.654a.5.5 0 0 1 .005.7l-1.332 1.377.267.268a.5.5 0 0 1 0 .705l-.333.334 1.323 1.329a.5.5 0 0 1 0 .705l-1.48 1.488v1.57a.5.5 0 0 1-.32.466 6.545 6.545 0 0 0-4.159 6.095c0 3.61 2.913 6.534 6.5 6.534 3.588 0 6.5-2.901 6.5-6.534 0-2.749-1.707-5.105-4.095-6.074a.5.5 0 0 1-.312-.463V67.532L19.74 65.17l-1.857 1.866ZM20 85.623a1.27 1.27 0 0 0-1.268 1.276c0 .702.56 1.276 1.268 1.276.712 0 1.268-.555 1.268-1.276A1.27 1.27 0 0 0 20 85.623Zm-2.268 1.276A2.27 2.27 0 0 1 20 84.623a2.27 2.27 0 0 1 2.268 2.276c0 1.269-1 2.276-2.268 2.276a2.27 2.27 0 0 1-2.268-2.276ZM57.623 114a1 1 0 0 1 1-1h63.048a1 1 0 0 1 0 2H58.623a1 1 0 0 1-1-1Z"
    clip-rule="evenodd" />
  <path class="tw-fill-secondary-600" fill-rule="evenodd"
    d="M78.022 114V95.654h2V114h-2ZM98.418 114V95.654h2V114h-2Z" clip-rule="evenodd" />
  <path class="tw-fill-secondary-600" fill-rule="evenodd"
    d="M16 14.46c0-7.732 6.268-14 14-14h119c7.732 0 14 6.268 14 14v68c0 7.732-6.268 14-14 14H39.5v-4H149c5.523 0 10-4.477 10-10v-68c0-5.523-4.477-10-10-10H30c-5.523 0-10 4.477-10 10v5h-4v-5Z"
    clip-rule="evenodd" />
  <path class="tw-fill-secondary-600" fill-rule="evenodd"
    d="M25 15.46a6 6 0 0 1 6-6h117a6 6 0 0 1 6 6v66a6 6 0 0 1-6 6H36.5v-2H148a4 4 0 0 0 4-4v-66a4 4 0 0 0-4-4H31a4 4 0 0 0-4 4v3h-2v-3Z"
    clip-rule="evenodd" />
  <path class="tw-fill-secondary-600"
    d="M104.269 32.86a1.42 1.42 0 0 0-1.007-.4h-25.83c-.39 0-.722.132-1.007.4a1.26 1.26 0 0 0-.425.947v16.199c0 1.207.25 2.407.75 3.597a13.22 13.22 0 0 0 1.861 3.165c.74.919 1.62 1.817 2.646 2.69a30.93 30.93 0 0 0 2.834 2.172c.868.577 1.77 1.121 2.712 1.636.942.516 1.612.862 2.007 1.043.394.181.714.326.95.42.18.083.373.128.583.128.21 0 .403-.041.582-.128.241-.099.557-.239.956-.42.394-.181 1.064-.532 2.006-1.043a36.595 36.595 0 0 0 2.712-1.636c.867-.576 1.813-1.302 2.838-2.171a19.943 19.943 0 0 0 2.646-2.69 13.24 13.24 0 0 0 1.862-3.166 9.19 9.19 0 0 0 .749-3.597V33.812c.005-.367-.14-.684-.425-.952Zm-3.329 17.298c0 5.864-10.593 10.916-10.593 10.916V35.93h10.593v14.228Z" />
  <path class="tw-fill-secondary-600" fill-rule="evenodd" d="M18 24.46h-5v-2h5v2ZM27 24.46h-5v-2h5v2Z"
    clip-rule="evenodd" />
  <path class="tw-fill-danger-600"
    d="M51.066 66.894a2.303 2.303 0 0 1-2.455-.5l-10.108-9.797L28.375 66.4l-.002.002a2.294 2.294 0 0 1-3.185.005 2.24 2.24 0 0 1-.506-2.496c.117-.27.286-.518.503-.728l10.062-9.737-9.945-9.623a2.258 2.258 0 0 1-.698-1.6c-.004-.314.06-.619.176-.894a2.254 2.254 0 0 1 1.257-1.222 2.305 2.305 0 0 1 1.723.014c.267.11.518.274.732.486l10.01 9.682 9.995-9.688.009-.008a2.292 2.292 0 0 1 3.159.026c.425.411.68.98.684 1.59a2.242 2.242 0 0 1-.655 1.6l-.01.01-9.926 9.627 10.008 9.7.029.027a2.237 2.237 0 0 1 .53 2.496l-.002.004a2.258 2.258 0 0 1-1.257 1.222Z" />
</svg>
`,ds=cs.W4`
<svg xmlns="http://www.w3.org/2000/svg" width="163" height="116" fill="none">
  <path class="tw-fill-secondary-600" fill-rule="evenodd" d="M31 19.58H9v22h22v-22Zm-24-2v26h26v-26H7Z"
    clip-rule="evenodd" />
  <path class="tw-fill-secondary-600" fill-rule="evenodd"
    d="M0 43.58a4 4 0 0 1 4-4h32a4 4 0 0 1 4 4v7h-4v-7H4v16.747l1.705 2.149a4 4 0 0 1 .866 2.486v22.204a4 4 0 0 1-1 2.646L4 91.595v17.985h32V91.595l-1.572-1.783a4 4 0 0 1-1-2.646V64.962a4 4 0 0 1 .867-2.486L36 60.327V56.58h4v3.747a4 4 0 0 1-.867 2.486l-1.704 2.149v22.204L39 88.95a4 4 0 0 1 1 2.646v17.985a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V91.595a4 4 0 0 1 1-2.646l1.571-1.783V64.962L.867 62.813A4 4 0 0 1 0 60.327V43.58Z"
    clip-rule="evenodd" />
  <path class="tw-fill-secondary-600" fill-rule="evenodd"
    d="M19.74 64.08a.5.5 0 0 1 .355.147l2.852 2.866a.5.5 0 0 1 .146.352V77.68c2.585 1.189 4.407 3.814 4.407 6.865 0 4.183-3.357 7.535-7.5 7.535-4.144 0-7.5-3.377-7.5-7.535a7.546 7.546 0 0 1 4.478-6.894V76.21a.5.5 0 0 1 .146-.353l1.275-1.282-1.322-1.329a.5.5 0 0 1 0-.705l.332-.334-.262-.263a.5.5 0 0 1-.005-.7l1.332-1.377-1.445-1.452a.5.5 0 0 1-.145-.353v-1.113a.5.5 0 0 1 .145-.353l2.357-2.368a.5.5 0 0 1 .355-.147Zm-1.856 3.074v.7l1.645 1.654a.5.5 0 0 1 .005.7l-1.332 1.377.267.268a.5.5 0 0 1 0 .706l-.333.334 1.323 1.329a.5.5 0 0 1 0 .705l-1.48 1.488v1.57a.5.5 0 0 1-.32.466 6.545 6.545 0 0 0-4.159 6.094c0 3.61 2.913 6.535 6.5 6.535 3.588 0 6.5-2.902 6.5-6.535 0-2.748-1.707-5.104-4.095-6.073a.5.5 0 0 1-.312-.463V67.651l-2.352-2.364-1.857 1.866ZM20 85.742a1.27 1.27 0 0 0-1.268 1.277c0 .701.56 1.276 1.268 1.276.712 0 1.268-.555 1.268-1.276A1.27 1.27 0 0 0 20 85.742Zm-2.268 1.277A2.27 2.27 0 0 1 20 84.742a2.27 2.27 0 0 1 2.268 2.277c0 1.268-1 2.276-2.268 2.276a2.27 2.27 0 0 1-2.268-2.276ZM41.796 42.844a1 1 0 0 1 1.413.058l5.526 6A1 1 0 0 1 48 50.58H27a1 1 0 1 1 0-2h18.72l-3.982-4.323a1 1 0 0 1 .058-1.413ZM33.315 62.315a1 1 0 0 1-1.413-.058l-5.526-6a1 1 0 0 1 .735-1.677h21a1 1 0 1 1 0 2h-18.72l3.982 4.322a1 1 0 0 1-.058 1.413ZM57.623 114.12a1 1 0 0 1 1-1h63.048a1 1 0 1 1 0 2H58.623a1 1 0 0 1-1-1Z"
    clip-rule="evenodd" />
  <path class="tw-fill-secondary-600" fill-rule="evenodd"
    d="M78.022 114.12V95.774h2v18.346h-2ZM98.418 114.12V95.774h2v18.346h-2Z" clip-rule="evenodd" />
  <path class="tw-fill-secondary-600" fill-rule="evenodd"
    d="M16 14.58c0-7.732 6.268-14 14-14h119c7.732 0 14 6.268 14 14v68c0 7.732-6.268 14-14 14H39.5v-4H149c5.523 0 10-4.478 10-10v-68c0-5.523-4.477-10-10-10H30c-5.523 0-10 4.477-10 10v5h-4v-5Z"
    clip-rule="evenodd" />
  <path class="tw-fill-secondary-600" fill-rule="evenodd"
    d="M25 15.58a6 6 0 0 1 6-6h117a6 6 0 0 1 6 6v66a6 6 0 0 1-6 6H36.5v-2H148a4 4 0 0 0 4-4v-66a4 4 0 0 0-4-4H31a4 4 0 0 0-4 4v3h-2v-3Z"
    clip-rule="evenodd" />
  <path class="tw-fill-secondary-600"
    d="M104.269 32.98a1.42 1.42 0 0 0-1.007-.4h-25.83c-.39 0-.722.132-1.007.4a1.26 1.26 0 0 0-.425.947v16.199c0 1.207.25 2.406.75 3.597a13.222 13.222 0 0 0 1.861 3.165c.74.919 1.62 1.817 2.646 2.69a30.93 30.93 0 0 0 2.834 2.172c.868.577 1.77 1.121 2.712 1.636.942.515 1.612.861 2.007 1.043.394.18.714.325.95.42.18.082.373.128.583.128.21 0 .403-.042.582-.128.241-.099.557-.24.956-.42.394-.182 1.064-.532 2.006-1.043a36.56 36.56 0 0 0 2.712-1.636c.867-.577 1.813-1.302 2.838-2.172a19.943 19.943 0 0 0 2.646-2.69 13.24 13.24 0 0 0 1.862-3.165c.5-1.187.749-2.386.749-3.597V33.93c.005-.367-.14-.684-.425-.952Zm-3.329 17.298c0 5.864-10.593 10.916-10.593 10.916V36.049h10.593v14.23Z" />
  <path class="tw-fill-secondary-600" fill-rule="evenodd" d="M18 24.58h-5v-2h5v2ZM27 24.58h-5v-2h5v2Z"
    clip-rule="evenodd" />
</svg>
`;var ps=i(22221);function hs(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n          "),s._UZ(2,"bit-icon",8),s._uU(3,"\n          "),s.TgZ(4,"p",9),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n          "),s.TgZ(8,"button",10),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n        "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("icon",e.Icons.CreatePasskeyIcon),s.xp6(3),s.Oqu(s.lcZ(6,4,"readingPasskeyLoadingInfo")),s.xp6(3),s.Q6J("loading",!0),s.xp6(1),s.hij("\n            ",s.lcZ(10,6,"loading"),"\n          ")}}function gs(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s._UZ(2,"bit-icon",8),s._uU(3,"\n          "),s.TgZ(4,"p",9),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n          "),s.TgZ(8,"button",11),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.retry())})),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n        "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("icon",e.Icons.CreatePasskeyFailedIcon),s.xp6(3),s.Oqu(s.lcZ(6,3,"readingPasskeyLoadingInfo")),s.xp6(4),s.hij("\n            ",s.lcZ(10,5,"tryAgain"),"\n          ")}}class fs extends ls{constructor(){super(...arguments),this.Icons={CreatePasskeyIcon:ds,CreatePasskeyFailedIcon:us}}}fs.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(fs)))(t||fs)}}(),fs.ɵcmp=s.Xpm({type:fs,selectors:[["app-login-via-webauthn"]],features:[s.qOj],decls:32,vars:11,consts:[[1,"tw-mx-auto","tw-mt-5","tw-flex","tw-max-w-lg","tw-flex-col","tw-items-center","tw-justify-center","tw-p-8"],["alt","Bitwarden",1,"logo","logo-themed"],["bitTypography","h3",1,"tw-my-8","tw-mb-3","tw-text-center"],[1,"tw-rounded-md","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background","tw-p-6"],[1,"tw-flex","tw-flex-col","tw-items-center"],[4,"ngIf"],["bitTypography","body1",1,"tw-mb-0"],["routerLink","/login"],[1,"tw-my-10",3,"icon"],["bitTypography","body1"],["type","button","bitButton","","block","","buttonType","primary",1,"tw-mb-4",3,"loading"],["type","button","bitButton","","block","","buttonType","primary",1,"tw-mb-4",3,"click"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div"),s._uU(3,"\n    "),s._UZ(4,"img",1),s._uU(5,"\n    "),s.TgZ(6,"h3",2),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n\n    "),s.TgZ(10,"div",3),s._uU(11,"\n      "),s.TgZ(12,"div",4),s._uU(13,"\n        "),s.YNc(14,hs,12,8,"ng-container",5),s._uU(15,"\n\n        "),s.YNc(16,gs,12,7,"ng-container",5),s._uU(17,"\n      "),s.qZA(),s._uU(18,"\n      "),s.TgZ(19,"p",6),s._uU(20),s.ALo(21,"i18n"),s._UZ(22,"br"),s._uU(23,"\n        "),s.TgZ(24,"a",7),s._uU(25),s.ALo(26,"i18n"),s.qZA(),s._uU(27,"\n      "),s.qZA(),s._uU(28,"\n    "),s.qZA(),s._uU(29,"\n  "),s.qZA(),s._uU(30,"\n"),s.qZA(),s._uU(31,"\n")),2&e&&(s.xp6(7),s.hij("\n      ",s.lcZ(8,5,"readingPasskeyLoading"),"\n    "),s.xp6(7),s.Q6J("ngIf","assert"===t.currentState),s.xp6(2),s.Q6J("ngIf","assertFailed"===t.currentState),s.xp6(4),s.hij("\n        ",s.lcZ(21,7,"troubleLoggingIn"),""),s.xp6(5),s.Oqu(s.lcZ(26,9,"useADifferentLogInMethod")))},dependencies:[d.O5,p.rH,Te.r,ps.G,On.t,ee.C],encapsulation:2});var ms=i(4423),vs=i(69842),ys=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ws=["masterPasswordInput"];class bs extends jn{get loggedEmail(){return this.formGroup.value.email}constructor(e,t,i,n,s,o,r,a,c,u,d,p,g,f,m,v,y,w){super(a,o,s),this.devicesApiService=e,this.appIdService=t,this.loginStrategyService=i,this.router=n,this.stateService=r,this.passwordGenerationService=c,this.cryptoFunctionService=u,this.logService=d,this.ngZone=p,this.formBuilder=g,this.formValidationErrorService=f,this.route=m,this.loginEmailService=v,this.ssoLoginService=y,this.webAuthnLoginService=w,this.showPassword=!1,this.validatedEmail=!1,this.paramEmailSet=!1,this.formGroup=this.formBuilder.group({email:["",[l.kI.required,l.kI.email]],masterPassword:["",[l.kI.required,l.kI.minLength(Ci.c.originalMinimumPasswordLength)]],rememberEmail:[!1]}),this.twoFactorRoute="2fa",this.successRoute="vault",this.forcePasswordResetRoute="update-temp-password",this.destroy$=new h.x}ngOnInit(){var e;return ys(this,void 0,void 0,(function*(){if(null===(e=this.route)||void 0===e||e.queryParams.pipe((0,g.R)(this.destroy$)).subscribe((e=>{if(!e)return;const t=e.email;null!=t&&t.indexOf("@")>-1&&(this.formGroup.controls.email.setValue(t),this.paramEmailSet=!0)})),!this.paramEmailSet){const e=yield(0,f.z)(this.loginEmailService.storedEmail$);this.formGroup.controls.email.setValue(null!=e?e:"")}let t=this.loginEmailService.getRememberEmail();null==t&&(t=null!=(yield(0,f.z)(this.loginEmailService.storedEmail$))),this.formGroup.controls.rememberEmail.setValue(t)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}submit(e=!0){return ys(this,void 0,void 0,(function*(){const t=this.formGroup.value;if(yield this.setupCaptcha(),this.formGroup.markAllAsTouched(),!this.formGroup.invalid||e)if(this.formGroup.invalid&&e){const e=this.getErrorToastMessage();this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e)}else try{const e=new Di.tE(t.email,t.masterPassword,this.captchaToken,null);this.formPromise=this.loginStrategyService.logIn(e);const i=yield this.formPromise;if(this.setLoginEmailValues(),yield this.loginEmailService.saveEmailSettings(),this.handleCaptchaRequired(i))return;if(this.handleMigrateEncryptionKey(i))return;i.requiresTwoFactor?null!=this.onSuccessfulLoginTwoFactorNavigate?this.onSuccessfulLoginTwoFactorNavigate():this.router.navigate([this.twoFactorRoute]):i.forcePasswordReset!=Gi.w.None?null!=this.onSuccessfulLoginForceResetNavigate?this.onSuccessfulLoginForceResetNavigate():this.router.navigate([this.forcePasswordResetRoute]):(null!=this.onSuccessfulLogin&&this.onSuccessfulLogin(),null!=this.onSuccessfulLoginNavigate?this.onSuccessfulLoginNavigate():this.router.navigate([this.successRoute]))}catch(i){this.logService.error(i)}}))}togglePassword(){this.showPassword=!this.showPassword,this.ngZone.isStable?document.getElementById("masterPassword").focus():this.ngZone.onStable.pipe((0,Bi.q)(1)).subscribe((()=>document.getElementById("masterPassword").focus()))}startAuthRequestLogin(){var e,t;return ys(this,void 0,void 0,(function*(){null===(e=this.formGroup.get("masterPassword"))||void 0===e||e.clearValidators(),null===(t=this.formGroup.get("masterPassword"))||void 0===t||t.updateValueAndValidity(),this.formGroup.valid&&(this.setLoginEmailValues(),this.router.navigate(["/login-with-device"]))}))}launchSsoBrowser(e,t){return ys(this,void 0,void 0,(function*(){yield this.saveEmailSettings();const i={type:"password",length:64,uppercase:!0,lowercase:!0,numbers:!0,special:!1},n=yield this.passwordGenerationService.generatePassword(i),s=yield this.passwordGenerationService.generatePassword(i),o=yield this.cryptoFunctionService.hash(s,"sha256"),r=Ci.c.fromBufferToUrlB64(o);yield this.ssoLoginService.setSsoState(n),yield this.ssoLoginService.setCodeVerifier(s);const a=(yield(0,f.z)(this.environmentService.environment$)).getWebVaultUrl();this.platformUtilsService.launchUri(a+"/#/sso?clientId="+e+"&redirectUri="+encodeURIComponent(t)+"&state="+n+"&codeChallenge="+r+"&email="+encodeURIComponent(this.formGroup.controls.email.value))}))}validateEmail(){return ys(this,void 0,void 0,(function*(){this.formGroup.controls.email.markAsTouched();this.formGroup.get("email").invalid||(this.toggleValidateEmail(!0),yield this.getLoginWithDevice(this.loggedEmail))}))}toggleValidateEmail(e){var t,i;this.validatedEmail=e,this.validatedEmail?(this.formGroup.controls.masterPassword.markAsUntouched(),this.ngZone.isStable?null===(i=null===(t=this.masterPasswordInput)||void 0===t?void 0:t.nativeElement)||void 0===i||i.focus():this.ngZone.onStable.pipe((0,Bi.q)(1)).subscribe((()=>{var e,t;null===(t=null===(e=this.masterPasswordInput)||void 0===e?void 0:e.nativeElement)||void 0===t||t.focus()}))):this.formGroup.controls.masterPassword.reset()}setLoginEmailValues(){this.loginEmailService.setEmail(this.formGroup.value.email),this.loginEmailService.setRememberEmail(this.formGroup.value.rememberEmail)}saveEmailSettings(){return ys(this,void 0,void 0,(function*(){this.setLoginEmailValues(),yield this.loginEmailService.saveEmailSettings(),yield this.ssoLoginService.setSsoEmail(this.formGroup.value.email)}))}handleMigrateEncryptionKey(e){return!!e.requiresEncryptionKeyMigration&&(this.platformUtilsService.showToast("error",this.i18nService.t("errorOccured"),this.i18nService.t("encryptionKeyMigrationRequired")),!0)}getErrorToastMessage(){const e=this.formValidationErrorService.getFormValidationErrors(this.formGroup.controls).shift();if(e)switch(e.errorName){case"email":return this.i18nService.t("invalidEmail");case"minlength":return this.i18nService.t("masterPasswordMinlength",Ci.c.originalMinimumPasswordLength);default:return this.i18nService.t(this.errorTag(e))}}errorTag(e){const t=e.errorName.charAt(0).toUpperCase()+e.errorName.slice(1);return`${e.controlName}${t}`}getLoginWithDevice(e){return ys(this,void 0,void 0,(function*(){try{const t=yield this.appIdService.getAppId();this.showLoginWithDevice=yield this.devicesApiService.getKnownDevice(e,t)}catch(t){this.showLoginWithDevice=!1}}))}}bs.ɵfac=function(e){return new(e||bs)(s.Y36(ms.c),s.Y36(Hn.s),s.Y36(Di.m),s.Y36(p.F0),s.Y36(N.P),s.Y36(M.D),s.Y36(J.b),s.Y36($i.L),s.Y36(A.UW),s.Y36($n.O),s.Y36(_e.$),s.Y36(s.R0b),s.Y36(l.qu),s.Y36(vs.q),s.Y36(p.gz),s.Y36(Di.rh),s.Y36(_n.F),s.Y36(rs.V))},bs.ɵdir=s.lG2({type:bs,viewQuery:function(e,t){if(1&e&&s.Gf(ws,7),2&e){let e;s.iGM(e=s.CRH())&&(t.masterPasswordInput=e.first)}},features:[s.qOj]});var Us=i(63700),_s=i(16494);var As=i(54666),Zs=i(1e4),xs=i(21656),Ss=i(12492),Ts=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Cs(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"div",19),s._uU(3,"\n            "),s.TgZ(4,"bit-form-field"),s._uU(5,"\n              "),s.TgZ(6,"bit-label"),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n              "),s.TgZ(10,"input",25),s.NdJ("keyup.enter",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.validateEmail())})),s.qZA(),s._uU(11,"\n            "),s.qZA(),s._uU(12,"\n          "),s.qZA(),s._uU(13,"\n\n          "),s.TgZ(14,"div",26),s._uU(15,"\n            "),s.TgZ(16,"bit-form-control",27),s._uU(17,"\n              "),s._UZ(18,"input",28),s._uU(19,"\n              "),s.TgZ(20,"bit-label"),s._uU(21),s.ALo(22,"i18n"),s.qZA(),s._uU(23,"\n            "),s.qZA(),s._uU(24,"\n          "),s.qZA(),s._uU(25,"\n\n          "),s.TgZ(26,"div",19),s._uU(27,"\n            "),s.TgZ(28,"button",29),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.validateEmail())})),s._uU(29,"\n              "),s.TgZ(30,"span"),s._uU(31),s.ALo(32,"i18n"),s.qZA(),s._uU(33,"\n            "),s.qZA(),s._uU(34,"\n          "),s.qZA(),s._uU(35,"\n\n          "),s.TgZ(36,"div",30),s._uU(37,"\n            "),s.TgZ(38,"p",19),s._uU(39),s.ALo(40,"i18n"),s.qZA(),s._uU(41,"\n\n            "),s.TgZ(42,"a",31),s.NdJ("mousedown",(function(e){return e.preventDefault()})),s._uU(43,"\n              "),s.TgZ(44,"span"),s._UZ(45,"i",32),s._uU(46),s.ALo(47,"i18n"),s.qZA(),s._uU(48,"\n            "),s.qZA(),s._uU(49,"\n          "),s.qZA(),s._uU(50,"\n\n          "),s._UZ(51,"hr"),s._uU(52,"\n\n          "),s.TgZ(53,"p",22),s._uU(54),s.ALo(55,"i18n"),s._uU(56,"\n            "),s.TgZ(57,"a",33),s.NdJ("mousedown",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.goToRegister())})),s._uU(58),s.ALo(59,"i18n"),s.qZA(),s._uU(60,"\n          "),s.qZA(),s._uU(61,"\n        "),s.BQk()}if(2&e){s.oxw();const e=s.MAs(1);s.xp6(7),s.Oqu(s.lcZ(8,8,"emailAddress")),s.xp6(14),s.Oqu(s.lcZ(22,10,"rememberEmail")),s.xp6(7),s.Q6J("disabled",e.loading),s.xp6(3),s.hij(" ",s.lcZ(32,12,"continue")," "),s.xp6(8),s.Oqu(s.lcZ(40,14,"or")),s.xp6(7),s.hij(" ",s.lcZ(47,16,"loginWithPasskey"),""),s.xp6(8),s.hij("\n            ",s.lcZ(55,18,"newAroundHere"),"\n            "),s.xp6(4),s.Oqu(s.lcZ(59,20,"createAccount"))}}function Os(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",19),s._uU(1,"\n            "),s.TgZ(2,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.startAuthRequestLogin())})),s._uU(3,"\n              "),s.TgZ(4,"span"),s._uU(5," "),s._UZ(6,"i",35),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n            "),s.qZA(),s._uU(10,"\n          "),s.qZA()}2&e&&(s.xp6(2),s.Q6J("block",!0),s.xp6(5),s.hij(" ",s.lcZ(8,2,"loginWithDevice")," "))}const ks=function(e){return{"tw-hidden":e}},Ps=function(e){return{email:e}},qs=function(){return[]};class Is extends bs{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v,y,w,b,U){var _;super(e,t,i,n,r,s,f,a,l,u,h,g,v,y,o,w,b,U),this.passwordStrengthService=c,this.policyApiService=d,this.policyService=p,this.stateService=f,this.routerService=m,this.showResetPasswordAutoEnrollWarning=!1,this.showPasswordless=!1,this.onSuccessfulLoginNavigate=this.goAfterLogIn,this.showPasswordless=(_="showPasswordless",(0,_s.Sp)(_))}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return Ts(this,void 0,void 0,(function*(){this.route.queryParams.pipe((0,oe.P)()).subscribe((t=>Ts(this,void 0,void 0,(function*(){if(null!=t.org){const e=this.router.createUrlTree(["create-organization"],{queryParams:{plan:t.org}});this.routerService.setPreviousUrl(e.toString())}if(null!=t.sponsorshipToken){const e=this.router.createUrlTree(["setup/families-for-enterprise"],{queryParams:{token:t.sponsorshipToken}});this.routerService.setPreviousUrl(e.toString())}yield e.ngOnInit.call(this)}))));const t=yield this.stateService.getOrganizationInvitation();if(null!=t){let e=null;try{this.policies=yield this.policyApiService.getPoliciesByToken(t.organizationId,t.token,t.email,t.organizationUserId),e=Ti.G.fromListResponse(this.policies)}catch(i){this.logService.error(i)}if(null!=e){const i=this.policyService.getResetPasswordPolicyOptions(e,t.organizationId);this.showResetPasswordAutoEnrollWarning=i[1]&&i[0].autoEnrollEnabled,this.policyService.masterPasswordPolicyOptions$(e).pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.enforcedPasswordPolicyOptions=e}))}}}))}goAfterLogIn(){return Ts(this,void 0,void 0,(function*(){const e=this.formGroup.value.masterPassword;if(null!=this.enforcedPasswordPolicyOptions){const t=this.passwordStrengthService.getPasswordStrength(e,this.formGroup.value.email),i=null==t?null:t.score;if(!this.policyService.evaluateMasterPassword(i,e,this.enforcedPasswordPolicyOptions)){const e={};return this.policies.data.map((t=>e[t.id]=new Us.n(t))),yield this.policyService.replace(e),void this.router.navigate(["update-password"])}}this.loginEmailService.clearValues(),this.router.navigate([this.successRoute])}))}goToHint(){this.setLoginEmailValues(),this.router.navigateByUrl("/hint")}goToRegister(){const e=this.formGroup.value.email;e?this.router.navigate(["/register"],{queryParams:{email:e}}):this.router.navigate(["/register"])}handleMigrateEncryptionKey(e){return!!e.requiresEncryptionKeyMigration&&(this.router.navigate(["migrate-legacy-encryption"]),!0)}}Is.ɵfac=function(e){return new(e||Is)(s.Y36(ms.c),s.Y36(Hn.s),s.Y36(Di.m),s.Y36(p.F0),s.Y36(M.D),s.Y36(p.gz),s.Y36(N.P),s.Y36($i.L),s.Y36(A.UW),s.Y36(Wi.A),s.Y36($n.O),s.Y36(Oi.P),s.Y36(Y.W),s.Y36(_e.$),s.Y36(s.R0b),s.Y36(H.b2),s.Y36(H.cw),s.Y36(l.qu),s.Y36(vs.q),s.Y36(Di.rh),s.Y36(_n.F),s.Y36(rs.V))},Is.ɵcmp=s.Xpm({type:Is,selectors:[["app-login"]],features:[s.qOj],decls:82,vars:37,consts:[[1,"tw-container","tw-mx-auto",3,"appApiAction","formGroup","ngSubmit"],["form",""],[1,"tw-mx-auto","tw-mt-5","tw-flex","tw-max-w-lg","tw-flex-col","tw-items-center","tw-justify-center","tw-p-8"],["alt","Vaultwarden",1,"logo","logo-themed"],[1,"tw-mx-4","tw-mb-4","tw-mt-3","tw-text-center","tw-text-xl"],[1,"tw-mt-3","tw-rounded-md","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background","tw-p-6"],[4,"ngIf"],[3,"ngClass"],[1,"tw-mb-6","tw-h-28"],[1,"!tw-mb-1"],["id","login_input_master-password","type","password","bitInput","","formControlName","masterPassword"],["masterPasswordInput",""],["type","button","bitSuffix","","bitIconButton","","bitPasswordInputToggle",""],["routerLink","/hint",1,"-tw-mt-2",3,"mousedown","click"],[3,"hidden"],["id","hcaptcha_iframe","height","80","sandbox","allow-scripts allow-same-origin"],[1,"tw-mb-3","tw-flex","tw-space-x-4"],["bitButton","","buttonType","primary","type","submit",3,"block","loading"],["class","tw-mb-3",4,"ngIf"],[1,"tw-mb-3"],["routerLink","/sso","bitButton","","buttonType","secondary",1,"tw-w-full",3,"queryParams","click"],[1,"bwi","bwi-provider","tw-mr-2"],[1,"tw-m-0","tw-text-sm"],[1,"tw-mb-1"],[3,"routerLink","click"],["id","login_input_email","bitInput","","type","email","formControlName","email","appAutofocus","",3,"keyup.enter"],[1,"tw-mb-3","tw-flex","tw-items-start"],[1,"tw-mb-0"],["type","checkbox","bitCheckbox","","formControlName","rememberEmail"],["bitButton","","type","button","buttonType","primary",1,"tw-w-full",3,"disabled","click"],[1,"tw-mb-3","tw-flex","tw-flex-col","tw-items-center","tw-justify-center","vw-hide"],["bitLink","","block","","linkType","primary","routerLink","/login-with-passkey",3,"mousedown"],[1,"bwi","bwi-passkey"],["routerLink","/register",3,"mousedown"],["bitButton","","type","button","buttonType","secondary",3,"block","click"],[1,"bwi","bwi-mobile"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit(!1)})),s._uU(2,"\n  "),s.TgZ(3,"div",2),s._uU(4,"\n    "),s.TgZ(5,"div"),s._uU(6,"\n      "),s._UZ(7,"img",3),s._uU(8,"\n      "),s.TgZ(9,"p",4),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n      "),s.TgZ(13,"div",5),s._uU(14,"\n        "),s.YNc(15,Cs,62,22,"ng-container",6),s._uU(16,"\n\n        "),s.TgZ(17,"div",7),s._uU(18,"\n          "),s.TgZ(19,"div",8),s._uU(20,"\n            "),s.TgZ(21,"bit-form-field",9),s._uU(22,"\n              "),s.TgZ(23,"bit-label"),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n              "),s._UZ(27,"input",10,11),s._uU(29,"\n              "),s._UZ(30,"button",12),s._uU(31,"\n            "),s.qZA(),s._uU(32,"\n            "),s.TgZ(33,"a",13),s.NdJ("mousedown",(function(){return t.goToHint()}))("click",(function(){return t.setLoginEmailValues()})),s._uU(34),s.ALo(35,"i18n"),s.qZA(),s._uU(36,"\n          "),s.qZA(),s._uU(37,"\n\n          "),s.TgZ(38,"div",14),s._uU(39,"\n            "),s._UZ(40,"iframe",15),s._uU(41,"\n          "),s.qZA(),s._uU(42,"\n\n          "),s.TgZ(43,"div",16),s._uU(44,"\n            "),s.TgZ(45,"button",17),s._uU(46,"\n              "),s.TgZ(47,"span"),s._uU(48),s.ALo(49,"i18n"),s.qZA(),s._uU(50,"\n            "),s.qZA(),s._uU(51,"\n          "),s.qZA(),s._uU(52,"\n\n          "),s.YNc(53,Os,11,4,"div",18),s._uU(54,"\n\n          "),s.TgZ(55,"div",19),s._uU(56,"\n            "),s.TgZ(57,"a",20),s.NdJ("click",(function(){return t.saveEmailSettings()})),s._uU(58,"\n              "),s._UZ(59,"i",21),s._uU(60),s.ALo(61,"i18n"),s.qZA(),s._uU(62,"\n          "),s.qZA(),s._uU(63,"\n\n          "),s._UZ(64,"hr"),s._uU(65,"\n\n          "),s.TgZ(66,"div",22),s._uU(67,"\n            "),s.TgZ(68,"p",23),s._uU(69),s.ALo(70,"i18n"),s.qZA(),s._uU(71,"\n            "),s.TgZ(72,"a",24),s.NdJ("click",(function(){return t.toggleValidateEmail(!1)})),s._uU(73),s.ALo(74,"i18n"),s.qZA(),s._uU(75,"\n          "),s.qZA(),s._uU(76,"\n        "),s.qZA(),s._uU(77,"\n      "),s.qZA(),s._uU(78,"\n    "),s.qZA(),s._uU(79,"\n  "),s.qZA(),s._uU(80,"\n"),s.qZA(),s._uU(81,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise)("formGroup",t.formGroup),s.xp6(10),s.hij("\n        ",s.lcZ(11,18,"loginOrCreateNewAccount"),"\n      "),s.xp6(5),s.Q6J("ngIf",!t.validatedEmail),s.xp6(2),s.Q6J("ngClass",s.VKq(32,ks,!t.validatedEmail)),s.xp6(7),s.Oqu(s.lcZ(25,20,"masterPass")),s.xp6(10),s.Oqu(s.lcZ(35,22,"getMasterPasswordHint")),s.xp6(4),s.Q6J("hidden",!t.showCaptcha()),s.xp6(7),s.Q6J("block",!0)("loading",e.loading),s.xp6(3),s.hij(" ",s.lcZ(49,24,"loginWithMasterPassword")," "),s.xp6(5),s.Q6J("ngIf",t.showLoginWithDevice&&t.showPasswordless),s.xp6(4),s.Q6J("queryParams",s.VKq(34,Ps,t.formGroup.value.email)),s.xp6(3),s.hij("\n              ",s.lcZ(61,26,"enterpriseSingleSignOn"),"\n            "),s.xp6(9),s.AsE("",s.lcZ(70,28,"loggingInAs")," ",t.loggedEmail,""),s.xp6(3),s.Q6J("routerLink",s.DdM(36,qs)),s.xp6(1),s.Oqu(s.lcZ(74,30,"notYou"))}},dependencies:[d.mk,d.O5,l._Y,l.Fj,l.Wl,l.JJ,l.JL,l.sg,l.u,p.rH,xe.b,Ji.U,Te.r,Sn.b,Oe.d,ke.G,As.w,Zs.e,Tn.A,Pe.u,xs.Q,Ss.r,ee.C],encapsulation:2});class Ms{}var Ns=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ls{constructor(e,t,i,n,s){this.router=e,this.apiService=t,this.platformUtilsService=i,this.i18nService=n,this.logService=s}submit(){return Ns(this,void 0,void 0,(function*(){try{const e=new Ms;e.email=this.email.trim().toLowerCase(),this.formPromise=this.apiService.postAccountRecoverDelete(e),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("deleteRecoverEmailSent")),this.router.navigate(["/"])}catch(e){this.logService.error(e)}}))}}Ls.ɵfac=function(e){return new(e||Ls)(s.Y36(p.F0),s.Y36(Ue.s),s.Y36(N.P),s.Y36(M.D),s.Y36(_e.$))},Ls.ɵcmp=s.Xpm({type:Ls,selectors:[["app-recover-delete"]],decls:52,vars:21,consts:[["ngNativeValidate","",1,"container",3,"appApiAction","ngSubmit"],["form",""],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],[1,"lead","text-center","mb-4"],[1,"card"],[1,"card-body"],[1,"form-group"],["for","email"],["id","email","type","text","name","Email","required","","appAutofocus","","inputmode","email","appInputVerbatim","false",1,"form-control",3,"ngModel","ngModelChange"],[1,"d-flex"],["type","submit",1,"btn","btn-primary","btn-block","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["routerLink","/login",1,"btn","btn-outline-secondary","btn-block","ml-2","mt-0"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n  "),s.TgZ(3,"div",2),s._uU(4,"\n    "),s.TgZ(5,"div",3),s._uU(6,"\n      "),s.TgZ(7,"p",4),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.TgZ(11,"div",5),s._uU(12,"\n        "),s.TgZ(13,"div",6),s._uU(14,"\n          "),s.TgZ(15,"p"),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n          "),s.TgZ(19,"div",7),s._uU(20,"\n            "),s.TgZ(21,"label",8),s._uU(22),s.ALo(23,"i18n"),s.qZA(),s._uU(24,"\n            "),s.TgZ(25,"input",9),s.NdJ("ngModelChange",(function(e){return t.email=e})),s.qZA(),s._uU(26,"\n          "),s.qZA(),s._uU(27,"\n          "),s._UZ(28,"hr"),s._uU(29,"\n          "),s.TgZ(30,"div",10),s._uU(31,"\n            "),s.TgZ(32,"button",11),s._uU(33,"\n              "),s.TgZ(34,"span"),s._uU(35),s.ALo(36,"i18n"),s.qZA(),s._uU(37,"\n              "),s._UZ(38,"i",12),s.ALo(39,"i18n"),s._uU(40,"\n            "),s.qZA(),s._uU(41,"\n            "),s.TgZ(42,"a",13),s._uU(43),s.ALo(44,"i18n"),s.qZA(),s._uU(45,"\n          "),s.qZA(),s._uU(46,"\n        "),s.qZA(),s._uU(47,"\n      "),s.qZA(),s._uU(48,"\n    "),s.qZA(),s._uU(49,"\n  "),s.qZA(),s._uU(50,"\n"),s.qZA(),s._uU(51,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,9,"deleteAccount")),s.xp6(8),s.Oqu(s.lcZ(17,11,"deleteRecoverDesc")),s.xp6(6),s.Oqu(s.lcZ(23,13,"emailAddress")),s.xp6(3),s.Q6J("ngModel",t.email),s.xp6(7),s.Q6J("disabled",e.loading),s.xp6(3),s.Oqu(s.lcZ(36,15,"submit")),s.xp6(3),s.s9C("title",s.lcZ(39,17,"loading")),s.xp6(5),s.hij("\n              ",s.lcZ(44,19,"cancel"),"\n            ")}},dependencies:[l.Fj,l.JJ,l.JL,l.Q7,l.On,l.F,p.rH,xe.b,Ji.U,zi.b,ee.C],encapsulation:2});class Ds extends ji.Y{}var Es=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Fs{constructor(e,t,i,n,s,o,r){this.router=e,this.apiService=t,this.platformUtilsService=i,this.i18nService=n,this.cryptoService=s,this.loginStrategyService=o,this.logService=r}submit(){return Es(this,void 0,void 0,(function*(){try{const e=new Ds;e.recoveryCode=this.recoveryCode.replace(/\s/g,"").toLowerCase(),e.email=this.email.trim().toLowerCase();const t=yield this.loginStrategyService.makePreloginKey(this.masterPassword,e.email);e.masterPasswordHash=yield this.cryptoService.hashMasterKey(this.masterPassword,t),this.formPromise=this.apiService.postTwoFactorRecover(e),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("twoStepRecoverDisabled")),this.router.navigate(["/"])}catch(e){this.logService.error(e)}}))}}Fs.ɵfac=function(e){return new(e||Fs)(s.Y36(p.F0),s.Y36(Ue.s),s.Y36(N.P),s.Y36(M.D),s.Y36(D.$),s.Y36(Di.m),s.Y36(_e.$))},Fs.ɵcmp=s.Xpm({type:Fs,selectors:[["app-recover-two-factor"]],decls:74,vars:32,consts:[["ngNativeValidate","",1,"container",3,"appApiAction","ngSubmit"],["form",""],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],[1,"lead","text-center","mb-4"],[1,"card"],[1,"card-body"],["href","https://bitwarden.com/help/lost-two-step-device/","target","_blank","rel","noreferrer"],[1,"form-group"],["for","email"],["id","email","type","text","name","Email","required","","appAutofocus","","inputmode","email","appInputVerbatim","false",1,"form-control",3,"ngModel","ngModelChange"],["for","masterPassword"],["id","masterPassword","type","password","name","MasterPassword","required","","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"],["for","recoveryCode"],["id","recoveryCode","type","text","name","RecoveryCode","required","","appInputVerbatim","",1,"text-monospace","form-control",3,"ngModel","ngModelChange"],[1,"d-flex"],["type","submit",1,"btn","btn-primary","btn-block","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["routerLink","/login",1,"btn","btn-outline-secondary","btn-block","ml-2","mt-0"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n  "),s.TgZ(3,"div",2),s._uU(4,"\n    "),s.TgZ(5,"div",3),s._uU(6,"\n      "),s.TgZ(7,"p",4),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.TgZ(11,"div",5),s._uU(12,"\n        "),s.TgZ(13,"div",6),s._uU(14,"\n          "),s.TgZ(15,"p"),s._uU(16),s.ALo(17,"i18n"),s.TgZ(18,"a",7),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n          "),s.qZA(),s._uU(22,"\n          "),s.TgZ(23,"div",8),s._uU(24,"\n            "),s.TgZ(25,"label",9),s._uU(26),s.ALo(27,"i18n"),s.qZA(),s._uU(28,"\n            "),s.TgZ(29,"input",10),s.NdJ("ngModelChange",(function(e){return t.email=e})),s.qZA(),s._uU(30,"\n          "),s.qZA(),s._uU(31,"\n          "),s.TgZ(32,"div",8),s._uU(33,"\n            "),s.TgZ(34,"label",11),s._uU(35),s.ALo(36,"i18n"),s.qZA(),s._uU(37,"\n            "),s.TgZ(38,"input",12),s.NdJ("ngModelChange",(function(e){return t.masterPassword=e})),s.qZA(),s._uU(39,"\n          "),s.qZA(),s._uU(40,"\n          "),s.TgZ(41,"div",8),s._uU(42,"\n            "),s.TgZ(43,"label",13),s._uU(44),s.ALo(45,"i18n"),s.qZA(),s._uU(46,"\n            "),s.TgZ(47,"input",14),s.NdJ("ngModelChange",(function(e){return t.recoveryCode=e})),s.qZA(),s._uU(48,"\n          "),s.qZA(),s._uU(49,"\n          "),s._UZ(50,"hr"),s._uU(51,"\n          "),s.TgZ(52,"div",15),s._uU(53,"\n            "),s.TgZ(54,"button",16),s._uU(55,"\n              "),s.TgZ(56,"span"),s._uU(57),s.ALo(58,"i18n"),s.qZA(),s._uU(59,"\n              "),s._UZ(60,"i",17),s.ALo(61,"i18n"),s._uU(62,"\n            "),s.qZA(),s._uU(63,"\n            "),s.TgZ(64,"a",18),s._uU(65),s.ALo(66,"i18n"),s.qZA(),s._uU(67,"\n          "),s.qZA(),s._uU(68,"\n        "),s.qZA(),s._uU(69,"\n      "),s.qZA(),s._uU(70,"\n    "),s.qZA(),s._uU(71,"\n  "),s.qZA(),s._uU(72,"\n"),s.qZA(),s._uU(73,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,14,"recoverAccountTwoStep")),s.xp6(8),s.hij("\n            ",s.lcZ(17,16,"recoverAccountTwoStepDesc"),"\n            "),s.xp6(3),s.Oqu(s.lcZ(20,18,"learnMore")),s.xp6(7),s.Oqu(s.lcZ(27,20,"emailAddress")),s.xp6(3),s.Q6J("ngModel",t.email),s.xp6(6),s.Oqu(s.lcZ(36,22,"masterPass")),s.xp6(3),s.Q6J("ngModel",t.masterPassword),s.xp6(6),s.Oqu(s.lcZ(45,24,"recoveryCodeTitle")),s.xp6(3),s.Q6J("ngModel",t.recoveryCode),s.xp6(7),s.Q6J("disabled",e.loading),s.xp6(3),s.Oqu(s.lcZ(58,26,"submit")),s.xp6(3),s.s9C("title",s.lcZ(61,28,"loading")),s.xp6(5),s.hij("\n              ",s.lcZ(66,30,"cancel"),"\n            ")}},dependencies:[l.Fj,l.JJ,l.JL,l.Q7,l.On,l.F,p.rH,xe.b,Ji.U,zi.b,ee.C],encapsulation:2});var Rs=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Js{constructor(e,t,i,n,s,o,r,a){this.router=e,this.stateService=t,this.syncService=i,this.platformUtilsService=n,this.i18nService=s,this.keyConnectorService=o,this.organizationApiService=r,this.dialogService=a,this.continuing=!1,this.leaving=!1,this.loading=!0}ngOnInit(){return Rs(this,void 0,void 0,(function*(){this.organization=yield this.keyConnectorService.getManagingOrganization(),this.email=yield this.stateService.getEmail(),yield this.syncService.fullSync(!1),this.loading=!1}))}convert(){return Rs(this,void 0,void 0,(function*(){this.continuing=!0,this.actionPromise=this.keyConnectorService.migrateUser();try{yield this.actionPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("removedMasterPassword")),yield this.keyConnectorService.removeConvertAccountRequired(),this.router.navigate([""])}catch(e){this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e.message)}}))}leave(){return Rs(this,void 0,void 0,(function*(){if(!(yield this.dialogService.openSimpleDialog({title:this.organization.name,content:{key:"leaveOrganizationConfirmation"},type:"warning"})))return!1;try{this.leaving=!0,this.actionPromise=this.organizationApiService.leave(this.organization.id),yield this.actionPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("leftOrganization")),yield this.keyConnectorService.removeConvertAccountRequired(),this.router.navigate([""])}catch(e){this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e)}}))}}function zs(e,t){1&e&&(s.TgZ(0,"div",2),s._uU(1,"\n  "),s.TgZ(2,"div"),s._uU(3,"\n    "),s._UZ(4,"img",3),s._uU(5,"\n    "),s.TgZ(6,"p",4),s._uU(7,"\n      "),s._UZ(8,"i",5),s.ALo(9,"i18n"),s._uU(10,"\n      "),s.TgZ(11,"span",6),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n    "),s.qZA(),s._uU(15,"\n  "),s.qZA(),s._uU(16,"\n"),s.qZA()),2&e&&(s.xp6(8),s.s9C("title",s.lcZ(9,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(13,4,"loading")))}function Ys(e,t){1&e&&(s._UZ(0,"i",16),s.ALo(1,"i18n")),2&e&&s.s9C("title",s.lcZ(1,1,"loading"))}function Ks(e,t){1&e&&(s._UZ(0,"i",16),s.ALo(1,"i18n")),2&e&&s.s9C("title",s.lcZ(1,1,"loading"))}function Bs(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",7),s._uU(1,"\n  "),s.TgZ(2,"div",8),s._uU(3,"\n    "),s.TgZ(4,"div",9),s._uU(5,"\n      "),s.TgZ(6,"p",10),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n      "),s._UZ(10,"hr"),s._uU(11,"\n      "),s.TgZ(12,"div",11),s._uU(13,"\n        "),s.TgZ(14,"div",12),s._uU(15,"\n          "),s.TgZ(16,"p"),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n\n          "),s.TgZ(20,"button",13),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.convert())})),s._uU(21,"\n            "),s.YNc(22,Ys,2,3,"i",14),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n          "),s.TgZ(26,"button",15),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.leave())})),s._uU(27,"\n            "),s.YNc(28,Ks,2,3,"i",14),s._uU(29),s.ALo(30,"i18n"),s.qZA(),s._uU(31,"\n        "),s.qZA(),s._uU(32,"\n      "),s.qZA(),s._uU(33,"\n    "),s.qZA(),s._uU(34,"\n  "),s.qZA(),s._uU(35,"\n"),s.qZA()}if(2&e){const e=s.oxw();s.xp6(7),s.Oqu(s.lcZ(8,8,"removeMasterPassword")),s.xp6(10),s.Oqu(s.xi3(18,10,"convertOrganizationEncryptionDesc",e.organization.name)),s.xp6(3),s.Q6J("disabled",e.actionPromise),s.xp6(2),s.Q6J("ngIf",e.continuing),s.xp6(1),s.hij("\n            ",s.lcZ(24,13,"removeMasterPassword"),"\n          "),s.xp6(3),s.Q6J("disabled",e.actionPromise),s.xp6(2),s.Q6J("ngIf",e.leaving),s.xp6(1),s.hij("\n            ",s.lcZ(30,15,"leaveOrganization"),"\n          ")}}Js.ɵfac=function(e){return new(e||Js)(s.Y36(p.F0),s.Y36(J.b),s.Y36(T._),s.Y36(N.P),s.Y36(M.D),s.Y36(B.J),s.Y36(Ae.M),s.Y36(I.x))},Js.ɵdir=s.lG2({type:Js});class Qs extends Js{}Qs.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(Qs)))(t||Qs)}}(),Qs.ɵcmp=s.Xpm({type:Qs,selectors:[["app-remove-password"]],features:[s.qOj],decls:4,vars:2,consts:[["class","mt-5 d-flex justify-content-center",4,"ngIf"],["class","container",4,"ngIf"],[1,"mt-5","d-flex","justify-content-center"],["alt","Bitwarden",1,"mb-4","logo","logo-themed"],[1,"text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","text-muted",3,"title"],[1,"sr-only"],[1,"container"],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],[1,"lead","text-center","mb-4"],[1,"card","d-block"],[1,"card-body"],["type","button",1,"btn","btn-primary","btn-block",3,"disabled","click"],["class","bwi bwi-spinner bwi-spin","aria-hidden","true",3,"title",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","btn-block",3,"disabled","click"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"]],template:function(e,t){1&e&&(s.YNc(0,zs,17,6,"div",0),s._uU(1,"\n"),s.YNc(2,Bs,36,17,"div",1),s._uU(3,"\n")),2&e&&(s.Q6J("ngIf",t.loading),s.xp6(2),s.Q6J("ngIf",!t.loading))},dependencies:[d.O5,ee.C],encapsulation:2});var Gs=i(80060),js=i(82558);class Vs{constructor(e,t,i,n,s,o,r,a,l){this.masterPasswordHash=e,this.key=t,this.masterPasswordHint=i,this.kdf=o,this.kdfIterations=r,this.kdfMemory=a,this.kdfParallelism=l,this.orgIdentifier=n,this.keys=s}}var $s=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Hs{constructor(e,t,i,n,s,o,r,a,l){this.i18nService=e,this.cryptoService=t,this.messagingService=i,this.passwordGenerationService=n,this.platformUtilsService=s,this.policyService=o,this.stateService=r,this.dialogService=a,this.kdfConfigService=l,this.minimumLength=Ci.c.minimumPasswordLength,this.destroy$=new h.x}ngOnInit(){return $s(this,void 0,void 0,(function*(){this.email=yield this.stateService.getEmail(),this.policyService.masterPasswordPolicyOptions$().pipe((0,g.R)(this.destroy$)).subscribe((e=>{var t;return null!==(t=this.enforcedPolicyOptions)&&void 0!==t?t:this.enforcedPolicyOptions=e}))}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}submit(){return $s(this,void 0,void 0,(function*(){if(!(yield this.strongPassword()))return;if(!(yield this.setupSubmitActions()))return;const e=yield this.stateService.getEmail();null==this.kdfConfig&&(this.kdfConfig=yield this.kdfConfigService.getKdfConfig());const t=yield this.cryptoService.makeMasterKey(this.masterPassword,e.trim().toLowerCase(),this.kdfConfig),i=yield this.cryptoService.hashMasterKey(this.masterPassword,t);let n=null;n=null==(yield this.cryptoService.getUserKey())?yield this.cryptoService.makeUserKey(t):yield this.cryptoService.encryptUserKeyWithMasterKey(t),yield this.performSubmitActions(i,t,n)}))}setupSubmitActions(){return $s(this,void 0,void 0,(function*(){return!0}))}performSubmitActions(e,t,i){return $s(this,void 0,void 0,(function*(){}))}strongPassword(){return $s(this,void 0,void 0,(function*(){if(null==this.masterPassword||""===this.masterPassword)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPasswordRequired")),!1;if(this.masterPassword.length<this.minimumLength)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPasswordMinimumlength",this.minimumLength)),!1;if(this.masterPassword!==this.masterPasswordRetype)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPassDoesntMatch")),!1;const e=this.passwordStrengthResult;if(null!=this.enforcedPolicyOptions&&!this.policyService.evaluateMasterPassword(e.score,this.masterPassword,this.enforcedPolicyOptions))return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPasswordPolicyRequirementsNotMet")),!1;const t=null!=e&&e.score<3;if(t&&this.leakedPassword){if(!(yield this.dialogService.openSimpleDialog({title:{key:"weakAndExposedMasterPassword"},content:{key:"weakAndBreachedMasterPasswordDesc"},type:"warning"})))return!1}else{if(t){if(!(yield this.dialogService.openSimpleDialog({title:{key:"weakMasterPassword"},content:{key:"weakMasterPasswordDesc"},type:"warning"})))return!1}if(this.leakedPassword){if(!(yield this.dialogService.openSimpleDialog({title:{key:"exposedMasterPassword"},content:{key:"exposedMasterPasswordDesc"},type:"warning"})))return!1}}return!0}))}logOut(){return $s(this,void 0,void 0,(function*(){(yield this.dialogService.openSimpleDialog({title:{key:"logOut"},content:{key:"logOutConfirmation"},acceptButtonText:{key:"logOut"},type:"warning"}))&&this.messagingService.send("logout")}))}getStrengthResult(e){this.passwordStrengthResult=e}getPasswordScoreText(e){this.color=e.color,this.text=e.text}}Hs.ɵfac=function(e){return new(e||Hs)(s.Y36(M.D),s.Y36(D.$),s.Y36(fe.o),s.Y36(A.UW),s.Y36(N.P),s.Y36(Y.d),s.Y36(J.b),s.Y36(I.x),s.Y36(sn.d))},Hs.ɵdir=s.lG2({type:Hs});var Ws=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Xs extends Hs{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v,y,w){super(i,n,s,o,r,l,h,y,w),this.accountService=e,this.masterPasswordService=t,this.policyApiService=a,this.router=c,this.apiService=u,this.syncService=d,this.route=p,this.organizationApiService=g,this.organizationUserService=f,this.userDecryptionOptionsService=m,this.ssoLoginService=v,this.syncLoading=!0,this.showPassword=!1,this.hint="",this.orgSsoIdentifier=null,this.resetPasswordAutoEnroll=!1,this.successRoute="vault",this.forceSetPasswordReason=Gi.w.None,this.ForceSetPasswordReason=Gi.w}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});var t;return Ws(this,void 0,void 0,(function*(){e.ngOnInit.call(this),yield this.syncService.fullSync(!0),this.syncLoading=!1,this.userId=null===(t=yield(0,f.z)(this.accountService.activeAccount$))||void 0===t?void 0:t.id,this.forceSetPasswordReason=yield(0,f.z)(this.masterPasswordService.forceSetPasswordReason$(this.userId)),this.route.queryParams.pipe((0,oe.P)(),(0,dn.w)((e=>null!=e.identifier?(0,mn.of)(e.identifier):this.ssoLoginService.getActiveUserOrganizationSsoIdentifier())),(0,m.h)((e=>null!=e)),(0,Gs.b)((e=>{this.orgSsoIdentifier=e})),(0,dn.w)((e=>this.organizationApiService.getAutoEnrollStatus(e))),(0,Gs.b)((e=>{this.orgId=e.id,this.resetPasswordAutoEnroll=e.resetPasswordEnabled})),(0,dn.w)((e=>this.policyApiService.getMasterPasswordPolicyOptsForOrgUser(e.id))),(0,Gs.b)((e=>{this.enforcedPolicyOptions=e}))).subscribe({error:()=>{this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}})}))}setupSubmitActions(){return Ws(this,void 0,void 0,(function*(){return this.kdfConfig=Hi.al,!0}))}performSubmitActions(e,t,i){return Ws(this,void 0,void 0,(function*(){let n=null,s=null;this.forceSetPasswordReason!=Gi.w.TdeUserWithoutPasswordHasPasswordResetPermission&&(s=yield this.cryptoService.makeKeyPair(i[0]),n=new yn.C(s[0],s[1].encryptedString));const o=new Vs(e,i[1].encryptedString,this.hint,this.orgSsoIdentifier,n,this.kdfConfig.kdfType,this.kdfConfig.iterations);try{this.resetPasswordAutoEnroll?this.formPromise=this.apiService.setPassword(o).then((()=>Ws(this,void 0,void 0,(function*(){return yield this.onSetPasswordSuccess(t,i,s),this.organizationApiService.getKeys(this.orgId)})))).then((t=>Ws(this,void 0,void 0,(function*(){if(null==t)throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));const i=Ci.c.fromB64ToArray(t.publicKey),n=yield this.cryptoService.getUserKey(),s=yield this.cryptoService.rsaEncrypt(n.key,i),o=new js.w;return o.masterPasswordHash=e,o.resetPasswordKey=s.encryptedString,this.organizationUserService.putOrganizationUserResetPasswordEnrollment(this.orgId,this.userId,o)})))):this.formPromise=this.apiService.setPassword(o).then((()=>Ws(this,void 0,void 0,(function*(){yield this.onSetPasswordSuccess(t,i,s)})))),yield this.formPromise,null!=this.onSuccessfulChangePassword?this.onSuccessfulChangePassword():this.router.navigate([this.successRoute])}catch(r){this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}}))}togglePassword(e){this.showPassword=!this.showPassword,document.getElementById(e?"masterPasswordRetype":"masterPassword").focus()}onSetPasswordSuccess(e,t,i){return Ws(this,void 0,void 0,(function*(){yield this.masterPasswordService.setForceSetPasswordReason(Gi.w.None,this.userId);const n=yield(0,f.z)(this.userDecryptionOptionsService.userDecryptionOptions$);n.hasMasterPassword=!0,yield this.userDecryptionOptionsService.setUserDecryptionOptions(n),yield this.kdfConfigService.setKdfConfig(this.userId,this.kdfConfig),yield this.masterPasswordService.setMasterKey(e,this.userId),yield this.cryptoService.setUserKey(t[0],this.userId),null!==i&&this.forceSetPasswordReason!=Gi.w.TdeUserWithoutPasswordHasPasswordResetPermission&&(yield this.cryptoService.setPrivateKey(i[1].encryptedString,this.userId));const s=yield this.cryptoService.hashMasterKey(this.masterPassword,e,Hi.RR.LocalAuthorization);yield this.masterPasswordService.setMasterKeyHash(s,this.userId)}))}}Xs.ɵfac=function(e){return new(e||Xs)(s.Y36(G.BR),s.Y36(Xi.R),s.Y36(M.D),s.Y36(D.$),s.Y36(fe.o),s.Y36(A.UW),s.Y36(N.P),s.Y36(Oi.P),s.Y36(Y.d),s.Y36(p.F0),s.Y36(Ue.s),s.Y36(T._),s.Y36(p.gz),s.Y36(J.b),s.Y36(Ae.M),s.Y36(ki.t),s.Y36(Di.UK),s.Y36(_n.F),s.Y36(I.x),s.Y36(sn.d))},Xs.ɵdir=s.lG2({type:Xs,features:[s.qOj]});var eo=i(56945),to=i(33401);function io(e,t){1&e&&(s.TgZ(0,"div",8),s._uU(1,"\n          "),s._UZ(2,"i",9),s.ALo(3,"i18n"),s._uU(4),s.ALo(5,"i18n"),s.qZA()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(2),s.hij("\n          ",s.lcZ(5,4,"loading"),"\n        "))}function no(e,t){1&e&&(s.TgZ(0,"p"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n            ",s.lcZ(2,1,"orgPermissionsUpdatedMustSetPassword"),"\n          "))}function so(e,t){1&e&&(s._uU(0,"\n            "),s.TgZ(1,"p"),s._uU(2),s.ALo(3,"i18n"),s.qZA(),s._uU(4,"\n          ")),2&e&&(s.xp6(2),s.Oqu(s.lcZ(3,1,"orgRequiresYouToSetPassword")))}function oo(e,t){1&e&&(s.TgZ(0,"app-callout",31),s.ALo(1,"i18n"),s._uU(2),s.ALo(3,"i18n"),s.qZA()),2&e&&(s.s9C("title",s.lcZ(1,2,"resetPasswordPolicyAutoEnroll")),s.xp6(2),s.hij("\n            ",s.lcZ(3,4,"resetPasswordAutoEnrollInviteWarning"),"\n          "))}function ro(e,t){if(1&e&&(s.TgZ(0,"auth-password-callout",32),s._uU(1,"\n            "),s.qZA()),2&e){const e=s.oxw(2);s.Q6J("policy",e.enforcedPolicyOptions)}}const ao=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};function lo(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",10),s._uU(1,"\n          "),s.YNc(2,no,3,3,"p",11),s._uU(3,"\n\n          "),s.YNc(4,so,5,3,"ng-template",null,12,s.W1O),s._uU(6,"\n\n          "),s.YNc(7,oo,4,6,"app-callout",13),s._uU(8,"\n          "),s.TgZ(9,"div",14),s._uU(10,"\n            "),s.YNc(11,ro,2,1,"auth-password-callout",15),s._uU(12,"\n            "),s.TgZ(13,"label",16),s._uU(14),s.ALo(15,"i18n"),s.qZA(),s._uU(16,"\n            "),s.TgZ(17,"div",17),s._uU(18,"\n              "),s.TgZ(19,"div",18),s._uU(20,"\n                "),s.TgZ(21,"input",19),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.masterPassword=t)})),s.qZA(),s._uU(22,"\n                "),s.TgZ(23,"app-password-strength",20),s.NdJ("passwordStrengthResult",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.getStrengthResult(t))})),s._uU(24,"\n                "),s.qZA(),s._uU(25,"\n              "),s.qZA(),s._uU(26,"\n              "),s.TgZ(27,"div"),s._uU(28,"\n                "),s.TgZ(29,"button",21),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.togglePassword(!1))})),s.ALo(30,"i18n"),s._uU(31,"\n                  "),s._UZ(32,"i",22),s._uU(33,"\n                "),s.qZA(),s._uU(34,"\n                "),s._UZ(35,"div",23),s._uU(36,"\n              "),s.qZA(),s._uU(37,"\n            "),s.qZA(),s._uU(38,"\n            "),s.TgZ(39,"small",24),s._uU(40),s.ALo(41,"i18n"),s.qZA(),s._uU(42,"\n          "),s.qZA(),s._uU(43,"\n          "),s.TgZ(44,"div",14),s._uU(45,"\n            "),s.TgZ(46,"label",25),s._uU(47),s.ALo(48,"i18n"),s.qZA(),s._uU(49,"\n            "),s.TgZ(50,"div",17),s._uU(51,"\n              "),s.TgZ(52,"input",26),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.masterPasswordRetype=t)})),s.qZA(),s._uU(53,"\n              "),s.TgZ(54,"button",21),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.togglePassword(!0))})),s.ALo(55,"i18n"),s._uU(56,"\n                "),s._UZ(57,"i",22),s._uU(58,"\n              "),s.qZA(),s._uU(59,"\n            "),s.qZA(),s._uU(60,"\n          "),s.qZA(),s._uU(61,"\n          "),s.TgZ(62,"div",14),s._uU(63,"\n            "),s.TgZ(64,"label",27),s._uU(65),s.ALo(66,"i18n"),s.qZA(),s._uU(67,"\n            "),s.TgZ(68,"input",28),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.hint=t)})),s.qZA(),s._uU(69,"\n            "),s.TgZ(70,"small",24),s._uU(71),s.ALo(72,"i18n"),s.qZA(),s._uU(73,"\n          "),s.qZA(),s._uU(74,"\n          "),s._UZ(75,"hr"),s._uU(76,"\n          "),s.TgZ(77,"div",17),s._uU(78,"\n            "),s.TgZ(79,"button",29),s._uU(80,"\n              "),s._UZ(81,"i",9),s.ALo(82,"i18n"),s._uU(83,"\n              "),s.TgZ(84,"span"),s._uU(85),s.ALo(86,"i18n"),s.qZA(),s._uU(87,"\n            "),s.qZA(),s._uU(88,"\n            "),s.TgZ(89,"button",30),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.logOut())})),s._uU(90),s.ALo(91,"i18n"),s.qZA(),s._uU(92,"\n          "),s.qZA(),s._uU(93,"\n        "),s.qZA()}if(2&e){const e=s.MAs(5),t=s.oxw(),i=s.MAs(1);s.xp6(2),s.Q6J("ngIf",t.forceSetPasswordReason==t.ForceSetPasswordReason.TdeUserWithoutPasswordHasPasswordResetPermission)("ngIfElse",e),s.xp6(5),s.Q6J("ngIf",t.resetPasswordAutoEnroll),s.xp6(4),s.Q6J("ngIf",t.enforcedPolicyOptions),s.xp6(3),s.Oqu(s.lcZ(15,25,"masterPass")),s.xp6(7),s.s9C("type",t.showPassword?"text":"password"),s.Q6J("ngModel",t.masterPassword),s.xp6(2),s.Q6J("password",t.masterPassword)("email",t.email)("showText",!0),s.xp6(6),s.s9C("appA11yTitle",s.lcZ(30,27,"toggleVisibility")),s.xp6(3),s.Q6J("ngClass",s.WLB(45,ao,!t.showPassword,t.showPassword)),s.xp6(8),s.Oqu(s.lcZ(41,29,"masterPassDesc")),s.xp6(7),s.Oqu(s.lcZ(48,31,"reTypeMasterPass")),s.xp6(5),s.s9C("type",t.showPassword?"text":"password"),s.Q6J("ngModel",t.masterPasswordRetype),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(55,33,"toggleVisibility")),s.xp6(3),s.Q6J("ngClass",s.WLB(48,ao,!t.showPassword,t.showPassword)),s.xp6(8),s.Oqu(s.lcZ(66,35,"masterPassHint")),s.xp6(3),s.Q6J("ngModel",t.hint),s.xp6(3),s.Oqu(s.lcZ(72,37,"masterPassHintDesc")),s.xp6(8),s.Q6J("disabled",i.loading),s.xp6(2),s.s9C("title",s.lcZ(82,39,"loading")),s.xp6(4),s.Oqu(s.lcZ(86,41,"submit")),s.xp6(5),s.hij("\n              ",s.lcZ(91,43,"logOut"),"\n            ")}}class co extends Xs{}co.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(co)))(t||co)}}(),co.ɵcmp=s.Xpm({type:co,selectors:[["app-set-password"]],features:[s.qOj],decls:21,vars:6,consts:[["ngNativeValidate","","autocomplete","off",3,"appApiAction","ngSubmit"],["form",""],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],[1,"lead","text-center","mb-4"],[1,"card","d-block"],["class","card-body text-center",4,"ngIf"],["class","card-body",4,"ngIf"],[1,"card-body","text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],[1,"card-body"],[4,"ngIf","ngIfElse"],["defaultCardDesc",""],["type","warning",3,"title",4,"ngIf"],[1,"form-group"],[3,"policy",4,"ngIf"],["for","masterPassword"],[1,"d-flex"],[1,"w-100"],["id","masterPassword","name","MasterPasswordHash","required","","appInputVerbatim","",1,"text-monospace","form-control","mb-1",3,"type","ngModel","ngModelChange"],[3,"password","email","showText","passwordStrengthResult"],["type","button",1,"ml-1","btn","btn-link",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],[1,"progress-bar","invisible"],[1,"form-text","text-muted"],["for","masterPasswordRetype"],["id","masterPasswordRetype","name","MasterPasswordRetype","required","","appInputVerbatim","",1,"text-monospace","form-control",3,"type","ngModel","ngModelChange"],["for","hint"],["id","hint","type","text","name","Hint",1,"form-control",3,"ngModel","ngModelChange"],["type","submit",1,"btn","btn-primary","btn-block","btn-submit",3,"disabled"],["type","button",1,"btn","btn-outline-secondary","btn-block","ml-2","mt-0",3,"click"],["type","warning",3,"title"],[3,"policy"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n  "),s.TgZ(3,"div",2),s._uU(4,"\n    "),s.TgZ(5,"div",3),s._uU(6,"\n      "),s.TgZ(7,"p",4),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.TgZ(11,"div",5),s._uU(12,"\n        "),s.YNc(13,io,6,6,"div",6),s._uU(14,"\n        "),s.YNc(15,lo,94,51,"div",7),s._uU(16,"\n      "),s.qZA(),s._uU(17,"\n    "),s.qZA(),s._uU(18,"\n  "),s.qZA(),s._uU(19,"\n"),s.qZA(),s._uU(20,"\n")),2&e&&(s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,4,"setMasterPassword")),s.xp6(5),s.Q6J("ngIf",t.syncLoading),s.xp6(2),s.Q6J("ngIf",!t.syncLoading))},dependencies:[d.mk,d.O5,l.Fj,l.JJ,l.JL,l.Q7,l.On,l.F,ui.B,xe.b,Se.O,zi.b,eo.Z,to.e,ee.C],encapsulation:2});var uo=i(61374),po=i(45213),ho=i(94516),go=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class fo{constructor(e,t,i,n,s,o){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.userVerificationService=n,this.messagingService=s,this.logService=o}submit(){return go(this,void 0,void 0,(function*(){try{this.formPromise=this.userVerificationService.buildRequest(this.masterPassword).then((e=>this.apiService.postSecurityStamp(e))),yield this.formPromise,this.platformUtilsService.showToast("success",this.i18nService.t("sessionsDeauthorized"),this.i18nService.t("logBackIn")),this.messagingService.send("logout")}catch(e){this.logService.error(e)}}))}}fo.ɵfac=function(e){return new(e||fo)(s.Y36(Ue.s),s.Y36(M.D),s.Y36(N.P),s.Y36(nn.i),s.Y36(fe.o),s.Y36(_e.$))},fo.ɵcmp=s.Xpm({type:fo,selectors:[["app-deauthorize-sessions"]],decls:55,vars:24,consts:[["role","dialog","aria-modal","true","aria-labelledby","deAuthTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","deAuthTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["type","warning"],["ngDefaultControl","","name","secret",3,"ngModel","ngModelChange"],[1,"modal-footer"],["type","submit",1,"btn","btn-danger","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"]],template:function(e,t){if(1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"form",2,3),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(6,"\n      "),s.TgZ(7,"div",4),s._uU(8,"\n        "),s.TgZ(9,"h1",5),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n        "),s.TgZ(13,"button",6),s.ALo(14,"i18n"),s._uU(15,"\n          "),s.TgZ(16,"span",7),s._uU(17,"×"),s.qZA(),s._uU(18,"\n        "),s.qZA(),s._uU(19,"\n      "),s.qZA(),s._uU(20,"\n      "),s.TgZ(21,"div",8),s._uU(22,"\n        "),s.TgZ(23,"p"),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n        "),s.TgZ(27,"app-callout",9),s._uU(28),s.ALo(29,"i18n"),s.qZA(),s._uU(30,"\n        "),s.TgZ(31,"app-user-verification",10),s.NdJ("ngModelChange",(function(e){return t.masterPassword=e})),s._uU(32,"\n        "),s.qZA(),s._uU(33,"\n      "),s.qZA(),s._uU(34,"\n      "),s.TgZ(35,"div",11),s._uU(36,"\n        "),s.TgZ(37,"button",12),s._uU(38,"\n          "),s._UZ(39,"i",13),s.ALo(40,"i18n"),s._uU(41,"\n          "),s.TgZ(42,"span"),s._uU(43),s.ALo(44,"i18n"),s.qZA(),s._uU(45,"\n        "),s.qZA(),s._uU(46,"\n        "),s.TgZ(47,"button",14),s._uU(48),s.ALo(49,"i18n"),s.qZA(),s._uU(50,"\n      "),s.qZA(),s._uU(51,"\n    "),s.qZA(),s._uU(52,"\n  "),s.qZA(),s._uU(53,"\n"),s.qZA(),s._uU(54,"\n")),2&e){const e=s.MAs(5);s.xp6(4),s.Q6J("appApiAction",t.formPromise),s.xp6(6),s.Oqu(s.lcZ(11,10,"deauthorizeSessions")),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(14,12,"close")),s.xp6(11),s.Oqu(s.lcZ(25,14,"deauthorizeSessionsDesc")),s.xp6(4),s.Oqu(s.lcZ(29,16,"deauthorizeSessionsWarning")),s.xp6(3),s.Q6J("ngModel",t.masterPassword),s.xp6(6),s.Q6J("disabled",e.loading),s.xp6(2),s.s9C("title",s.lcZ(40,18,"loading")),s.xp6(4),s.Oqu(s.lcZ(44,20,"deauthorizeSessions")),s.xp6(5),s.hij("\n          ",s.lcZ(49,22,"close"),"\n        ")}},dependencies:[l.Fj,l.JJ,l.JL,l.On,l.F,ui.B,xe.b,Se.O,ho.W,ee.C],encapsulation:2});var mo=i(37408),vo=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class yo{constructor(e,t,i,n,s){this.i18nService=e,this.platformUtilsService=t,this.formBuilder=i,this.accountApiService=n,this.logService=s,this.deleteForm=this.formBuilder.group({verification:void 0})}submit(){return vo(this,void 0,void 0,(function*(){try{const e=this.deleteForm.get("verification").value;this.formPromise=this.accountApiService.deleteAccount(e),yield this.formPromise,this.platformUtilsService.showToast("success",this.i18nService.t("accountDeleted"),this.i18nService.t("accountDeletedDesc"))}catch(e){this.logService.error(e)}}))}}yo.ɵfac=function(e){return new(e||yo)(s.Y36(M.D),s.Y36(N.P),s.Y36(l.qu),s.Y36(mo.X),s.Y36(_e.$))},yo.ɵcmp=s.Xpm({type:yo,selectors:[["app-delete-account"]],decls:55,vars:24,consts:[["role","dialog","aria-modal","true","aria-labelledby","deleteAccountTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","formGroup","ngSubmit"],["form",""],[1,"modal-header"],["id","deleteAccountTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["type","warning"],["ngDefaultControl","","formControlName","verification","name","verification"],[1,"modal-footer"],["type","submit",1,"btn","btn-danger","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"]],template:function(e,t){if(1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"form",2,3),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(6,"\n      "),s.TgZ(7,"div",4),s._uU(8,"\n        "),s.TgZ(9,"h1",5),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n        "),s.TgZ(13,"button",6),s.ALo(14,"i18n"),s._uU(15,"\n          "),s.TgZ(16,"span",7),s._uU(17,"×"),s.qZA(),s._uU(18,"\n        "),s.qZA(),s._uU(19,"\n      "),s.qZA(),s._uU(20,"\n      "),s.TgZ(21,"div",8),s._uU(22,"\n        "),s.TgZ(23,"p"),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n        "),s.TgZ(27,"app-callout",9),s._uU(28),s.ALo(29,"i18n"),s.qZA(),s._uU(30,"\n        "),s.TgZ(31,"app-user-verification",10),s._uU(32,"\n        "),s.qZA(),s._uU(33,"\n      "),s.qZA(),s._uU(34,"\n      "),s.TgZ(35,"div",11),s._uU(36,"\n        "),s.TgZ(37,"button",12),s._uU(38,"\n          "),s._UZ(39,"i",13),s.ALo(40,"i18n"),s._uU(41,"\n          "),s.TgZ(42,"span"),s._uU(43),s.ALo(44,"i18n"),s.qZA(),s._uU(45,"\n        "),s.qZA(),s._uU(46,"\n        "),s.TgZ(47,"button",14),s._uU(48),s.ALo(49,"i18n"),s.qZA(),s._uU(50,"\n      "),s.qZA(),s._uU(51,"\n    "),s.qZA(),s._uU(52,"\n  "),s.qZA(),s._uU(53,"\n"),s.qZA(),s._uU(54,"\n")),2&e){const e=s.MAs(5);s.xp6(4),s.Q6J("appApiAction",t.formPromise)("formGroup",t.deleteForm),s.xp6(6),s.Oqu(s.lcZ(11,10,"deleteAccount")),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(14,12,"close")),s.xp6(11),s.Oqu(s.lcZ(25,14,"deleteAccountDesc")),s.xp6(4),s.Oqu(s.lcZ(29,16,"deleteAccountWarning")),s.xp6(9),s.Q6J("disabled",e.loading),s.xp6(2),s.s9C("title",s.lcZ(40,18,"loading")),s.xp6(4),s.Oqu(s.lcZ(44,20,"deleteAccount")),s.xp6(5),s.hij("\n          ",s.lcZ(49,22,"close"),"\n        ")}},dependencies:[l.Fj,l.JJ,l.JL,l.sg,l.u,ui.B,xe.b,Se.O,ho.W,ee.C],encapsulation:2});var wo=i(31978),bo=i(48103);class Uo extends ji.Y{}class _o extends Uo{}var Ao=i(46246),Zo=i(36338),xo=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function So(e,t){1&e&&(s.TgZ(0,"app-callout",9),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n    ",s.lcZ(2,1,"changeEmailTwoFactorWarning"),"\n  "))}function To(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n    "),s._UZ(2,"hr"),s._uU(3,"\n    "),s.TgZ(4,"p"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n    "),s.TgZ(8,"app-callout",9),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n\n    "),s.TgZ(12,"div",10),s._uU(13,"\n      "),s.TgZ(14,"bit-form-field"),s._uU(15,"\n        "),s.TgZ(16,"bit-label"),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n        "),s._UZ(20,"input",11),s._uU(21,"\n      "),s.qZA(),s._uU(22,"\n    "),s.qZA(),s._uU(23,"\n  "),s.BQk()),2&e){const e=s.oxw();s.xp6(5),s.Oqu(s.xi3(6,3,"changeEmailDesc",e.formGroup.controls.step1.value.newEmail)),s.xp6(4),s.Oqu(s.lcZ(10,6,"loggedOutWarning")),s.xp6(8),s.Oqu(s.lcZ(18,8,"code"))}}function Co(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",12),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.reset())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n    ",s.lcZ(2,1,"cancel"),"\n  "))}class Oo{constructor(e,t,i,n,s,o,r,a,c){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.cryptoService=n,this.messagingService=s,this.logService=o,this.stateService=r,this.formBuilder=a,this.kdfConfigService=c,this.tokenSent=!1,this.showTwoFactorEmailWarning=!1,this.formGroup=this.formBuilder.group({step1:this.formBuilder.group({masterPassword:["",[l.kI.required]],newEmail:["",[l.kI.required,l.kI.email]]}),token:[{value:"",disabled:!0},[l.kI.required]]}),this.submit=()=>xo(this,void 0,void 0,(function*(){if(this.formGroup.controls.step1.markAllAsTouched(),this.tokenSent&&this.formGroup.controls.token.markAllAsTouched(),this.formGroup.invalid)return;const e=this.formGroup.controls.step1.value,t=e.newEmail.trim().toLowerCase();if(this.tokenSent){const n=new _o;n.token=this.formGroup.value.token,n.newEmail=t,n.masterPasswordHash=yield this.cryptoService.hashMasterKey(e.masterPassword,yield this.cryptoService.getOrDeriveMasterKey(e.masterPassword));const s=yield this.kdfConfigService.getKdfConfig(),o=yield this.cryptoService.makeMasterKey(e.masterPassword,t,s);n.newMasterPasswordHash=yield this.cryptoService.hashMasterKey(e.masterPassword,o);const r=yield this.cryptoService.encryptUserKeyWithMasterKey(o);n.key=r[1].encryptedString;try{yield this.apiService.postEmail(n),this.reset(),this.platformUtilsService.showToast("success",this.i18nService.t("emailChanged"),this.i18nService.t("logBackIn")),this.messagingService.send("logout")}catch(i){this.logService.error(i)}}else{const n=new Uo;n.newEmail=t,n.masterPasswordHash=yield this.cryptoService.hashMasterKey(e.masterPassword,yield this.cryptoService.getOrDeriveMasterKey(e.masterPassword));try{yield this.apiService.postEmailToken(n),this.activateStep2()}catch(i){this.logService.error(i)}}}))}ngOnInit(){return xo(this,void 0,void 0,(function*(){const e=yield this.apiService.getTwoFactorProviders();this.showTwoFactorEmailWarning=e.data.some((e=>e.type===bo.L.Email&&e.enabled))}))}activateStep2(){this.formGroup.controls.step1.disable(),this.formGroup.controls.token.enable(),this.tokenSent=!0}reset(){this.formGroup.reset(),this.formGroup.controls.step1.enable(),this.formGroup.controls.token.disable(),this.tokenSent=!1}}Oo.ɵfac=function(e){return new(e||Oo)(s.Y36(Ue.s),s.Y36(M.D),s.Y36(N.P),s.Y36(D.$),s.Y36(fe.o),s.Y36(_e.$),s.Y36(J.b),s.Y36(l.qu),s.Y36(sn.d))},Oo.ɵcmp=s.Xpm({type:Oo,selectors:[["app-change-email"]],decls:36,vars:14,consts:[[3,"formGroup","bitSubmit"],["type","warning",4,"ngIf"],["formGroupName","step1",1,"tw-w-1/2","tw-pr-2"],["id","change-email_input_masterPassword","bitInput","","type","password","formControlName","masterPassword"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],["id","change-email_input_newEmail","bitInput","","type","email","formControlName","newEmail","inputmode","email"],[4,"ngIf"],["type","submit","bitButton","","buttonType","primary","bitFormButton",""],["type","button","bitButton","",3,"click",4,"ngIf"],["type","warning"],[1,"tw-w-1/2","tw-pr-2"],["id","change-email_input_token","bitInput","","type","text","formControlName","token"],["type","button","bitButton","",3,"click"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0),s._uU(1,"\n  "),s.YNc(2,So,3,3,"app-callout",1),s._uU(3,"\n\n  "),s.TgZ(4,"div",2),s._uU(5,"\n    "),s.TgZ(6,"bit-form-field"),s._uU(7,"\n      "),s.TgZ(8,"bit-label"),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n      "),s._UZ(12,"input",3),s._uU(13,"\n      "),s._UZ(14,"button",4),s._uU(15,"\n    "),s.qZA(),s._uU(16,"\n    "),s.TgZ(17,"bit-form-field"),s._uU(18,"\n      "),s.TgZ(19,"bit-label"),s._uU(20),s.ALo(21,"i18n"),s.qZA(),s._uU(22,"\n      "),s._UZ(23,"input",5),s._uU(24,"\n    "),s.qZA(),s._uU(25,"\n  "),s.qZA(),s._uU(26,"\n\n  "),s.YNc(27,To,24,10,"ng-container",6),s._uU(28,"\n\n  "),s.TgZ(29,"button",7),s._uU(30),s.ALo(31,"i18n"),s.qZA(),s._uU(32,"\n  "),s.YNc(33,Co,3,3,"button",8),s._uU(34,"\n"),s.qZA(),s._uU(35,"\n")),2&e&&(s.Q6J("formGroup",t.formGroup)("bitSubmit",t.submit),s.xp6(2),s.Q6J("ngIf",t.showTwoFactorEmailWarning),s.xp6(7),s.Oqu(s.lcZ(10,8,"masterPass")),s.xp6(11),s.Oqu(s.lcZ(21,10,"newEmail")),s.xp6(7),s.Q6J("ngIf",t.tokenSent),s.xp6(3),s.hij("\n    ",s.lcZ(31,12,t.tokenSent?"changeEmail":"continue"),"\n  "),s.xp6(3),s.Q6J("ngIf",t.tokenSent))},dependencies:[d.O5,l._Y,l.Fj,l.JJ,l.JL,l.sg,l.u,l.x0,Se.O,Ao.b,Zo.u,Te.r,Oe.d,ke.G,As.w,Zs.e,Pe.u,xs.Q,ee.C],encapsulation:2});var ko=i(99877),Po=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const qo=["deauthorizeSessionsTemplate"],Io=["purgeVaultTemplate"],Mo=["deleteAccountTemplate"];function No(e,t){1&e&&(s.TgZ(0,"div",7),s._uU(1,"\n    "),s.TgZ(2,"h1",8),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n    "),s._UZ(6,"app-change-email"),s._uU(7,"\n  "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,1,"changeEmail")))}function Lo(e,t){}function Do(e,t){}function Eo(e,t){}function Fo(e,t){}function Ro(e,t){}class Jo{constructor(e,t){this.modalService=e,this.userVerificationService=t,this.showChangeEmail=!0}ngOnInit(){return Po(this,void 0,void 0,(function*(){this.showChangeEmail=yield this.userVerificationService.hasMasterPassword()}))}deauthorizeSessions(){return Po(this,void 0,void 0,(function*(){yield this.modalService.openViewRef(fo,this.deauthModalRef)}))}purgeVault(){return Po(this,void 0,void 0,(function*(){yield this.modalService.openViewRef(po.$,this.purgeModalRef)}))}deleteAccount(){return Po(this,void 0,void 0,(function*(){yield this.modalService.openViewRef(yo,this.deleteModalRef)}))}}Jo.ɵfac=function(e){return new(e||Jo)(s.Y36(uo.Z),s.Y36(nn.i))},Jo.ɵcmp=s.Xpm({type:Jo,selectors:[["app-account"]],viewQuery:function(e,t){if(1&e&&(s.Gf(qo,7,s.s_b),s.Gf(Io,7,s.s_b),s.Gf(Mo,7,s.s_b)),2&e){let e;s.iGM(e=s.CRH())&&(t.deauthModalRef=e.first),s.iGM(e=s.CRH())&&(t.purgeModalRef=e.first),s.iGM(e=s.CRH())&&(t.deleteModalRef=e.first)}},decls:39,vars:10,consts:[["class","tw-mt-16",4,"ngIf"],["type","button","bitButton","","buttonType","danger",3,"click"],["deauthorizeSessionsTemplate",""],["purgeVaultTemplate",""],["deleteAccountTemplate",""],["viewUserApiKeyTemplate",""],["rotateUserApiKeyTemplate",""],[1,"tw-mt-16"],["bitTypography","h1"]],template:function(e,t){1&e&&(s._UZ(0,"app-header"),s._uU(1,"\n\n"),s.TgZ(2,"bit-container"),s._uU(3,"\n  "),s._UZ(4,"app-profile"),s._uU(5,"\n\n  "),s.YNc(6,No,8,3,"div",0),s._uU(7,"\n\n  "),s.TgZ(8,"app-danger-zone"),s._uU(9,"\n    "),s.TgZ(10,"button",1),s.NdJ("click",(function(){return t.deauthorizeSessions()})),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n    "),s.TgZ(14,"button",1),s.NdJ("click",(function(){return t.purgeVault()})),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n    "),s.TgZ(18,"button",1),s.NdJ("click",(function(){return t.deleteAccount()})),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n  "),s.qZA(),s._uU(22,"\n\n  "),s.YNc(23,Lo,0,0,"ng-template",null,2,s.W1O),s._uU(25,"\n  "),s.YNc(26,Do,0,0,"ng-template",null,3,s.W1O),s._uU(28,"\n  "),s.YNc(29,Eo,0,0,"ng-template",null,4,s.W1O),s._uU(31,"\n  "),s.YNc(32,Fo,0,0,"ng-template",null,5,s.W1O),s._uU(34,"\n  "),s.YNc(35,Ro,0,0,"ng-template",null,6,s.W1O),s._uU(37,"\n"),s.qZA(),s._uU(38,"\n")),2&e&&(s.xp6(6),s.Q6J("ngIf",t.showChangeEmail),s.xp6(5),s.hij("\n      ",s.lcZ(12,4,"deauthorizeSessions"),"\n    "),s.xp6(4),s.hij("\n      ",s.lcZ(16,6,"purgeVault"),"\n    "),s.xp6(4),s.hij("\n      ",s.lcZ(20,8,"deleteAccount"),"\n    "))},dependencies:[d.O5,Te.r,si.e,On.t,wo.q,oi.k,Oo,ko.d,ee.C],encapsulation:2});var zo,Yo=i(19576),Ko=i(76736),Bo=i(10945);!function(e){e[e.View=0]="View",e[e.Takeover=1]="Takeover"}(zo||(zo={}));class Qo{}var Go,jo=i(28783),Vo=i(1113),$o=i(29465),Ho=i(18362),Wo=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e.Confirmed="confirmed"}(Go||(Go={}));class Xo{constructor(e,t,i,n,s,o,r){this.params=e,this.formBuilder=t,this.apiService=i,this.cryptoService=n,this.organizationManagementPreferencesService=s,this.logService=o,this.dialogRef=r,this.loading=!0,this.confirmForm=this.formBuilder.group({dontAskAgain:[!1]}),this.submit=()=>Wo(this,void 0,void 0,(function*(){if(!this.loading){this.confirmForm.get("dontAskAgain").value&&(yield this.organizationManagementPreferencesService.autoConfirmFingerPrints.set(!0));try{this.dialogRef.close(Go.Confirmed)}catch(e){this.logService.error(e)}}}))}ngOnInit(){return Wo(this,void 0,void 0,(function*(){try{const e=yield this.apiService.getUserPublicKey(this.params.userId);if(null!=e){const t=Ci.c.fromB64ToArray(e.publicKey),i=yield this.cryptoService.getFingerprint(this.params.userId,t);null!=i&&(this.fingerprint=i.join("-"))}}catch(e){this.logService.error(e)}this.loading=!1}))}static open(e,t){return e.open(Xo,t)}}Xo.ɵfac=function(e){return new(e||Xo)(s.Y36(jo.Kt),s.Y36(l.qu),s.Y36(Ue.s),s.Y36(D.$),s.Y36(Vo.R),s.Y36(_e.$),s.Y36(jo.zj))},Xo.ɵcmp=s.Xpm({type:Xo,selectors:[["emergency-access-confirm"]],decls:53,vars:23,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle",""],[1,"tw-text-muted"],["bitDialogContent",""],["bitTypography","body1"],["bitLink","","href","https://bitwarden.com/help/fingerprint-phrase/","target","_blank","rel","noreferrer"],["type","checkbox","bitCheckbox","","formControlName","dontAskAgain"],["bitDialogFooter",""],["type","submit","buttonType","primary","bitButton","","bitFormButton",""],["bitButton","","bitFormButton","","buttonType","secondary","type","button","bitDialogClose",""]],template:function(e,t){1&e&&(s.TgZ(0,"form",0),s._uU(1,"\n  "),s.TgZ(2,"bit-dialog",1),s._uU(3,"\n    "),s.TgZ(4,"span",2),s._uU(5),s.ALo(6,"i18n"),s.TgZ(7,"small",3),s._uU(8),s.qZA(),s._uU(9,"\n    "),s.qZA(),s._uU(10,"\n    "),s.TgZ(11,"div",4),s._uU(12,"\n      "),s.TgZ(13,"p",5),s._uU(14),s.ALo(15,"i18n"),s.TgZ(16,"a",6),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n      "),s.qZA(),s._uU(20,"\n      "),s.TgZ(21,"p",5),s._uU(22,"\n        "),s.TgZ(23,"code"),s._uU(24),s.qZA(),s._uU(25,"\n      "),s.qZA(),s._uU(26,"\n\n      "),s.TgZ(27,"bit-form-control"),s._uU(28,"\n        "),s._UZ(29,"input",7),s._uU(30,"\n        "),s.TgZ(31,"bit-label"),s._uU(32),s.ALo(33,"i18n"),s.qZA(),s._uU(34,"\n      "),s.qZA(),s._uU(35,"\n    "),s.qZA(),s._uU(36,"\n    "),s.TgZ(37,"div",8),s._uU(38,"\n      "),s.TgZ(39,"button",9),s._uU(40,"\n        "),s.TgZ(41,"span"),s._uU(42),s.ALo(43,"i18n"),s.qZA(),s._uU(44,"\n      "),s.qZA(),s._uU(45,"\n      "),s.TgZ(46,"button",10),s._uU(47),s.ALo(48,"i18n"),s.qZA(),s._uU(49,"\n    "),s.qZA(),s._uU(50,"\n  "),s.qZA(),s._uU(51,"\n"),s.qZA(),s._uU(52,"\n")),2&e&&(s.Q6J("formGroup",t.confirmForm)("bitSubmit",t.submit),s.xp6(2),s.Q6J("loading",t.loading),s.xp6(3),s.hij("\n      ",s.lcZ(6,11,"confirmUser"),"\n      "),s.xp6(3),s.Oqu(t.params.name),s.xp6(6),s.hij("\n        ",s.lcZ(15,13,"fingerprintEnsureIntegrityVerify"),"\n        "),s.xp6(3),s.hij("\n          ",s.lcZ(18,15,"learnMore"),""),s.xp6(7),s.Oqu(t.fingerprint),s.xp6(8),s.hij(" ",s.lcZ(33,17,"dontAskFingerprintAgain"),""),s.xp6(10),s.Oqu(s.lcZ(43,19,"confirm")),s.xp6(5),s.hij("\n        ",s.lcZ(48,21,"cancel"),"\n      "))},dependencies:[l._Y,l.Wl,l.JJ,l.JL,l.sg,l.u,Ao.b,Zo.u,Te.r,Sn.b,$o.a,Ho.f,Tn.A,Pe.u,Ss.r,On.t,ee.C],encapsulation:2});var er,tr=i(21500),ir=i(66079),nr=i(28975),sr=i(30469),or=i(55039),rr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function ar(e,t){1&e&&s._UZ(0,"app-premium-badge")}function lr(e,t){if(1&e&&(s.TgZ(0,"small",19),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.Oqu(e.params.name)}}function cr(e,t){1&e&&(s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"p",20),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n        "),s.TgZ(6,"bit-form-field"),s._uU(7,"\n          "),s.TgZ(8,"bit-label"),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n          "),s._UZ(12,"input",21),s._uU(13,"\n        "),s.qZA(),s._uU(14,"\n      "),s.BQk()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,2,"inviteEmergencyContactDesc")),s.xp6(6),s.Oqu(s.lcZ(10,4,"email")))}function ur(e,t){if(1&e&&s._UZ(0,"bit-option",22),2&e){const e=t.$implicit;s.Q6J("value",e.value)("label",e.name)}}function dr(e,t){if(1&e&&(s._UZ(0,"button",23),s.ALo(1,"i18n")),2&e){const e=s.oxw();s.s9C("appA11yTitle",s.lcZ(1,2,"delete")),s.Q6J("bitAction",e.delete)}}!function(e){e.Saved="saved",e.Canceled="canceled",e.Deleted="deleted"}(er||(er={}));class pr{constructor(e,t,i,n,s,o,r){this.params=e,this.formBuilder=t,this.emergencyAccessService=i,this.i18nService=n,this.platformUtilsService=s,this.logService=o,this.dialogRef=r,this.loading=!0,this.readOnly=!1,this.editMode=!1,this.type=zo.View,this.emergencyAccessType=zo,this.addEditForm=this.formBuilder.group({email:["",[l.kI.email,l.kI.required]],emergencyAccessType:[this.emergencyAccessType.View],waitTime:[{value:null,disabled:this.readOnly},[l.kI.required]]}),this.submit=()=>rr(this,void 0,void 0,(function*(){if(this.addEditForm.invalid)this.addEditForm.markAllAsTouched();else try{this.editMode?yield this.emergencyAccessService.update(this.params.emergencyAccessId,this.addEditForm.value.emergencyAccessType,this.addEditForm.value.waitTime):yield this.emergencyAccessService.invite(this.addEditForm.value.email,this.addEditForm.value.emergencyAccessType,this.addEditForm.value.waitTime),this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode?"editedUserId":"invitedUsers",this.params.name)),this.dialogRef.close(er.Saved)}catch(e){this.logService.error(e)}})),this.delete=()=>rr(this,void 0,void 0,(function*(){this.dialogRef.close(er.Deleted)}))}ngOnInit(){return rr(this,void 0,void 0,(function*(){if(this.editMode=this.loading=null!=this.params.emergencyAccessId,this.waitTimes=[{name:this.i18nService.t("oneDay"),value:1},{name:this.i18nService.t("days","2"),value:2},{name:this.i18nService.t("days","7"),value:7},{name:this.i18nService.t("days","14"),value:14},{name:this.i18nService.t("days","30"),value:30},{name:this.i18nService.t("days","90"),value:90}],this.editMode){this.title=this.i18nService.t("editEmergencyContact");try{const e=yield this.emergencyAccessService.getEmergencyAccess(this.params.emergencyAccessId);this.addEditForm.patchValue({email:e.email,waitTime:e.waitTimeDays,emergencyAccessType:e.type})}catch(e){this.logService.error(e)}}else this.title=this.i18nService.t("inviteEmergencyContact"),this.addEditForm.patchValue({waitTime:this.waitTimes[2].value});this.loading=!1}))}}pr.open=(e,t)=>e.open(pr,t),pr.ɵfac=function(e){return new(e||pr)(s.Y36(jo.Kt),s.Y36(l.qu),s.Y36(Ko.d),s.Y36(M.D),s.Y36(N.P),s.Y36(_e.$),s.Y36(jo.zj))},pr.ɵcmp=s.Xpm({type:pr,selectors:[["emergency-access-add-edit"]],decls:82,vars:43,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle",""],[4,"ngIf"],["class","tw-text-muted",4,"ngIf"],["bitDialogContent",""],["formControlName","emergencyAccessType",3,"block"],["target","_blank","rel","noreferrer","bitLink","","linkType","primary","href","https://bitwarden.com/help/emergency-access/#user-access",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["id","emergencyTypeView",3,"value"],["id","emergencyTypeTakeover",3,"value"],[1,"tw-w-1/2","tw-relative","tw-px-2.5"],["formControlName","waitTime"],[3,"value","label",4,"ngFor","ngForOf"],[1,"tw-text-sm"],["bitDialogFooter",""],["type","submit","buttonType","primary","bitButton","","bitFormButton","",3,"disabled"],["bitButton","","bitFormButton","","buttonType","secondary","type","button","bitDialogClose",""],["type","button","bitFormButton","","class","tw-ml-auto","bitIconButton","bwi-trash","buttonType","danger",3,"bitAction","appA11yTitle",4,"ngIf"],[1,"tw-text-muted"],["bitTypography","body1"],["bitInput","","formControlName","email"],[3,"value","label"],["type","button","bitFormButton","","bitIconButton","bwi-trash","buttonType","danger",1,"tw-ml-auto",3,"bitAction","appA11yTitle"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0),s._uU(1,"\n  "),s.TgZ(2,"bit-dialog",1),s._uU(3,"\n    "),s.TgZ(4,"span",2),s._uU(5,"\n      "),s.YNc(6,ar,1,0,"app-premium-badge",3),s._uU(7),s.YNc(8,lr,2,1,"small",4),s._uU(9,"\n    "),s.qZA(),s._uU(10,"\n    "),s.ynx(11,5),s._uU(12,"\n      "),s.YNc(13,cr,15,6,"ng-container",3),s._uU(14,"\n      "),s.TgZ(15,"bit-radio-group",6),s._uU(16,"\n        "),s.TgZ(17,"bit-label"),s._uU(18),s.ALo(19,"i18n"),s.TgZ(20,"a",7),s.ALo(21,"i18n"),s._uU(22,"\n            "),s._UZ(23,"i",8),s._uU(24,"\n          "),s.qZA(),s._uU(25,"\n        "),s.qZA(),s._uU(26,"\n        "),s.TgZ(27,"bit-radio-button",9),s._uU(28,"\n          "),s.TgZ(29,"bit-label"),s._uU(30),s.ALo(31,"i18n"),s.qZA(),s._uU(32,"\n          "),s.TgZ(33,"bit-hint"),s._uU(34),s.ALo(35,"i18n"),s.qZA(),s._uU(36,"\n        "),s.qZA(),s._uU(37,"\n\n        "),s.TgZ(38,"bit-radio-button",10),s._uU(39,"\n          "),s.TgZ(40,"bit-label"),s._uU(41),s.ALo(42,"i18n"),s.qZA(),s._uU(43,"\n          "),s.TgZ(44,"bit-hint"),s._uU(45),s.ALo(46,"i18n"),s.qZA(),s._uU(47,"\n        "),s.qZA(),s._uU(48,"\n      "),s.qZA(),s._uU(49,"\n\n      "),s.TgZ(50,"bit-form-field",11),s._uU(51,"\n        "),s.TgZ(52,"bit-label"),s._uU(53),s.ALo(54,"i18n"),s.qZA(),s._uU(55,"\n        "),s.TgZ(56,"bit-select",12),s._uU(57,"\n          "),s.YNc(58,ur,1,2,"bit-option",13),s._uU(59,"\n        "),s.qZA(),s._uU(60,"\n        "),s.TgZ(61,"bit-hint",14),s._uU(62),s.ALo(63,"i18n"),s.qZA(),s._uU(64,"\n      "),s.qZA(),s._uU(65,"\n    "),s.BQk(),s._uU(66,"\n    "),s.ynx(67,15),s._uU(68,"\n      "),s.TgZ(69,"button",16),s._uU(70),s.ALo(71,"i18n"),s.qZA(),s._uU(72,"\n      "),s.TgZ(73,"button",17),s._uU(74),s.ALo(75,"i18n"),s.qZA(),s._uU(76,"\n      "),s.YNc(77,dr,2,4,"button",18),s._uU(78,"\n    "),s.BQk(),s._uU(79,"\n  "),s.qZA(),s._uU(80,"\n"),s.qZA(),s._uU(81,"\n")),2&e&&(s.Q6J("formGroup",t.addEditForm)("bitSubmit",t.submit),s.xp6(2),s.Q6J("loading",t.loading),s.xp6(4),s.Q6J("ngIf",t.readOnly),s.xp6(1),s.hij("\n      ",t.title,"\n      "),s.xp6(1),s.Q6J("ngIf",t.params.name),s.xp6(5),s.Q6J("ngIf",!t.editMode),s.xp6(2),s.Q6J("block",!0),s.xp6(3),s.hij("\n          ",s.lcZ(19,23,"userAccess"),"\n          "),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(21,25,"learnMore")),s.xp6(7),s.Q6J("value",t.emergencyAccessType.View),s.xp6(3),s.Oqu(s.lcZ(31,27,"view")),s.xp6(4),s.Oqu(s.lcZ(35,29,"viewDesc")),s.xp6(4),s.Q6J("value",t.emergencyAccessType.Takeover),s.xp6(3),s.Oqu(s.lcZ(42,31,"takeover")),s.xp6(4),s.Oqu(s.lcZ(46,33,"takeoverDesc")),s.xp6(8),s.Oqu(s.lcZ(54,35,"waitTime")),s.xp6(5),s.Q6J("ngForOf",t.waitTimes),s.xp6(4),s.Oqu(s.lcZ(63,37,"waitTimeDesc")),s.xp6(7),s.Q6J("disabled",t.readOnly),s.xp6(1),s.hij("\n        ",s.lcZ(71,39,"save"),"\n      "),s.xp6(4),s.hij("\n        ",s.lcZ(75,41,"cancel"),"\n      "),s.xp6(3),s.Q6J("ngIf",t.editMode))},dependencies:[d.sg,d.O5,l._Y,l.Fj,l.JJ,l.JL,l.sg,l.u,ui.B,xn.Q,Ao.b,Zo.u,Te.r,$o.a,Ho.f,Oe.d,ke.G,Pe.u,Cn.M,xs.Q,Ss.r,tr._,ir.w,nr.H,sr.x,On.t,or.R,ee.C],encapsulation:2});var hr,gr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function fr(e,t){if(1&e&&(s.TgZ(0,"small",17),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.Oqu(e.params.name)}}function mr(e,t){if(1&e&&(s.TgZ(0,"auth-password-callout",18),s._uU(1,"\n      "),s.qZA()),2&e){const e=s.oxw();s.Q6J("policy",e.enforcedPolicyOptions)}}!function(e){e.Done="done"}(hr||(hr={}));class vr extends Hs{constructor(e,t,i,n,s,o,r,a,c,u,d,p,h,g){super(i,n,s,r,a,c,o,p,g),this.params=e,this.formBuilder=t,this.emergencyAccessService=u,this.logService=d,this.dialogRef=h,this.takeoverForm=this.formBuilder.group({masterPassword:["",[l.kI.required]],masterPasswordRetype:["",[l.kI.required]]}),this.submit=()=>gr(this,void 0,void 0,(function*(){if(this.takeoverForm.invalid)this.takeoverForm.markAllAsTouched();else if(this.masterPassword=this.takeoverForm.get("masterPassword").value,this.masterPasswordRetype=this.takeoverForm.get("masterPasswordRetype").value,yield this.strongPassword()){try{yield this.emergencyAccessService.takeover(this.params.emergencyAccessId,this.masterPassword,this.params.email)}catch(e){this.logService.error(e),this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("unexpectedError"))}this.dialogRef.close(hr.Done)}}))}ngOnInit(){return gr(this,void 0,void 0,(function*(){const e=yield this.emergencyAccessService.getGrantorPolicies(this.params.emergencyAccessId);this.policyService.masterPasswordPolicyOptions$(e).pipe((0,g.R)(this.destroy$)).subscribe((e=>this.enforcedPolicyOptions=e))}))}ngOnDestroy(){super.ngOnDestroy()}}vr.open=(e,t)=>e.open(vr,t),vr.ɵfac=function(e){return new(e||vr)(s.Y36(jo.Kt),s.Y36(l.qu),s.Y36(M.D),s.Y36(D.$),s.Y36(fe.o),s.Y36(J.b),s.Y36(A.UW),s.Y36(N.P),s.Y36(Y.d),s.Y36(Ko.d),s.Y36(_e.$),s.Y36(I.x),s.Y36(jo.zj),s.Y36(sn.d))},vr.ɵcmp=s.Xpm({type:vr,selectors:[["emergency-access-takeover"]],inputs:{kdf:"kdf",kdfIterations:"kdfIterations"},features:[s.qOj],decls:66,vars:25,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large"],["bitDialogTitle",""],["class","tw-text-muted",4,"ngIf"],["bitDialogContent",""],["type","warning"],[3,"policy",4,"ngIf"],[1,"tw-w-full","tw-flex","tw-gap-4"],[1,"tw-relative","tw-flex-1"],["disableMargin","",1,"tw-mb-2"],["bitInput","","type","password","autocomplete","new-password","formControlName","masterPassword"],["type","button","bitSuffix","","bitIconButton","","bitPasswordInputToggle",""],[3,"password","email","showText","passwordStrengthResult"],["bitInput","","type","password","autocomplete","new-password","formControlName","masterPasswordRetype"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""],[1,"tw-text-muted"],[3,"policy"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0),s._uU(1,"\n  "),s.TgZ(2,"bit-dialog",1),s._uU(3,"\n    "),s.TgZ(4,"span",2),s._uU(5),s.ALo(6,"i18n"),s.YNc(7,fr,2,1,"small",3),s._uU(8,"\n    "),s.qZA(),s._uU(9,"\n    "),s.TgZ(10,"div",4),s._uU(11,"\n      "),s.TgZ(12,"app-callout",5),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n      "),s.YNc(16,mr,2,1,"auth-password-callout",6),s._uU(17,"\n      "),s.TgZ(18,"div",7),s._uU(19,"\n        "),s.TgZ(20,"div",8),s._uU(21,"\n          "),s.TgZ(22,"bit-form-field",9),s._uU(23,"\n            "),s.TgZ(24,"bit-label"),s._uU(25),s.ALo(26,"i18n"),s.qZA(),s._uU(27,"\n            "),s._UZ(28,"input",10),s._uU(29,"\n            "),s._UZ(30,"button",11),s._uU(31,"\n          "),s.qZA(),s._uU(32,"\n          "),s.TgZ(33,"app-password-strength",12),s.NdJ("passwordStrengthResult",(function(e){return t.getStrengthResult(e)})),s._uU(34,"\n          "),s.qZA(),s._uU(35,"\n        "),s.qZA(),s._uU(36,"\n        "),s.TgZ(37,"div",8),s._uU(38,"\n          "),s.TgZ(39,"bit-form-field",9),s._uU(40,"\n            "),s.TgZ(41,"bit-label"),s._uU(42),s.ALo(43,"i18n"),s.qZA(),s._uU(44,"\n            "),s._UZ(45,"input",13),s._uU(46,"\n            "),s._UZ(47,"button",11),s._uU(48,"\n          "),s.qZA(),s._uU(49,"\n        "),s.qZA(),s._uU(50,"\n      "),s.qZA(),s._uU(51,"\n    "),s.qZA(),s._uU(52,"\n    "),s.TgZ(53,"div",14),s._uU(54,"\n      "),s.TgZ(55,"button",15),s._uU(56),s.ALo(57,"i18n"),s.qZA(),s._uU(58,"\n      "),s.TgZ(59,"button",16),s._uU(60),s.ALo(61,"i18n"),s.qZA(),s._uU(62,"\n    "),s.qZA(),s._uU(63,"\n  "),s.qZA(),s._uU(64,"\n"),s.qZA(),s._uU(65,"\n")),2&e&&(s.Q6J("formGroup",t.takeoverForm)("bitSubmit",t.submit),s.xp6(5),s.hij("\n      ",s.lcZ(6,13,"takeover"),"\n      "),s.xp6(2),s.Q6J("ngIf",t.params.name),s.xp6(6),s.Oqu(s.lcZ(14,15,"loggedOutWarning")),s.xp6(3),s.Q6J("ngIf",t.enforcedPolicyOptions),s.xp6(9),s.Oqu(s.lcZ(26,17,"newMasterPass")),s.xp6(8),s.Q6J("password",t.takeoverForm.value.masterPassword)("email",t.email)("showText",!0),s.xp6(9),s.Oqu(s.lcZ(43,19,"confirmNewMasterPass")),s.xp6(14),s.hij("\n        ",s.lcZ(57,21,"save"),"\n      "),s.xp6(4),s.hij("\n        ",s.lcZ(61,23,"cancel"),"\n      "))},dependencies:[d.O5,l._Y,l.Fj,l.JJ,l.JL,l.sg,l.u,Se.O,eo.Z,Ao.b,Zo.u,Te.r,$o.a,Ho.f,Oe.d,ke.G,As.w,Zs.e,Pe.u,xs.Q,to.e,ee.C],encapsulation:2});var yr=i(384),wr=i(2051),br=i(14970),Ur=i(66385),_r=i(24083),Ar=i(73974),Zr=i(26194),xr=i(44234),Sr=i(84575),Tr=i(54735),Cr=i(50941),Or=i(26361),kr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Pr=["addEdit"],qr=["takeoverTemplate"],Ir=["confirmTemplate"];function Mr(e,t){1&e&&(s.TgZ(0,"bit-callout",14),s.ALo(1,"i18n"),s._uU(2),s.ALo(3,"i18n"),s.qZA()),2&e&&(s.s9C("title",s.lcZ(1,2,"warning")),s.xp6(2),s.Oqu(s.lcZ(3,4,"emergencyAccessOwnerWarning")))}function Nr(e,t){1&e&&(s.TgZ(0,"span",33),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"invited")))}function Lr(e,t){1&e&&(s.TgZ(0,"span",34),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"accepted")))}function Dr(e,t){1&e&&(s.TgZ(0,"span",34),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"emergencyAccessRecoveryInitiated")))}function Er(e,t){1&e&&(s.TgZ(0,"span",35),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"emergencyAccessRecoveryApproved")))}function Fr(e,t){if(1&e&&(s.TgZ(0,"small",36),s._uU(1),s.qZA()),2&e){const e=s.oxw().$implicit;s.xp6(1),s.Oqu(e.name)}}function Rr(e,t){1&e&&(s.TgZ(0,"span",35),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"view")))}function Jr(e,t){1&e&&(s.TgZ(0,"span",35),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"takeover")))}function zr(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",31),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(3);return s.KtG(i.reinvite(t))})),s._uU(1,"\n                "),s._UZ(2,"i",37),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n                ",s.lcZ(4,1,"resendInvitation"),"\n              "))}function Yr(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",31),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(3);return s.KtG(i.confirm(t))})),s._uU(1,"\n                "),s._UZ(2,"i",38),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n                ",s.lcZ(4,1,"confirm"),"\n              "))}function Kr(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",31),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(3);return s.KtG(i.approve(t))})),s._uU(1,"\n                "),s._UZ(2,"i",38),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n                ",s.lcZ(4,1,"approve"),"\n              "))}function Br(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",31),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(3);return s.KtG(i.reject(t))})),s._uU(1,"\n                "),s._UZ(2,"i",32),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n                ",s.lcZ(4,1,"reject"),"\n              "))}function Qr(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr",20),s._uU(1,"\n          "),s.TgZ(2,"td",21),s._uU(3,"\n            "),s._UZ(4,"bit-avatar",22),s.ALo(5,"userName"),s._uU(6,"\n            "),s.TgZ(7,"span"),s._uU(8,"\n              "),s.TgZ(9,"a",23),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.edit(t))})),s._uU(10),s.qZA(),s._uU(11,"\n              "),s.YNc(12,Nr,3,3,"span",24),s._uU(13,"\n              "),s.YNc(14,Lr,3,3,"span",25),s._uU(15,"\n              "),s.YNc(16,Dr,3,3,"span",25),s._uU(17,"\n              "),s.YNc(18,Er,3,3,"span",26),s._uU(19,"\n\n              "),s.YNc(20,Fr,2,1,"small",27),s._uU(21,"\n            "),s.qZA(),s._uU(22,"\n          "),s.qZA(),s._uU(23,"\n          "),s.TgZ(24,"td",16),s._uU(25,"\n            "),s.YNc(26,Rr,3,3,"span",26),s._uU(27,"\n            "),s.YNc(28,Jr,3,3,"span",26),s._uU(29,"\n          "),s.qZA(),s._uU(30,"\n          "),s.TgZ(31,"td",17),s._uU(32,"\n            "),s._UZ(33,"button",28),s.ALo(34,"i18n"),s._uU(35,"\n            "),s.TgZ(36,"bit-menu",null,29),s._uU(38,"\n              "),s.YNc(39,zr,5,3,"button",30),s._uU(40,"\n              "),s.YNc(41,Yr,5,3,"button",30),s._uU(42,"\n              "),s.YNc(43,Kr,5,3,"button",30),s._uU(44,"\n              "),s.YNc(45,Br,5,3,"button",30),s._uU(46,"\n              "),s.TgZ(47,"button",31),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.remove(t))})),s._uU(48,"\n                "),s._UZ(49,"i",32),s._uU(50),s.ALo(51,"i18n"),s.qZA(),s._uU(52,"\n            "),s.qZA(),s._uU(53,"\n          "),s.qZA(),s._uU(54,"\n        "),s.qZA()}if(2&e){const e=t.$implicit,i=s.MAs(37),n=s.oxw(3);s.xp6(4),s.Q6J("text",s.lcZ(5,18,e))("id",e.granteeId)("color",e.avatarColor),s.xp6(6),s.Oqu(e.email),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.Invited),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.Accepted),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.RecoveryInitiated),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.RecoveryApproved),s.xp6(2),s.Q6J("ngIf",e.name),s.xp6(6),s.Q6J("ngIf",e.type===n.emergencyAccessType.View),s.xp6(2),s.Q6J("ngIf",e.type===n.emergencyAccessType.Takeover),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(34,20,"options")),s.Q6J("bitMenuTriggerFor",i),s.xp6(6),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.Invited),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.Accepted),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.RecoveryInitiated),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.RecoveryInitiated||e.status===n.emergencyAccessStatusType.RecoveryApproved),s.xp6(5),s.hij("\n                ",s.lcZ(51,22,"remove"),"\n              ")}}function Gr(e,t){if(1&e&&(s._uU(0,"\n        "),s.YNc(1,Qr,55,24,"tr",19),s._uU(2,"\n      ")),2&e){const e=s.oxw(2);s.xp6(1),s.Q6J("ngForOf",e.trustedContacts)}}function jr(e,t){1&e&&(s.TgZ(0,"bit-table"),s._uU(1,"\n      "),s.ynx(2,15),s._uU(3,"\n        "),s.TgZ(4,"tr"),s._uU(5,"\n          "),s.TgZ(6,"th",16),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n          "),s.TgZ(10,"th",16),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n          "),s.TgZ(14,"th",17),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n        "),s.qZA(),s._uU(18,"\n      "),s.BQk(),s._uU(19,"\n      "),s.YNc(20,Gr,3,1,"ng-template",18),s._uU(21,"\n    "),s.qZA()),2&e&&(s.xp6(7),s.Oqu(s.lcZ(8,3,"name")),s.xp6(4),s.Oqu(s.lcZ(12,5,"accessLevel")),s.xp6(4),s.Oqu(s.lcZ(16,7,"options")))}function Vr(e,t){1&e&&(s.TgZ(0,"p",40),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"noTrustedContacts")))}function $r(e,t){1&e&&(s.ynx(0),s._uU(1,"\n        "),s._UZ(2,"i",41),s.ALo(3,"i18n"),s._uU(4,"\n        "),s.TgZ(5,"span",42),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n      "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function Hr(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n      "),s.YNc(2,Vr,3,3,"p",39),s._uU(3,"\n      "),s.YNc(4,$r,9,6,"ng-container",9),s._uU(5,"\n    "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.loaded),s.xp6(2),s.Q6J("ngIf",!e.loaded)}}function Wr(e,t){1&e&&(s.TgZ(0,"span",35),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"invited")))}function Xr(e,t){1&e&&(s.TgZ(0,"span",34),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"accepted")))}function ea(e,t){1&e&&(s.TgZ(0,"span",34),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"emergencyAccessRecoveryInitiated")))}function ta(e,t){1&e&&(s.TgZ(0,"span",46),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"emergencyAccessRecoveryApproved")))}function ia(e,t){if(1&e&&(s.TgZ(0,"small",36),s._uU(1),s.qZA()),2&e){const e=s.oxw().$implicit;s.xp6(1),s.Oqu(e.name)}}function na(e,t){1&e&&(s.TgZ(0,"span",35),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"view")))}function sa(e,t){1&e&&(s.TgZ(0,"span",35),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"takeover")))}function oa(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",31),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(3);return s.KtG(i.requestAccess(t))})),s._uU(1,"\n                "),s._UZ(2,"i",37),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n                ",s.lcZ(4,1,"requestAccess"),"\n              "))}function ra(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",31),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(3);return s.KtG(i.takeover(t))})),s._uU(1,"\n                "),s._UZ(2,"i",47),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n                ",s.lcZ(4,1,"takeover"),"\n              "))}function aa(e,t){if(1&e&&(s.TgZ(0,"button",48),s._uU(1,"\n                "),s._UZ(2,"i",49),s._uU(3),s.ALo(4,"i18n"),s.qZA()),2&e){const e=s.oxw().$implicit;s.Q6J("routerLink",e.id),s.xp6(3),s.hij("\n                ",s.lcZ(4,2,"view"),"\n              ")}}function la(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr",20),s._uU(1,"\n          "),s.TgZ(2,"td",21),s._uU(3,"\n            "),s._UZ(4,"bit-avatar",22),s.ALo(5,"userName"),s._uU(6,"\n            "),s.TgZ(7,"span"),s._uU(8,"\n              "),s.TgZ(9,"span"),s._uU(10),s.qZA(),s._uU(11,"\n              "),s.YNc(12,Wr,3,3,"span",26),s._uU(13,"\n              "),s.YNc(14,Xr,3,3,"span",25),s._uU(15,"\n              "),s.YNc(16,ea,3,3,"span",25),s._uU(17,"\n              "),s.YNc(18,ta,3,3,"span",43),s._uU(19,"\n\n              "),s.YNc(20,ia,2,1,"small",27),s._uU(21,"\n            "),s.qZA(),s._uU(22,"\n          "),s.qZA(),s._uU(23,"\n          "),s.TgZ(24,"td",16),s._uU(25,"\n            "),s.YNc(26,na,3,3,"span",26),s._uU(27,"\n            "),s.YNc(28,sa,3,3,"span",26),s._uU(29,"\n          "),s.qZA(),s._uU(30,"\n          "),s.TgZ(31,"td",17),s._uU(32,"\n            "),s._UZ(33,"button",28),s.ALo(34,"i18n"),s._uU(35,"\n            "),s.TgZ(36,"bit-menu",null,44),s._uU(38,"\n              "),s.YNc(39,oa,5,3,"button",30),s._uU(40,"\n              "),s.YNc(41,ra,5,3,"button",30),s._uU(42,"\n              "),s.YNc(43,aa,5,4,"button",45),s._uU(44,"\n              "),s.TgZ(45,"button",31),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.remove(t))})),s._uU(46,"\n                "),s._UZ(47,"i",32),s._uU(48),s.ALo(49,"i18n"),s.qZA(),s._uU(50,"\n            "),s.qZA(),s._uU(51,"\n          "),s.qZA(),s._uU(52,"\n        "),s.qZA()}if(2&e){const e=t.$implicit,i=s.MAs(37),n=s.oxw(3);s.xp6(4),s.Q6J("text",s.lcZ(5,17,e))("id",e.grantorId)("color",e.avatarColor),s.xp6(6),s.Oqu(e.email),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.Invited),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.Accepted),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.RecoveryInitiated),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.RecoveryApproved),s.xp6(2),s.Q6J("ngIf",e.name),s.xp6(6),s.Q6J("ngIf",e.type===n.emergencyAccessType.View),s.xp6(2),s.Q6J("ngIf",e.type===n.emergencyAccessType.Takeover),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(34,19,"options")),s.Q6J("bitMenuTriggerFor",i),s.xp6(6),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.Confirmed),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.RecoveryApproved&&e.type===n.emergencyAccessType.Takeover),s.xp6(2),s.Q6J("ngIf",e.status===n.emergencyAccessStatusType.RecoveryApproved&&e.type===n.emergencyAccessType.View),s.xp6(5),s.hij("\n                ",s.lcZ(49,21,"remove"),"\n              ")}}function ca(e,t){if(1&e&&(s._uU(0,"\n        "),s.YNc(1,la,53,23,"tr",19),s._uU(2,"\n      ")),2&e){const e=s.oxw(2);s.xp6(1),s.Q6J("ngForOf",e.grantedContacts)}}function ua(e,t){1&e&&(s.TgZ(0,"bit-table"),s._uU(1,"\n      "),s.ynx(2,15),s._uU(3,"\n        "),s.TgZ(4,"tr"),s._uU(5,"\n          "),s.TgZ(6,"th",16),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n          "),s.TgZ(10,"th",16),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n          "),s.TgZ(14,"th",17),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n        "),s.qZA(),s._uU(18,"\n      "),s.BQk(),s._uU(19,"\n      "),s.YNc(20,ca,3,1,"ng-template",18),s._uU(21,"\n    "),s.qZA()),2&e&&(s.xp6(7),s.Oqu(s.lcZ(8,3,"name")),s.xp6(4),s.Oqu(s.lcZ(12,5,"accessLevel")),s.xp6(4),s.Oqu(s.lcZ(16,7,"options")))}function da(e,t){1&e&&(s.TgZ(0,"p",0),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"noGrantedAccess")))}function pa(e,t){1&e&&(s.ynx(0),s._uU(1,"\n        "),s._UZ(2,"i",41),s.ALo(3,"i18n"),s._uU(4,"\n        "),s.TgZ(5,"span",42),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n      "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function ha(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n      "),s.YNc(2,da,3,3,"p",50),s._uU(3,"\n      "),s.YNc(4,pa,9,6,"ng-container",9),s._uU(5,"\n    "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.loaded),s.xp6(2),s.Q6J("ngIf",!e.loaded)}}function ga(e,t){}function fa(e,t){}function ma(e,t){}class va{constructor(e,t,i,n,s,o,r,a,l,c,u){this.emergencyAccessService=e,this.i18nService=t,this.platformUtilsService=i,this.messagingService=n,this.userNamePipe=s,this.logService=o,this.stateService=r,this.organizationService=a,this.dialogService=l,this.organizationManagementPreferencesService=u,this.loaded=!1,this.emergencyAccessType=zo,this.emergencyAccessStatusType=Bo.L,this.edit=e=>kr(this,void 0,void 0,(function*(){const t=yield(0,f.z)(this.canAccessPremium$),i=pr.open(this.dialogService,{data:{name:this.userNamePipe.transform(e),emergencyAccessId:null==e?void 0:e.id,readOnly:!t}}),n=yield(0,se.n)(i.closed);n===er.Saved?yield this.load():n===er.Deleted&&(yield this.remove(e))})),this.invite=()=>kr(this,void 0,void 0,(function*(){yield this.edit(null)})),this.takeover=e=>kr(this,void 0,void 0,(function*(){var t;const i=vr.open(this.dialogService,{data:{name:this.userNamePipe.transform(e),email:e.email,emergencyAccessId:null!==(t=e.id)&&void 0!==t?t:null}});(yield(0,se.n)(i.closed))===hr.Done&&this.platformUtilsService.showToast("success",null,this.i18nService.t("passwordResetFor",this.userNamePipe.transform(e)))})),this.canAccessPremium$=c.hasPremiumFromAnySource$}ngOnInit(){return kr(this,void 0,void 0,(function*(){const e=yield this.organizationService.getAll();this.isOrganizationOwner=e.some((e=>e.isOwner)),this.load()}))}load(){return kr(this,void 0,void 0,(function*(){this.trustedContacts=yield this.emergencyAccessService.getEmergencyAccessTrusted(),this.grantedContacts=yield this.emergencyAccessService.getEmergencyAccessGranted(),this.loaded=!0}))}premiumRequired(){return kr(this,void 0,void 0,(function*(){(yield(0,f.z)(this.canAccessPremium$))||this.messagingService.send("premiumRequired")}))}reinvite(e){return kr(this,void 0,void 0,(function*(){null==this.actionPromise&&(this.actionPromise=this.emergencyAccessService.reinvite(e.id),yield this.actionPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("hasBeenReinvited",e.email)),this.actionPromise=null)}))}confirm(e){return kr(this,void 0,void 0,(function*(){function t(){e.status=Bo.L.Confirmed}if(null!=this.actionPromise)return;const i=yield(0,f.z)(this.organizationManagementPreferencesService.autoConfirmFingerPrints.state$);if(null!=i&&i)this.actionPromise=this.emergencyAccessService.confirm(e.id,e.granteeId),yield this.actionPromise,t(),this.platformUtilsService.showToast("success",null,this.i18nService.t("hasBeenConfirmed",this.userNamePipe.transform(e))),this.actionPromise=null;else{const i=Xo.open(this.dialogService,{data:{name:this.userNamePipe.transform(e),emergencyAccessId:e.id,userId:null==e?void 0:e.granteeId}});(yield(0,se.n)(i.closed))===Go.Confirmed&&(yield this.emergencyAccessService.confirm(e.id,e.granteeId),t(),this.platformUtilsService.showToast("success",null,this.i18nService.t("hasBeenConfirmed",this.userNamePipe.transform(e))))}}))}remove(e){return kr(this,void 0,void 0,(function*(){if(!(yield this.dialogService.openSimpleDialog({title:this.userNamePipe.transform(e),content:{key:"removeUserConfirmation"},type:"warning"})))return!1;try{yield this.emergencyAccessService.delete(e.id),this.platformUtilsService.showToast("success",null,this.i18nService.t("removedUserId",this.userNamePipe.transform(e))),e instanceof Qo?this.removeGrantee(e):this.removeGrantor(e)}catch(t){this.logService.error(t)}}))}requestAccess(e){return kr(this,void 0,void 0,(function*(){if(!(yield this.dialogService.openSimpleDialog({title:this.userNamePipe.transform(e),content:{key:"requestAccessConfirmation",placeholders:[e.waitTimeDays.toString()]},acceptButtonText:{key:"requestAccess"},type:"warning"})))return!1;yield this.emergencyAccessService.requestAccess(e.id),e.status=Bo.L.RecoveryInitiated,this.platformUtilsService.showToast("success",null,this.i18nService.t("requestSent",this.userNamePipe.transform(e)))}))}approve(e){return kr(this,void 0,void 0,(function*(){const t=this.i18nService.t(e.type===zo.View?"view":"takeover");if(!(yield this.dialogService.openSimpleDialog({title:this.userNamePipe.transform(e),content:{key:"approveAccessConfirmation",placeholders:[this.userNamePipe.transform(e),t]},acceptButtonText:{key:"approve"},type:"warning"})))return!1;yield this.emergencyAccessService.approve(e.id),e.status=Bo.L.RecoveryApproved,this.platformUtilsService.showToast("success",null,this.i18nService.t("emergencyApproved",this.userNamePipe.transform(e)))}))}reject(e){return kr(this,void 0,void 0,(function*(){yield this.emergencyAccessService.reject(e.id),e.status=Bo.L.Confirmed,this.platformUtilsService.showToast("success",null,this.i18nService.t("emergencyRejected",this.userNamePipe.transform(e)))}))}removeGrantee(e){const t=this.trustedContacts.indexOf(e);t>-1&&this.trustedContacts.splice(t,1)}removeGrantor(e){const t=this.grantedContacts.indexOf(e);t>-1&&this.grantedContacts.splice(t,1)}}va.ɵfac=function(e){return new(e||va)(s.Y36(Ko.d),s.Y36(M.D),s.Y36(N.P),s.Y36(fe.o),s.Y36(Yo.z),s.Y36(_e.$),s.Y36(J.b),s.Y36(w.Mn),s.Y36(I.x),s.Y36(yr.M),s.Y36(Vo.R))},va.ɵcmp=s.Xpm({type:va,selectors:[["emergency-access"]],viewQuery:function(e,t){if(1&e&&(s.Gf(Pr,7,s.s_b),s.Gf(qr,7,s.s_b),s.Gf(Ir,7,s.s_b)),2&e){let e;s.iGM(e=s.CRH())&&(t.addEditModalRef=e.first),s.iGM(e=s.CRH())&&(t.takeoverModalRef=e.first),s.iGM(e=s.CRH())&&(t.confirmModalRef=e.first)}},decls:67,vars:24,consts:[["bitTypography","body1"],[1,"tw-text-main"],["bitLink","","href","https://bitwarden.com/help/emergency-access/","target","_blank","rel","noreferrer"],["type","warning",3,"title",4,"ngIf"],[1,"tw-flex","tw-items-center","tw-gap-2","tw-mb-2"],["bitTypography","h2","noMargin","",1,"tw-mb-0"],[1,"tw-ml-auto","tw-flex"],["type","button","bitButton","","buttonType","primary",3,"bitAction","disabled"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-fw"],[4,"ngIf"],["bitTypography","h2"],["addEdit",""],["takeoverTemplate",""],["confirmTemplate",""],["type","warning",3,"title"],["header",""],["bitCell",""],["bitCell","",1,"tw-text-right"],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["bitCell","",1,"tw-flex","tw-items-center","tw-gap-4"],["size","small",3,"text","id","color"],["bitLink","","href","#","appStopClick","",3,"click"],["bitBadge","","variant","secondary",4,"ngIf"],["bitBadge","","variant","warning",4,"ngIf"],["bitBadge","",4,"ngIf"],["class","tw-text-muted tw-block",4,"ngIf"],["type","button","bitIconButton","bwi-ellipsis-v","buttonType","main",3,"bitMenuTriggerFor","appA11yTitle"],["trustedContactOptions",""],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-close"],["bitBadge","","variant","secondary"],["bitBadge","","variant","warning"],["bitBadge",""],[1,"tw-text-muted","tw-block"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-envelope"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-check"],["bitTypography","body1","class","tw-mt-2",4,"ngIf"],["bitTypography","body1",1,"tw-mt-2"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"tw-sr-only"],["bitBadge","","variant","success",4,"ngIf"],["grantedContactOptions",""],["type","button","bitMenuItem","",3,"routerLink",4,"ngIf"],["bitBadge","","variant","success"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-key"],["type","button","bitMenuItem","",3,"routerLink"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-eye"],["bitTypography","body1",4,"ngIf"]],template:function(e,t){1&e&&(s._UZ(0,"app-header"),s._uU(1,"\n"),s.TgZ(2,"bit-container"),s._uU(3,"\n  "),s.TgZ(4,"bit-section"),s._uU(5,"\n    "),s.TgZ(6,"p",0),s._uU(7,"\n      "),s.TgZ(8,"span",1),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n      "),s.TgZ(12,"a",2),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n    "),s.qZA(),s._uU(16,"\n    "),s.YNc(17,Mr,4,6,"bit-callout",3),s._uU(18,"\n  "),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"bit-section"),s._uU(21,"\n    "),s.TgZ(22,"div",4),s._uU(23,"\n      "),s.TgZ(24,"h2",5),s._uU(25),s.ALo(26,"i18n"),s.qZA(),s._uU(27,"\n      "),s._UZ(28,"app-premium-badge"),s._uU(29,"\n      "),s.TgZ(30,"div",6),s._uU(31,"\n        "),s.TgZ(32,"button",7),s.ALo(33,"async"),s._uU(34,"\n          "),s._UZ(35,"i",8),s._uU(36),s.ALo(37,"i18n"),s.qZA(),s._uU(38,"\n      "),s.qZA(),s._uU(39,"\n    "),s.qZA(),s._uU(40,"\n    "),s.YNc(41,jr,22,9,"bit-table",9),s._uU(42,"\n    "),s.YNc(43,Hr,6,2,"ng-container",9),s._uU(44,"\n  "),s.qZA(),s._uU(45,"\n\n  "),s.TgZ(46,"bit-section"),s._uU(47,"\n    "),s.TgZ(48,"h2",10),s._uU(49),s.ALo(50,"i18n"),s.qZA(),s._uU(51,"\n\n    "),s.YNc(52,ua,22,9,"bit-table",9),s._uU(53,"\n    "),s.YNc(54,ha,6,2,"ng-container",9),s._uU(55,"\n  "),s.qZA(),s._uU(56,"\n"),s.qZA(),s._uU(57,"\n\n"),s.YNc(58,ga,0,0,"ng-template",null,11,s.W1O),s._uU(60,"\n"),s.YNc(61,fa,0,0,"ng-template",null,12,s.W1O),s._uU(63,"\n"),s.YNc(64,ma,0,0,"ng-template",null,13,s.W1O),s._uU(66,"\n")),2&e&&(s.xp6(9),s.Oqu(s.lcZ(10,12,"emergencyAccessDesc")),s.xp6(4),s.hij("\n        ",s.lcZ(14,14,"learnMore"),".\n      "),s.xp6(4),s.Q6J("ngIf",t.isOrganizationOwner),s.xp6(8),s.hij("\n        ",s.lcZ(26,16,"trustedEmergencyContacts"),"\n      "),s.xp6(7),s.Q6J("bitAction",t.invite)("disabled",!s.lcZ(33,18,t.canAccessPremium$)),s.xp6(4),s.hij("\n          ",s.lcZ(37,20,"addEmergencyContact"),"\n        "),s.xp6(5),s.Q6J("ngIf",t.trustedContacts&&t.trustedContacts.length),s.xp6(2),s.Q6J("ngIf",!t.trustedContacts||!t.trustedContacts.length),s.xp6(6),s.Oqu(s.lcZ(50,22,"designatedEmergencyContacts")),s.xp6(3),s.Q6J("ngIf",t.grantedContacts&&t.grantedContacts.length),s.xp6(2),s.Q6J("ngIf",!t.grantedContacts||!t.grantedContacts.length))},dependencies:[d.sg,d.O5,p.rH,ui.B,wr.O,xn.Q,br.A,Ur.l,Te.r,_r.O,si.e,xs.Q,Ss.r,Ar.M,Zr.t,xr.e,Sr.e,Tr.a,Cr.Y,Or.v,Tr.f,On.t,oi.k,or.R,d.Ov,ee.C,Yo.z],encapsulation:2});var ya=i(91548),wa=i(53481),ba=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Ua(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.Oqu(e.cipher.name)}}function _a(e,t){1&e&&s._UZ(0,"i",24)}function Aa(e,t){1&e&&s._UZ(0,"i",25)}function Za(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",26),s._uU(1,"\n                    "),s.TgZ(2,"a",27),s._uU(3,"\n                      "),s._UZ(4,"i",28),s.ALo(5,"i18n"),s._uU(6,"\n                      "),s.TgZ(7,"span",29),s._uU(8),s.ALo(9,"i18n"),s.qZA()(),s._uU(10,"\n                    "),s.TgZ(11,"button",30,31),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(2);return s.KtG(i.reupload(t))})),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n                  "),s.qZA()}if(2&e){const e=s.MAs(12),t=s.oxw().$implicit,i=s.oxw(2);s.xp6(4),s.s9C("title",s.lcZ(5,5,"attachmentFixDescription")),s.xp6(4),s.Oqu(s.lcZ(9,7,"attachmentFixDescription")),s.xp6(3),s.Q6J("appApiAction",i.reuploadPromises[t.id])("disabled",e.loading),s.xp6(2),s.hij("\n                      ",s.lcZ(14,9,"fix"),"\n                    ")}}function xa(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"td",32),s._uU(1,"\n                "),s.TgZ(2,"button",33,34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(2);return s.KtG(i.delete(t))})),s.ALo(4,"i18n"),s._uU(5,"\n                  "),s._UZ(6,"i",35),s._uU(7,"\n                  "),s._UZ(8,"i",36),s.ALo(9,"i18n"),s._uU(10,"\n                "),s.qZA(),s._uU(11,"\n              "),s.qZA()}if(2&e){const e=s.MAs(3),t=s.oxw().$implicit,i=s.oxw(2);s.xp6(2),s.s9C("appA11yTitle",s.lcZ(4,6,"delete")),s.Q6J("appApiAction",i.deletePromises[t.id])("disabled",e.loading),s.xp6(4),s.Q6J("hidden",e.loading),s.xp6(2),s.s9C("title",s.lcZ(9,8,"loading")),s.Q6J("hidden",!e.loading)}}function Sa(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr"),s._uU(1,"\n              "),s.TgZ(2,"td",16),s._uU(3,"\n                "),s.YNc(4,_a,1,0,"i",17),s._uU(5,"\n                "),s.YNc(6,Aa,1,0,"i",18),s._uU(7,"\n              "),s.qZA(),s._uU(8,"\n              "),s.TgZ(9,"td",19),s._uU(10,"\n                "),s.TgZ(11,"div",20),s._uU(12,"\n                  "),s.TgZ(13,"a",21),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(2);return s.KtG(i.download(t))})),s._uU(14),s.qZA(),s._uU(15,"\n                  "),s.YNc(16,Za,16,11,"div",22),s._uU(17,"\n                "),s.qZA(),s._uU(18,"\n                "),s.TgZ(19,"small"),s._uU(20),s.qZA(),s._uU(21,"\n              "),s.qZA(),s._uU(22,"\n              "),s.YNc(23,xa,12,10,"td",23),s._uU(24,"\n            "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw(2);s.xp6(4),s.Q6J("ngIf",!e.downloading),s.xp6(2),s.Q6J("ngIf",e.downloading),s.xp6(8),s.Oqu(e.fileName),s.xp6(2),s.Q6J("ngIf",i.showFixOldAttachments(e)),s.xp6(4),s.Oqu(e.sizeName),s.xp6(3),s.Q6J("ngIf",!i.viewOnly)}}function Ta(e,t){if(1&e&&(s.TgZ(0,"table",14),s._uU(1,"\n          "),s.TgZ(2,"tbody"),s._uU(3,"\n            "),s.YNc(4,Sa,25,6,"tr",15),s._uU(5,"\n          "),s.qZA(),s._uU(6,"\n        "),s.qZA()),2&e){const e=s.oxw();s.xp6(4),s.Q6J("ngForOf",e.cipher.attachments)}}function Ca(e,t){1&e&&(s.TgZ(0,"div"),s._uU(1,"\n          "),s.TgZ(2,"h3"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"label",37),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n          "),s._UZ(10,"input",38),s._uU(11,"\n          "),s.TgZ(12,"small",39),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n        "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,3,"newAttachment")),s.xp6(4),s.Oqu(s.lcZ(8,5,"file")),s.xp6(6),s.Oqu(s.lcZ(14,7,"maxFileSize")))}function Oa(e,t){if(1&e&&(s.TgZ(0,"button",40),s._uU(1,"\n          "),s._UZ(2,"i",41),s.ALo(3,"i18n"),s._uU(4,"\n          "),s.TgZ(5,"span"),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n        "),s.qZA()),2&e){s.oxw();const e=s.MAs(5);s.Q6J("disabled",e.loading),s.xp6(2),s.s9C("title",s.lcZ(3,3,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,5,"save"))}}class ka extends ya.t{constructor(e,t,i,n,s,o,r,a,l,c){super(e,t,i,s,o,window,r,n,a,l,c),this.viewOnly=!0,this.canAccessAttachments=!0}init(){return ba(this,void 0,void 0,(function*(){}))}showFixOldAttachments(e){return!1}}ka.ɵfac=function(e){return new(e||ka)(s.Y36(C.u),s.Y36(M.D),s.Y36(D.$),s.Y36(J.b),s.Y36(N.P),s.Y36(Ue.s),s.Y36(_e.$),s.Y36(wa._),s.Y36(I.x),s.Y36(yr.M))},ka.ɵcmp=s.Xpm({type:ka,selectors:[["emergency-access-attachments"]],features:[s.qOj],decls:42,vars:14,consts:[["role","dialog","aria-modal","true","aria-labelledby","attachmentsTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","attachmentsTitle",1,"modal-title"],[4,"ngIf"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["class","table table-hover table-list",4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit",3,"disabled",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"table","table-hover","table-list"],[4,"ngFor","ngForOf"],[1,"table-list-icon"],["class","bwi bwi-fw bwi-lg bwi-file","aria-hidden","true",4,"ngIf"],["class","bwi bwi-spinner bwi-lg bwi-fw bwi-spin","aria-hidden","true",4,"ngIf"],[1,"wrap"],[1,"d-flex"],["href","#","appStopClick","",3,"click"],["class","ml-2",4,"ngIf"],["class","table-list-options",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-lg","bwi-file"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-fw","bwi-spin"],[1,"ml-2"],["href","https://bitwarden.com/help/attachments/#fixing-old-attachments","target","_blank","rel","noreferrer"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle","text-warning",3,"title"],[1,"sr-only"],["type","button",1,"btn","btn-outline-primary","btn-sm","m-0","py-0","px-2",3,"appApiAction","disabled","click"],["reuploadBtn",""],[1,"table-list-options"],["type","button","appStopClick","",1,"btn","btn-outline-danger",3,"appA11yTitle","appApiAction","disabled","click"],["deleteBtn",""],["aria-hidden","true",1,"bwi","bwi-trash","bwi-lg","bwi-fw",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-lg","bwi-fw",3,"hidden","title"],["for","file",1,"sr-only"],["type","file","id","file","name","file","required","",1,"form-control-file"],[1,"form-text","text-muted"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"form",2,3),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(6,"\n      "),s.TgZ(7,"div",4),s._uU(8,"\n        "),s.TgZ(9,"h1",5),s._uU(10),s.ALo(11,"i18n"),s.YNc(12,Ua,2,1,"small",6),s._uU(13,"\n        "),s.qZA(),s._uU(14,"\n        "),s.TgZ(15,"button",7),s.ALo(16,"i18n"),s._uU(17,"\n          "),s.TgZ(18,"span",8),s._uU(19,"×"),s.qZA(),s._uU(20,"\n        "),s.qZA(),s._uU(21,"\n      "),s.qZA(),s._uU(22,"\n      "),s.TgZ(23,"div",9),s._uU(24,"\n        "),s.YNc(25,Ta,7,1,"table",10),s._uU(26,"\n        "),s.YNc(27,Ca,16,9,"div",6),s._uU(28,"\n      "),s.qZA(),s._uU(29,"\n      "),s.TgZ(30,"div",11),s._uU(31,"\n        "),s.YNc(32,Oa,9,7,"button",12),s._uU(33,"\n        "),s.TgZ(34,"button",13),s._uU(35),s.ALo(36,"i18n"),s.qZA(),s._uU(37,"\n      "),s.qZA(),s._uU(38,"\n    "),s.qZA(),s._uU(39,"\n  "),s.qZA(),s._uU(40,"\n"),s.qZA(),s._uU(41,"\n")),2&e&&(s.xp6(4),s.Q6J("appApiAction",t.formPromise),s.xp6(6),s.hij("\n          ",s.lcZ(11,8,"attachments"),"\n          "),s.xp6(2),s.Q6J("ngIf",t.cipher),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(16,10,"close")),s.xp6(10),s.Q6J("ngIf",t.cipher&&t.cipher.hasAttachments),s.xp6(2),s.Q6J("ngIf",!t.viewOnly),s.xp6(5),s.Q6J("ngIf",!t.viewOnly),s.xp6(3),s.hij("\n          ",s.lcZ(36,12,"close"),"\n        "))},dependencies:[d.sg,d.O5,l.JL,l.F,ui.B,xe.b,wr.O,ee.C],encapsulation:2});var Pa=i(25406),qa=i(1018),Ia=i(98438),Ma=i(8067),Na=i(87483),La=i(88701),Da=i(21989),Ea=i(78696),Fa=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Ra(e,t){1&e&&(s.TgZ(0,"app-callout",26),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n          ",s.lcZ(2,1,"personalOwnershipPolicyInEffect"),"\n        "))}function Ja(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function za(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",16),s._uU(1,"\n          "),s.TgZ(2,"div",17),s._uU(3,"\n            "),s.TgZ(4,"label",27),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n            "),s.TgZ(8,"select",28),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.type=t)})),s._uU(9,"\n              "),s.YNc(10,Ja,2,2,"option",29),s._uU(11,"\n            "),s.qZA(),s._uU(12,"\n          "),s.qZA(),s._uU(13,"\n        "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(s.lcZ(6,4,"whatTypeOfItem")),s.xp6(3),s.Q6J("ngModel",e.cipher.type)("disabled",e.cipher.isDeleted),s.xp6(2),s.Q6J("ngForOf",e.typeOptions)}}function Ya(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.id),s.xp6(1),s.Oqu(e.name)}}function Ka(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",17),s._uU(1,"\n            "),s.TgZ(2,"label",31),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n            "),s.TgZ(6,"select",32),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.folderId=t)})),s._uU(7,"\n              "),s.YNc(8,Ya,2,2,"option",29),s.ALo(9,"async"),s._uU(10,"\n            "),s.qZA(),s._uU(11,"\n          "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,4,"folder")),s.xp6(3),s.Q6J("ngModel",e.cipher.folderId)("disabled",e.cipher.isDeleted||e.viewOnly),s.xp6(2),s.Q6J("ngForOf",s.lcZ(9,6,e.folders$))}}function Ba(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",41),s._uU(1,"\n                  "),s.TgZ(2,"button",54),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.copy(t.cipher.login.username,"username","Username"))})),s.ALo(3,"i18n"),s._uU(4,"\n                    "),s._UZ(5,"i",44),s._uU(6,"\n                  "),s.qZA(),s._uU(7,"\n                "),s.qZA()}2&e&&(s.xp6(2),s.s9C("appA11yTitle",s.lcZ(3,1,"copyUsername")))}function Qa(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",62),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.generatePassword())})),s.ALo(1,"i18n"),s._uU(2,"\n                    "),s._UZ(3,"i",63),s._uU(4,"\n                  "),s.qZA()}2&e&&s.s9C("appA11yTitle",s.lcZ(1,1,"generatePassword"))}function Ga(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",64),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.togglePasswordCount())})),s.ALo(1,"i18n"),s._uU(2,"\n                    "),s._UZ(3,"i",65),s._uU(4,"\n                  "),s.qZA()}2&e&&s.Q6J("appA11yTitle",s.lcZ(1,1,"toggleCharacterCount"))}function ja(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",55),s._uU(1,"\n                  "),s.YNc(2,Qa,5,3,"a",56),s._uU(3,"\n                  "),s.TgZ(4,"a",57,58),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.checkPassword())})),s.ALo(6,"i18n"),s._uU(7,"\n                    "),s._UZ(8,"i",59),s._uU(9,"\n                    "),s._UZ(10,"i",60),s.ALo(11,"i18n"),s._uU(12,"\n                  "),s.qZA(),s._uU(13,"\n                  "),s.YNc(14,Ga,5,3,"a",61),s._uU(15,"\n                "),s.qZA()}if(2&e){const e=s.MAs(5),t=s.oxw(3);s.xp6(2),s.Q6J("ngIf",t.cipher.viewPassword&&!(!t.cipher.edit&&t.editMode)),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(6,7,"checkPassword")),s.Q6J("appApiAction",t.checkPasswordPromise),s.xp6(4),s.Q6J("hidden",e.loading),s.xp6(2),s.s9C("title",s.lcZ(11,9,"loading")),s.Q6J("hidden",!e.loading),s.xp6(4),s.Q6J("ngIf",t.cipher.viewPassword)}}function Va(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",66),s._uU(1,"\n            "),s.TgZ(2,"label"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n            "),s.TgZ(6,"div",67),s._uU(7,"\n              "),s._UZ(8,"bit-color-password",68),s._uU(9,"\n              "),s.TgZ(10,"button",69),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.togglePasswordCount())})),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n            "),s.qZA(),s._uU(14,"\n          "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,4,"passwordCharacterCount")),s.xp6(5),s.Q6J("password",e.cipher.login.password)("showCount",!0),s.xp6(3),s.hij("\n                ",s.lcZ(12,6,"hide"),"\n              ")}}function $a(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",74),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.removePasskey())})),s.ALo(1,"i18n"),s._uU(2,"\n                    "),s._UZ(3,"i",75),s._uU(4,"\n                  "),s.qZA()}2&e&&s.s9C("appA11yTitle",s.lcZ(1,1,"removePasskey"))}function Ha(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n            "),s.TgZ(2,"div",46),s._uU(3,"\n              "),s.TgZ(4,"div",47),s._uU(5,"\n                "),s.TgZ(6,"label",70),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n                "),s.TgZ(10,"div",71),s.ALo(11,"i18n"),s._uU(12,"\n                  "),s._UZ(13,"input",72),s._uU(14,"\n                  "),s.YNc(15,$a,5,3,"button",73),s._uU(16,"\n                "),s.qZA(),s._uU(17,"\n              "),s.qZA(),s._uU(18,"\n            "),s.qZA(),s._uU(19,"\n          "),s.BQk()),2&e){const e=s.oxw(3);s.xp6(7),s.Oqu(s.lcZ(8,5,"typePasskey")),s.xp6(3),s.zWS("aria-label","",s.lcZ(11,7,"typePasskey")," ",e.fido2CredentialCreationDateValue,""),s.xp6(3),s.Q6J("value",e.fido2CredentialCreationDateValue),s.xp6(2),s.Q6J("ngIf",!e.cipher.isDeleted&&!e.viewOnly)}}const Wa=function(){return{"stroke-dashoffset.px":40}};function Xa(e,t){1&e&&(s.TgZ(0,"div",76),s._uU(1,"\n                "),s.TgZ(2,"span",77),s._uU(3,"\n                  "),s.TgZ(4,"span",78),s._uU(5,"15"),s.qZA(),s._uU(6,"\n                  "),s.O4$(),s.TgZ(7,"svg"),s._uU(8,"\n                    "),s.TgZ(9,"g"),s._uU(10,"\n                      "),s._UZ(11,"circle",79),s._uU(12,"\n                      "),s._UZ(13,"circle",80),s._uU(14,"\n                    "),s.qZA(),s._uU(15,"\n                  "),s.qZA(),s._uU(16,"\n                "),s.qZA(),s._uU(17,"\n                "),s.kcU(),s.TgZ(18,"span",81),s.ALo(19,"i18n"),s._uU(20,"--- ---"),s.qZA(),s._uU(21,"\n                "),s._UZ(22,"i",82),s._uU(23,"\n              "),s.qZA()),2&e&&(s.xp6(11),s.Q6J("ngStyle",s.DdM(4,Wa)),s.xp6(7),s.s9C("title",s.lcZ(19,2,"verificationCodeTotp")))}function el(e,t){1&e&&s._UZ(0,"app-premium-badge",86)}function tl(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",87),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.upgradeOrganization())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n                  ",s.lcZ(2,1,"upgrade"),"\n                "))}function il(e,t){if(1&e&&(s.TgZ(0,"div",83),s._uU(1,"\n                "),s.YNc(2,el,1,0,"app-premium-badge",84),s._uU(3,"\n                "),s.YNc(4,tl,3,3,"a",85),s._uU(5,"\n              "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngIf",!e.organization&&!e.cipher.organizationId),s.xp6(2),s.Q6J("ngIf",e.organization&&!e.organization.useTotp||!e.organization&&!e.canAccessPremium&&e.cipher.organizationId&&!e.cipher.organizationUseTotp)}}const nl=function(e){return{"stroke-dashoffset.px":e}};function sl(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",76),s._uU(1,"\n                "),s.TgZ(2,"span",77),s._uU(3,"\n                  "),s.TgZ(4,"span",88),s._uU(5),s.qZA(),s._uU(6,"\n                  "),s.O4$(),s.TgZ(7,"svg"),s._uU(8,"\n                    "),s.TgZ(9,"g"),s._uU(10,"\n                      "),s._UZ(11,"circle",89),s._uU(12,"\n                      "),s._UZ(13,"circle",90),s._uU(14,"\n                    "),s.qZA(),s._uU(15,"\n                  "),s.qZA(),s._uU(16,"\n                "),s.qZA(),s._uU(17,"\n                "),s.kcU(),s.TgZ(18,"span",91),s.ALo(19,"i18n"),s._uU(20),s.qZA(),s._uU(21,"\n                "),s.TgZ(22,"button",92),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.copy(t.totpCode,"verificationCodeTotp","TOTP"))})),s.ALo(23,"i18n"),s._uU(24,"\n                  "),s._UZ(25,"i",44),s._uU(26,"\n                "),s.qZA(),s._uU(27,"\n              "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(e.totpSec),s.xp6(6),s.Q6J("ngStyle",s.VKq(9,nl,e.totpDash)),s.xp6(7),s.s9C("title",s.lcZ(19,5,"verificationCodeTotp")),s.xp6(2),s.Oqu(e.totpCodeFormatted),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(23,7,"copyVerificationCode"))}}function ol(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n                      ",e.name,"\n                    ")}}function rl(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",104),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(4);return s.KtG(i.removeUri(t))})),s.ALo(1,"i18n"),s._uU(2,"\n                    "),s._UZ(3,"i",105),s._uU(4,"\n                  "),s.qZA()}2&e&&s.s9C("appA11yTitle",s.lcZ(1,1,"remove"))}function al(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",94),s.ALo(1,"i18n"),s._uU(2,"\n              "),s.TgZ(3,"div",95),s._uU(4,"\n                "),s.TgZ(5,"label",96),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n                "),s.TgZ(9,"div",34),s._uU(10,"\n                  "),s.TgZ(11,"input",97),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.uri=t)})),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n                  "),s.TgZ(14,"div",41),s._uU(15,"\n                    "),s.TgZ(16,"button",42),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(4);return s.KtG(i.launch(t))})),s.ALo(17,"i18n"),s._uU(18,"\n                      "),s._UZ(19,"i",98),s._uU(20,"\n                    "),s.qZA(),s._uU(21,"\n                    "),s.TgZ(22,"button",54),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(4);return s.KtG(i.copy(t.uri,"uri","URI"))})),s.ALo(23,"i18n"),s._uU(24,"\n                      "),s._UZ(25,"i",44),s._uU(26,"\n                    "),s.qZA(),s._uU(27,"\n                  "),s.qZA(),s._uU(28,"\n                "),s.qZA(),s._uU(29,"\n              "),s.qZA(),s._uU(30,"\n              "),s.TgZ(31,"div",99),s._uU(32,"\n                "),s.TgZ(33,"div",37),s._uU(34,"\n                  "),s.TgZ(35,"label",96),s._uU(36),s.ALo(37,"i18n"),s.qZA(),s._uU(38,"\n                  "),s.TgZ(39,"a",100),s.ALo(40,"i18n"),s._uU(41,"\n                    "),s._UZ(42,"i",101),s._uU(43,"\n                  "),s.qZA(),s._uU(44,"\n                "),s.qZA(),s._uU(45,"\n                "),s.TgZ(46,"div",37),s._uU(47,"\n                  "),s.TgZ(48,"select",102),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.match=t)}))("change",(function(){const t=s.CHM(e).$implicit,i=s.oxw(4);return s.KtG(i.loginUriMatchChanged(t))})),s._uU(49,"\n                    "),s.YNc(50,ol,2,2,"option",29),s._uU(51,"\n                  "),s.qZA(),s._uU(52,"\n                  "),s.YNc(53,rl,5,3,"button",103),s._uU(54,"\n                "),s.qZA(),s._uU(55,"\n              "),s.qZA(),s._uU(56,"\n            "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=s.oxw(4);s.uIk("aria-label",s.xi3(1,20,"uriPosition",i+1)),s.xp6(5),s.MGl("for","loginUri",i,""),s.xp6(1),s.Oqu(s.xi3(7,23,"uriPosition",i+1)),s.xp6(5),s.MGl("id","loginUri",i,"")("name","Login.Uris[",i,"].Uri")("placeholder","",s.lcZ(12,26,"ex")," https://google.com"),s.Q6J("ngModel",e.uri)("disabled",n.cipher.isDeleted||n.viewOnly),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(17,28,"launch")),s.Q6J("disabled",!e.canLaunch),s.xp6(6),s.s9C("appA11yTitle",s.lcZ(23,30,"copyUri")),s.xp6(13),s.MGl("for","loginUriMatch",i,""),s.xp6(1),s.hij("\n                    ",s.lcZ(37,32,"matchDetection"),"\n                  "),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(40,34,"learnMore")),s.xp6(9),s.MGl("id","loginUriMatch",i,"")("name","Login.Uris[",i,"].Match"),s.Q6J("ngModel",e.match)("disabled",n.cipher.isDeleted||n.viewOnly),s.xp6(2),s.Q6J("ngForOf",n.uriMatchOptions),s.xp6(3),s.Q6J("ngIf",!n.cipher.isDeleted&&!n.viewOnly)}}function ll(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n            "),s.YNc(2,al,57,36,"div",93),s._uU(3,"\n          "),s.BQk()),2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngForOf",e.cipher.login.uris)("ngForTrackBy",e.trackByFunction)}}function cl(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",106),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.addUri())})),s._uU(1,"\n            "),s._UZ(2,"i",107),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij(" ",s.lcZ(4,1,"newUri"),"\n          "))}const ul=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}},dl=function(e){return{low:e}};function pl(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"div",16),s._uU(3,"\n            "),s.TgZ(4,"div",17),s._uU(5,"\n              "),s.TgZ(6,"label",33),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n              "),s.TgZ(10,"div",34),s._uU(11,"\n                "),s.TgZ(12,"input",35),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.login.username=t)})),s.qZA(),s._uU(13,"\n                "),s.YNc(14,Ba,8,3,"div",36),s._uU(15,"\n              "),s.qZA(),s._uU(16,"\n            "),s.qZA(),s._uU(17,"\n            "),s.TgZ(18,"div",17),s._uU(19,"\n              "),s.TgZ(20,"div",37),s._uU(21,"\n                "),s.TgZ(22,"label",38),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n                "),s.YNc(26,ja,16,11,"div",39),s._uU(27,"\n              "),s.qZA(),s._uU(28,"\n              "),s.TgZ(29,"div",34),s._uU(30,"\n                "),s.TgZ(31,"input",40),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.login.password=t)})),s.qZA(),s._uU(32,"\n                "),s.TgZ(33,"div",41),s._uU(34,"\n                  "),s.TgZ(35,"button",42),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.togglePassword())})),s.ALo(36,"i18n"),s._uU(37,"\n                    "),s._UZ(38,"i",43),s._uU(39,"\n                  "),s.qZA(),s._uU(40,"\n                  "),s.TgZ(41,"button",42),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.copy(t.cipher.login.password,"password","Password"))})),s.ALo(42,"i18n"),s._uU(43,"\n                    "),s._UZ(44,"i",44),s._uU(45,"\n                  "),s.qZA(),s._uU(46,"\n                "),s.qZA(),s._uU(47,"\n              "),s.qZA(),s._uU(48,"\n            "),s.qZA(),s._uU(49,"\n          "),s.qZA(),s._uU(50,"\n          "),s.YNc(51,Va,15,8,"div",45),s._uU(52,"\n          "),s.YNc(53,Ha,20,9,"ng-container",21),s._uU(54,"\n          "),s.TgZ(55,"div",46),s._uU(56,"\n            "),s.TgZ(57,"div",47),s._uU(58,"\n              "),s.TgZ(59,"label",48),s._uU(60),s.ALo(61,"i18n"),s.qZA(),s._uU(62,"\n              "),s.TgZ(63,"input",49),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.login.totp=t)})),s.qZA(),s._uU(64,"\n            "),s.qZA(),s._uU(65,"\n            "),s.TgZ(66,"div",50),s._uU(67,"\n              "),s.YNc(68,Xa,24,5,"div",51),s._uU(69,"\n              "),s.YNc(70,il,6,2,"div",52),s._uU(71,"\n              "),s.YNc(72,sl,28,11,"div",51),s._uU(73,"\n            "),s.qZA(),s._uU(74,"\n          "),s.qZA(),s._uU(75,"\n          "),s.YNc(76,ll,4,2,"ng-container",21),s._uU(77,"\n          "),s.YNc(78,cl,5,3,"a",53),s._uU(79,"\n        "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,29,"username")),s.xp6(5),s.Q6J("ngModel",e.cipher.login.username)("disabled",e.cipher.isDeleted||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),s.xp6(2),s.Q6J("ngIf",!e.cipher.isDeleted),s.xp6(9),s.Oqu(s.lcZ(24,31,"password")),s.xp6(3),s.Q6J("ngIf",!e.cipher.isDeleted&&!e.viewOnly),s.xp6(5),s.s9C("type",e.showPassword?"text":"password"),s.Q6J("ngModel",e.cipher.login.password)("disabled",e.cipher.isDeleted||!e.cipher.viewPassword||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),s.xp6(4),s.s9C("appA11yTitle",s.lcZ(36,33,"toggleVisibility")),s.Q6J("disabled",!e.cipher.viewPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(39,ul,!e.showPassword,e.showPassword)),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(42,35,"copyPassword")),s.Q6J("disabled",!e.cipher.viewPassword),s.xp6(10),s.Q6J("ngIf",e.showPasswordCount),s.xp6(2),s.Q6J("ngIf",e.cipher.login.hasFido2Credentials),s.xp6(7),s.Oqu(s.lcZ(61,37,"authenticatorKeyTotp")),s.xp6(3),s.s9C("type",e.cipher.viewPassword?"text":"password"),s.Q6J("ngModel",e.cipher.login.totp)("disabled",e.cipher.isDeleted||!e.cipher.viewPassword||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),s.xp6(3),s.Q6J("ngClass",s.VKq(42,dl,e.totpLow)),s.xp6(2),s.Q6J("ngIf",!e.cipher.login.totp||!e.totpCode),s.xp6(2),s.Q6J("ngIf",!e.cipher.login.totp||!e.totpCode),s.xp6(2),s.Q6J("ngIf",e.cipher.login.totp&&e.totpCode),s.xp6(4),s.Q6J("ngIf",e.cipher.login.hasUris),s.xp6(2),s.Q6J("ngIf",!(e.cipher.isDeleted||e.viewOnly||!e.cipher.edit&&e.editMode))}}function hl(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n                    ",e.name,"\n                  ")}}function gl(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"span"),s._uU(1,"\n                "),s.TgZ(2,"select",122),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.cipher.card.brand=t)})),s._uU(3,"\n                  "),s.YNc(4,hl,2,2,"option",29),s._uU(5,"\n                "),s.qZA(),s._uU(6,"\n              "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngModel",e.cipher.card.brand)("disabled",e.cipher.isDeleted||e.viewOnly),s.xp6(2),s.Q6J("ngForOf",e.cardBrandOptions)}}function fl(e,t){if(1&e&&(s._uU(0,"\n                "),s._UZ(1,"input",123),s._uU(2,"\n              ")),2&e){const e=s.oxw(3);s.xp6(1),s.Q6J("readonly",!0)("value",e.cipher.card.brand)}}function ml(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n                    ",e.name,"\n                  ")}}function vl(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"span"),s._uU(1,"\n                "),s.TgZ(2,"select",124),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.cipher.card.expMonth=t)})),s._uU(3,"\n                  "),s.YNc(4,ml,2,2,"option",29),s._uU(5,"\n                "),s.qZA(),s._uU(6,"\n              "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngModel",e.cipher.card.expMonth)("disabled",e.cipher.isDeleted||e.viewOnly),s.xp6(2),s.Q6J("ngForOf",e.cardExpMonthOptions)}}function yl(e,t){if(1&e&&(s._uU(0,"\n                "),s._UZ(1,"input",125),s._uU(2,"\n              ")),2&e){const e=s.oxw(3);s.xp6(1),s.Q6J("readonly",!0)("value",e.getCardExpMonthDisplay())}}function wl(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"div",16),s._uU(3,"\n            "),s.TgZ(4,"div",17),s._uU(5,"\n              "),s.TgZ(6,"label",108),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n              "),s.TgZ(10,"input",109),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.cardholderName=t)})),s.qZA(),s._uU(11,"\n            "),s.qZA(),s._uU(12,"\n            "),s.TgZ(13,"div",17),s._uU(14,"\n              "),s.TgZ(15,"label",110),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n              "),s.YNc(19,gl,7,3,"span",111),s._uU(20,"\n              "),s.YNc(21,fl,3,2,"ng-template",null,112,s.W1O),s._uU(23,"\n            "),s.qZA(),s._uU(24,"\n          "),s.qZA(),s._uU(25,"\n          "),s.TgZ(26,"div",16),s._uU(27,"\n            "),s.TgZ(28,"div",17),s._uU(29,"\n              "),s.TgZ(30,"label",113),s._uU(31),s.ALo(32,"i18n"),s.qZA(),s._uU(33,"\n              "),s.TgZ(34,"div",34),s._uU(35,"\n                "),s.TgZ(36,"input",114),s.NdJ("input",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.onCardNumberChange())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.number=t)})),s.qZA(),s._uU(37,"\n                "),s.TgZ(38,"div",41),s._uU(39,"\n                  "),s.TgZ(40,"button",54),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.toggleCardNumber())})),s.ALo(41,"i18n"),s._uU(42,"\n                    "),s._UZ(43,"i",43),s._uU(44,"\n                  "),s.qZA(),s._uU(45,"\n                  "),s.TgZ(46,"button",54),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.copy(t.cipher.card.number,"number","Number"))})),s.ALo(47,"i18n"),s._uU(48,"\n                    "),s._UZ(49,"i",44),s._uU(50,"\n                  "),s.qZA(),s._uU(51,"\n                "),s.qZA(),s._uU(52,"\n              "),s.qZA(),s._uU(53,"\n            "),s.qZA(),s._uU(54,"\n            "),s.TgZ(55,"div",115),s._uU(56,"\n              "),s.TgZ(57,"label",116),s._uU(58),s.ALo(59,"i18n"),s.qZA(),s._uU(60,"\n              "),s.YNc(61,vl,7,3,"span",111),s._uU(62,"\n              "),s.YNc(63,yl,3,2,"ng-template",null,117,s.W1O),s._uU(65,"\n            "),s.qZA(),s._uU(66,"\n            "),s.TgZ(67,"div",115),s._uU(68,"\n              "),s.TgZ(69,"label",118),s._uU(70),s.ALo(71,"i18n"),s.qZA(),s._uU(72,"\n              "),s.TgZ(73,"input",119),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.expYear=t)})),s.ALo(74,"i18n"),s.qZA(),s._uU(75,"\n            "),s.qZA(),s._uU(76,"\n          "),s.qZA(),s._uU(77,"\n          "),s.TgZ(78,"div",16),s._uU(79,"\n            "),s.TgZ(80,"div",17),s._uU(81,"\n              "),s.TgZ(82,"label",120),s._uU(83),s.ALo(84,"i18n"),s.qZA(),s._uU(85,"\n              "),s.TgZ(86,"div",34),s._uU(87,"\n                "),s.TgZ(88,"input",121),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.code=t)})),s.qZA(),s._uU(89,"\n                "),s.TgZ(90,"div",41),s._uU(91,"\n                  "),s.TgZ(92,"button",54),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.toggleCardCode())})),s.ALo(93,"i18n"),s._uU(94,"\n                    "),s._UZ(95,"i",43),s._uU(96,"\n                  "),s.qZA(),s._uU(97,"\n                  "),s.TgZ(98,"button",54),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.copy(t.cipher.card.code,"securityCode","Security Code"))})),s.ALo(99,"i18n"),s._uU(100,"\n                    "),s._UZ(101,"i",44),s._uU(102,"\n                  "),s.qZA(),s._uU(103,"\n                "),s.qZA(),s._uU(104,"\n              "),s.qZA(),s._uU(105,"\n            "),s.qZA(),s._uU(106,"\n          "),s.qZA(),s._uU(107,"\n        "),s.BQk()}if(2&e){const e=s.MAs(22),t=s.MAs(64),i=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,31,"cardholderName")),s.xp6(3),s.Q6J("ngModel",i.cipher.card.cardholderName)("disabled",i.cipher.isDeleted||i.viewOnly)("readonly",!i.cipher.edit&&i.editMode),s.xp6(6),s.Oqu(s.lcZ(17,33,"brand")),s.xp6(3),s.Q6J("ngIf",!(!i.cipher.edit&&i.editMode))("ngIfElse",e),s.xp6(12),s.Oqu(s.lcZ(32,35,"number")),s.xp6(5),s.s9C("type",i.showCardNumber?"text":"password"),s.Q6J("ngModel",i.cipher.card.number)("disabled",i.cipher.isDeleted||i.viewOnly)("readonly",!i.cipher.edit&&i.editMode),s.xp6(4),s.s9C("appA11yTitle",s.lcZ(41,37,"toggleVisibility")),s.xp6(3),s.Q6J("ngClass",s.WLB(53,ul,!i.showCardNumber,i.showCardNumber)),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(47,39,"copyNumber")),s.xp6(12),s.Oqu(s.lcZ(59,41,"expirationMonth")),s.xp6(3),s.Q6J("ngIf",!(!i.cipher.edit&&i.editMode))("ngIfElse",t),s.xp6(9),s.Oqu(s.lcZ(71,43,"expirationYear")),s.xp6(3),s.MGl("placeholder","",s.lcZ(74,45,"ex")," 2019"),s.Q6J("ngModel",i.cipher.card.expYear)("disabled",i.cipher.isDeleted||i.viewOnly)("readonly",!i.cipher.edit&&i.editMode),s.xp6(10),s.Oqu(s.lcZ(84,47,"securityCode")),s.xp6(5),s.s9C("type",i.showCardCode?"text":"password"),s.Q6J("ngModel",i.cipher.card.code)("disabled",i.cipher.isDeleted||i.viewOnly)("readonly",!i.cipher.edit&&i.editMode),s.xp6(4),s.s9C("appA11yTitle",s.lcZ(93,49,"toggleVisibility")),s.xp6(3),s.Q6J("ngClass",s.WLB(56,ul,!i.showCardCode,i.showCardCode)),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(99,51,"securityCode"))}}function bl(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n                    ",e.name,"\n                  ")}}function Ul(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"span"),s._uU(1,"\n                "),s.TgZ(2,"select",163),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.cipher.identity.title=t)})),s._uU(3,"\n                  "),s.YNc(4,bl,2,2,"option",29),s._uU(5,"\n                "),s.qZA(),s._uU(6,"\n              "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngModel",e.cipher.identity.title)("disabled",e.cipher.isDeleted||e.viewOnly),s.xp6(2),s.Q6J("ngForOf",e.identityTitleOptions)}}function _l(e,t){if(1&e&&(s._uU(0,"\n                "),s._UZ(1,"input",164),s._uU(2,"\n              ")),2&e){const e=s.oxw(3);s.xp6(1),s.Q6J("readonly",!0)("value",e.cipher.identity.title)}}function Al(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"div",16),s._uU(3,"\n            "),s.TgZ(4,"div",126),s._uU(5,"\n              "),s.TgZ(6,"label",127),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n              "),s.YNc(10,Ul,7,3,"span",111),s._uU(11,"\n              "),s.YNc(12,_l,3,2,"ng-template",null,128,s.W1O),s._uU(14,"\n            "),s.qZA(),s._uU(15,"\n          "),s.qZA(),s._uU(16,"\n          "),s.TgZ(17,"div",16),s._uU(18,"\n            "),s.TgZ(19,"div",126),s._uU(20,"\n              "),s.TgZ(21,"label",129),s._uU(22),s.ALo(23,"i18n"),s.qZA(),s._uU(24,"\n              "),s.TgZ(25,"input",130),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.firstName=t)})),s.qZA(),s._uU(26,"\n            "),s.qZA(),s._uU(27,"\n            "),s.TgZ(28,"div",126),s._uU(29,"\n              "),s.TgZ(30,"label",131),s._uU(31),s.ALo(32,"i18n"),s.qZA(),s._uU(33,"\n              "),s.TgZ(34,"input",132),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.middleName=t)})),s.qZA(),s._uU(35,"\n            "),s.qZA(),s._uU(36,"\n            "),s.TgZ(37,"div",126),s._uU(38,"\n              "),s.TgZ(39,"label",133),s._uU(40),s.ALo(41,"i18n"),s.qZA(),s._uU(42,"\n              "),s.TgZ(43,"input",134),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.lastName=t)})),s.qZA(),s._uU(44,"\n            "),s.qZA(),s._uU(45,"\n          "),s.qZA(),s._uU(46,"\n          "),s.TgZ(47,"div",16),s._uU(48,"\n            "),s.TgZ(49,"div",126),s._uU(50,"\n              "),s.TgZ(51,"label",135),s._uU(52),s.ALo(53,"i18n"),s.qZA(),s._uU(54,"\n              "),s.TgZ(55,"input",136),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.username=t)})),s.qZA(),s._uU(56,"\n            "),s.qZA(),s._uU(57,"\n            "),s.TgZ(58,"div",126),s._uU(59,"\n              "),s.TgZ(60,"label",137),s._uU(61),s.ALo(62,"i18n"),s.qZA(),s._uU(63,"\n              "),s.TgZ(64,"input",138),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.company=t)})),s.qZA(),s._uU(65,"\n            "),s.qZA(),s._uU(66,"\n          "),s.qZA(),s._uU(67,"\n          "),s.TgZ(68,"div",16),s._uU(69,"\n            "),s.TgZ(70,"div",126),s._uU(71,"\n              "),s.TgZ(72,"label",139),s._uU(73),s.ALo(74,"i18n"),s.qZA(),s._uU(75,"\n              "),s.TgZ(76,"input",140),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.ssn=t)})),s.qZA(),s._uU(77,"\n            "),s.qZA(),s._uU(78,"\n            "),s.TgZ(79,"div",126),s._uU(80,"\n              "),s.TgZ(81,"label",141),s._uU(82),s.ALo(83,"i18n"),s.qZA(),s._uU(84,"\n              "),s.TgZ(85,"input",142),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.passportNumber=t)})),s.qZA(),s._uU(86,"\n            "),s.qZA(),s._uU(87,"\n            "),s.TgZ(88,"div",126),s._uU(89,"\n              "),s.TgZ(90,"label",143),s._uU(91),s.ALo(92,"i18n"),s.qZA(),s._uU(93,"\n              "),s.TgZ(94,"input",144),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.licenseNumber=t)})),s.qZA(),s._uU(95,"\n            "),s.qZA(),s._uU(96,"\n          "),s.qZA(),s._uU(97,"\n          "),s.TgZ(98,"div",16),s._uU(99,"\n            "),s.TgZ(100,"div",17),s._uU(101,"\n              "),s.TgZ(102,"label",145),s._uU(103),s.ALo(104,"i18n"),s.qZA(),s._uU(105,"\n              "),s.TgZ(106,"input",146),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.email=t)})),s.qZA(),s._uU(107,"\n            "),s.qZA(),s._uU(108,"\n            "),s.TgZ(109,"div",17),s._uU(110,"\n              "),s.TgZ(111,"label",147),s._uU(112),s.ALo(113,"i18n"),s.qZA(),s._uU(114,"\n              "),s.TgZ(115,"input",148),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.phone=t)})),s.qZA(),s._uU(116,"\n            "),s.qZA(),s._uU(117,"\n          "),s.qZA(),s._uU(118,"\n          "),s.TgZ(119,"div",16),s._uU(120,"\n            "),s.TgZ(121,"div",17),s._uU(122,"\n              "),s.TgZ(123,"label",149),s._uU(124),s.ALo(125,"i18n"),s.qZA(),s._uU(126,"\n              "),s.TgZ(127,"input",150),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.address1=t)})),s.qZA(),s._uU(128,"\n            "),s.qZA(),s._uU(129,"\n            "),s.TgZ(130,"div",17),s._uU(131,"\n              "),s.TgZ(132,"label",151),s._uU(133),s.ALo(134,"i18n"),s.qZA(),s._uU(135,"\n              "),s.TgZ(136,"input",152),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.address2=t)})),s.qZA(),s._uU(137,"\n            "),s.qZA(),s._uU(138,"\n          "),s.qZA(),s._uU(139,"\n          "),s.TgZ(140,"div",16),s._uU(141,"\n            "),s.TgZ(142,"div",17),s._uU(143,"\n              "),s.TgZ(144,"label",153),s._uU(145),s.ALo(146,"i18n"),s.qZA(),s._uU(147,"\n              "),s.TgZ(148,"input",154),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.address3=t)})),s.qZA(),s._uU(149,"\n            "),s.qZA(),s._uU(150,"\n            "),s.TgZ(151,"div",17),s._uU(152,"\n              "),s.TgZ(153,"label",155),s._uU(154),s.ALo(155,"i18n"),s.qZA(),s._uU(156,"\n              "),s.TgZ(157,"input",156),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.city=t)})),s.qZA(),s._uU(158,"\n            "),s.qZA(),s._uU(159,"\n          "),s.qZA(),s._uU(160,"\n          "),s.TgZ(161,"div",16),s._uU(162,"\n            "),s.TgZ(163,"div",17),s._uU(164,"\n              "),s.TgZ(165,"label",157),s._uU(166),s.ALo(167,"i18n"),s.qZA(),s._uU(168,"\n              "),s.TgZ(169,"input",158),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.state=t)})),s.qZA(),s._uU(170,"\n            "),s.qZA(),s._uU(171,"\n            "),s.TgZ(172,"div",17),s._uU(173,"\n              "),s.TgZ(174,"label",159),s._uU(175),s.ALo(176,"i18n"),s.qZA(),s._uU(177,"\n              "),s.TgZ(178,"input",160),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.postalCode=t)})),s.qZA(),s._uU(179,"\n            "),s.qZA(),s._uU(180,"\n          "),s.qZA(),s._uU(181,"\n          "),s.TgZ(182,"div",16),s._uU(183,"\n            "),s.TgZ(184,"div",17),s._uU(185,"\n              "),s.TgZ(186,"label",161),s._uU(187),s.ALo(188,"i18n"),s.qZA(),s._uU(189,"\n              "),s.TgZ(190,"input",162),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.country=t)})),s.qZA(),s._uU(191,"\n            "),s.qZA(),s._uU(192,"\n          "),s.qZA(),s._uU(193,"\n        "),s.BQk()}if(2&e){const e=s.MAs(13),t=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,71,"title")),s.xp6(3),s.Q6J("ngIf",!(!t.cipher.edit&&t.editMode))("ngIfElse",e),s.xp6(12),s.Oqu(s.lcZ(23,73,"firstName")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.firstName)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(32,75,"middleName")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.middleName)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(41,77,"lastName")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.lastName)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(53,79,"username")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.username)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(62,81,"company")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.company)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(74,83,"ssn")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.ssn)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(83,85,"passportNumber")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.passportNumber)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(92,87,"licenseNumber")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.licenseNumber)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(104,89,"email")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.email)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(113,91,"phone")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.phone)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(125,93,"address1")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.address1)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(134,95,"address2")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.address2)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(146,97,"address3")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.address3)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(155,99,"cityTown")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.city)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(167,101,"stateProvince")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.state)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(6),s.Oqu(s.lcZ(176,103,"zipPostalCode")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.postalCode)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode),s.xp6(9),s.Oqu(s.lcZ(188,105,"country")),s.xp6(3),s.Q6J("ngModel",t.cipher.identity.country)("disabled",t.cipher.isDeleted||t.viewOnly)("readonly",!t.cipher.edit&&t.editMode)}}function Zl(e,t){if(1&e&&s._UZ(0,"app-vault-add-edit-custom-fields",165),2&e){const e=s.oxw(2);s.Q6J("cipher",e.cipher)("thisCipherType",e.cipher.type)("viewOnly",e.viewOnly)("copy",e.copy.bind(e))("editMode",e.editMode)}}function xl(e,t){if(1&e&&(s.TgZ(0,"option",30),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function Sl(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"h3",166),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"div",16),s._uU(7,"\n            "),s.TgZ(8,"div",167),s._uU(9,"\n              "),s.TgZ(10,"label",168),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n              "),s.TgZ(14,"select",169),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.organizationId=t)}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.organizationChanged())})),s._uU(15,"\n                "),s.YNc(16,xl,2,2,"option",29),s._uU(17,"\n              "),s.qZA(),s._uU(18,"\n            "),s.qZA(),s._uU(19,"\n          "),s.qZA(),s._uU(20,"\n        "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,5,"ownership")),s.xp6(8),s.Oqu(s.lcZ(12,7,"whoOwnsThisItem")),s.xp6(3),s.Q6J("ngModel",e.cipher.organizationId)("disabled",e.cipher.isDeleted||e.viewOnly),s.xp6(2),s.Q6J("ngForOf",e.ownershipOptions)}}function Tl(e,t){1&e&&(s.TgZ(0,"div"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n            ",s.lcZ(2,1,"noCollectionsInList"),"\n          "))}function Cl(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",171),s._uU(1,"\n              "),s.TgZ(2,"input",172),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.checked=t)})),s.qZA(),s._uU(3,"\n              "),s.TgZ(4,"label",173),s._uU(5),s.qZA(),s._uU(6,"\n            "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=s.oxw(4);s.xp6(2),s.MGl("id","collection-",i,"")("name","Collection[",i,"].Checked"),s.Q6J("ngModel",e.checked)("disabled",n.cipher.isDeleted||n.viewOnly),s.xp6(2),s.MGl("for","collection-",i,""),s.xp6(1),s.Oqu(e.name)}}function Ol(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n            "),s.YNc(2,Cl,7,6,"div",170),s._uU(3,"\n          "),s.BQk()),2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngForOf",e.collections)}}function kl(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"h3",166),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.YNc(6,Tl,3,3,"div",21),s._uU(7,"\n          "),s.YNc(8,Ol,4,1,"ng-container",21),s._uU(9,"\n        "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,3,"collections")),s.xp6(3),s.Q6J("ngIf",!e.collections||!e.collections.length),s.xp6(2),s.Q6J("ngIf",e.collections&&e.collections.length)}}function Pl(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n              "),s.TgZ(2,"b",175),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.ALo(6,"date"),s.qZA()),2&e){const e=s.oxw(3);s.xp6(3),s.hij("",s.lcZ(4,2,"dateCreated"),":"),s.xp6(2),s.hij("\n              ",s.xi3(6,4,e.cipher.creationDate,"medium"),"\n            ")}}function ql(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n              "),s.TgZ(2,"b",175),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.ALo(6,"date"),s.qZA()),2&e){const e=s.oxw(3);s.xp6(3),s.hij("",s.lcZ(4,2,"datePasswordUpdated"),":"),s.xp6(2),s.hij("\n              ",s.xi3(6,4,e.cipher.passwordRevisionDisplayDate,"medium"),"\n            ")}}function Il(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div"),s._uU(1,"\n              "),s.TgZ(2,"b",175),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n              "),s.TgZ(6,"a",176),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.viewHistory())})),s.ALo(7,"i18n"),s._uU(8),s.qZA(),s._uU(9,"\n            "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.hij("",s.lcZ(4,3,"passwordHistory"),":"),s.xp6(3),s.s9C("title",s.lcZ(7,5,"view")),s.xp6(2),s.hij("\n                ",e.cipher.passwordHistory.length,"\n              ")}}function Ml(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1),s.ALo(2,"date"),s._UZ(3,"bit-color-password",178),s._uU(4,"\n              "),s.qZA()),2&e){const e=t.$implicit;s.xp6(1),s.hij("\n                ",s.xi3(2,2,e.lastUsedDate,"short")," -\n                "),s.xp6(2),s.Q6J("password",e.password)}}function Nl(e,t){if(1&e&&(s.TgZ(0,"div",86),s._uU(1,"\n              "),s.YNc(2,Ml,5,5,"div",177),s._uU(3,"\n            "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngForOf",e.cipher.passwordHistory)}}function Ll(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"div",174),s._uU(3,"\n            "),s.TgZ(4,"div"),s._uU(5,"\n              "),s.TgZ(6,"b",175),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9),s.ALo(10,"date"),s.qZA(),s._uU(11,"\n            "),s.YNc(12,Pl,7,7,"div",21),s._uU(13,"\n            "),s.YNc(14,ql,7,7,"div",21),s._uU(15,"\n            "),s.YNc(16,Il,10,7,"div",21),s._uU(17,"\n            "),s.YNc(18,Nl,4,1,"div",84),s._uU(19,"\n          "),s.qZA(),s._uU(20,"\n        "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(7),s.hij("",s.lcZ(8,6,"dateUpdated"),":"),s.xp6(2),s.hij("\n              ",s.xi3(10,8,e.cipher.revisionDate,"medium"),"\n            "),s.xp6(3),s.Q6J("ngIf",e.cipher.creationDate),s.xp6(2),s.Q6J("ngIf",e.showRevisionDate),s.xp6(2),s.Q6J("ngIf",e.hasPasswordHistory),s.xp6(2),s.Q6J("ngIf",e.viewingPasswordHistory)}}function Dl(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"h3",166),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"div",171),s._uU(7,"\n            "),s.TgZ(8,"input",179),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.repromptChanged())})),s.qZA(),s._uU(9,"\n            "),s.TgZ(10,"label",180),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n            "),s.TgZ(14,"a",181),s.ALo(15,"i18n"),s._uU(16,"\n              "),s._UZ(17,"i",101),s._uU(18,"\n            "),s.qZA(),s._uU(19,"\n          "),s.qZA(),s._uU(20,"\n        "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,5,"options")),s.xp6(5),s.Q6J("ngModel",e.reprompt)("disabled",e.cipher.isDeleted||e.viewOnly||!e.cipher.edit&&e.editMode),s.xp6(3),s.Oqu(s.lcZ(12,7,"passwordPrompt")),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(15,9,"learnMore"))}}function El(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",13),s._uU(1,"\n        "),s.YNc(2,Ra,3,3,"app-callout",14),s._uU(3,"\n        "),s.YNc(4,za,14,6,"div",15),s._uU(5,"\n        "),s.TgZ(6,"div",16),s._uU(7,"\n          "),s.TgZ(8,"div",17),s._uU(9,"\n            "),s.TgZ(10,"label",18),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n            "),s.TgZ(14,"input",19),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.cipher.name=t)})),s.qZA(),s._uU(15,"\n          "),s.qZA(),s._uU(16,"\n          "),s.YNc(17,Ka,12,8,"div",20),s._uU(18,"\n        "),s.qZA(),s._uU(19,"\n        "),s._uU(20,"\n        "),s.YNc(21,pl,80,44,"ng-container",21),s._uU(22,"\n        "),s._uU(23,"\n        "),s.YNc(24,wl,108,59,"ng-container",21),s._uU(25,"\n        "),s._uU(26,"\n        "),s.YNc(27,Al,194,107,"ng-container",21),s._uU(28,"\n        "),s.TgZ(29,"div",22),s._uU(30,"\n          "),s.TgZ(31,"label",23),s._uU(32),s.ALo(33,"i18n"),s.qZA(),s._uU(34,"\n          "),s.TgZ(35,"textarea",24),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.cipher.notes=t)})),s.qZA(),s._uU(36,"\n        "),s.qZA(),s._uU(37,"\n        "),s.YNc(38,Zl,1,5,"app-vault-add-edit-custom-fields",25),s._uU(39,"\n        "),s.YNc(40,Sl,21,9,"ng-container",21),s._uU(41,"\n        "),s.YNc(42,kl,10,5,"ng-container",21),s._uU(43,"\n        "),s.YNc(44,Ll,21,11,"ng-container",21),s._uU(45,"\n        "),s.YNc(46,Dl,21,11,"ng-container",21),s._uU(47,"\n      "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.allowOwnershipAssignment()&&!e.allowPersonal),s.xp6(2),s.Q6J("ngIf",!e.editMode&&!e.viewOnly),s.xp6(7),s.Oqu(s.lcZ(12,19,"name")),s.xp6(3),s.Q6J("ngModel",e.cipher.name)("disabled",e.cipher.isDeleted||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),s.xp6(3),s.Q6J("ngIf",!e.organization),s.xp6(4),s.Q6J("ngIf",e.cipher.type===e.cipherType.Login),s.xp6(3),s.Q6J("ngIf",e.cipher.type===e.cipherType.Card),s.xp6(3),s.Q6J("ngIf",e.cipher.type===e.cipherType.Identity),s.xp6(5),s.Oqu(s.lcZ(33,21,"notes")),s.xp6(3),s.Q6J("ngModel",e.cipher.notes)("disabled",e.cipher.isDeleted||e.viewOnly)("readonly",!e.cipher.edit&&e.editMode),s.xp6(3),s.Q6J("ngIf",!(!e.cipher.hasFields&&!e.cipher.edit&&e.editMode)),s.xp6(2),s.Q6J("ngIf",e.allowOwnershipAssignment()),s.xp6(2),s.Q6J("ngIf",(!e.editMode||e.cloneMode)&&e.cipher.organizationId),s.xp6(2),s.Q6J("ngIf",e.editMode),s.xp6(2),s.Q6J("ngIf",e.canUseReprompt)}}function Fl(e,t){if(1&e&&(s.TgZ(0,"button",182),s._uU(1,"\n          "),s._UZ(2,"i",183),s.ALo(3,"i18n"),s._uU(4,"\n          "),s.TgZ(5,"span"),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n        "),s.qZA()),2&e){const e=s.oxw(),t=s.MAs(5);s.Q6J("disabled",t.loading),s.xp6(2),s.s9C("title",s.lcZ(3,3,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,5,null!=e.cipher&&e.cipher.isDeleted?"restore":"save"))}}const Rl=function(e,t){return{"bwi-star-f":e,"bwi-star":t}};function Jl(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",187),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.toggleFavorite())})),s.ALo(1,"i18n"),s._uU(2,"\n            "),s._UZ(3,"i",43),s._uU(4,"\n          "),s.qZA()}if(2&e){const e=s.oxw(2);s.s9C("appA11yTitle",s.lcZ(1,2,e.cipher.favorite?"unfavorite":"favorite")),s.xp6(3),s.Q6J("ngClass",s.WLB(4,Rl,e.cipher.favorite,!e.cipher.favorite))}}function zl(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",188,189),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.delete())})),s.ALo(2,"i18n"),s._uU(3,"\n            "),s._UZ(4,"i",190),s._uU(5,"\n            "),s._UZ(6,"i",191),s.ALo(7,"i18n"),s._uU(8,"\n          "),s.qZA()}if(2&e){const e=s.MAs(1),t=s.oxw(2);s.s9C("appA11yTitle",s.lcZ(2,6,t.cipher.isDeleted?"permanentlyDelete":"delete")),s.Q6J("disabled",e.loading)("appApiAction",t.deletePromise),s.xp6(4),s.Q6J("hidden",e.loading),s.xp6(2),s.s9C("title",s.lcZ(7,8,"loading")),s.Q6J("hidden",!e.loading)}}function Yl(e,t){if(1&e&&(s.TgZ(0,"div",184),s._uU(1,"\n          "),s.YNc(2,Jl,5,7,"button",185),s._uU(3,"\n          "),s.YNc(4,zl,9,10,"button",186),s._uU(5,"\n        "),s.qZA()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",!e.organization&&!e.cipher.isDeleted),s.xp6(2),s.Q6J("ngIf",e.editMode&&!e.cloneMode&&!(!e.cipher.edit&&e.editMode))}}class Kl extends qa.Z{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v,y,w){super(e,t,i,n,s,o,r,a,l,c,u,d,h,g,p,f,m,v,y,w),this.originalCipher=null,this.viewOnly=!0,this.componentName="app-org-vault-add-edit"}load(){return Fa(this,void 0,void 0,(function*(){this.title=this.i18nService.t("viewItem")}))}loadCipher(){return Fa(this,void 0,void 0,(function*(){return Promise.resolve(this.originalCipher)}))}}Kl.ɵfac=function(e){return new(e||Kl)(s.Y36(C.u),s.Y36(S.s),s.Y36(M.D),s.Y36(N.P),s.Y36(Ia.C),s.Y36(J.b),s.Y36(E.a),s.Y36(Ma.w),s.Y36(A.UW),s.Y36(fe.o),s.Y36(Na.j),s.Y36(Y.d),s.Y36(Pa.C),s.Y36(w.Mn),s.Y36(_e.$),s.Y36(La.e),s.Y36(I.x),s.Y36(d.uU),s.Y36(Q.E),s.Y36(yr.M))},Kl.ɵcmp=s.Xpm({type:Kl,selectors:[["app-org-vault-add-edit"]],features:[s.qOj],decls:36,vars:11,consts:[["role","dialog","aria-modal","true","aria-labelledby","cipherAddEditTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],["ngNativeValidate","","autocomplete","off",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","cipherAddEditTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit",3,"disabled",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["class","ml-auto",4,"ngIf"],[1,"modal-body"],["type","info",4,"ngIf"],["class","row",4,"ngIf"],[1,"row"],[1,"col-6","form-group"],["for","name"],["id","name","type","text","name","Name","required","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["class","col-6 form-group",4,"ngIf"],[4,"ngIf"],[1,"form-group"],["for","notes"],["id","notes","name","Notes","rows","6",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],[3,"cipher","thisCipherType","viewOnly","copy","editMode",4,"ngIf"],["type","info"],["for","type"],["id","type","name","Type","appAutofocus","",1,"form-control",3,"ngModel","disabled","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],["for","folder"],["id","folder","name","FolderId",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","loginUsername"],[1,"input-group"],["id","loginUsername","type","text","name","Login.Username","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["class","input-group-append",4,"ngIf"],[1,"d-flex"],["for","loginPassword"],["class","ml-auto d-flex",4,"ngIf"],["id","loginPassword","name","Login.Password","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","readonly","ngModelChange"],[1,"input-group-append"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","disabled","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone"],["class","tw-mb-4",4,"ngIf"],[1,"tw-flex","tw-flex-row"],[1,"tw-mb-4","tw-w-1/2"],["for","loginTotp"],["id","loginTotp","name","Login.Totp","appInputVerbatim","",1,"form-control","text-monospace",3,"type","ngModel","disabled","readonly","ngModelChange"],[1,"tw-mb-4","tw-ml-4","tw-flex","tw-w-1/2","tw-items-end",3,"ngClass"],["class","totp tw-flex tw-flex-row tw-items-center",4,"ngIf"],["class","tw-pb-2",4,"ngIf"],["href","#","appStopClick","","class","d-inline-block mb-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","click"],[1,"ml-auto","d-flex"],["href","#","class","d-block mr-2 bwi-icon-above-input","appStopClick","",3,"appA11yTitle","click",4,"ngIf"],["href","#","appStopClick","",1,"d-block","bwi-icon-above-input",3,"appA11yTitle","appApiAction","click"],["checkPasswordBtn",""],["aria-hidden","true",1,"bwi","bwi-lg","bwi-fw","bwi-check-circle",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-fw","bwi-spinner","bwi-spin",3,"hidden","title"],["href","#","class","d-block bwi-icon-above-input","appStopClick","",3,"appA11yTitle","click",4,"ngIf"],["href","#","appStopClick","",1,"d-block","mr-2","bwi-icon-above-input",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-fw","bwi-generate"],["href","#","appStopClick","",1,"d-block","bwi-icon-above-input",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-fw","bwi-numbered-list"],[1,"tw-mb-4"],[1,"tw-flex","tw-justify-between"],[3,"password","showCount"],["type","button","bitLink","",3,"click"],["for","loginFido2credential"],["tabindex","0",1,"tw-flex","tw-flex-row"],["id","loginFido2credential","type","text","name","Login.Fido2credential","appInputVerbatim","","disabled","","readonly","",1,"form-control",3,"value"],["type","button","class","tw-items-center tw-border-none tw-bg-transparent tw-text-danger tw-ml-3",3,"appA11yTitle","click",4,"ngIf"],["type","button",1,"tw-items-center","tw-border-none","tw-bg-transparent","tw-text-danger","tw-ml-3",3,"appA11yTitle","click"],[1,"bwi","bwi-lg","bwi-minus-circle"],[1,"totp","tw-flex","tw-flex-row","tw-items-center"],[1,"totp-countdown"],[1,"totp-sec","tw-text-muted"],["r","12.6","cy","16","cx","16","opacity","0.25",1,"totp-circle-muted","inner",3,"ngStyle"],["opacity","0.25","r","14","cy","16","cx","16",1,"totp-circle-muted","outer"],[1,"totp-code","tw-ml-2","tw-mr-3","tw-text-muted",3,"title"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone","tw-text-muted"],[1,"tw-pb-2"],["class","ml-3",4,"ngIf"],["href","#","appStopClick","","bitBadge","","variant","primary","class","tw-ml-4",3,"click",4,"ngIf"],[1,"ml-3"],["href","#","appStopClick","","bitBadge","","variant","primary",1,"tw-ml-4",3,"click"],[1,"totp-sec"],["r","12.6","cy","16","cx","16",1,"totp-circle","inner",3,"ngStyle"],["r","14","cy","16","cx","16",1,"totp-circle","outer"],[1,"totp-code","tw-mx-2","tw-mt-1",3,"title"],["type","button",1,"tw-items-center","tw-border-none","tw-bg-transparent","tw-text-primary-600",3,"appA11yTitle","click"],["role","group","class","row",4,"ngFor","ngForOf","ngForTrackBy"],["role","group",1,"row"],[1,"col-7","form-group"],[3,"for"],["type","text","appInputVerbatim","",1,"form-control",3,"id","name","ngModel","disabled","placeholder","ngModelChange"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-share-square"],[1,"col-5","form-group"],["href","https://bitwarden.com/help/uri-match-detection/","target","_blank","rel","noreferrer",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],[1,"form-control","overflow-hidden",3,"id","name","ngModel","disabled","ngModelChange","change"],["type","button","class","btn btn-link text-danger ml-2",3,"appA11yTitle","click",4,"ngIf"],["type","button",1,"btn","btn-link","text-danger","ml-2",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-minus-circle","bwi-lg"],["href","#","appStopClick","",1,"d-inline-block","mb-3",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus-circle","bwi-fw"],["for","cardCardholderName"],["id","cardCardholderName","type","text","name","Card.CardCardholderName",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","cardBrand"],[4,"ngIf","ngIfElse"],["readonlyCardBrand",""],["for","cardNumber"],["id","cardNumber","name","Card.Number","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","readonly","input","ngModelChange"],[1,"col","form-group"],["for","cardExpMonth"],["readonlyCardExpMonth",""],["for","cardExpYear"],["id","cardExpYear","type","text","name","Card.ExpYear",1,"form-control",3,"ngModel","placeholder","disabled","readonly","ngModelChange"],["for","cardCode"],["id","cardCode","name","Card.Code","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","readonly","ngModelChange"],["id","cardBrand","name","Card.Brand",1,"form-control",3,"ngModel","disabled","ngModelChange"],["id","cardBrand","name","Card.Brand","type","text",1,"form-control",3,"readonly","value"],["id","cardExpMonth","name","Card.ExpMonth",1,"form-control",3,"ngModel","disabled","ngModelChange"],["id","cardExpMonth","type","text","name","Card.ExpMonth",1,"form-control",3,"readonly","value"],[1,"col-4","form-group"],["for","idTitle"],["readonlyIdTitle",""],["for","idFirstName"],["id","idFirstName","type","text","name","Identity.FirstName",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idMiddleName"],["id","idMiddleName","type","text","name","Identity.MiddleName",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idLastName"],["id","idLastName","type","text","name","Identity.LastName",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idUsername"],["id","idUsername","type","text","name","Identity.Username","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idCompany"],["id","idCompany","type","text","name","Identity.Company",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idSsn"],["id","idSsn","type","text","name","Identity.SSN","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idPassportNumber"],["id","idPassportNumber","type","text","name","Identity.PassportNumber","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idLicenseNumber"],["id","idLicenseNumber","type","text","name","Identity.LicenseNumber","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idEmail"],["id","idEmail","type","text","inputmode","email","name","Identity.Email","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idPhone"],["id","idPhone","type","text","inputmode","tel","name","Identity.Phone",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idAddress1"],["id","idAddress1","type","text","name","Identity.Address1",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idAddress2"],["id","idAddress2","type","text","name","Identity.Address2",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idAddress3"],["id","idAddress3","type","text","name","Identity.Address3",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idCity"],["id","idCity","type","text","name","Identity.City",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idState"],["id","idState","type","text","name","Identity.State",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idPostalCode"],["id","idPostalCode","type","text","name","Identity.PostalCode",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["for","idCountry"],["id","idCountry","type","text","name","Identity.Country",1,"form-control",3,"ngModel","disabled","readonly","ngModelChange"],["id","idTitle","name","Identity.Title",1,"form-control",3,"ngModel","disabled","ngModelChange"],["id","idTitle","name","Identity.Title","type","text",1,"form-control",3,"readonly","value"],[3,"cipher","thisCipherType","viewOnly","copy","editMode"],[1,"mt-4"],[1,"col-5"],["for","organizationId"],["id","organizationId","name","OrganizationId",1,"form-control",3,"ngModel","disabled","ngModelChange","change"],["class","form-check",4,"ngFor","ngForOf"],[1,"form-check"],["type","checkbox",1,"form-check-input",3,"ngModel","id","name","disabled","ngModelChange"],[1,"form-check-label",3,"for"],[1,"small","text-muted","mt-4"],[1,"font-weight-semibold"],["href","#","appStopClick","",3,"title","click"],[4,"ngFor","ngForOf"],[3,"password"],["type","checkbox","id","passwordPrompt","name","passwordPrompt",1,"form-check-input",3,"ngModel","disabled","change"],["for","passwordPrompt",1,"form-check-label"],["target","_blank","rel","noreferrer","href","https://bitwarden.com/help/managing-items/#protect-individual-items",3,"appA11yTitle"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],[1,"ml-auto"],["type","button","class","btn btn-link",3,"appA11yTitle","click",4,"ngIf"],["type","button","class","btn btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click",4,"ngIf"],["type","button",1,"btn","btn-link",3,"appA11yTitle","click"],["type","button",1,"btn","btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click"],["deleteBtn",""],["aria-hidden","true",1,"bwi","bwi-trash","bwi-lg","bwi-fw",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-lg","bwi-fw",3,"hidden","title"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"form",2,3),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(6,"\n      "),s.TgZ(7,"div",4),s._uU(8,"\n        "),s.TgZ(9,"h1",5),s._uU(10),s.qZA(),s._uU(11,"\n        "),s.TgZ(12,"button",6),s.ALo(13,"i18n"),s._uU(14,"\n          "),s.TgZ(15,"span",7),s._uU(16,"×"),s.qZA(),s._uU(17,"\n        "),s.qZA(),s._uU(18,"\n      "),s.qZA(),s._uU(19,"\n      "),s.YNc(20,El,48,23,"div",8),s._uU(21,"\n      "),s.TgZ(22,"div",9),s._uU(23,"\n        "),s.YNc(24,Fl,9,7,"button",10),s._uU(25,"\n        "),s.TgZ(26,"button",11),s._uU(27),s.ALo(28,"i18n"),s.qZA(),s._uU(29,"\n        "),s.YNc(30,Yl,6,2,"div",12),s._uU(31,"\n      "),s.qZA(),s._uU(32,"\n    "),s.qZA(),s._uU(33,"\n  "),s.qZA(),s._uU(34,"\n"),s.qZA(),s._uU(35,"\n")),2&e&&(s.xp6(4),s.Q6J("appApiAction",t.formPromise),s.xp6(6),s.Oqu(t.title),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(13,7,"close")),s.xp6(8),s.Q6J("ngIf",t.cipher),s.xp6(4),s.Q6J("ngIf",!t.viewOnly),s.xp6(3),s.hij("\n          ",s.lcZ(28,9,t.viewOnly?"close":"cancel"),"\n        "),s.xp6(3),s.Q6J("ngIf",t.cipher&&!t.viewOnly))},dependencies:[d.mk,d.sg,d.O5,d.PC,l.YN,l.Kr,l.Fj,l.Wl,l.EJ,l.JJ,l.JL,l.Q7,l.On,l.F,ui.B,xe.b,Ji.U,Se.O,zi.b,wr.O,Ur.l,Da.L,Ss._,Ea.P,or.R,d.Ov,d.uU,ee.C],encapsulation:2});var Bl=i(15252),Ql=i(12963),Gl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const jl=["cipherAddEdit"],Vl=["attachments"];function $l(e,t){1&e&&(s.ynx(0),s._uU(1,"\n              "),s._UZ(2,"i",13),s.ALo(3,"i18n"),s._uU(4,"\n              "),s.TgZ(5,"span",14),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n            "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"shared")),s.xp6(4),s.Oqu(s.lcZ(7,4,"shared")))}function Hl(e,t){1&e&&(s.ynx(0),s._uU(1,"\n              "),s._UZ(2,"i",15),s.ALo(3,"i18n"),s._uU(4,"\n              "),s.TgZ(5,"span",14),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n            "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"attachments")),s.xp6(4),s.Oqu(s.lcZ(7,4,"attachments")))}function Wl(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div"),s._uU(1,"\n              "),s._UZ(2,"button",16),s.ALo(3,"i18n"),s._uU(4,"\n              "),s.TgZ(5,"bit-menu",null,17),s._uU(7,"\n                "),s.TgZ(8,"button",18),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(3);return s.KtG(i.viewAttachments(t))})),s._uU(9,"\n                  "),s._UZ(10,"i",19),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n              "),s.qZA(),s._uU(14,"\n            "),s.qZA()}if(2&e){const e=s.MAs(6);s.xp6(2),s.s9C("appA11yTitle",s.lcZ(3,3,"options")),s.Q6J("bitMenuTriggerFor",e),s.xp6(9),s.hij("\n                  ",s.lcZ(12,5,"attachments"),"\n                ")}}function Xl(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr",7),s._uU(1,"\n          "),s.TgZ(2,"td",8),s._uU(3,"\n            "),s._UZ(4,"app-vault-icon",9),s._uU(5,"\n          "),s.qZA(),s._uU(6,"\n          "),s.TgZ(7,"td",10),s._uU(8,"\n            "),s.TgZ(9,"a",11),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.selectCipher(t))})),s.ALo(10,"i18n"),s._uU(11),s.qZA(),s._uU(12,"\n            "),s.YNc(13,$l,9,6,"ng-container",2),s._uU(14,"\n            "),s.YNc(15,Hl,9,6,"ng-container",2),s._uU(16,"\n            "),s._UZ(17,"br"),s._uU(18,"\n            "),s.TgZ(19,"small",12),s._uU(20),s.qZA(),s._uU(21,"\n          "),s.qZA(),s._uU(22,"\n          "),s.TgZ(23,"td",8),s._uU(24,"\n            "),s.YNc(25,Wl,15,7,"div",2),s._uU(26,"\n          "),s.qZA(),s._uU(27,"\n        "),s.qZA()}if(2&e){const e=t.$implicit;s.xp6(4),s.Q6J("cipher",e),s.xp6(5),s.s9C("title",s.lcZ(10,7,"editItem")),s.xp6(2),s.Oqu(e.name),s.xp6(2),s.Q6J("ngIf",e.organizationId),s.xp6(2),s.Q6J("ngIf",e.hasAttachments),s.xp6(5),s.Oqu(e.subTitle),s.xp6(5),s.Q6J("ngIf",e.hasAttachments)}}function ec(e,t){if(1&e&&(s._uU(0,"\n        "),s.YNc(1,Xl,28,9,"tr",6),s._uU(2,"\n      ")),2&e){const e=s.oxw(2);s.xp6(1),s.Q6J("ngForOf",e.ciphers)}}function tc(e,t){1&e&&(s.ynx(0),s._uU(1,"\n    "),s.TgZ(2,"bit-table"),s._uU(3,"\n      "),s.YNc(4,ec,3,1,"ng-template",5),s._uU(5,"\n    "),s.qZA(),s._uU(6,"\n  "),s.BQk())}function ic(e,t){1&e&&(s.ynx(0),s._uU(1,"\n    "),s._UZ(2,"i",20),s.ALo(3,"i18n"),s._uU(4,"\n    "),s.TgZ(5,"span",14),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n  "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function nc(e,t){}function sc(e,t){}class oc{constructor(e,t,i,n){this.modalService=e,this.router=t,this.route=i,this.emergencyAccessService=n,this.ciphers=[],this.loaded=!1}ngOnInit(){this.route.params.subscribe((e=>{if(null==e.id)return this.router.navigate(["settings/emergency-access"]);this.id=e.id,this.load()}))}selectCipher(e){return Gl(this,void 0,void 0,(function*(){const[t,i]=yield this.modalService.openViewRef(Kl,this.cipherAddEditModalRef,(t=>{t.cipherId=null==e?null:e.id,t.cipher=e}));return i}))}load(){return Gl(this,void 0,void 0,(function*(){this.ciphers=yield this.emergencyAccessService.getViewOnlyCiphers(this.id),this.loaded=!0}))}viewAttachments(e){return Gl(this,void 0,void 0,(function*(){yield this.modalService.openViewRef(ka,this.attachmentsModalRef,(t=>{t.cipher=e,t.emergencyAccessId=this.id}))}))}}oc.ɵfac=function(e){return new(e||oc)(s.Y36(uo.Z),s.Y36(p.F0),s.Y36(p.gz),s.Y36(Ko.d))},oc.ɵcmp=s.Xpm({type:oc,selectors:[["emergency-access-view"]],viewQuery:function(e,t){if(1&e&&(s.Gf(jl,7,s.s_b),s.Gf(Vl,7,s.s_b)),2&e){let e;s.iGM(e=s.CRH())&&(t.cipherAddEditModalRef=e.first),s.iGM(e=s.CRH())&&(t.attachmentsModalRef=e.first)}},decls:17,vars:5,consts:[["bitTypography","h1"],[1,"tw-mt-6"],[4,"ngIf"],["cipherAddEdit",""],["attachments",""],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["bitCell",""],[3,"cipher"],["bitCell","",1,"tw-w-full"],["bitLink","","href","#","appStopClick","",3,"title","click"],[1,"tw-text-xs"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection",3,"title"],[1,"tw-sr-only"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip",3,"title"],["type","button","buttonType","main","bitIconButton","bwi-ellipsis-v",3,"bitMenuTriggerFor","appA11yTitle"],["optionsMenu",""],["type","button","bitMenuItem","","appStopClick","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-paperclip"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1),s.ALo(2,"i18n"),s.qZA(),s._uU(3,"\n\n"),s.TgZ(4,"div",1),s._uU(5,"\n  "),s.YNc(6,tc,7,0,"ng-container",2),s._uU(7,"\n  "),s.YNc(8,ic,9,6,"ng-container",2),s._uU(9,"\n"),s.qZA(),s._uU(10,"\n"),s.YNc(11,nc,0,0,"ng-template",null,3,s.W1O),s._uU(13,"\n"),s.YNc(14,sc,0,0,"ng-template",null,4,s.W1O),s._uU(16,"\n")),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,3,"vault")),s.xp6(5),s.Q6J("ngIf",t.ciphers.length),s.xp6(2),s.Q6J("ngIf",!t.loaded))},dependencies:[d.sg,d.O5,ui.B,Bl.o,wr.O,Ql._,xs.Q,Ss.r,Ar.M,Zr.t,xr.e,Tr.a,Cr.Y,Or.v,Tr.f,On.t,ee.C],encapsulation:2});class rc extends ji.Y{}var ac=i(92879),lc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function cc(e,t){if(1&e&&(s.TgZ(0,"auth-password-callout",26),s._uU(1,"\n"),s.qZA()),2&e){const e=s.oxw();s.Q6J("policy",e.enforcedPolicyOptions)}}class uc extends Hs{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f){super(e,t,i,s,o,r,n,p,f),this.auditService=a,this.cipherService=l,this.syncService=c,this.apiService=u,this.router=d,this.userVerificationService=h,this.keyRotationService=g,this.rotateUserKey=!1,this.checkForBreaches=!0,this.characterMinimumMessage=""}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return lc(this,void 0,void 0,(function*(){(yield this.userVerificationService.hasMasterPassword())||this.router.navigate(["/settings/security/two-factor"]),this.masterPasswordHint=(yield this.apiService.getProfile()).masterPasswordHint,yield e.ngOnInit.call(this),this.characterMinimumMessage=this.i18nService.t("characterMinimum",this.minimumLength)}))}rotateUserKeyClicked(){return lc(this,void 0,void 0,(function*(){if(this.rotateUserKey){const e=yield this.cipherService.getAllDecrypted();let t=!1;if(null!=e)for(let i=0;i<e.length;i++)if(null==e[i].organizationId&&e[i].hasOldAttachments){t=!0;break}if(t){return(yield this.dialogService.openSimpleDialog({title:{key:"warning"},content:{key:"oldAttachmentsNeedFixDesc"},acceptButtonText:{key:"learnMore"},cancelButtonText:{key:"close"},type:"warning"}))&&this.platformUtilsService.launchUri("https://bitwarden.com/help/attachments/#add-storage-space"),void(this.rotateUserKey=!1)}(yield this.dialogService.openSimpleDialog({title:{key:"rotateEncKeyTitle"},content:this.i18nService.t("updateEncryptionKeyWarning")+" "+this.i18nService.t("updateEncryptionKeyExportWarning")+" "+this.i18nService.t("rotateEncKeyConfirmation"),type:"warning"}))||(this.rotateUserKey=!1)}}))}submit(){const e=Object.create(null,{submit:{get:()=>super.submit}});return lc(this,void 0,void 0,(function*(){null==this.masterPasswordHint||this.masterPasswordHint!=this.masterPassword?(this.leakedPassword=!1,this.checkForBreaches&&(this.leakedPassword=(yield this.auditService.passwordLeaked(this.masterPassword))>0),yield e.submit.call(this)):this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("hintEqualsPassword"))}))}setupSubmitActions(){const e=Object.create(null,{setupSubmitActions:{get:()=>super.setupSubmitActions}});return lc(this,void 0,void 0,(function*(){return null==this.currentMasterPassword||""===this.currentMasterPassword?(this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPasswordRequired")),!1):(this.rotateUserKey&&(yield this.syncService.fullSync(!0)),e.setupSubmitActions.call(this))}))}performSubmitActions(e,t,i){return lc(this,void 0,void 0,(function*(){const t=yield this.cryptoService.getOrDeriveMasterKey(this.currentMasterPassword),n=new rc;n.masterPasswordHash=yield this.cryptoService.hashMasterKey(this.currentMasterPassword,t),n.masterPasswordHint=this.masterPasswordHint,n.newMasterPasswordHash=e,n.key=i[1].encryptedString;try{this.rotateUserKey?this.formPromise=this.apiService.postPassword(n).then((()=>this.updateKey())):this.formPromise=this.apiService.postPassword(n),yield this.formPromise,this.platformUtilsService.showToast("success",this.i18nService.t("masterPasswordChanged"),this.i18nService.t("logBackIn")),this.messagingService.send("logout")}catch(s){this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}}))}updateKey(){return lc(this,void 0,void 0,(function*(){yield this.keyRotationService.rotateUserKeyAndEncryptedData(this.masterPassword)}))}}uc.ɵfac=function(e){return new(e||uc)(s.Y36(M.D),s.Y36(D.$),s.Y36(fe.o),s.Y36(J.b),s.Y36(A.UW),s.Y36(N.P),s.Y36(Y.d),s.Y36(Ia.C),s.Y36(C.u),s.Y36(T._),s.Y36(Ue.s),s.Y36(p.F0),s.Y36(I.x),s.Y36(nn.i),s.Y36(ac.j),s.Y36(sn.d))},uc.ɵcmp=s.Xpm({type:uc,selectors:[["app-change-password"]],features:[s.qOj],decls:113,vars:49,consts:[[1,"tabbed-header"],["type","warning"],[3,"policy",4,"ngIf"],["ngNativeValidate","","autocomplete","off",1,"tw-mb-14",3,"appApiAction","ngSubmit"],["form",""],[1,"row"],[1,"col-6"],[1,"form-group"],["for","currentMasterPassword"],["id","currentMasterPassword","type","password","name","MasterPasswordHash","required","","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"],["for","newMasterPassword"],["id","newMasterPassword","type","password","name","NewMasterPasswordHash","required","","appInputVerbatim","","autocomplete","new-password",1,"form-control","mb-1",3,"ngModel","ngModelChange"],[1,"tw-font-semibold"],[3,"password","email","showText","passwordStrengthResult"],["for","masterPasswordRetype"],["id","masterPasswordRetype","type","password","name","MasterPasswordRetype","required","","appInputVerbatim","","autocomplete","new-password",1,"form-control",3,"ngModel","ngModelChange"],[1,"form-check"],["type","checkbox","id","checkForBreaches","name","checkForBreaches",1,"form-check-input",3,"ngModel","ngModelChange"],["for","checkForBreaches",1,"form-check-label"],["type","checkbox","id","rotateUserKey","name","RotateUserKey",1,"form-check-input",3,"ngModel","ngModelChange","change"],["for","rotateUserKey",1,"form-check-label"],["href","https://bitwarden.com/help/account-encryption-key/#rotate-your-encryption-key","target","_blank","rel","noreferrer",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["for","masterPasswordHint"],["id","masterPasswordHint","maxlength","50","type","text","name","MasterPasswordHint",1,"form-control",3,"ngModel","ngModelChange"],["type","submit","buttonType","primary","bitButton","",3,"loading"],[3,"policy"]],template:function(e,t){if(1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"h1"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n"),s.qZA(),s._uU(6,"\n\n"),s.TgZ(7,"bit-callout",1),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n"),s.YNc(11,cc,2,1,"auth-password-callout",2),s._uU(12,"\n\n"),s.TgZ(13,"form",3,4),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(15,"\n  "),s.TgZ(16,"div",5),s._uU(17,"\n    "),s.TgZ(18,"div",6),s._uU(19,"\n      "),s.TgZ(20,"div",7),s._uU(21,"\n        "),s.TgZ(22,"label",8),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n        "),s.TgZ(26,"input",9),s.NdJ("ngModelChange",(function(e){return t.currentMasterPassword=e})),s.qZA(),s._uU(27,"\n      "),s.qZA(),s._uU(28,"\n    "),s.qZA(),s._uU(29,"\n  "),s.qZA(),s._uU(30,"\n  "),s.TgZ(31,"div",5),s._uU(32,"\n    "),s.TgZ(33,"div",6),s._uU(34,"\n      "),s.TgZ(35,"div",7),s._uU(36,"\n        "),s.TgZ(37,"label",10),s._uU(38),s.ALo(39,"i18n"),s.qZA(),s._uU(40,"\n        "),s.TgZ(41,"input",11),s.NdJ("ngModelChange",(function(e){return t.masterPassword=e})),s.qZA(),s._uU(42,"\n        "),s.TgZ(43,"bit-hint"),s._uU(44,"\n          "),s.TgZ(45,"span",12),s._uU(46),s.ALo(47,"i18n"),s.qZA(),s._uU(48),s.ALo(49,"i18n"),s.qZA(),s._uU(50,"\n        "),s.TgZ(51,"app-password-strength",13),s.NdJ("passwordStrengthResult",(function(e){return t.getStrengthResult(e)})),s._uU(52,"\n        "),s.qZA(),s._uU(53,"\n      "),s.qZA(),s._uU(54,"\n    "),s.qZA(),s._uU(55,"\n    "),s.TgZ(56,"div",6),s._uU(57,"\n      "),s.TgZ(58,"div",7),s._uU(59,"\n        "),s.TgZ(60,"label",14),s._uU(61),s.ALo(62,"i18n"),s.qZA(),s._uU(63,"\n        "),s.TgZ(64,"input",15),s.NdJ("ngModelChange",(function(e){return t.masterPasswordRetype=e})),s.qZA(),s._uU(65,"\n      "),s.qZA(),s._uU(66,"\n    "),s.qZA(),s._uU(67,"\n  "),s.qZA(),s._uU(68,"\n  "),s.TgZ(69,"div",7),s._uU(70,"\n    "),s.TgZ(71,"div",16),s._uU(72,"\n      "),s.TgZ(73,"input",17),s.NdJ("ngModelChange",(function(e){return t.checkForBreaches=e})),s.qZA(),s._uU(74,"\n      "),s.TgZ(75,"label",18),s._uU(76),s.ALo(77,"i18n"),s.qZA(),s._uU(78,"\n    "),s.qZA(),s._uU(79,"\n  "),s.qZA(),s._uU(80,"\n  "),s.TgZ(81,"div",7),s._uU(82,"\n    "),s.TgZ(83,"div",16),s._uU(84,"\n      "),s.TgZ(85,"input",19),s.NdJ("ngModelChange",(function(e){return t.rotateUserKey=e}))("change",(function(){return t.rotateUserKeyClicked()})),s.qZA(),s._uU(86,"\n      "),s.TgZ(87,"label",20),s._uU(88),s.ALo(89,"i18n"),s.qZA(),s._uU(90,"\n      "),s.TgZ(91,"a",21),s.ALo(92,"i18n"),s._uU(93,"\n        "),s._UZ(94,"i",22),s._uU(95,"\n      "),s.qZA(),s._uU(96,"\n    "),s.qZA(),s._uU(97,"\n  "),s.qZA(),s._uU(98,"\n  "),s.TgZ(99,"div",7),s._uU(100,"\n    "),s.TgZ(101,"label",23),s._uU(102),s.ALo(103,"i18n"),s.qZA(),s._uU(104,"\n    "),s.TgZ(105,"input",24),s.NdJ("ngModelChange",(function(e){return t.masterPasswordHint=e})),s.qZA(),s._uU(106,"\n  "),s.qZA(),s._uU(107,"\n  "),s.TgZ(108,"button",25),s._uU(109),s.ALo(110,"i18n"),s.qZA(),s._uU(111,"\n"),s.qZA(),s._uU(112,"\n")),2&e){const e=s.MAs(14);s.xp6(3),s.Oqu(s.lcZ(4,25,"changeMasterPassword")),s.xp6(5),s.Oqu(s.lcZ(9,27,"loggedOutWarning")),s.xp6(3),s.Q6J("ngIf",t.enforcedPolicyOptions),s.xp6(2),s.Q6J("appApiAction",t.formPromise),s.xp6(10),s.Oqu(s.lcZ(24,29,"currentMasterPass")),s.xp6(3),s.Q6J("ngModel",t.currentMasterPassword),s.xp6(12),s.Oqu(s.lcZ(39,31,"newMasterPass")),s.xp6(3),s.Q6J("ngModel",t.masterPassword),s.xp6(5),s.Oqu(s.lcZ(47,33,"important")),s.xp6(2),s.AsE("\n          ",s.lcZ(49,35,"masterPassImportant")," ",t.characterMinimumMessage,"\n        "),s.xp6(3),s.Q6J("password",t.masterPassword)("email",t.email)("showText",!0),s.xp6(10),s.Oqu(s.lcZ(62,37,"confirmNewMasterPass")),s.xp6(3),s.Q6J("ngModel",t.masterPasswordRetype),s.xp6(9),s.Q6J("ngModel",t.checkForBreaches),s.xp6(3),s.hij("\n        ",s.lcZ(77,39,"checkForBreaches"),"\n      "),s.xp6(9),s.Q6J("ngModel",t.rotateUserKey),s.xp6(3),s.hij("\n        ",s.lcZ(89,41,"rotateAccountEncKey"),"\n      "),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(92,43,"learnMore")),s.xp6(11),s.Oqu(s.lcZ(103,45,"masterPassHintLabel")),s.xp6(3),s.Q6J("ngModel",t.masterPasswordHint),s.xp6(3),s.Q6J("loading",e.loading),s.xp6(1),s.hij("\n    ",s.lcZ(110,47,"changeMasterPassword"),"\n  ")}},dependencies:[d.O5,l.Fj,l.Wl,l.JJ,l.JL,l.Q7,l.nD,l.On,l.F,ui.B,xe.b,zi.b,eo.Z,Te.r,_r.O,Cn.M,to.e,ee.C],encapsulation:2});var dc=i(37480),pc=i(64447),hc=i(88160);class gc extends rc{}var fc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class mc{constructor(e,t,i,n,s,o,r,a,c){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.cryptoService=n,this.messagingService=s,this.stateService=o,this.logService=r,this.kdfConfigService=a,this.form=new l.cw({masterPassword:new l.NI(null,l.kI.required)}),this.showPassword=!1,this.loading=!1,this.kdfConfig=c.kdfConfig,this.masterPassword=null}submit(){return fc(this,void 0,void 0,(function*(){this.loading=!0;try{this.formPromise=this.makeKeyAndSaveAsync(),yield this.formPromise,this.platformUtilsService.showToast("success",this.i18nService.t("encKeySettingsChanged"),this.i18nService.t("logBackIn")),this.messagingService.send("logout")}catch(e){this.logService.error(e)}finally{this.loading=!1}}))}makeKeyAndSaveAsync(){return fc(this,void 0,void 0,(function*(){const e=this.form.value.masterPassword;this.kdfConfig.validateKdfConfig();const t=new gc;t.kdf=this.kdfConfig.kdfType,t.kdfIterations=this.kdfConfig.iterations,this.kdfConfig.kdfType===Hi.G3.Argon2id&&(t.kdfMemory=this.kdfConfig.memory,t.kdfParallelism=this.kdfConfig.parallelism);const i=yield this.cryptoService.getOrDeriveMasterKey(e);t.masterPasswordHash=yield this.cryptoService.hashMasterKey(e,i);const n=yield this.stateService.getEmail(),s=yield this.cryptoService.makeMasterKey(e,n,this.kdfConfig);t.newMasterPasswordHash=yield this.cryptoService.hashMasterKey(e,s);const o=yield this.cryptoService.encryptUserKeyWithMasterKey(s);t.key=o[1].encryptedString,yield this.apiService.postAccountKdf(t)}))}}mc.ɵfac=function(e){return new(e||mc)(s.Y36(Ue.s),s.Y36(M.D),s.Y36(N.P),s.Y36(D.$),s.Y36(fe.o),s.Y36(J.b),s.Y36(_e.$),s.Y36(sn.d),s.Y36(jo.Kt))},mc.ɵcmp=s.Xpm({type:mc,selectors:[["app-change-kdf-confirmation"]],decls:49,vars:22,consts:[["bitDialogTitle",""],["bitDialogContent",""],["type","warning"],["id","form","ngNativeValidate","","autocomplete","off",3,"formGroup","appApiAction","ngSubmit"],[1,"row"],[1,"col-12"],[1,"tw-mb-1"],["bitInput","","type","password","required","","formControlName","masterPassword","appAutofocus",""],["type","button","bitSuffix","","bitIconButton","","bitPasswordInputToggle","",3,"toggled","toggledChange"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit","form","form",3,"loading"],["bitButton","","buttonType","secondary","type","button","bitDialogClose",""]],template:function(e,t){1&e&&(s.TgZ(0,"bit-dialog"),s._uU(1,"\n  "),s.TgZ(2,"span",0),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n\n  "),s.TgZ(6,"span",1),s._uU(7,"\n    "),s.TgZ(8,"bit-callout",2),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n    "),s.TgZ(12,"form",3),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(13,"\n      "),s.TgZ(14,"div",4),s._uU(15,"\n        "),s.TgZ(16,"div",5),s._uU(17,"\n          "),s.TgZ(18,"bit-form-field",6)(19,"bit-label"),s._uU(20),s.ALo(21,"i18n"),s.qZA(),s._uU(22,"\n            "),s._UZ(23,"input",7),s._uU(24,"\n            "),s.TgZ(25,"button",8),s.NdJ("toggledChange",(function(e){return t.showPassword=e})),s.qZA(),s.TgZ(26,"bit-hint"),s._uU(27),s.ALo(28,"i18n"),s.qZA()(),s._uU(29,"\n        "),s.qZA(),s._uU(30,"\n      "),s.qZA(),s._uU(31,"\n    "),s.qZA(),s._uU(32,"\n  "),s.qZA(),s._uU(33,"\n  "),s.ynx(34,9),s._uU(35,"\n    "),s.TgZ(36,"button",10),s._uU(37,"\n      "),s.TgZ(38,"span"),s._uU(39),s.ALo(40,"i18n"),s.qZA(),s._uU(41,"\n    "),s.qZA(),s._uU(42,"\n    "),s.TgZ(43,"button",11),s._uU(44),s.ALo(45,"i18n"),s.qZA(),s._uU(46,"\n  "),s.BQk(),s._uU(47,"\n"),s.qZA(),s._uU(48,"\n")),2&e&&(s.xp6(3),s.hij("\n    ",s.lcZ(4,10,"changeKdf"),"\n  "),s.xp6(6),s.Oqu(s.lcZ(10,12,"changeKdfLoggedOutWarning")),s.xp6(3),s.Q6J("formGroup",t.form)("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(21,14,"masterPass")),s.xp6(5),s.Q6J("toggled",t.showPassword),s.xp6(2),s.hij("\n              ",s.lcZ(28,16,"confirmIdentity"),"\n            "),s.xp6(9),s.Q6J("loading",t.loading),s.xp6(3),s.Oqu(s.lcZ(40,18,"changeKdf")),s.xp6(5),s.hij("\n      ",s.lcZ(45,20,"cancel"),"\n    "))},dependencies:[l.Fj,l.JJ,l.JL,l.Q7,l.sg,l.u,xe.b,Ji.U,Te.r,_r.O,$o.a,Ho.f,Oe.d,ke.G,As.w,Zs.e,Pe.u,Cn.M,xs.Q,ee.C],encapsulation:2});var vc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function yc(e,t){if(1&e&&(s.TgZ(0,"option",15),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function wc(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"label",16),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"input",17),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.kdfConfig.memory=t)})),s.qZA(),s._uU(7,"\n        "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(3),s.Oqu(s.lcZ(4,4,"kdfMemory")),s.xp6(3),s.Q6J("min",e.ARGON2_MEMORY.min)("max",e.ARGON2_MEMORY.max)("ngModel",e.kdfConfig.memory)}}function bc(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"label",18),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"a",19),s.ALo(7,"i18n"),s._uU(8,"\n            "),s._UZ(9,"i",9),s._uU(10,"\n          "),s.qZA(),s._uU(11,"\n          "),s.TgZ(12,"input",20),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.kdfConfig.iterations=t)})),s.qZA(),s._uU(13,"\n        "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(3),s.Oqu(s.lcZ(4,5,"kdfIterations")),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(7,7,"learnMore")),s.xp6(6),s.Q6J("min",e.PBKDF2_ITERATIONS.min)("max",e.PBKDF2_ITERATIONS.max)("ngModel",e.kdfConfig.iterations)}}function Uc(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n          "),s.TgZ(2,"label",18),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"input",21),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.kdfConfig.iterations=t)})),s.qZA(),s._uU(7,"\n          "),s.TgZ(8,"label",22),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n          "),s.TgZ(12,"input",23),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.kdfConfig.parallelism=t)})),s.qZA(),s._uU(13,"\n        "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(3),s.Oqu(s.lcZ(4,8,"kdfIterations")),s.xp6(3),s.Q6J("min",e.ARGON2_ITERATIONS.min)("max",e.ARGON2_ITERATIONS.max)("ngModel",e.kdfConfig.iterations),s.xp6(3),s.Oqu(s.lcZ(10,10,"kdfParallelism")),s.xp6(3),s.Q6J("min",e.ARGON2_PARALLELISM.min)("max",e.ARGON2_PARALLELISM.max)("ngModel",e.kdfConfig.parallelism)}}function _c(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"p",24),s._uU(3),s.ALo(4,"i18n"),s.ALo(5,"number"),s.qZA(),s._uU(6,"\n        "),s.TgZ(7,"bit-callout",1),s._uU(8),s.ALo(9,"i18n"),s.ALo(10,"number"),s.qZA(),s._uU(11,"\n      "),s.BQk()),2&e){const e=s.oxw();s.xp6(3),s.hij("\n          ",s.xi3(4,2,"kdfIterationsDesc",s.lcZ(5,5,e.PBKDF2_ITERATIONS.defaultValue)),"\n        "),s.xp6(5),s.hij("\n          ",s.xi3(9,7,"kdfIterationsWarning",s.lcZ(10,10,1e5)),"\n        ")}}function Ac(e,t){1&e&&(s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"p",24),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n        "),s.TgZ(6,"bit-callout",1),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n      "),s.BQk()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,2,"argon2Desc")),s.xp6(4),s.hij(" ",s.lcZ(8,4,"argon2Warning"),""))}class Zc{constructor(e,t){this.dialogService=e,this.kdfConfigService=t,this.kdfConfig=Hi.al,this.kdfType=Hi.G3,this.kdfOptions=[],this.PBKDF2_ITERATIONS=Hi.qv,this.ARGON2_ITERATIONS=Hi.lh,this.ARGON2_MEMORY=Hi._l,this.ARGON2_PARALLELISM=Hi.Oi,this.kdfOptions=[{name:"PBKDF2 SHA-256",value:Hi.G3.PBKDF2_SHA256},{name:"Argon2id",value:Hi.G3.Argon2id}]}ngOnInit(){return vc(this,void 0,void 0,(function*(){this.kdfConfig=yield this.kdfConfigService.getKdfConfig()}))}isPBKDF2(e){return e instanceof hc.S}isArgon2(e){return e instanceof hc.H}onChangeKdf(e){return vc(this,void 0,void 0,(function*(){if(e===Hi.G3.PBKDF2_SHA256)this.kdfConfig=new hc.S;else{if(e!==Hi.G3.Argon2id)throw new Error("Unknown KDF type.");this.kdfConfig=new hc.H}}))}openConfirmationModal(){return vc(this,void 0,void 0,(function*(){this.dialogService.open(mc,{data:{kdfConfig:this.kdfConfig}})}))}}Zc.ɵfac=function(e){return new(e||Zc)(s.Y36(I.x),s.Y36(sn.d))},Zc.ɵcmp=s.Xpm({type:Zc,selectors:[["app-change-kdf"]],decls:62,vars:23,consts:[[1,"tabbed-header"],["type","warning"],["ngNativeValidate","","autocomplete","off"],["form",""],[1,"row"],[1,"col-6"],[1,"form-group","mb-0"],["for","kdf"],["href","https://bitwarden.com/help/kdf-algorithms","target","_blank","rel","noreferrer",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["id","kdf","name","Kdf","required","",1,"form-control","mb-3",3,"ngModel","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"col-12"],["type","button","buttonType","primary","bitButton","",3,"loading","click"],[3,"ngValue"],["for","kdfMemory"],["id","kdfMemory","type","number","name","Memory","required","",1,"form-control","mb-3",3,"min","max","ngModel","ngModelChange"],["for","kdfIterations"],["href","https://bitwarden.com/help/what-encryption-is-used/#changing-kdf-iterations","target","_blank","rel","noreferrer",1,"ml-auto",3,"appA11yTitle"],["id","kdfIterations","type","number","name","KdfIterations","required","",1,"form-control",3,"min","max","ngModel","ngModelChange"],["id","iterations","type","number","name","Iterations","required","",1,"form-control","mb-3",3,"min","max","ngModel","ngModelChange"],["for","kdfParallelism"],["id","kdfParallelism","type","number","name","Parallelism","required","",1,"form-control",3,"min","max","ngModel","ngModelChange"],[1,"small","form-text","text-muted"]],template:function(e,t){if(1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"h1"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n"),s.qZA(),s._uU(6,"\n"),s.TgZ(7,"bit-callout",1),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n"),s.TgZ(11,"form",2,3),s._uU(13,"\n  "),s.TgZ(14,"div",4),s._uU(15,"\n    "),s.TgZ(16,"div",5),s._uU(17,"\n      "),s.TgZ(18,"div",6),s._uU(19,"\n        "),s.TgZ(20,"label",7),s._uU(21),s.ALo(22,"i18n"),s.qZA(),s._uU(23,"\n        "),s.TgZ(24,"a",8),s.ALo(25,"i18n"),s._uU(26,"\n          "),s._UZ(27,"i",9),s._uU(28,"\n        "),s.qZA(),s._uU(29,"\n        "),s.TgZ(30,"select",10),s.NdJ("ngModelChange",(function(e){return t.kdfConfig.kdfType=e}))("ngModelChange",(function(e){return t.onChangeKdf(e)})),s._uU(31,"\n          "),s.YNc(32,yc,2,2,"option",11),s._uU(33,"\n        "),s.qZA(),s._uU(34,"\n        "),s.YNc(35,wc,8,6,"ng-container",12),s._uU(36,"\n      "),s.qZA(),s._uU(37,"\n    "),s.qZA(),s._uU(38,"\n    "),s.TgZ(39,"div",5),s._uU(40,"\n      "),s.TgZ(41,"div",6),s._uU(42,"\n        "),s.YNc(43,bc,14,9,"ng-container",12),s._uU(44,"\n        "),s.YNc(45,Uc,14,12,"ng-container",12),s._uU(46,"\n      "),s.qZA(),s._uU(47,"\n    "),s.qZA(),s._uU(48,"\n    "),s.TgZ(49,"div",13),s._uU(50,"\n      "),s.YNc(51,_c,12,12,"ng-container",12),s._uU(52,"\n      "),s.YNc(53,Ac,10,6,"ng-container",12),s._uU(54,"\n    "),s.qZA(),s._uU(55,"\n  "),s.qZA(),s._uU(56,"\n  "),s.TgZ(57,"button",14),s.NdJ("click",(function(){return t.openConfirmationModal()})),s._uU(58),s.ALo(59,"i18n"),s.qZA(),s._uU(60,"\n"),s.qZA(),s._uU(61,"\n")),2&e){const e=s.MAs(12);s.xp6(3),s.Oqu(s.lcZ(4,13,"encKeySettings")),s.xp6(5),s.Oqu(s.lcZ(9,15,"changeKdfLoggedOutWarning")),s.xp6(13),s.Oqu(s.lcZ(22,17,"kdfAlgorithm")),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(25,19,"learnMore")),s.xp6(6),s.Q6J("ngModel",t.kdfConfig.kdfType),s.xp6(2),s.Q6J("ngForOf",t.kdfOptions),s.xp6(3),s.Q6J("ngIf",t.isArgon2(t.kdfConfig)),s.xp6(8),s.Q6J("ngIf",t.isPBKDF2(t.kdfConfig)),s.xp6(2),s.Q6J("ngIf",t.isArgon2(t.kdfConfig)),s.xp6(6),s.Q6J("ngIf",t.isPBKDF2(t.kdfConfig)),s.xp6(2),s.Q6J("ngIf",t.isArgon2(t.kdfConfig)),s.xp6(4),s.Q6J("loading",e.loading),s.xp6(1),s.hij("\n    ",s.lcZ(59,21,"changeKdf"),"\n  ")}},dependencies:[d.sg,d.O5,l.YN,l.Kr,l.Fj,l.wV,l.EJ,l.JJ,l.JL,l.Q7,l.qQ,l.Fd,l.On,l.F,ui.B,Te.r,_r.O,d.JJ,ee.C],encapsulation:2});var xc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Sc=["viewUserApiKeyTemplate"],Tc=["rotateUserApiKeyTemplate"];function Cc(e,t){1&e&&s._UZ(0,"app-change-kdf")}function Oc(e,t){}function kc(e,t){}const Pc=function(e,t){return{"tabbed-header":e,"secondary-header":t}};class qc{constructor(e,t,i,n){this.userVerificationService=e,this.stateService=t,this.modalService=i,this.apiService=n,this.showChangeKdf=!0}ngOnInit(){return xc(this,void 0,void 0,(function*(){this.showChangeKdf=yield this.userVerificationService.hasMasterPassword()}))}viewUserApiKey(){return xc(this,void 0,void 0,(function*(){const e=yield this.stateService.getUserId();yield this.modalService.openViewRef(pc.B,this.viewUserApiKeyModalRef,(t=>{t.keyType="user",t.entityId=e,t.postKey=this.apiService.postUserApiKey.bind(this.apiService),t.scope="api",t.grantType="client_credentials",t.apiKeyTitle="apiKey",t.apiKeyWarning="userApiKeyWarning",t.apiKeyDescription="userApiKeyDesc"}))}))}rotateUserApiKey(){return xc(this,void 0,void 0,(function*(){const e=yield this.stateService.getUserId();yield this.modalService.openViewRef(pc.B,this.rotateUserApiKeyModalRef,(t=>{t.keyType="user",t.isRotation=!0,t.entityId=e,t.postKey=this.apiService.postUserRotateApiKey.bind(this.apiService),t.scope="api",t.grantType="client_credentials",t.apiKeyTitle="apiKey",t.apiKeyWarning="userApiKeyWarning",t.apiKeyDescription="apiKeyRotateDesc"}))}))}}qc.ɵfac=function(e){return new(e||qc)(s.Y36(nn.i),s.Y36(J.b),s.Y36(uo.Z),s.Y36(Ue.s))},qc.ɵcmp=s.Xpm({type:qc,selectors:[["app-security-keys"]],viewQuery:function(e,t){if(1&e&&(s.Gf(Sc,7,s.s_b),s.Gf(Tc,7,s.s_b)),2&e){let e;s.iGM(e=s.CRH())&&(t.viewUserApiKeyModalRef=e.first),s.iGM(e=s.CRH())&&(t.rotateUserApiKeyModalRef=e.first)}},decls:27,vars:17,consts:[[4,"ngIf"],[1,"border-0","mb-0",3,"ngClass"],["type","button","bitButton","","buttonType","secondary",3,"click"],["viewUserApiKeyTemplate",""],["rotateUserApiKeyTemplate",""]],template:function(e,t){1&e&&(s.YNc(0,Cc,1,0,"app-change-kdf",0),s._uU(1,"\n"),s.TgZ(2,"div",1),s._uU(3,"\n  "),s.TgZ(4,"h1"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"p"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n"),s.TgZ(13,"button",2),s.NdJ("click",(function(){return t.viewUserApiKey()})),s._uU(14),s.ALo(15,"i18n"),s.qZA(),s._uU(16,"\n"),s.TgZ(17,"button",2),s.NdJ("click",(function(){return t.rotateUserApiKey()})),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n"),s.YNc(21,Oc,0,0,"ng-template",null,3,s.W1O),s._uU(23,"\n"),s.YNc(24,kc,0,0,"ng-template",null,4,s.W1O),s._uU(26,"\n")),2&e&&(s.Q6J("ngIf",t.showChangeKdf),s.xp6(2),s.Q6J("ngClass",s.WLB(14,Pc,!t.showChangeKdf,t.showChangeKdf)),s.xp6(3),s.Oqu(s.lcZ(6,6,"apiKey")),s.xp6(5),s.hij("\n  ",s.lcZ(11,8,"userApiKeyDesc"),"\n"),s.xp6(4),s.hij("\n  ",s.lcZ(15,10,"viewApiKey"),"\n"),s.xp6(4),s.hij("\n  ",s.lcZ(19,12,"rotateApiKey"),"\n"))},dependencies:[d.mk,d.O5,Te.r,Zc,ee.C],encapsulation:2});var Ic=i(66267),Mc=i(97327);const Nc=["rla"];class Lc{onKeyDown(e){"Space"===e.code&&this.tabItem.click()}get active(){var e,t;return null!==(t=null===(e=this.routerLinkActive)||void 0===e?void 0:e.isActive)&&void 0!==t&&t}constructor(e){this._tabNavBar=e,this.destroy$=new h.x,this.routerLinkMatchOptions={queryParams:"ignored",matrixParams:"ignored",paths:"subset",fragment:"ignored"},this.disabled=!1}focus(){this.tabItem.focus()}ngAfterViewInit(){this.routerLinkActive.isActiveChange.pipe((0,g.R)(this.destroy$)).subscribe((e=>this._tabNavBar.updateActiveLink()))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Lc.ɵfac=function(e){return new(e||Lc)(s.Y36(Fc))},Lc.ɵcmp=s.Xpm({type:Lc,selectors:[["bit-tab-link"]],viewQuery:function(e,t){if(1&e&&(s.Gf(Mc.B,5),s.Gf(Nc,5)),2&e){let e;s.iGM(e=s.CRH())&&(t.tabItem=e.first),s.iGM(e=s.CRH())&&(t.routerLinkActive=e.first)}},hostBindings:function(e,t){1&e&&s.NdJ("keydown",(function(e){return t.onKeyDown(e)}))},inputs:{route:"route",disabled:"disabled"},ngContentSelectors:["*"],decls:6,vars:5,consts:[["bitTabListItem","","routerLinkActive","","ariaCurrentWhenActive","page","role","link",3,"routerLink","routerLinkActiveOptions","active","disabled"],["rla","routerLinkActive"]],template:function(e,t){if(1&e&&(s.F$t(),s.TgZ(0,"a",0,1),s._uU(2,"\n  "),s.Hsn(3),s._uU(4,"\n"),s.qZA(),s._uU(5,"\n")),2&e){const e=s.MAs(1);s.Q6J("routerLink",t.disabled?null:t.route)("routerLinkActiveOptions",t.routerLinkMatchOptions)("active",e.isActive)("disabled",t.disabled),s.uIk("aria-disabled",t.disabled)}},dependencies:[p.rH,p.Od,Mc.B],encapsulation:2});var Dc=i(52850),Ec=i(59047);class Fc{constructor(){this.label=""}ngAfterContentInit(){this.keyManager=new Ic.Em(this.tabLabels).withHorizontalOrientation("ltr").withWrap().withHomeAndEnd()}updateActiveLink(){const e=this.tabLabels.toArray();for(let t=0;t<e.length;t++)e[t].active&&this.keyManager.updateActiveItem(t)}}Fc.ɵfac=function(e){return new(e||Fc)},Fc.ɵcmp=s.Xpm({type:Fc,selectors:[["bit-tab-nav-bar"]],contentQueries:function(e,t,i){if(1&e&&s.Suo(i,Lc,4),2&e){let e;s.iGM(e=s.CRH())&&(t.tabLabels=e)}},hostAttrs:[1,"tw-block"],inputs:{label:"label"},ngContentSelectors:["*"],decls:8,vars:1,consts:[["bitTabListContainer","",3,"keydown"]],template:function(e,t){1&e&&(s.F$t(),s.TgZ(0,"bit-tab-header"),s._uU(1,"\n  "),s.TgZ(2,"nav",0),s.NdJ("keydown",(function(e){return t.keyManager.onKeydown(e)})),s._uU(3,"\n    "),s.Hsn(4),s._uU(5,"\n  "),s.qZA(),s._uU(6,"\n"),s.qZA(),s._uU(7,"\n")),2&e&&(s.xp6(2),s.uIk("aria-label",t.label))},dependencies:[Dc.M,Ec.Q],encapsulation:2});var Rc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Jc{constructor(e){this.userVerificationService=e,this.showChangePassword=!0}ngOnInit(){return Rc(this,void 0,void 0,(function*(){this.showChangePassword=yield this.userVerificationService.hasMasterPassword()}))}}Jc.ɵfac=function(e){return new(e||Jc)(s.Y36(nn.i))},Jc.ɵcmp=s.Xpm({type:Jc,selectors:[["app-security"]],decls:23,vars:9,consts:[["slot","tabs"],["route","change-password"],["route","two-factor"],["route","security-keys"]],template:function(e,t){1&e&&(s.TgZ(0,"app-header"),s._uU(1,"\n  "),s.TgZ(2,"bit-tab-nav-bar",0),s._uU(3,"\n    "),s.TgZ(4,"bit-tab-link",1),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n    "),s.TgZ(8,"bit-tab-link",2),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n    "),s.TgZ(12,"bit-tab-link",3),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n  "),s.qZA(),s._uU(16,"\n"),s.qZA(),s._uU(17,"\n\n"),s.TgZ(18,"bit-container"),s._uU(19,"\n  "),s._UZ(20,"router-outlet"),s._uU(21,"\n"),s.qZA(),s._uU(22,"\n")),2&e&&(s.xp6(5),s.Oqu(s.lcZ(6,3,"masterPassword")),s.xp6(4),s.Oqu(s.lcZ(10,5,"twoStepLogin")),s.xp6(4),s.Oqu(s.lcZ(14,7,"keys")))},dependencies:[p.lC,si.e,Fc,Lc,oi.k,ee.C],encapsulation:2});const zc=[{path:"",component:Jc,data:{titleId:"security"},children:[{path:"",pathMatch:"full",redirectTo:"change-password"},{path:"change-password",component:uc,data:{titleId:"masterPassword"}},{path:"two-factor",component:dc.x,data:{titleId:"twoStepLogin"}},{path:"security-keys",component:qc,data:{titleId:"keys"}}]}];class Yc{}Yc.ɵfac=function(e){return new(e||Yc)},Yc.ɵmod=s.oAB({type:Yc}),Yc.ɵinj=s.cJS({imports:[p.Bz.forChild(zc),p.Bz]});var Kc=i(45995),Bc=i(5351),Qc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Gc(e,t){1&e&&(s.TgZ(0,"div",7),s._uU(1,"\n          "),s._UZ(2,"i",8),s.ALo(3,"i18n"),s._uU(4),s.ALo(5,"i18n"),s.qZA()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(2),s.hij("\n          ",s.lcZ(5,4,"loading"),"\n        "))}function jc(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",7),s._uU(1,"\n          "),s.TgZ(2,"p"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"div",9),s._uU(7,"\n            "),s.TgZ(8,"label",10),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n            "),s.TgZ(12,"input",11),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.identifier=t)})),s.qZA(),s._uU(13,"\n          "),s.qZA(),s._uU(14,"\n          "),s._UZ(15,"hr"),s._uU(16,"\n          "),s.TgZ(17,"div",12),s._uU(18,"\n            "),s.TgZ(19,"button",13),s._uU(20,"\n              "),s.TgZ(21,"span"),s._uU(22," "),s._UZ(23,"i",14),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n              "),s._UZ(27,"i",8),s.ALo(28,"i18n"),s._uU(29,"\n            "),s.qZA(),s._uU(30,"\n            "),s.TgZ(31,"a",15),s._uU(32),s.ALo(33,"i18n"),s.qZA(),s._uU(34,"\n          "),s.qZA(),s._uU(35,"\n        "),s.qZA()}if(2&e){const e=s.oxw(),t=s.MAs(1);s.xp6(3),s.Oqu(s.lcZ(4,7,"ssoLogInWithOrgIdentifier")),s.xp6(6),s.Oqu(s.lcZ(10,9,"ssoIdentifier")),s.xp6(3),s.Q6J("ngModel",e.identifier),s.xp6(7),s.Q6J("disabled",t.loading),s.xp6(5),s.hij(" ",s.lcZ(25,11,"logIn")," "),s.xp6(3),s.s9C("title",s.lcZ(28,13,"loading")),s.xp6(5),s.hij("\n              ",s.lcZ(33,15,"cancel"),"\n            ")}}class Vc extends Kc.o{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v){super(e,t,i,n,s,o,r,a,l,c,u,d,g,f,m,v),this.orgDomainApiService=p,this.validationService=h,this.redirectUri=window.location.origin+"/sso-connector.html",this.clientId="web"}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return Qc(this,void 0,void 0,(function*(){e.ngOnInit.call(this),this.route.queryParams.pipe((0,oe.P)()).subscribe((e=>Qc(this,void 0,void 0,(function*(){if(null!=e.identifier)this.identifier=e.identifier;else{if(e.email){this.loggingIn=!0;try{const t=yield this.orgDomainApiService.getClaimedOrgDomainByEmail(e.email);if(null==t?void 0:t.ssoAvailable)return this.identifier=t.organizationIdentifier,void(yield this.submit())}catch(t){this.handleGetClaimedDomainByEmailError(t)}this.loggingIn=!1}const i=yield this.ssoLoginService.getOrganizationSsoIdentifier();null!=i&&(this.identifier=i)}}))))}))}handleGetClaimedDomainByEmailError(e){if(e instanceof Kn.i){const t=e;if(t.statusCode===le.WE.NotFound)return;this.validationService.showError(t)}}submit(){const e=Object.create(null,{submit:{get:()=>super.submit}});return Qc(this,void 0,void 0,(function*(){yield this.ssoLoginService.setOrganizationSsoIdentifier(this.identifier),"browser"===this.clientId&&(document.cookie=`ssoHandOffMessage=${this.i18nService.t("ssoHandOff")};SameSite=strict`),e.submit.call(this)}))}}Vc.ɵfac=function(e){return new(e||Vc)(s.Y36(_n.F),s.Y36(Di.m),s.Y36(p.F0),s.Y36(M.D),s.Y36(p.gz),s.Y36(J.b),s.Y36(N.P),s.Y36(Ue.s),s.Y36($n.O),s.Y36($i.L),s.Y36(A.UW),s.Y36(_e.$),s.Y36(Bc.T),s.Y36(Bt.R),s.Y36(Di.Bb),s.Y36(Q.E),s.Y36(Xi.R),s.Y36(G.BR))},Vc.ɵcmp=s.Xpm({type:Vc,selectors:[["app-sso"]],features:[s.qOj],decls:19,vars:3,consts:[["ngNativeValidate","",1,"container",3,"appApiAction","ngSubmit"],["form",""],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],["alt","Bitwarden",1,"logo","mb-2","logo-themed"],[1,"card","d-block","mt-4"],["class","card-body",4,"ngIf"],[1,"card-body"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],[1,"form-group"],["for","identifier"],["id","identifier","type","text","name","Identifier","required","","appAutofocus","",1,"form-control",3,"ngModel","ngModelChange"],[1,"d-flex"],["type","submit",1,"btn","btn-primary","btn-block","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-sign-in"],["routerLink","/login",1,"btn","btn-outline-secondary","btn-block","ml-2","mt-0"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n  "),s.TgZ(3,"div",2),s._uU(4,"\n    "),s.TgZ(5,"div",3),s._uU(6,"\n      "),s._UZ(7,"img",4),s._uU(8,"\n      "),s.TgZ(9,"div",5),s._uU(10,"\n        "),s.YNc(11,Gc,6,6,"div",6),s._uU(12,"\n        "),s.YNc(13,jc,36,17,"div",6),s._uU(14,"\n      "),s.qZA(),s._uU(15,"\n    "),s.qZA(),s._uU(16,"\n  "),s.qZA(),s._uU(17,"\n"),s.qZA(),s._uU(18,"\n")),2&e&&(s.Q6J("appApiAction",t.initiateSsoFormPromise),s.xp6(11),s.Q6J("ngIf",t.loggingIn),s.xp6(2),s.Q6J("ngIf",!t.loggingIn))},dependencies:[d.O5,l.Fj,l.JJ,l.JL,l.Q7,l.On,l.F,p.rH,xe.b,Ji.U,ee.C],encapsulation:2});class $c{}var Hc,Wc,Xc=i(83376),eu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function tu(e,t){1&e&&(s.ynx(0),s._uU(1,"\n  "),s._UZ(2,"i",2),s.ALo(3,"i18n"),s._uU(4,"\n  "),s.TgZ(5,"span",3),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n"),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function iu(e,t){if(1&e&&(s.TgZ(0,"div",16),s._uU(1,"\n        "),s.TgZ(2,"label",17),s._uU(3,"\n          "),s._UZ(4,"input",18),s._uU(5),s.ALo(6,"i18n"),s.ALo(7,"currency"),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n      "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(4),s.Q6J("value",e.annualCadence),s.xp6(1),s.lnq("\n          ",s.lcZ(6,4,"annual")," -\n          ",s.xi3(7,6,e.getPriceFor(e.annualCadence),"$"),"\n          /",s.lcZ(8,9,"yr"),"\n        ")}}function nu(e,t){if(1&e&&(s.TgZ(0,"div",16),s._uU(1,"\n        "),s.TgZ(2,"label",19),s._uU(3,"\n          "),s._UZ(4,"input",20),s._uU(5),s.ALo(6,"i18n"),s.ALo(7,"currency"),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n      "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(4),s.Q6J("value",e.monthlyCadence),s.xp6(1),s.lnq("\n          ",s.lcZ(6,4,"monthly")," -\n          ",s.xi3(7,6,e.getPriceFor(e.monthlyCadence),"$"),"\n          /",s.lcZ(8,9,"monthAbbr"),"\n        ")}}function su(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"form",4,5),s.NdJ("ngSubmit",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.submit())})),s._uU(2,"\n  "),s.TgZ(3,"div",6),s._uU(4,"\n    "),s.TgZ(5,"div",7),s._uU(6,"\n      "),s.TgZ(7,"h2",8),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.YNc(11,iu,10,11,"div",9),s._uU(12,"\n      "),s.YNc(13,nu,10,11,"div",9),s._uU(14,"\n    "),s.qZA(),s._uU(15,"\n    "),s.TgZ(16,"div",10),s._uU(17,"\n      "),s.TgZ(18,"h2",8),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n      "),s._UZ(22,"app-payment",11),s._uU(23,"\n      "),s.TgZ(24,"app-tax-info",12),s.NdJ("onCountryChanged",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.changedCountry())})),s.qZA(),s._uU(25,"\n    "),s.qZA(),s._uU(26,"\n    "),s.TgZ(27,"div",13),s._uU(28,"\n      "),s.TgZ(29,"button",14),s._uU(30),s.ALo(31,"i18n"),s.qZA(),s._uU(32,"\n      "),s.TgZ(33,"button",15),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.stepBack())})),s._uU(34,"Back"),s.qZA(),s._uU(35,"\n    "),s.qZA(),s._uU(36,"\n  "),s.qZA(),s._uU(37,"\n"),s.qZA()}if(2&e){const e=s.MAs(1),t=s.oxw();s.Q6J("formGroup",t.formGroup)("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,11,"billingPlanLabel")),s.xp6(3),s.Q6J("ngIf",null!==t.annualPlan),s.xp6(2),s.Q6J("ngIf",null!==t.monthlyPlan),s.xp6(6),s.Oqu(s.lcZ(20,13,"paymentType")),s.xp6(3),s.Q6J("hideCredit",!0)("trialFlow",!0),s.xp6(2),s.Q6J("trialFlow",!0),s.xp6(5),s.Q6J("loading",e.loading),s.xp6(1),s.hij("\n        ",s.lcZ(31,15,"startTrial"),"\n      ")}}!function(e){e[e.Annual=0]="Annual",e[e.Monthly=1]="Monthly"}(Hc||(Hc={})),function(e){e[e.PasswordManager=0]="PasswordManager",e[e.SecretsManager=1]="SecretsManager"}(Wc||(Wc={}));class ou{constructor(e,t,i,n,o,r){this.apiService=e,this.i18nService=t,this.formBuilder=i,this.messagingService=n,this.organizationBillingService=o,this.platformUtilsService=r,this.subscriptionProduct=Wc.PasswordManager,this.steppedBack=new s.vpe,this.organizationCreated=new s.vpe,this.loading=!0,this.annualCadence=Hc.Annual,this.monthlyCadence=Hc.Monthly,this.formGroup=this.formBuilder.group({cadence:[Hc.Annual,l.kI.required]}),this.productTypeToPlanTypeMap={[le.kv.Enterprise]:{[Hc.Annual]:ae.k9.EnterpriseAnnually,[Hc.Monthly]:ae.k9.EnterpriseMonthly},[le.kv.Families]:{[Hc.Annual]:ae.k9.FamiliesAnnually},[le.kv.Teams]:{[Hc.Annual]:ae.k9.TeamsAnnually,[Hc.Monthly]:ae.k9.TeamsMonthly},[le.kv.TeamsStarter]:{[Hc.Monthly]:ae.k9.TeamsStarter}}}ngOnInit(){return eu(this,void 0,void 0,(function*(){const e=yield this.apiService.getPlans();this.applicablePlans=e.data.filter(this.isApplicable),this.annualPlan=this.findPlanFor(Hc.Annual),this.monthlyPlan=this.findPlanFor(Hc.Monthly),this.loading=!1}))}submit(){return eu(this,void 0,void 0,(function*(){this.formPromise=this.createOrganization();const e=yield this.formPromise,t=this.getPlanDescription();this.platformUtilsService.showToast("success",this.i18nService.t("organizationCreated"),this.i18nService.t("organizationReadyToGo")),this.organizationCreated.emit({organizationId:e,planDescription:t}),this.messagingService.send("organizationCreated",{organizationId:e})}))}changedCountry(){this.paymentComponent.hideBank="US"!==this.taxInfoComponent.taxInfo.country,this.paymentComponent.hideBank&&this.paymentComponent.method===ae.Lt.BankAccount&&(this.paymentComponent.method=ae.Lt.Card,this.paymentComponent.changeMethod())}getPriceFor(e){const t=this.findPlanFor(e);return this.subscriptionProduct===Wc.PasswordManager?0===t.PasswordManager.basePrice?t.PasswordManager.seatPrice:t.PasswordManager.basePrice:0===t.SecretsManager.basePrice?t.SecretsManager.seatPrice:t.SecretsManager.basePrice}stepBack(){this.steppedBack.emit()}createOrganization(){return eu(this,void 0,void 0,(function*(){const e=this.findPlanFor(this.formGroup.value.cadence),t=yield this.paymentComponent.createPaymentToken(),i={name:this.organizationInfo.name,billingEmail:this.organizationInfo.email,initiationPath:this.subscriptionProduct===Wc.PasswordManager?"Password Manager trial from marketing website":"Secrets Manager trial from marketing website"},n={type:e.type,passwordManagerSeats:1};this.subscriptionProduct===Wc.SecretsManager&&(n.subscribeToSecretsManager=!0,n.isFromSecretsManagerTrial=!0,n.secretsManagerSeats=1);const s={paymentMethod:t,billing:this.getBillingInformationFromTaxInfoComponent()};return(yield this.organizationBillingService.purchaseSubscription({organization:i,plan:n,payment:s})).id}))}findPlanFor(e){var t;const i=this.organizationInfo.type,n=null===(t=this.productTypeToPlanTypeMap[i])||void 0===t?void 0:t[e];return n?this.applicablePlans.find((e=>e.type===n)):null}getBillingInformationFromTaxInfoComponent(){return{postalCode:this.taxInfoComponent.taxInfo.postalCode,country:this.taxInfoComponent.taxInfo.country,taxId:this.taxInfoComponent.taxInfo.taxId,addressLine1:this.taxInfoComponent.taxInfo.line1,addressLine2:this.taxInfoComponent.taxInfo.line2,city:this.taxInfoComponent.taxInfo.city,state:this.taxInfoComponent.taxInfo.state}}getPlanDescription(){const e=this.findPlanFor(this.formGroup.value.cadence),t=this.subscriptionProduct===Wc.PasswordManager?0===e.PasswordManager.basePrice?e.PasswordManager.seatPrice:e.PasswordManager.basePrice:0===e.SecretsManager.basePrice?e.SecretsManager.seatPrice:e.SecretsManager.basePrice;switch(this.formGroup.value.cadence){case Hc.Annual:return`${this.i18nService.t("annual")} ($${t}/${this.i18nService.t("yr")})`;case Hc.Monthly:return`${this.i18nService.t("monthly")} ($${t}/${this.i18nService.t("monthAbbr")})`}}isApplicable(e){const t=e.product===le.kv.Enterprise||e.product===le.kv.Families||e.product===le.kv.Teams||e.product===le.kv.TeamsStarter,i=!e.disabled&&!e.legacyYear;return t&&i}}ou.ɵfac=function(e){return new(e||ou)(s.Y36(Ue.s),s.Y36(M.D),s.Y36(l.qu),s.Y36(fe.o),s.Y36(Xc.c),s.Y36(N.P))},ou.ɵcmp=s.Xpm({type:ou,selectors:[["app-trial-billing-step"]],viewQuery:function(e,t){if(1&e&&(s.Gf(ye.pV,5),s.Gf(ye.Fi,5)),2&e){let e;s.iGM(e=s.CRH())&&(t.paymentComponent=e.first),s.iGM(e=s.CRH())&&(t.taxInfoComponent=e.first)}},inputs:{organizationInfo:"organizationInfo",subscriptionProduct:"subscriptionProduct"},outputs:{steppedBack:"steppedBack",organizationCreated:"organizationCreated"},standalone:!0,features:[s.jDz],decls:4,vars:2,consts:[[4,"ngIf"],[3,"formGroup","appApiAction","ngSubmit",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],[3,"formGroup","appApiAction","ngSubmit"],["form",""],[1,"tw-container","tw-mb-3"],[1,"tw-mb-6"],[1,"tw-mb-3","tw-text-base","tw-font-semibold"],["class","tw-mb-1 tw-items-center",4,"ngIf"],[1,"tw-mb-4"],[3,"hideCredit","trialFlow"],[3,"trialFlow","onCountryChanged"],[1,"tw-flex","tw-space-x-2"],["type","submit","buttonType","primary","bitButton","",3,"loading"],["bitButton","","type","button","buttonType","secondary",3,"click"],[1,"tw-mb-1","tw-items-center"],["for","annual",1,"tw-","tw-block","tw-text-main"],["id","annual","name","cadence","type","radio","formControlName","cadence",1,"tw-h-4","tw-w-4","tw-align-middle",3,"value"],["for","monthly",1,"tw-","tw-block","tw-text-main"],["id","monthly","name","cadence","type","radio","formControlName","cadence",1,"tw-h-4","tw-w-4","tw-align-middle",3,"value"]],template:function(e,t){1&e&&(s.YNc(0,tu,9,6,"ng-container",0),s._uU(1,"\n"),s.YNc(2,su,38,17,"form",1),s._uU(3,"\n")),2&e&&(s.Q6J("ngIf",t.loading),s.xp6(2),s.Q6J("ngIf",!t.loading))},dependencies:[ye.ql,d.O5,l._Y,l.Fj,l._,l.JJ,l.JL,l.sg,l.u,xe.b,Te.r,we.p,be.F,d.H9,ee.C],encapsulation:2});var ru=i(70062),au=i(19433);const lu=function(e,t){return{"tw-border-0 tw-border-l tw-border-solid tw-border-secondary-300":e,"tw-pt-6":t}};function cu(e,t){if(1&e&&(s._uU(0,"\n  "),s.TgZ(1,"div",0),s._uU(2,"\n    "),s.Hsn(3),s._uU(4,"\n  "),s.qZA(),s._uU(5,"\n")),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngClass",s.WLB(1,lu,e.applyBorder,e.addSubLabelSpacing))}}class uu extends au.be{constructor(){super(...arguments),this.subLabel="",this.applyBorder=!0,this.addSubLabelSpacing=!1}}uu.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(uu)))(t||uu)}}(),uu.ɵcmp=s.Xpm({type:uu,selectors:[["app-vertical-step"]],inputs:{subLabel:"subLabel",applyBorder:"applyBorder",addSubLabelSpacing:"addSubLabelSpacing"},features:[s._Bn([{provide:au.be,useExisting:uu}]),s.qOj],ngContentSelectors:["*"],decls:2,vars:0,consts:[[1,"tw-inline-block","tw-w-11/12","tw-pl-7",3,"ngClass"]],template:function(e,t){1&e&&(s.F$t(),s.YNc(0,cu,6,4,"ng-template"),s._uU(1,"\n"))},dependencies:[d.mk],encapsulation:2});const du=function(e,t,i){return{"tw-bg-primary-600 tw-text-contrast":e,"tw-bg-secondary-300 tw-text-main":t,"tw-bg-transparent tw-text-muted":i}};function pu(e,t){if(1&e&&(s.TgZ(0,"span",7),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.Q6J("ngClass",s.kEZ(2,du,e.selected,!e.selected&&!e.disabled&&e.step.editable,e.disabled)),s.xp6(1),s.hij("\n      ",e.stepNumber,"\n    ")}}function hu(e,t){1&e&&(s.TgZ(0,"span",8),s._uU(1,"\n      "),s._UZ(2,"i",9),s._uU(3,"\n    "),s.qZA())}const gu=function(e){return{"hover:tw-bg-secondary-100":e}},fu=function(e){return{"tw-font-bold":e}},mu=function(e){return{"tw-mt-1":e}};class vu{constructor(){this.onSelectStep=new s.vpe,this.disabled=!1,this.selected=!1}selectStep(){this.onSelectStep.emit()}}function yu(e,t){if(1&e&&s._UZ(0,"div",5),2&e){const e=s.oxw(2);s.Q6J("ngTemplateOutlet",e.selected?e.selected.content:null)}}function wu(e,t){1&e&&s._UZ(0,"div",6)}function bu(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"li"),s._uU(1,"\n      "),s.TgZ(2,"app-vertical-step-content",2),s.NdJ("onSelectStep",(function(){const t=s.CHM(e).index,i=s.oxw();return s.KtG(i.selectStepByIndex(t))})),s.qZA(),s._uU(3,"\n      "),s.YNc(4,yu,1,1,"div",3),s._uU(5,"\n      "),s.YNc(6,wu,1,0,"div",4),s._uU(7,"\n    "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=t.last,o=s.oxw();s.xp6(2),s.Q6J("disabled",o.isStepDisabled(i))("selected",o.selectedIndex===i)("step",e)("stepNumber",i+1),s.xp6(2),s.Q6J("ngIf",o.selectedIndex===i),s.xp6(2),s.Q6J("ngIf",!(n||o.selectedIndex===i))}}vu.ɵfac=function(e){return new(e||vu)},vu.ɵcmp=s.Xpm({type:vu,selectors:[["app-vertical-step-content"]],inputs:{disabled:"disabled",selected:"selected",step:"step",stepNumber:"stepNumber"},outputs:{onSelectStep:"onSelectStep"},decls:20,vars:15,consts:[[1,"tw-m-2.5","tw-h-16","tw-text-center"],["type","button",1,"tw-flex","tw-w-full","tw-items-center","tw-border-none","tw-bg-transparent",3,"disabled","ngClass","click"],["class","tw-mr-3.5 tw-w-9 tw-rounded-full tw-font-bold tw-leading-9",3,"ngClass",4,"ngIf"],["class","tw-mr-3.5 tw-w-9 tw-rounded-full tw-bg-primary-600 tw-font-bold tw-leading-9 tw-text-contrast",4,"ngIf"],[1,"tw-txt-main","tw-mt-3.5","tw-h-12","tw-text-left","tw-leading-snug",3,"ngClass"],[1,"main-label","text","tw-mb-1","tw-text-main",3,"ngClass"],[1,"sub-label","small","tw-text-muted"],[1,"tw-mr-3.5","tw-w-9","tw-rounded-full","tw-font-bold","tw-leading-9",3,"ngClass"],[1,"tw-mr-3.5","tw-w-9","tw-rounded-full","tw-bg-primary-600","tw-font-bold","tw-leading-9","tw-text-contrast"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-check","tw-p-1"]],template:function(e,t){1&e&&(s._uU(0,"\n"),s.TgZ(1,"div",0),s._uU(2,"\n  "),s.TgZ(3,"button",1),s.NdJ("click",(function(){return t.selectStep()})),s._uU(4,"\n    "),s.YNc(5,pu,2,6,"span",2),s._uU(6,"\n    "),s.YNc(7,hu,4,0,"span",3),s._uU(8,"\n    "),s.TgZ(9,"div",4),s._uU(10,"\n      "),s.TgZ(11,"p",5),s._uU(12),s.qZA(),s._uU(13,"\n      "),s.TgZ(14,"p",6),s._uU(15),s.qZA(),s._uU(16,"\n    "),s.qZA(),s._uU(17,"\n  "),s.qZA(),s._uU(18,"\n"),s.qZA(),s._uU(19,"\n")),2&e&&(s.xp6(3),s.Q6J("disabled",t.disabled)("ngClass",s.VKq(9,gu,!t.disabled&&t.step.editable)),s.uIk("aria-expanded",t.selected),s.xp6(2),s.Q6J("ngIf",!t.step.completed),s.xp6(2),s.Q6J("ngIf",t.step.completed),s.xp6(2),s.Q6J("ngClass",s.VKq(11,fu,t.selected)),s.xp6(2),s.Q6J("ngClass",s.VKq(13,mu,!t.step.subLabel)),s.xp6(1),s.hij("\n        ",t.step.label,"\n      "),s.xp6(3),s.Oqu(t.step.subLabel))},dependencies:[d.mk,d.O5],encapsulation:2});class Uu extends au.B8{constructor(){super(...arguments),this.activeClass="active"}isNextButtonHidden(){return!(this.steps.length===this.selectedIndex+1)}isStepDisabled(e){var t;return this.selectedIndex!==e&&(this.selectedIndex!==e-1||!(null===(t=this.steps.find(((t,i)=>i==e-1)))||void 0===t?void 0:t.completed))}selectStepByIndex(e){this.selectedIndex=e}}Uu.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(Uu)))(t||Uu)}}(),Uu.ɵcmp=s.Xpm({type:Uu,selectors:[["app-vertical-stepper"]],inputs:{activeClass:"activeClass"},features:[s._Bn([{provide:au.B8,useExisting:Uu}]),s.qOj],decls:8,vars:1,consts:[[1,"tw-flex","tw-list-none","tw-flex-col","tw-flex-wrap","tw-p-5"],[4,"ngFor","ngForOf"],[3,"disabled","selected","step","stepNumber","onSelectStep"],["class","tw-inline-block tw-pl-7",3,"ngTemplateOutlet",4,"ngIf"],["class","tw-ml-8 tw-h-6 tw-border-0 tw-border-l tw-border-solid tw-border-secondary-300",4,"ngIf"],[1,"tw-inline-block","tw-pl-7",3,"ngTemplateOutlet"],[1,"tw-ml-8","tw-h-6","tw-border-0","tw-border-l","tw-border-solid","tw-border-secondary-300"]],template:function(e,t){1&e&&(s.TgZ(0,"div"),s._uU(1,"\n  "),s.TgZ(2,"ul",0),s._uU(3,"\n    "),s.YNc(4,bu,8,6,"li",1),s._uU(5,"\n  "),s.qZA(),s._uU(6,"\n"),s.qZA(),s._uU(7,"\n")),2&e&&(s.xp6(4),s.Q6J("ngForOf",t.steps))},dependencies:[d.sg,d.O5,d.tP,vu],encapsulation:2});class _u{constructor(e,t,i,n,s,o,r,a,l,c,u){this.email=e,this.name=t,this.masterPasswordHash=i,this.key=s,this.referenceData=o,this.captchaResponse=r,this.kdf=a,this.kdfIterations=l,this.kdfMemory=c,this.kdfParallelism=u,this.masterPasswordHint=n||null}}class Au{static validateInputsDoesntMatch(e,t){return i=>{var n;return i.parent&&i.parent.controls&&(null==i?void 0:i.value)===(null===(n=null==i?void 0:i.parent)||void 0===n?void 0:n.controls)[e].value?{inputsMatchError:{message:t}}:null}}static validateInputsMatch(e,t){return i=>{var n;return i.parent&&i.parent.controls?(null==i?void 0:i.value)===(null===(n=null==i?void 0:i.parent)||void 0===n?void 0:n.controls)[e].value?null:{inputsDoesntMatchError:{message:t}}:null}}static validateFormInputsMatch(e,t,i){return n=>{const s=n.controls[e],o=n.controls[t];s.value!==o.value?o.setErrors({inputsDoesntMatchError:{message:i}}):o.setErrors(null)}}}var Zu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class xu extends jn{constructor(e,t,i,n,o,r,a,c,u,d,p,h,g,f){super(p,o,u),this.formValidationErrorService=e,this.formBuilder=t,this.loginStrategyService=i,this.router=n,this.cryptoService=r,this.apiService=a,this.stateService=c,this.passwordGenerationService=d,this.logService=h,this.auditService=g,this.dialogService=f,this.isInTrialFlow=!1,this.createdAccount=new s.vpe,this.showPassword=!1,this.showTerms=!0,this.showErrorSummary=!1,this.minimumLength=Ci.c.minimumPasswordLength,this.formGroup=this.formBuilder.group({email:["",[l.kI.required,l.kI.email]],name:[""],masterPassword:["",[l.kI.required,l.kI.minLength(this.minimumLength)]],confirmMasterPassword:["",[l.kI.required,l.kI.minLength(this.minimumLength)]],hint:[null,[Au.validateInputsDoesntMatch("masterPassword",this.i18nService.t("hintEqualsPassword"))]],checkForBreaches:[!0],acceptPolicies:[!1,[this.acceptPoliciesValidation()]]},{validator:Au.validateFormInputsMatch("masterPassword","confirmMasterPassword",this.i18nService.t("masterPassDoesntMatch"))}),this.successRoute="login",this.accountCreated=!1,this.captchaBypassToken=null,this.showTerms=!u.isSelfHost(),this.characterMinimumMessage=this.i18nService.t("characterMinimum",this.minimumLength)}ngOnInit(){return Zu(this,void 0,void 0,(function*(){this.setupCaptcha()}))}submit(e=!0){return Zu(this,void 0,void 0,(function*(){if(void 0===crypto.subtle)return void this.platformUtilsService.showToast("error","This browser requires HTTPS to use the web vault","Check the Vaultwarden wiki for details on how to enable it");let t=this.formGroup.value.email;t=t.trim().toLowerCase();let i=this.formGroup.value.name;i=""===i?null:i;const n=this.formGroup.value.masterPassword;try{if(!this.accountCreated){const s=yield this.registerAccount(yield this.buildRegisterRequest(t,n,i),e);if(!s.successful)return;this.captchaBypassToken=s.captchaBypassToken,this.accountCreated=!0}if(this.isInTrialFlow){this.accountCreated||this.platformUtilsService.showToast("success",null,this.i18nService.t("trialAccountCreated"));if((yield this.logIn(t,n,this.captchaBypassToken)).captchaRequired)return;this.createdAccount.emit(this.formGroup.value.email)}else this.platformUtilsService.showToast("success",null,this.i18nService.t("newAccountCreated")),this.router.navigate([this.successRoute],{queryParams:{email:t}})}catch(s){this.logService.error(s)}}))}togglePassword(){this.showPassword=!this.showPassword}getStrengthResult(e){this.passwordStrengthResult=e}getPasswordScoreText(e){this.color=e.color,this.text=e.text}getErrorToastMessage(){const e=this.formValidationErrorService.getFormValidationErrors(this.formGroup.controls).shift();if(e)switch(e.errorName){case"email":return this.i18nService.t("invalidEmail");case"inputsDoesntMatchError":return this.i18nService.t("masterPassDoesntMatch");case"inputsMatchError":return this.i18nService.t("hintEqualsPassword");case"minlength":return this.i18nService.t("masterPasswordMinlength",Ci.c.minimumPasswordLength);default:return this.i18nService.t(this.errorTag(e))}}errorTag(e){const t=e.errorName.charAt(0).toUpperCase()+e.errorName.slice(1);return`${e.controlName}${t}`}acceptPoliciesValidation(){return e=>!e.value&&this.showTerms?{required:!0}:null}validateRegistration(e){return Zu(this,void 0,void 0,(function*(){if(this.formGroup.markAllAsTouched(),this.showErrorSummary=!0,this.formGroup.get("acceptPolicies").hasError("required"))return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("acceptPoliciesRequired")),{isValid:!1};if(this.formGroup.invalid&&!e)return{isValid:!1};if(this.formGroup.invalid&&e){const e=this.getErrorToastMessage();return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e),{isValid:!1}}const t=null!=this.passwordStrengthResult&&this.passwordStrengthResult.score<3,i=this.formGroup.controls.checkForBreaches.value&&(yield this.auditService.passwordLeaked(this.formGroup.controls.masterPassword.value))>0;if(t&&i){if(!(yield this.dialogService.openSimpleDialog({title:{key:"weakAndExposedMasterPassword"},content:{key:"weakAndBreachedMasterPasswordDesc"},type:"warning"})))return{isValid:!1}}else if(t){if(!(yield this.dialogService.openSimpleDialog({title:{key:"weakMasterPassword"},content:{key:"weakMasterPasswordDesc"},type:"warning"})))return{isValid:!1}}else if(i){if(!(yield this.dialogService.openSimpleDialog({title:{key:"exposedMasterPassword"},content:{key:"exposedMasterPasswordDesc"},type:"warning"})))return{isValid:!1}}return{isValid:!0}}))}buildRegisterRequest(e,t,i){return Zu(this,void 0,void 0,(function*(){const n=this.formGroup.value.hint,s=Hi.al,o=yield this.cryptoService.makeMasterKey(t,e,s),r=yield this.cryptoService.makeUserKey(o),a=yield this.cryptoService.hashMasterKey(t,o),l=yield this.cryptoService.makeKeyPair(r[0]),c=new _u(e,i,a,n,r[1].encryptedString,this.referenceData,this.captchaToken,s.kdfType,s.iterations);c.keys=new yn.C(l[0],l[1].encryptedString);const u=yield this.stateService.getOrganizationInvitation();return null!=u&&null!=u.token&&null!=u.organizationUserId&&(c.token=u.token,c.organizationUserId=u.organizationUserId),c}))}registerAccount(e,t){return Zu(this,void 0,void 0,(function*(){if(!(yield this.validateRegistration(t)).isValid)return{successful:!1};this.formPromise=this.apiService.postRegister(e);try{return{successful:!0,captchaBypassToken:(yield this.formPromise).captchaBypassToken}}catch(i){if(this.handleCaptchaRequired(i))return{successful:!1};throw i}}))}logIn(e,t,i){return Zu(this,void 0,void 0,(function*(){const n=new Di.tE(e,t,i,null),s=yield this.loginStrategyService.logIn(n);return this.handleCaptchaRequired(s)?{captchaRequired:!0}:{captchaRequired:!1}}))}}xu.ɵfac=function(e){return new(e||xu)(s.Y36(vs.q),s.Y36(l.QS),s.Y36(Di.m),s.Y36(p.F0),s.Y36(M.D),s.Y36(D.$),s.Y36(Ue.s),s.Y36(J.b),s.Y36(N.P),s.Y36(A.UW),s.Y36($i.L),s.Y36(_e.$),s.Y36(Ia.C),s.Y36(I.x))},xu.ɵdir=s.lG2({type:xu,inputs:{isInTrialFlow:"isInTrialFlow"},outputs:{createdAccount:"createdAccount"},features:[s.qOj]});var Su=i(49399);function Tu(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n    "),s._UZ(2,"i",1),s._uU(3),s.ALo(4,"i18n"),s.BQk()),2&e){const e=s.oxw();s.xp6(3),s.hij(" ",s.xi3(4,1,"fieldsNeedAttention",e.errorString),"\n  ")}}class Cu{get errorCount(){return this.getErrorCount(this.formGroup)}get errorString(){return this.errorCount.toString()}getErrorCount(e){return Object.values(e.controls).reduce(((e,t)=>t instanceof l.nJ?e+this.getErrorCount(t):null==t.errors||!t.dirty&&t.untouched?e:e+Object.keys(t.errors).length),0)}}Cu.ɵfac=function(e){return new(e||Cu)},Cu.ɵcmp=s.Xpm({type:Cu,selectors:[["bit-error-summary"]],hostAttrs:["aria-live","assertive",1,"tw-block","tw-text-danger","tw-mt-2"],inputs:{formGroup:"formGroup"},decls:2,vars:1,consts:[[4,"ngIf"],[1,"bwi","bwi-error"]],template:function(e,t){1&e&&(s._uU(0," "),s.YNc(1,Tu,5,4,"ng-container",0)),2&e&&(s.xp6(1),s.Q6J("ngIf",t.errorCount>0))},dependencies:[d.O5,Su.C],encapsulation:2});var Ou=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function ku(e,t){if(1&e&&(s.TgZ(0,"auth-password-callout",23),s._uU(1,"\n      "),s.qZA()),2&e){const e=s.oxw();s.Q6J("policy",e.enforcedPolicyOptions)}}function Pu(e,t){1&e&&(s.TgZ(0,"div",24),s._uU(1,"\n      "),s._UZ(2,"input",25),s._uU(3,"\n\n      "),s.TgZ(4,"bit-label",26),s._uU(5),s.ALo(6,"i18n"),s._UZ(7,"br"),s._uU(8,"\n        "),s.TgZ(9,"a",27),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,",\n        "),s.TgZ(13,"a",28),s._uU(14),s.ALo(15,"i18n"),s.qZA(),s._uU(16,"\n      "),s.qZA(),s._uU(17,"\n    "),s.qZA()),2&e&&(s.xp6(5),s.hij("\n        ",s.lcZ(6,3,"acceptPolicies"),""),s.xp6(5),s.Oqu(s.lcZ(11,5,"termsOfService")),s.xp6(4),s.Oqu(s.lcZ(15,7,"privacyPolicy")))}function qu(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"button",29),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n      "),s.BQk()),2&e){s.oxw();const e=s.MAs(3);s.xp6(2),s.Q6J("block",!0)("loading",e.loading),s.xp6(1),s.hij("\n          ",s.lcZ(4,3,"createAccount"),"\n        ")}}function Iu(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"button",29),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n      "),s.BQk()),2&e){s.oxw();const e=s.MAs(3);s.xp6(2),s.Q6J("block",!0)("loading",e.loading),s.xp6(1),s.hij("\n          ",s.lcZ(4,3,"logIn"),"\n        ")}}function Mu(e,t){if(1&e&&s._UZ(0,"bit-error-summary",30),2&e){const e=s.oxw();s.Q6J("formGroup",e.formGroup)}}class Nu extends xu{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g){super(e,t,i,n,s,o,r,a,l,c,d,p,h,g),this.policyService=u,this.showErrorSummary=!1}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});var t;return Ou(this,void 0,void 0,(function*(){yield e.ngOnInit.call(this),this.referenceData=this.referenceDataValue,this.queryParamEmail&&(null===(t=this.formGroup.get("email"))||void 0===t||t.setValue(this.queryParamEmail)),null!=this.enforcedPolicyOptions&&this.enforcedPolicyOptions.minLength>0?this.characterMinimumMessage="":this.characterMinimumMessage=this.i18nService.t("characterMinimum",this.minimumLength)}))}submit(){const e=Object.create(null,{submit:{get:()=>super.submit}});return Ou(this,void 0,void 0,(function*(){null==this.enforcedPolicyOptions||this.policyService.evaluateMasterPassword(this.passwordStrengthResult.score,this.formGroup.value.masterPassword,this.enforcedPolicyOptions)?yield e.submit.call(this,!1):this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPasswordPolicyRequirementsNotMet"))}))}}Nu.ɵfac=function(e){return new(e||Nu)(s.Y36(vs.q),s.Y36(l.QS),s.Y36(Di.m),s.Y36(p.F0),s.Y36(M.D),s.Y36(D.$),s.Y36(Ue.s),s.Y36(J.b),s.Y36(N.P),s.Y36(A.UW),s.Y36(Y.d),s.Y36($i.L),s.Y36(_e.$),s.Y36(Ia.C),s.Y36(I.x))},Nu.ɵcmp=s.Xpm({type:Nu,selectors:[["app-register-form"]],inputs:{queryParamEmail:"queryParamEmail",queryParamFromOrgInvite:"queryParamFromOrgInvite",enforcedPolicyOptions:"enforcedPolicyOptions",referenceDataValue:"referenceDataValue"},features:[s.qOj],decls:131,vars:55,consts:[[1,"tw-container","tw-mx-auto",3,"appApiAction","formGroup","ngSubmit"],["form",""],[1,"tw-mb-3"],["id","register-form_input_email","bitInput","","type","email","formControlName","email"],["id","register-form_input_name","bitInput","","type","text","formControlName","name"],[3,"policy",4,"ngIf"],["id","register-form_input_master-password","bitInput","","type","password","formControlName","masterPassword"],["type","button","bitSuffix","","bitIconButton","","bitPasswordInputToggle","",3,"toggled","toggledChange"],[1,"tw-font-semibold"],[3,"password","email","name","showText","passwordStrengthResult"],["id","register-form_input_confirm-master-password","bitInput","","type","password","formControlName","confirmMasterPassword"],["id","register-form_input_hint","bitInput","","type","text","formControlName","hint"],[3,"hidden"],["id","hcaptcha_iframe","height","80","sandbox","allow-scripts allow-same-origin"],[1,"tw-mb-4","tw-flex","tw-items-start"],["type","checkbox","bitCheckbox","","id","checkForBreaches","name","CheckBreach","formControlName","checkForBreaches",1,"mt-1"],["for","checkForBreaches"],["class","tw-mb-3 tw-flex tw-items-start",4,"ngIf"],[1,"tw-space-x-2","tw-pt-2"],[4,"ngIf"],[1,"tw-m-0","tw-mt-5","tw-text-sm"],["routerLink","/login"],[3,"formGroup",4,"ngIf"],[3,"policy"],[1,"tw-mb-3","tw-flex","tw-items-start"],["id","register-form-input-accept-policies","bitCheckbox","","type","checkbox","formControlName","acceptPolicies",1,"mt-1"],["for","register-form-input-accept-policies"],["href","https://bitwarden.com/terms/","target","_blank","rel","noreferrer"],["href","https://bitwarden.com/privacy/","target","_blank","rel","noreferrer"],["type","submit","buttonType","primary","bitButton","",3,"block","loading"],[3,"formGroup"]],template:function(e,t){if(1&e&&(s._uU(0,"\n"),s._uU(1,"\n"),s.TgZ(2,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(4,"\n  "),s.TgZ(5,"div"),s._uU(6,"\n    "),s.TgZ(7,"div",2),s._uU(8,"\n      "),s.TgZ(9,"bit-form-field"),s._uU(10,"\n        "),s.TgZ(11,"bit-label"),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n        "),s._UZ(15,"input",3),s._uU(16,"\n        "),s.TgZ(17,"bit-hint"),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n      "),s.qZA(),s._uU(21,"\n    "),s.qZA(),s._uU(22,"\n\n    "),s.TgZ(23,"div",2),s._uU(24,"\n      "),s.TgZ(25,"bit-form-field"),s._uU(26,"\n        "),s.TgZ(27,"bit-label"),s._uU(28),s.ALo(29,"i18n"),s.qZA(),s._uU(30,"\n        "),s._UZ(31,"input",4),s._uU(32,"\n        "),s.TgZ(33,"bit-hint"),s._uU(34),s.ALo(35,"i18n"),s.qZA(),s._uU(36,"\n      "),s.qZA(),s._uU(37,"\n    "),s.qZA(),s._uU(38,"\n\n    "),s.TgZ(39,"div",2),s._uU(40,"\n      "),s.YNc(41,ku,2,1,"auth-password-callout",5),s._uU(42,"\n      "),s.TgZ(43,"bit-form-field"),s._uU(44,"\n        "),s.TgZ(45,"bit-label"),s._uU(46),s.ALo(47,"i18n"),s.qZA(),s._uU(48,"\n        "),s._UZ(49,"input",6),s._uU(50,"\n        "),s.TgZ(51,"button",7),s.NdJ("toggledChange",(function(e){return t.showPassword=e})),s.qZA(),s._uU(52,"\n        "),s.TgZ(53,"bit-hint"),s._uU(54,"\n          "),s.TgZ(55,"span",8),s._uU(56),s.ALo(57,"i18n"),s.qZA(),s._uU(58),s.ALo(59,"i18n"),s.qZA(),s._uU(60,"\n      "),s.qZA(),s._uU(61,"\n      "),s.TgZ(62,"app-password-strength",9),s.NdJ("passwordStrengthResult",(function(e){return t.getStrengthResult(e)})),s._uU(63,"\n      "),s.qZA(),s._uU(64,"\n    "),s.qZA(),s._uU(65,"\n\n    "),s.TgZ(66,"div",2),s._uU(67,"\n      "),s.TgZ(68,"bit-form-field"),s._uU(69,"\n        "),s.TgZ(70,"bit-label"),s._uU(71),s.ALo(72,"i18n"),s.qZA(),s._uU(73,"\n        "),s._UZ(74,"input",10),s._uU(75,"\n        "),s.TgZ(76,"button",7),s.NdJ("toggledChange",(function(e){return t.showPassword=e})),s.qZA(),s._uU(77,"\n      "),s.qZA(),s._uU(78,"\n    "),s.qZA(),s._uU(79,"\n\n    "),s.TgZ(80,"div",2),s._uU(81,"\n      "),s.TgZ(82,"bit-form-field"),s._uU(83,"\n        "),s.TgZ(84,"bit-label"),s._uU(85),s.ALo(86,"i18n"),s.qZA(),s._uU(87,"\n        "),s._UZ(88,"input",11),s._uU(89,"\n        "),s.TgZ(90,"bit-hint"),s._uU(91),s.ALo(92,"i18n"),s.qZA(),s._uU(93,"\n      "),s.qZA(),s._uU(94,"\n    "),s.qZA(),s._uU(95,"\n\n    "),s.TgZ(96,"div",12),s._uU(97,"\n      "),s._UZ(98,"iframe",13),s._uU(99,"\n    "),s.qZA(),s._uU(100,"\n    "),s.TgZ(101,"div",14),s._uU(102,"\n      "),s._UZ(103,"input",15),s._uU(104,"\n      "),s.TgZ(105,"bit-label",16),s._uU(106),s.ALo(107,"i18n"),s.qZA(),s._uU(108,"\n    "),s.qZA(),s._uU(109,"\n    "),s.YNc(110,Pu,18,9,"div",17),s._uU(111,"\n\n    "),s.TgZ(112,"div",18),s._uU(113,"\n      "),s.YNc(114,qu,6,5,"ng-container",19),s._uU(115,"\n      "),s.YNc(116,Iu,6,5,"ng-container",19),s._uU(117,"\n    "),s.qZA(),s._uU(118,"\n    "),s.TgZ(119,"p",20),s._uU(120),s.ALo(121,"i18n"),s.TgZ(122,"a",21),s._uU(123),s.ALo(124,"i18n"),s.qZA(),s._uU(125,"\n    "),s.qZA(),s._uU(126,"\n    "),s.YNc(127,Mu,1,1,"bit-error-summary",22),s._uU(128,"\n  "),s.qZA(),s._uU(129,"\n"),s.qZA(),s._uU(130,"\n")),2&e){let e,i,n;s.xp6(2),s.Q6J("appApiAction",t.formPromise)("formGroup",t.formGroup),s.xp6(10),s.Oqu(s.lcZ(13,29,"emailAddress")),s.xp6(3),s.uIk("readonly",!!t.queryParamFromOrgInvite||null),s.xp6(3),s.Oqu(s.lcZ(19,31,"emailAddressDesc")),s.xp6(10),s.Oqu(s.lcZ(29,33,"name")),s.xp6(6),s.Oqu(s.lcZ(35,35,"yourNameDesc")),s.xp6(7),s.Q6J("ngIf",t.enforcedPolicyOptions),s.xp6(5),s.Oqu(s.lcZ(47,37,"masterPass")),s.xp6(5),s.Q6J("toggled",t.showPassword),s.xp6(5),s.Oqu(s.lcZ(57,39,"important")),s.xp6(2),s.AsE("\n          ",s.lcZ(59,41,"masterPassImportant")," ",t.characterMinimumMessage,"\n        "),s.xp6(4),s.Q6J("password",null==(e=t.formGroup.get("masterPassword"))?null:e.value)("email",null==(i=t.formGroup.get("email"))?null:i.value)("name",null==(n=t.formGroup.get("name"))?null:n.value)("showText",!0),s.xp6(9),s.Oqu(s.lcZ(72,43,"reTypeMasterPass")),s.xp6(5),s.Q6J("toggled",t.showPassword),s.xp6(9),s.Oqu(s.lcZ(86,45,"masterPassHintLabel")),s.xp6(6),s.Oqu(s.lcZ(92,47,"masterPassHintDesc")),s.xp6(5),s.Q6J("hidden",!t.showCaptcha()),s.xp6(10),s.hij(" ",s.lcZ(107,49,"checkForBreaches"),""),s.xp6(4),s.Q6J("ngIf",t.showTerms),s.xp6(4),s.Q6J("ngIf",!t.accountCreated),s.xp6(2),s.Q6J("ngIf",t.accountCreated),s.xp6(4),s.hij("\n      ",s.lcZ(121,51,"alreadyHaveAccount"),"\n      "),s.xp6(3),s.Oqu(s.lcZ(124,53,"logIn")),s.xp6(4),s.Q6J("ngIf",t.showErrorSummary)}},dependencies:[d.O5,l._Y,l.Fj,l.Wl,l.JJ,l.JL,l.sg,l.u,p.rH,xe.b,eo.Z,Te.r,Sn.b,Cu,Oe.d,ke.G,As.w,Zs.e,Pe.u,Cn.M,xs.Q,to.e,ee.C],encapsulation:2});var Lu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Du(e,t){if(1&e&&(s.TgZ(0,"a",6),s._uU(1,"\n      "),s._UZ(2,"i",7),s._uU(3),s.qZA()),2&e){const e=t.$implicit,i=s.oxw(2);s.uIk("href",e==i.currentRegion?"javascript:void(0)":e.urls.webVault+i.routeAndParams,s.LSH),s.xp6(2),s.Udp("visibility",e==i.currentRegion?"visible":"hidden"),s.xp6(1),s.hij("\n      ",e.domain,"\n    ")}}const Eu=function(){return[]};function Fu(e,t){if(1&e&&(s.TgZ(0,"div",1),s._uU(1,"\n  "),s.TgZ(2,"bit-menu",null,2),s._uU(4,"\n    "),s.YNc(5,Du,4,4,"a",3),s._uU(6,"\n  "),s.qZA(),s._uU(7,"\n  "),s.TgZ(8,"div"),s._uU(9),s.ALo(10,"i18n"),s.TgZ(11,"a",4),s._uU(12,"\n      "),s.TgZ(13,"b"),s._uU(14),s.qZA(),s._UZ(15,"i",5),s._uU(16,"\n    "),s.qZA(),s._uU(17,"\n  "),s.qZA(),s._uU(18,"\n"),s.qZA()),2&e){const e=s.MAs(3),t=s.oxw();s.xp6(5),s.Q6J("ngForOf",t.availableRegions),s.xp6(4),s.hij("\n    ",s.lcZ(10,5,"server"),":\n    "),s.xp6(2),s.Q6J("routerLink",s.DdM(7,Eu))("bitMenuTriggerFor",e),s.xp6(3),s.Oqu(null==t.currentRegion?null:t.currentRegion.domain)}}class Ru{constructor(e,t,i){this.platformUtilsService=e,this.environmentService=t,this.router=i,this.availableRegions=this.environmentService.availableRegions(),this.showRegionSelector=!1}ngOnInit(){return Lu(this,void 0,void 0,(function*(){this.showRegionSelector=!this.platformUtilsService.isSelfHost(),this.routeAndParams=`/#${this.router.url}`;const e=Ci.c.getHost(window.location.href);this.currentRegion=this.availableRegions.find((t=>Ci.c.getHost(t.urls.webVault)===e))}))}}Ru.ɵfac=function(e){return new(e||Ru)(s.Y36(N.P),s.Y36($i.L),s.Y36(p.F0))},Ru.ɵcmp=s.Xpm({type:Ru,selectors:[["environment-selector"]],decls:2,vars:1,consts:[["class","tw-mb-1",4,"ngIf"],[1,"tw-mb-1"],["environmentOptions",""],["bitMenuItem","","class","pr-4",4,"ngFor","ngForOf"],[3,"routerLink","bitMenuTriggerFor"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-sm","bwi-angle-down"],["bitMenuItem","",1,"pr-4"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-sm","bwi-check","pb-1"]],template:function(e,t){1&e&&(s.YNc(0,Fu,19,8,"div",0),s._uU(1,"\n")),2&e&&s.Q6J("ngIf",t.showRegionSelector)},dependencies:[d.sg,d.O5,p.rH,Ar.M,Zr.t,xr.e,ee.C],encapsulation:2});class Ju{}Ju.ɵfac=function(e){return new(e||Ju)},Ju.ɵcmp=s.Xpm({type:Ju,selectors:[["app-logo-cnet-5-stars"]],decls:30,vars:0,consts:[[1,"tw-flex","tw-justify-center","tw-gap-4","tw-text-[#eab308]","tw-text-5xl"],[1,"bwi","bwi-star-f"],[1,"tw-mx-auto","tw-my-2","tw-max-w-xl","tw-px-4","tw-text-center"],["src","../../images/register-layout/cnet-logo.svg","alt","CNET Logo",1,"tw-mx-auto","tw-block","tw-w-40"],[1,"tw-text-center","tw-font-bold","-tw-translate-y-4"]],template:function(e,t){1&e&&(s.TgZ(0,"figure"),s._uU(1,"\n  "),s.TgZ(2,"div",0),s._uU(3,"\n    "),s._UZ(4,"i",1),s._uU(5,"\n    "),s._UZ(6,"i",1),s._uU(7,"\n    "),s._UZ(8,"i",1),s._uU(9,"\n    "),s._UZ(10,"i",1),s._uU(11,"\n    "),s._UZ(12,"i",1),s._uU(13,"\n  "),s.qZA(),s._uU(14,"\n  "),s.TgZ(15,"blockquote",2),s._uU(16,"\n    “Bitwarden scores points for being fully open-source, secure and audited annually by third-party\n    cybersecurity firms, giving it a level of transparency that sets it apart from its peers.”\n  "),s.qZA(),s._uU(17,"\n  "),s.TgZ(18,"figcaption"),s._uU(19,"\n    "),s.TgZ(20,"cite"),s._uU(21,"\n      "),s._UZ(22,"img",3),s._uU(23,"\n    "),s.qZA(),s._uU(24,"\n    "),s.TgZ(25,"p",4),s._uU(26,"Best Password Manager in 2024"),s.qZA(),s._uU(27,"\n  "),s.qZA(),s._uU(28,"\n"),s.qZA(),s._uU(29,"\n"))},encapsulation:2});class zu{}zu.ɵfac=function(e){return new(e||zu)},zu.ɵcmp=s.Xpm({type:zu,selectors:[["review-logo"]],inputs:{logoClass:"logoClass",logoSrc:"logoSrc",logoAlt:"logoAlt"},decls:32,vars:3,consts:[[1,"tw-flex","tw-flex-col","tw-items-center","tw-justify-center"],[1,"tw-mb-2",3,"ngClass","src","alt"],[1,"tw-flex","tw-items-center"],[1,"tw-flex","tw-items-center","tw-justify-center","tw-text-[#eab308]","tw-text-2xl"],[1,"bwi","bwi-star-f"],[1,"tw-relative"],[1,"tw-absolute","tw-inset-0","tw-w-3","tw-overflow-hidden"],[1,"bwi","bwi-star-f","tw-text-[#cbd5e1]"],[1,"tw-ml-2"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s._UZ(2,"img",1),s._uU(3,"\n  "),s.TgZ(4,"div",2),s._uU(5,"\n    "),s.TgZ(6,"div",3),s._uU(7,"\n      "),s._UZ(8,"i",4),s._uU(9,"\n      "),s._UZ(10,"i",4),s._uU(11,"\n      "),s._UZ(12,"i",4),s._uU(13,"\n      "),s._UZ(14,"i",4),s._uU(15,"\n      "),s.TgZ(16,"div",5),s._uU(17,"\n        "),s.TgZ(18,"div",6),s._uU(19,"\n          "),s._UZ(20,"i",4),s._uU(21,"\n        "),s.qZA(),s._uU(22,"\n        "),s._UZ(23,"i",7),s._uU(24,"\n      "),s.qZA(),s._uU(25,"\n    "),s.qZA(),s._uU(26,"\n    "),s.TgZ(27,"span",8),s._uU(28,"4.7"),s.qZA(),s._uU(29,"\n  "),s.qZA(),s._uU(30,"\n"),s.qZA(),s._uU(31,"\n")),2&e&&(s.xp6(2),s.Q6J("ngClass",t.logoClass)("src",t.logoSrc,s.LSH)("alt",t.logoAlt))},dependencies:[d.mk],encapsulation:2});class Yu{}Yu.ɵfac=function(e){return new(e||Yu)},Yu.ɵcmp=s.Xpm({type:Yu,selectors:[["app-enterprise-content"]],decls:51,vars:0,consts:[[1,"tw-text-3xl","!tw-text-alt2"],[1,"tw-pt-32"],[1,"tw-text-2xl"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main","tw-list-none","tw-pl-0"],[1,"bwi","bwi-lg","bwi-check-circle","tw-mr-4"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"],[1,"tw-flex","tw-items-end","tw-gap-8"],["logoClass","tw-w-8","logoSrc","../../images/register-layout/g2-logo.svg","logoAlt","G2 Logo"],["logoClass","tw-w-28","logoSrc","../../images/register-layout/capterra-logo.svg","logoAlt","Capterra Logo"],["logoClass","tw-w-28","logoSrc","../../images/register-layout/get-app-logo.svg","logoAlt","Get App Logo"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"The Password Manager Trusted by Millions"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6,"Everything enterprises need out of a password manager:"),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.TgZ(11,"li"),s._UZ(12,"i",4),s._uU(13,"Secure password sharing"),s.qZA(),s._uU(14,"\n  "),s.TgZ(15,"li"),s._uU(16,"\n    "),s._UZ(17,"i",4),s._uU(18,"Easy, flexible SSO and SCIM integrations\n  "),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"li"),s._UZ(21,"i",4),s._uU(22,"Free families plan for users"),s.qZA(),s._uU(23,"\n  "),s.TgZ(24,"li"),s._UZ(25,"i",4),s._uU(26,"Quick import and migration tools"),s.qZA(),s._uU(27,"\n  "),s.TgZ(28,"li"),s._UZ(29,"i",4),s._uU(30,"Simple, streamlined user experience"),s.qZA(),s._uU(31,"\n  "),s.TgZ(32,"li"),s._UZ(33,"i",4),s._uU(34,"Priority support and trainers"),s.qZA(),s._uU(35,"\n"),s.qZA(),s._uU(36,"\n"),s.TgZ(37,"div",5),s._uU(38,"\n  "),s._UZ(39,"app-logo-cnet-5-stars"),s._uU(40,"\n  "),s.TgZ(41,"div",6),s._uU(42,"\n    "),s._UZ(43,"review-logo",7),s._uU(44,"\n    "),s._UZ(45,"review-logo",8),s._uU(46,"\n    "),s._UZ(47,"review-logo",9),s._uU(48,"\n  "),s.qZA(),s._uU(49,"\n"),s.qZA(),s._uU(50,"\n"))},dependencies:[Ju,zu],encapsulation:2});class Ku{}Ku.ɵfac=function(e){return new(e||Ku)},Ku.ɵcmp=s.Xpm({type:Ku,selectors:[["app-logo-forbes"]],decls:14,vars:0,consts:[["src","../../images/register-layout/forbes-logo.svg","alt","Forbes Logo",1,"tw-mx-auto","tw-block","tw-w-40"],[1,"tw-mx-auto","tw-mt-2","tw-max-w-xl","tw-px-4","tw-text-center"]],template:function(e,t){1&e&&(s.TgZ(0,"figure"),s._uU(1,"\n  "),s.TgZ(2,"figcaption"),s._uU(3,"\n    "),s.TgZ(4,"cite"),s._uU(5,"\n      "),s._UZ(6,"img",0),s._uU(7,"\n    "),s.qZA(),s._uU(8,"\n  "),s.qZA(),s._uU(9,"\n  "),s.TgZ(10,"blockquote",1),s._uU(11,"\n    “Bitwarden boasts the backing of some of the world's best security experts and an attractive,\n    easy-to-use interface”\n  "),s.qZA(),s._uU(12,"\n"),s.qZA(),s._uU(13,"\n"))},encapsulation:2});class Bu{}Bu.ɵfac=function(e){return new(e||Bu)},Bu.ɵcmp=s.Xpm({type:Bu,selectors:[["app-logo-us-news"]],decls:2,vars:0,consts:[["src","../../images/register-layout/usnews-360-badge.svg","alt","US News 360 Reviews Best Password Manager",1,"tw-mx-auto","tw-block","tw-w-48"]],template:function(e,t){1&e&&(s._UZ(0,"img",0),s._uU(1,"\n"))},encapsulation:2});class Qu{}Qu.ɵfac=function(e){return new(e||Qu)},Qu.ɵcmp=s.Xpm({type:Qu,selectors:[["app-teams-content"]],decls:31,vars:0,consts:[[1,"tw-text-4xl","!tw-text-alt2"],[1,"tw-pt-32"],[1,"tw-text-2xl"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"The Bitwarden Password Manager"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6,"\n    Trusted by millions of individuals, teams, and organizations worldwide for secure password\n    storage and sharing.\n  "),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.TgZ(11,"li"),s._uU(12,"Store logins, secure notes, and more"),s.qZA(),s._uU(13,"\n  "),s.TgZ(14,"li"),s._uU(15,"Collaborate and share securely"),s.qZA(),s._uU(16,"\n  "),s.TgZ(17,"li"),s._uU(18,"Access anywhere on any device"),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"li"),s._uU(21,"Create your account to get started"),s.qZA(),s._uU(22,"\n"),s.qZA(),s._uU(23,"\n"),s.TgZ(24,"div",4),s._uU(25,"\n  "),s._UZ(26,"app-logo-forbes"),s._uU(27,"\n  "),s._UZ(28,"app-logo-us-news"),s._uU(29,"\n"),s.qZA(),s._uU(30,"\n"))},dependencies:[Ku,Bu],encapsulation:2});class Gu{}Gu.ɵfac=function(e){return new(e||Gu)},Gu.ɵcmp=s.Xpm({type:Gu,selectors:[["app-trial-confirmation-details"]],inputs:{email:"email",orgLabel:"orgLabel"},decls:27,vars:12,consts:[[1,"tw-pb-6","tw-pl-6"],[1,"tw-text-xl"],[1,"tw-list-disc"],[1,"tw-font-bold"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"p",1),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n  "),s.TgZ(6,"ul",2),s._uU(7,"\n    "),s.TgZ(8,"li"),s._uU(9,"\n      "),s.TgZ(10,"p"),s._uU(11),s.ALo(12,"i18n"),s.TgZ(13,"span",3),s._uU(14),s.qZA(),s._uU(15,".\n      "),s.qZA(),s._uU(16,"\n    "),s.qZA(),s._uU(17,"\n    "),s.TgZ(18,"li"),s._uU(19,"\n      "),s.TgZ(20,"p"),s._uU(21),s.ALo(22,"i18n"),s.qZA(),s._uU(23,"\n    "),s.qZA(),s._uU(24,"\n  "),s.qZA(),s._uU(25,"\n"),s.qZA(),s._uU(26,"\n")),2&e&&(s.xp6(3),s.Oqu(s.xi3(4,4,"trialThankYou",t.orgLabel)),s.xp6(8),s.hij("\n        ",s.lcZ(12,7,"trialConfirmationEmail"),"\n        "),s.xp6(3),s.Oqu(t.email),s.xp6(7),s.hij("\n        ",s.xi3(22,9,"trialPaidInfoMessage",t.orgLabel),"\n      "))},dependencies:[ee.C],encapsulation:2});class ju{}ju.ɵfac=function(e){return new(e||ju)},ju.ɵcmp=s.Xpm({type:ju,selectors:[["app-default-content"]],decls:31,vars:0,consts:[[1,"tw-text-4xl","!tw-text-alt2"],[1,"tw-pt-32"],[1,"tw-text-2xl"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"The Bitwarden Password Manager"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6,"\n    Trusted by millions of individuals, teams, and organizations worldwide for secure password\n    storage and sharing.\n  "),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.TgZ(11,"li"),s._uU(12,"Store logins, secure notes, and more"),s.qZA(),s._uU(13,"\n  "),s.TgZ(14,"li"),s._uU(15,"Collaborate and share securely"),s.qZA(),s._uU(16,"\n  "),s.TgZ(17,"li"),s._uU(18,"Access anywhere on any device"),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"li"),s._uU(21,"Create your account to get started"),s.qZA(),s._uU(22,"\n"),s.qZA(),s._uU(23,"\n"),s.TgZ(24,"div",4),s._uU(25,"\n  "),s._UZ(26,"app-logo-forbes"),s._uU(27,"\n  "),s._UZ(28,"app-logo-us-news"),s._uU(29,"\n"),s.qZA(),s._uU(30,"\n"))},dependencies:[Ku,Bu],encapsulation:2});class Vu{}Vu.ɵfac=function(e){return new(e||Vu)},Vu.ɵcmp=s.Xpm({type:Vu,selectors:[["app-enterprise1-content"]],decls:51,vars:0,consts:[[1,"tw-text-3xl","!tw-text-alt2"],[1,"tw-pt-32"],[1,"tw-text-2xl"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main","tw-list-none","tw-pl-0"],[1,"bwi","bwi-lg","bwi-check-circle","tw-mr-4"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"],[1,"tw-flex","tw-items-end","tw-gap-8"],["logoClass","tw-w-8","logoSrc","../../images/register-layout/g2-logo.svg","logoAlt","G2 Logo"],["logoClass","tw-w-28","logoSrc","../../images/register-layout/capterra-logo.svg","logoAlt","Capterra Logo"],["logoClass","tw-w-28","logoSrc","../../images/register-layout/get-app-logo.svg","logoAlt","Get App Logo"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"The Password Manager Trusted by Millions"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6,"Everything enterprises need out of a password manager:"),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.TgZ(11,"li"),s._UZ(12,"i",4),s._uU(13,"Secure password sharing"),s.qZA(),s._uU(14,"\n  "),s.TgZ(15,"li"),s._uU(16,"\n    "),s._UZ(17,"i",4),s._uU(18,"Easy, flexible SSO and SCIM integrations\n  "),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"li"),s._UZ(21,"i",4),s._uU(22,"Free families plan for users"),s.qZA(),s._uU(23,"\n  "),s.TgZ(24,"li"),s._UZ(25,"i",4),s._uU(26,"Quick import and migration tools"),s.qZA(),s._uU(27,"\n  "),s.TgZ(28,"li"),s._UZ(29,"i",4),s._uU(30,"Simple, streamlined user experience"),s.qZA(),s._uU(31,"\n  "),s.TgZ(32,"li"),s._UZ(33,"i",4),s._uU(34,"Priority support and trainers"),s.qZA(),s._uU(35,"\n"),s.qZA(),s._uU(36,"\n"),s.TgZ(37,"div",5),s._uU(38,"\n  "),s._UZ(39,"app-logo-cnet-5-stars"),s._uU(40,"\n  "),s.TgZ(41,"div",6),s._uU(42,"\n    "),s._UZ(43,"review-logo",7),s._uU(44,"\n    "),s._UZ(45,"review-logo",8),s._uU(46,"\n    "),s._UZ(47,"review-logo",9),s._uU(48,"\n  "),s.qZA(),s._uU(49,"\n"),s.qZA(),s._uU(50,"\n"))},dependencies:[Ju,zu],encapsulation:2});class $u{}$u.ɵfac=function(e){return new(e||$u)},$u.ɵcmp=s.Xpm({type:$u,selectors:[["app-enterprise2-content"]],decls:51,vars:0,consts:[[1,"tw-text-3xl","!tw-text-alt2"],[1,"tw-pt-32"],[1,"tw-text-2xl"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main","tw-list-none","tw-pl-0"],[1,"bwi","bwi-lg","bwi-check-circle","tw-mr-4"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"],[1,"tw-flex","tw-items-end","tw-gap-8"],["logoClass","tw-w-8","logoSrc","../../images/register-layout/g2-logo.svg","logoAlt","G2 Logo"],["logoClass","tw-w-28","logoSrc","../../images/register-layout/capterra-logo.svg","logoAlt","Capterra Logo"],["logoClass","tw-w-28","logoSrc","../../images/register-layout/get-app-logo.svg","logoAlt","Get App Logo"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"The Password Manager Trusted by Millions"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6,"Everything enterprises need out of a password manager:"),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.TgZ(11,"li"),s._UZ(12,"i",4),s._uU(13,"Secure password sharing"),s.qZA(),s._uU(14,"\n  "),s.TgZ(15,"li"),s._uU(16,"\n    "),s._UZ(17,"i",4),s._uU(18,"Easy, flexible SSO and SCIM integrations\n  "),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"li"),s._UZ(21,"i",4),s._uU(22,"Free families plan for users"),s.qZA(),s._uU(23,"\n  "),s.TgZ(24,"li"),s._UZ(25,"i",4),s._uU(26,"Quick import and migration tools"),s.qZA(),s._uU(27,"\n  "),s.TgZ(28,"li"),s._UZ(29,"i",4),s._uU(30,"Simple, streamlined user experience"),s.qZA(),s._uU(31,"\n  "),s.TgZ(32,"li"),s._UZ(33,"i",4),s._uU(34,"Priority support and trainers"),s.qZA(),s._uU(35,"\n"),s.qZA(),s._uU(36,"\n"),s.TgZ(37,"div",5),s._uU(38,"\n  "),s._UZ(39,"app-logo-cnet-5-stars"),s._uU(40,"\n  "),s.TgZ(41,"div",6),s._uU(42,"\n    "),s._UZ(43,"review-logo",7),s._uU(44,"\n    "),s._UZ(45,"review-logo",8),s._uU(46,"\n    "),s._UZ(47,"review-logo",9),s._uU(48,"\n  "),s.qZA(),s._uU(49,"\n"),s.qZA(),s._uU(50,"\n"))},dependencies:[Ju,zu],encapsulation:2});class Hu{}Hu.ɵfac=function(e){return new(e||Hu)},Hu.ɵcmp=s.Xpm({type:Hu,selectors:[["app-teams1-content"]],decls:40,vars:0,consts:[[1,"tw-text-4xl","!tw-text-alt2"],[1,"tw-flex","tw-flex-col","tw-items-center","tw-justify-center","tw-pt-16"],[1,"tw-text-2xl"],[1,"tw-text-xl"],[1,"tw-pt-10"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"Start Your Teams Free Trial Now"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"div",2),s._uU(6,"$4 per month / per user"),s.qZA(),s._uU(7,"\n  "),s.TgZ(8,"div",3),s._uU(9,"Annual subscription"),s.qZA(),s._uU(10,"\n"),s.qZA(),s._uU(11,"\n"),s.TgZ(12,"div",4),s._uU(13,"\n  "),s.TgZ(14,"h2",2),s._uU(15,"\n    Millions of individuals, teams, and organizations worldwide trust Bitwarden for secure password\n    storage and sharing.\n  "),s.qZA(),s._uU(16,"\n"),s.qZA(),s._uU(17,"\n"),s.TgZ(18,"ul",5),s._uU(19,"\n  "),s.TgZ(20,"li"),s._uU(21,"Collaborate and share securely"),s.qZA(),s._uU(22,"\n  "),s.TgZ(23,"li"),s._uU(24,"Deploy and manage quickly and easily"),s.qZA(),s._uU(25,"\n  "),s.TgZ(26,"li"),s._uU(27,"Access anywhere on any device"),s.qZA(),s._uU(28,"\n  "),s.TgZ(29,"li"),s._uU(30,"Create your account to get started"),s.qZA(),s._uU(31,"\n"),s.qZA(),s._uU(32,"\n"),s.TgZ(33,"div",6),s._uU(34,"\n  "),s._UZ(35,"app-logo-forbes"),s._uU(36,"\n  "),s._UZ(37,"app-logo-us-news"),s._uU(38,"\n"),s.qZA(),s._uU(39,"\n"))},dependencies:[Ku,Bu],encapsulation:2});class Wu{}Wu.ɵfac=function(e){return new(e||Wu)},Wu.ɵcmp=s.Xpm({type:Wu,selectors:[["app-teams2-content"]],decls:31,vars:0,consts:[[1,"tw-text-4xl","!tw-text-alt2"],[1,"tw-pt-32"],[1,"tw-text-2xl"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"Start Your Free Trial Now"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6,"\n    Millions of individuals, teams, and organizations worldwide trust Bitwarden for secure password\n    storage and sharing.\n  "),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.TgZ(11,"li"),s._uU(12,"Collaborate and share securely"),s.qZA(),s._uU(13,"\n  "),s.TgZ(14,"li"),s._uU(15,"Deploy and manage quickly and easily"),s.qZA(),s._uU(16,"\n  "),s.TgZ(17,"li"),s._uU(18,"Access anywhere on any device"),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"li"),s._uU(21,"Create your account to get started"),s.qZA(),s._uU(22,"\n"),s.qZA(),s._uU(23,"\n"),s.TgZ(24,"div",4),s._uU(25,"\n  "),s._UZ(26,"app-logo-forbes"),s._uU(27,"\n  "),s._UZ(28,"app-logo-us-news"),s._uU(29,"\n"),s.qZA(),s._uU(30,"\n"))},dependencies:[Ku,Bu],encapsulation:2});const Xu=function(){return{org:"teams",layout:"teams1"}};class ed{}ed.ɵfac=function(e){return new(e||ed)},ed.ɵcmp=s.Xpm({type:ed,selectors:[["app-teams3-content"]],decls:40,vars:2,consts:[[1,"tw-text-4xl","!tw-text-alt2"],[1,"tw-pt-32"],[1,"tw-text-2xl"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main"],[1,"tw-mt-2","tw-text-base"],["routerLink","/register",3,"queryParams"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"Begin Teams Starter Free Trial Now"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6,"\n    Millions of individuals, teams, and organizations worldwide trust Bitwarden for secure password\n    storage and sharing.\n  "),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.TgZ(11,"li"),s._uU(12,"\n    Powerful security for up to 10 users\n    "),s.TgZ(13,"div",4),s._uU(14,"\n      Have more than 10 users?\n      "),s.TgZ(15,"a",5),s._uU(16,"Start a Teams trial"),s.qZA(),s._uU(17,"\n    "),s.qZA(),s._uU(18,"\n  "),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"li"),s._uU(21,"Collaborate and share securely"),s.qZA(),s._uU(22,"\n  "),s.TgZ(23,"li"),s._uU(24,"Deploy and manage quickly and easily"),s.qZA(),s._uU(25,"\n  "),s.TgZ(26,"li"),s._uU(27,"Access anywhere on any device"),s.qZA(),s._uU(28,"\n  "),s.TgZ(29,"li"),s._uU(30,"Create your account to get started"),s.qZA(),s._uU(31,"\n"),s.qZA(),s._uU(32,"\n"),s.TgZ(33,"div",6),s._uU(34,"\n  "),s._UZ(35,"app-logo-forbes"),s._uU(36,"\n  "),s._UZ(37,"app-logo-us-news"),s._uU(38,"\n"),s.qZA(),s._uU(39,"\n")),2&e&&(s.xp6(15),s.Q6J("queryParams",s.DdM(1,Xu)))},dependencies:[p.rH,Ku,Bu],encapsulation:2});class td{}td.ɵfac=function(e){return new(e||td)},td.ɵcmp=s.Xpm({type:td,selectors:[["app-logo-cnet"]],decls:14,vars:0,consts:[["src","../../images/register-layout/cnet-logo.svg","alt","CNET Logo",1,"tw-mx-auto","tw-block","tw-w-40"],[1,"tw-mx-auto","tw-mt-2","tw-max-w-xl","tw-px-4","tw-text-center"]],template:function(e,t){1&e&&(s.TgZ(0,"figure"),s._uU(1,"\n  "),s.TgZ(2,"figcaption"),s._uU(3,"\n    "),s.TgZ(4,"cite"),s._uU(5,"\n      "),s._UZ(6,"img",0),s._uU(7,"\n    "),s.qZA(),s._uU(8,"\n  "),s.qZA(),s._uU(9,"\n  "),s.TgZ(10,"blockquote",1),s._uU(11,'\n    "No more excuses; start using Bitwarden today. The identity you save could be your own. The\n    money definitely will be."\n  '),s.qZA(),s._uU(12,"\n"),s.qZA(),s._uU(13,"\n"))},encapsulation:2});class id{}id.ɵfac=function(e){return new(e||id)},id.ɵcmp=s.Xpm({type:id,selectors:[["app-cnet-enterprise-content"]],decls:31,vars:0,consts:[[1,"tw-text-4xl","!tw-text-alt2"],[1,"tw-pt-32"],[1,"tw-text-2xl"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"Start Your Enterprise Free Trial Now"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6,"\n    Millions of individuals, teams, and organizations worldwide trust Bitwarden for secure password\n    storage and sharing.\n  "),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.TgZ(11,"li"),s._uU(12,"Collaborate and share securely"),s.qZA(),s._uU(13,"\n  "),s.TgZ(14,"li"),s._uU(15,"Deploy and manage quickly and easily"),s.qZA(),s._uU(16,"\n  "),s.TgZ(17,"li"),s._uU(18,"Access anywhere on any device"),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"li"),s._uU(21,"Create your account to get started"),s.qZA(),s._uU(22,"\n"),s.qZA(),s._uU(23,"\n"),s.TgZ(24,"div",4),s._uU(25,"\n  "),s._UZ(26,"app-logo-cnet"),s._uU(27,"\n  "),s._UZ(28,"app-logo-us-news"),s._uU(29,"\n"),s.qZA(),s._uU(30,"\n"))},dependencies:[td,Bu],encapsulation:2});class nd{}nd.ɵfac=function(e){return new(e||nd)},nd.ɵcmp=s.Xpm({type:nd,selectors:[["app-cnet-individual-content"]],decls:31,vars:0,consts:[[1,"tw-text-4xl","!tw-text-alt2"],[1,"tw-pt-32"],[1,"tw-text-2xl"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"Start Your Premium Account Now"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6,"\n    Millions of individuals, teams, and organizations worldwide trust Bitwarden for secure password\n    storage and sharing.\n  "),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.TgZ(11,"li"),s._uU(12,"Store logins, secure notes, and more"),s.qZA(),s._uU(13,"\n  "),s.TgZ(14,"li"),s._uU(15,"Secure your account with advanced two-step login"),s.qZA(),s._uU(16,"\n  "),s.TgZ(17,"li"),s._uU(18,"Access anywhere on any device"),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"li"),s._uU(21,"Create your account to get started"),s.qZA(),s._uU(22,"\n"),s.qZA(),s._uU(23,"\n"),s.TgZ(24,"div",4),s._uU(25,"\n  "),s._UZ(26,"app-logo-cnet"),s._uU(27,"\n  "),s._UZ(28,"app-logo-us-news"),s._uU(29,"\n"),s.qZA(),s._uU(30,"\n"))},dependencies:[td,Bu],encapsulation:2});class sd{}sd.ɵfac=function(e){return new(e||sd)},sd.ɵcmp=s.Xpm({type:sd,selectors:[["app-cnet-teams-content"]],decls:31,vars:0,consts:[[1,"tw-text-4xl","!tw-text-alt2"],[1,"tw-pt-32"],[1,"tw-text-2xl"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"Start Your Teams Free Trial Now"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6,"\n    Millions of individuals, teams, and organizations worldwide trust Bitwarden for secure password\n    storage and sharing.\n  "),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.TgZ(11,"li"),s._uU(12,"Collaborate and share securely"),s.qZA(),s._uU(13,"\n  "),s.TgZ(14,"li"),s._uU(15,"Deploy and manage quickly and easily"),s.qZA(),s._uU(16,"\n  "),s.TgZ(17,"li"),s._uU(18,"Access anywhere on any device"),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"li"),s._uU(21,"Create your account to get started"),s.qZA(),s._uU(22,"\n"),s.qZA(),s._uU(23,"\n"),s.TgZ(24,"div",4),s._uU(25,"\n  "),s._UZ(26,"app-logo-cnet"),s._uU(27,"\n  "),s._UZ(28,"app-logo-us-news"),s._uU(29,"\n"),s.qZA(),s._uU(30,"\n"))},dependencies:[td,Bu],encapsulation:2});class od{}od.ɵfac=function(e){return new(e||od)},od.ɵcmp=s.Xpm({type:od,selectors:[["app-abm-enterprise-content"]],decls:31,vars:0,consts:[[1,"tw-text-4xl","!tw-text-alt2"],[1,"tw-pt-32"],[1,"tw-text-2xl"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"The Bitwarden Password Manager"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6,"\n    Trusted by millions of individuals, teams, and organizations worldwide for secure password\n    storage and sharing.\n  "),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.TgZ(11,"li"),s._uU(12,"Store logins, secure notes, and more"),s.qZA(),s._uU(13,"\n  "),s.TgZ(14,"li"),s._uU(15,"Collaborate and share securely"),s.qZA(),s._uU(16,"\n  "),s.TgZ(17,"li"),s._uU(18,"Access anywhere on any device"),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"li"),s._uU(21,"Create your account to get started"),s.qZA(),s._uU(22,"\n"),s.qZA(),s._uU(23,"\n"),s.TgZ(24,"div",4),s._uU(25,"\n  "),s._UZ(26,"app-logo-forbes"),s._uU(27,"\n  "),s._UZ(28,"app-logo-us-news"),s._uU(29,"\n"),s.qZA(),s._uU(30,"\n"))},dependencies:[Ku,Bu],encapsulation:2});class rd{}rd.ɵfac=function(e){return new(e||rd)},rd.ɵcmp=s.Xpm({type:rd,selectors:[["app-abm-teams-content"]],decls:31,vars:0,consts:[[1,"tw-text-4xl","!tw-text-alt2"],[1,"tw-pt-32"],[1,"tw-text-2xl"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main"],[1,"tw-mt-28","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1,"The Bitwarden Password Manager"),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6,"\n    Trusted by millions of individuals, teams, and organizations worldwide for secure password\n    storage and sharing.\n  "),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.TgZ(11,"li"),s._uU(12,"Store logins, secure notes, and more"),s.qZA(),s._uU(13,"\n  "),s.TgZ(14,"li"),s._uU(15,"Collaborate and share securely"),s.qZA(),s._uU(16,"\n  "),s.TgZ(17,"li"),s._uU(18,"Access anywhere on any device"),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"li"),s._uU(21,"Create your account to get started"),s.qZA(),s._uU(22,"\n"),s.qZA(),s._uU(23,"\n"),s.TgZ(24,"div",4),s._uU(25,"\n  "),s._UZ(26,"app-logo-forbes"),s._uU(27,"\n  "),s._UZ(28,"app-logo-us-news"),s._uU(29,"\n"),s.qZA(),s._uU(30,"\n"))},dependencies:[Ku,Bu],encapsulation:2});class ad{}function ld(e,t){if(1&e&&(s.TgZ(0,"li"),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.xp6(1),s.hij("\n    ",e,"\n  ")}}function cd(e,t){if(1&e&&(s.TgZ(0,"li"),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.xp6(1),s.hij("\n          ",e,"\n        ")}}ad.ɵfac=function(e){return new(e||ad)},ad.ɵcmp=s.Xpm({type:ad,selectors:[["app-review-blurb"]],inputs:{header:"header",quote:"quote",source:"source"},decls:18,vars:3,consts:[[1,"tw-mx-auto","tw-pb-2","tw-max-w-xl","tw-font-semibold","tw-text-center"],[1,"tw-mx-auto","tw-my-2","tw-max-w-xl","tw-px-4","tw-text-center"],[1,"tw-mx-auto","tw-text-center","tw-font-bold"]],template:function(e,t){1&e&&(s.TgZ(0,"figure"),s._uU(1,"\n  "),s.TgZ(2,"h2",0),s._uU(3),s.qZA(),s._uU(4,"\n  "),s.TgZ(5,"blockquote",1),s._uU(6),s.qZA(),s._uU(7,"\n  "),s.TgZ(8,"figcaption"),s._uU(9,"\n    "),s.TgZ(10,"cite"),s._uU(11,"\n      "),s.TgZ(12,"p",2),s._uU(13),s.qZA(),s._uU(14,"\n    "),s.qZA(),s._uU(15,"\n  "),s.qZA(),s._uU(16,"\n"),s.qZA(),s._uU(17,"\n")),2&e&&(s.xp6(3),s.hij("\n    ",t.header,"\n  "),s.xp6(3),s.hij('\n    "',t.quote,'"\n  '),s.xp6(7),s.Oqu(t.source))},encapsulation:2});class ud{constructor(e){this.activatedRoute=e,this.headline="A simpler, faster way to secure and automate secrets across code and infrastructure deployments",this.paidPrimaryPoints=["Unlimited secrets, users, and projects","Simple and transparent pricing","Zero-knowledge, end-to-end encryption"],this.paidCalloutHeadline="Limited time offer",this.paidCallouts=["Sign up today and receive a complimentary 12-month subscription to Bitwarden Password Manager","Experience complete security across your organization","Secure all your sensitive credentials, from user applications to machine secrets"],this.freePrimaryPoints=["Unlimited secrets","Simple and transparent pricing","Zero-knowledge, end-to-end encryption"],this.freeCalloutHeadline="Go beyond developer security!",this.freeCallouts=["Your Bitwarden account will also grant complimentary access to Bitwarden Password Manager","Extend end-to-end encryption to your personal passwords, addresses, credit cards and notes"],this.destroy$=new h.x}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngOnInit(){this.activatedRoute.queryParams.pipe((0,g.R)(this.destroy$)).subscribe((e=>{switch(e.org){case"enterprise":this.header="Secrets Manager for Enterprise",this.primaryPoints=this.paidPrimaryPoints,this.calloutHeadline=this.paidCalloutHeadline,this.callouts=this.paidCallouts;break;case"free":this.header="Bitwarden Secrets Manager",this.primaryPoints=this.freePrimaryPoints,this.calloutHeadline=this.freeCalloutHeadline,this.callouts=this.freeCallouts;break;case"teams":case"teamsStarter":this.header="Secrets Manager for Teams",this.primaryPoints=this.paidPrimaryPoints,this.calloutHeadline=this.paidCalloutHeadline,this.callouts=this.paidCallouts}}))}}ud.ɵfac=function(e){return new(e||ud)(s.Y36(p.gz))},ud.ɵcmp=s.Xpm({type:ud,selectors:[["app-secrets-manager-content"]],decls:36,vars:5,consts:[[1,"tw-text-4xl","!tw-text-alt2"],[1,"tw-pt-16"],[1,"tw-text-2xl","tw-font-semibold"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-gap-10","tw-text-2xl","tw-text-main"],[4,"ngFor","ngForOf"],[1,"tw-mt-12","tw-flex","tw-flex-col"],[1,"tw-rounded-[32px]","tw-bg-background"],[1,"tw-my-8","tw-mx-6"],[1,"tw-pl-5","tw-font-semibold"],[1,"tw-space-y-4","tw-mt-4","tw-pl-10"],[1,"tw-mt-12","tw-flex","tw-flex-col","tw-items-center","tw-gap-5"],["header","Businesses trust Bitwarden to secure their infrastructure","quote","At this point, it would be almost impossible to leak our secrets. It's just one less thing we have to worry about.","source","Titanom Technologies"]],template:function(e,t){1&e&&(s.TgZ(0,"h1",0),s._uU(1),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"div",1),s._uU(4,"\n  "),s.TgZ(5,"h2",2),s._uU(6),s.qZA(),s._uU(7,"\n"),s.qZA(),s._uU(8,"\n"),s.TgZ(9,"ul",3),s._uU(10,"\n  "),s.YNc(11,ld,2,1,"li",4),s._uU(12,"\n"),s.qZA(),s._uU(13,"\n"),s.TgZ(14,"div",5),s._uU(15,"\n  "),s.TgZ(16,"div",6),s._uU(17,"\n    "),s.TgZ(18,"div",7),s._uU(19,"\n      "),s.TgZ(20,"h2",8),s._uU(21),s.qZA(),s._uU(22,"\n      "),s.TgZ(23,"ul",9),s._uU(24,"\n        "),s.YNc(25,cd,2,1,"li",4),s._uU(26,"\n      "),s.qZA(),s._uU(27,"\n    "),s.qZA(),s._uU(28,"\n  "),s.qZA(),s._uU(29,"\n"),s.qZA(),s._uU(30,"\n"),s.TgZ(31,"div",10),s._uU(32,"\n  "),s._UZ(33,"app-review-blurb",11),s._uU(34,"\n"),s.qZA(),s._uU(35,"\n")),2&e&&(s.xp6(1),s.Oqu(t.header),s.xp6(5),s.hij("\n    ",t.headline,"\n  "),s.xp6(5),s.Q6J("ngForOf",t.primaryPoints),s.xp6(10),s.Oqu(t.calloutHeadline),s.xp6(4),s.Q6J("ngForOf",t.callouts))},dependencies:[d.sg,ad],encapsulation:2});var dd=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const pd=["stepper"];class hd{constructor(e,t,i,n){this.formBuilder=e,this.i18nService=t,this.organizationBillingService=i,this.router=n,this.formGroup=this.formBuilder.group({name:["",{validators:[l.kI.required,l.kI.maxLength(50)],updateOn:"change"}],email:["",{validators:[l.kI.email]}]}),this.subLabels={createAccount:"Before creating your free organization, you first need to log in or create a personal account.",organizationInfo:"Enter your organization information"}}ngOnInit(){this.referenceEventRequest=new $c,this.referenceEventRequest.initiationPath="Secrets Manager trial from marketing website"}accountCreated(e){var t;null===(t=this.formGroup.get("email"))||void 0===t||t.setValue(e),this.subLabels.createAccount=e,this.verticalStepper.next()}createOrganization(){return dd(this,void 0,void 0,(function*(){const e=yield this.organizationBillingService.startFree({organization:{name:this.formGroup.get("name").value,billingEmail:this.formGroup.get("email").value},plan:{type:ae.k9.Free,subscribeToSecretsManager:!0,isFromSecretsManagerTrial:!0}});this.organizationId=e.id,this.subLabels.organizationInfo=e.name,this.verticalStepper.next()}))}navigateToMembers(){return dd(this,void 0,void 0,(function*(){yield this.router.navigate(["organizations",this.organizationId,"members"])}))}navigateToSecretsManager(){return dd(this,void 0,void 0,(function*(){yield this.router.navigate(["sm",this.organizationId])}))}}hd.ɵfac=function(e){return new(e||hd)(s.Y36(l.QS),s.Y36(M.D),s.Y36(Xc.c),s.Y36(p.F0))},hd.ɵcmp=s.Xpm({type:hd,selectors:[["app-secrets-manager-trial-free-stepper"]],viewQuery:function(e,t){if(1&e&&s.Gf(pd,5),2&e){let e;s.iGM(e=s.CRH())&&(t.verticalStepper=e.first)}},decls:61,vars:42,consts:[["linear",""],["stepper",""],[3,"label","editable","subLabel","addSubLabelSpacing"],[3,"referenceDataValue","isInTrialFlow","createdAccount"],[3,"label","subLabel"],[3,"nameOnly","formGroup"],["type","button","bitButton","","buttonType","primary",3,"disabled","click"],[3,"label"],[1,"tw-pb-6","tw-pl-6"],[1,"tw-text-xl"],[1,"tw-list-disc"],[1,"tw-font-bold"],[1,"tw-mb-3","tw-flex"],["type","button","bitButton","","buttonType","primary",3,"click"],["type","button","bitButton","","buttonType","secondary",1,"tw-ml-3","tw-inline-flex","tw-items-center","tw-px-3",3,"click"]],template:function(e,t){1&e&&(s.TgZ(0,"app-vertical-stepper",0,1),s._uU(2,"\n  "),s.TgZ(3,"app-vertical-step",2),s.ALo(4,"titlecase"),s.ALo(5,"i18n"),s._uU(6,"\n    "),s.TgZ(7,"app-register-form",3),s.NdJ("createdAccount",(function(e){return t.accountCreated(e)})),s._uU(8,"\n    "),s.qZA(),s._uU(9,"\n  "),s.qZA(),s._uU(10,"\n  "),s.TgZ(11,"app-vertical-step",4),s.ALo(12,"titlecase"),s.ALo(13,"i18n"),s._uU(14,"\n    "),s.TgZ(15,"app-org-info",5),s._uU(16," "),s.qZA(),s._uU(17,"\n    "),s.TgZ(18,"button",6),s.NdJ("click",(function(){return t.createOrganization()})),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n  "),s.qZA(),s._uU(22,"\n  "),s.TgZ(23,"app-vertical-step",7),s.ALo(24,"titlecase"),s.ALo(25,"i18n"),s._uU(26,"\n    "),s.TgZ(27,"div",8),s._uU(28,"\n      "),s.TgZ(29,"p",9),s._uU(30),s.ALo(31,"i18n"),s.qZA(),s._uU(32,"\n      "),s.TgZ(33,"ul",10),s._uU(34,"\n        "),s.TgZ(35,"li"),s._uU(36,"\n          "),s.TgZ(37,"p"),s._uU(38),s.ALo(39,"i18n"),s.TgZ(40,"span",11),s._uU(41),s.qZA(),s._uU(42,".\n          "),s.qZA(),s._uU(43,"\n        "),s.qZA(),s._uU(44,"\n      "),s.qZA(),s._uU(45,"\n    "),s.qZA(),s._uU(46,"\n    "),s.TgZ(47,"div",12),s._uU(48,"\n      "),s.TgZ(49,"button",13),s.NdJ("click",(function(){return t.navigateToSecretsManager()})),s._uU(50),s.ALo(51,"titlecase"),s.ALo(52,"i18n"),s.qZA(),s._uU(53,"\n      "),s.TgZ(54,"button",14),s.NdJ("click",(function(){return t.navigateToMembers()})),s._uU(55),s.ALo(56,"i18n"),s.qZA(),s._uU(57,"\n    "),s.qZA(),s._uU(58,"\n  "),s.qZA(),s._uU(59,"\n"),s.qZA(),s._uU(60,"\n")),2&e&&(s.xp6(3),s.s9C("label",s.lcZ(4,18,s.lcZ(5,20,"createAccount"))),s.Q6J("editable",!1)("subLabel",t.subLabels.createAccount)("addSubLabelSpacing",!0),s.xp6(4),s.Q6J("referenceDataValue",t.referenceEventRequest)("isInTrialFlow",!0),s.xp6(4),s.s9C("label",s.lcZ(12,22,s.lcZ(13,24,"organizationInformation"))),s.Q6J("subLabel",t.subLabels.organizationInfo),s.xp6(4),s.Q6J("nameOnly",!0)("formGroup",t.formGroup),s.xp6(3),s.Q6J("disabled",t.formGroup.get("name").invalid),s.xp6(1),s.hij("\n      ",s.lcZ(20,26,"next"),"\n    "),s.xp6(4),s.s9C("label",s.lcZ(24,28,s.lcZ(25,30,"confirmationDetails"))),s.xp6(7),s.Oqu(s.lcZ(31,32,"smFreeTrialThankYou")),s.xp6(8),s.hij("\n            ",s.lcZ(39,34,"smFreeTrialConfirmationEmail"),"\n            "),s.xp6(3),s.Oqu(t.formGroup.get("email").value),s.xp6(9),s.hij("\n        ",s.lcZ(51,36,s.lcZ(52,38,"getStarted")),"\n      "),s.xp6(5),s.hij("\n        ",s.lcZ(56,40,"inviteUsers"),"\n      "))},dependencies:[l.JL,l.sg,Te.r,Uu,uu,Nu,De,d.rS,ee.C],encapsulation:2});const gd=["stepper"],fd=function(e,t,i){return{name:e,email:t,type:i}};function md(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-trial-billing-step",13),s.NdJ("steppedBack",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.steppedBack())}))("organizationCreated",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.organizationCreated(t))})),s.qZA()}if(2&e){const e=s.oxw();s.Q6J("organizationInfo",s.kEZ(2,fd,e.formGroup.get("name").value,e.formGroup.get("email").value,e.productType))("subscriptionProduct",e.SubscriptionProduct.SecretsManager)}}class vd extends hd{constructor(){super(...arguments),this.billingSubLabel=this.i18nService.t("billingTrialSubLabel"),this.SubscriptionProduct=Wc}organizationCreated(e){this.organizationId=e.organizationId,this.billingSubLabel=e.planDescription,this.verticalStepper.next()}steppedBack(){this.verticalStepper.previous()}get createAccountLabel(){return`Before creating your ${this.productType===le.kv.TeamsStarter?"Teams Starter":le.kv[this.productType]} organization, you first need to log in or create a personal account.`}get productType(){switch(this.organizationTypeQueryParameter){case"enterprise":return le.kv.Enterprise;case"families":return le.kv.Families;case"teams":return le.kv.Teams;case"teamsStarter":return le.kv.TeamsStarter}}}function yd(e,t){if(1&e&&(s.TgZ(0,"div",10),s._uU(1,"\n            "),s.TgZ(2,"h2",11),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n            "),s._UZ(6,"environment-selector",12),s._uU(7,"\n          "),s.qZA()),2&e){const e=s.oxw();s.xp6(3),s.hij("\n              ",s.xi3(4,1,"startYour7DayFreeTrialOfBitwardenSecretsManagerFor",e.organizationTypeQueryParameter),"\n            ")}}function wd(e,t){1&e&&s._UZ(0,"app-secrets-manager-trial-free-stepper")}function bd(e,t){if(1&e&&s._UZ(0,"app-secrets-manager-trial-paid-stepper",13),2&e){const e=s.oxw();s.Q6J("organizationTypeQueryParameter",e.organizationTypeQueryParameter)}}vd.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(vd)))(t||vd)}}(),vd.ɵcmp=s.Xpm({type:vd,selectors:[["app-secrets-manager-trial-paid-stepper"]],viewQuery:function(e,t){if(1&e&&s.Gf(gd,5),2&e){let e;s.iGM(e=s.CRH())&&(t.verticalStepper=e.first)}},inputs:{organizationTypeQueryParameter:"organizationTypeQueryParameter"},features:[s.qOj],decls:49,vars:44,consts:[["linear",""],["stepper",""],[3,"label","editable","subLabel","addSubLabelSpacing"],[3,"referenceDataValue","isInTrialFlow","createdAccount"],[3,"label","subLabel"],[3,"nameOnly","formGroup"],["type","button","bitButton","","buttonType","primary","cdkStepperNext","",3,"disabled"],[3,"organizationInfo","subscriptionProduct","steppedBack","organizationCreated",4,"ngIf"],[3,"label"],[3,"email","orgLabel"],[1,"tw-mb-3","tw-flex"],["type","button","bitButton","","buttonType","primary",3,"click"],["type","button","bitButton","","buttonType","secondary",1,"tw-ml-3","tw-inline-flex","tw-items-center","tw-px-3",3,"click"],[3,"organizationInfo","subscriptionProduct","steppedBack","organizationCreated"]],template:function(e,t){if(1&e&&(s.TgZ(0,"app-vertical-stepper",0,1),s._uU(2,"\n  "),s.TgZ(3,"app-vertical-step",2),s.ALo(4,"titlecase"),s.ALo(5,"i18n"),s._uU(6,"\n    "),s.TgZ(7,"app-register-form",3),s.NdJ("createdAccount",(function(e){return t.accountCreated(e)})),s._uU(8,"\n    "),s.qZA(),s._uU(9,"\n  "),s.qZA(),s._uU(10,"\n  "),s.TgZ(11,"app-vertical-step",4),s.ALo(12,"titlecase"),s.ALo(13,"i18n"),s._uU(14,"\n    "),s._UZ(15,"app-org-info",5),s._uU(16,"\n    "),s.TgZ(17,"button",6),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n  "),s.qZA(),s._uU(21,"\n  "),s.TgZ(22,"app-vertical-step",4),s.ALo(23,"titlecase"),s.ALo(24,"i18n"),s._uU(25,"\n    "),s.YNc(26,md,1,6,"app-trial-billing-step",7),s._uU(27,"\n  "),s.qZA(),s._uU(28,"\n  "),s.TgZ(29,"app-vertical-step",8),s.ALo(30,"titlecase"),s.ALo(31,"i18n"),s._uU(32,"\n    "),s._UZ(33,"app-trial-confirmation-details",9),s._uU(34,"\n    "),s.TgZ(35,"div",10),s._uU(36,"\n      "),s.TgZ(37,"button",11),s.NdJ("click",(function(){return t.navigateToSecretsManager()})),s._uU(38),s.ALo(39,"titlecase"),s.ALo(40,"i18n"),s.qZA(),s._uU(41,"\n      "),s.TgZ(42,"button",12),s.NdJ("click",(function(){return t.navigateToMembers()})),s._uU(43),s.ALo(44,"i18n"),s.qZA(),s._uU(45,"\n    "),s.qZA(),s._uU(46,"\n  "),s.qZA(),s._uU(47,"\n"),s.qZA(),s._uU(48,"\n")),2&e){const e=s.MAs(1);s.xp6(3),s.s9C("label",s.lcZ(4,20,s.lcZ(5,22,"createAccount"))),s.Q6J("editable",!1)("subLabel",t.createAccountLabel)("addSubLabelSpacing",!0),s.xp6(4),s.Q6J("referenceDataValue",t.referenceEventRequest)("isInTrialFlow",!0),s.xp6(4),s.s9C("label",s.lcZ(12,24,s.lcZ(13,26,"organizationInformation"))),s.Q6J("subLabel",t.subLabels.organizationInfo),s.xp6(4),s.Q6J("nameOnly",!0)("formGroup",t.formGroup),s.xp6(2),s.Q6J("disabled",t.formGroup.get("name").invalid),s.xp6(1),s.hij("\n      ",s.lcZ(19,28,"next"),"\n    "),s.xp6(4),s.s9C("label",s.lcZ(23,30,s.lcZ(24,32,"billing"))),s.Q6J("subLabel",t.billingSubLabel),s.xp6(4),s.Q6J("ngIf",2===e.selectedIndex),s.xp6(3),s.s9C("label",s.lcZ(30,34,s.lcZ(31,36,"confirmationDetails"))),s.xp6(4),s.Q6J("email",t.formGroup.get("email").value)("orgLabel",t.organizationTypeQueryParameter),s.xp6(5),s.hij("\n        ",s.lcZ(39,38,s.lcZ(40,40,"getStarted")),"\n      "),s.xp6(5),s.hij("\n        ",s.lcZ(44,42,"inviteUsers"),"\n      ")}},dependencies:[d.O5,l.JL,l.sg,Te.r,au.st,Uu,uu,Nu,De,ou,Gu,d.rS,ee.C],encapsulation:2});class Ud{constructor(e){this.route=e,this.destroy$=new h.x}ngOnInit(){this.route.queryParams.pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.organizationTypeQueryParameter=e.org}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get freeOrganization(){return"free"===this.organizationTypeQueryParameter}}Ud.ɵfac=function(e){return new(e||Ud)(s.Y36(p.gz))},Ud.ɵcmp=s.Xpm({type:Ud,selectors:[["app-secrets-manager-trial"]],decls:34,vars:3,consts:[[1,"tw-absolute","tw--z-10","tw--mt-48","tw-h-[28rem]","tw-w-full","tw-bg-background-alt2"],[1,"tw-min-w-4xl","tw-mx-auto","tw-flex","tw-max-w-screen-xl","tw-gap-12","tw-px-4"],[1,"tw-w-1/2"],["alt","Bitwarden","src","../../../../images/register-layout/logo-horizontal-white.svg",1,"tw-mt-6",2,"height","50px","width","335px"],[1,"tw-pt-12"],[1,"tw-pt-44"],[1,"tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background"],["class","tw-flex tw-h-auto tw-w-full tw-gap-5 tw-rounded-t tw-bg-secondary-100",4,"ngIf"],[4,"ngIf"],[3,"organizationTypeQueryParameter",4,"ngIf"],[1,"tw-flex","tw-h-auto","tw-w-full","tw-gap-5","tw-rounded-t","tw-bg-secondary-100"],[1,"tw-pb-4","tw-pl-4","tw-pt-5","tw-text-base","tw-font-bold","tw-uppercase"],[1,"tw-mr-4","tw-mt-6","tw-flex-shrink-0","tw-text-end"],[3,"organizationTypeQueryParameter"]],template:function(e,t){1&e&&(s._uU(0,"\n"),s.ynx(1),s._uU(2,"\n  "),s._UZ(3,"div",0),s._uU(4,"\n  "),s.TgZ(5,"div",1),s._uU(6,"\n    "),s.TgZ(7,"div",2),s._uU(8,"\n      "),s._UZ(9,"img",3),s._uU(10,"\n      "),s.TgZ(11,"div",4),s._uU(12,"\n        "),s._UZ(13,"app-secrets-manager-content"),s._uU(14,"\n      "),s.qZA(),s._uU(15,"\n    "),s.qZA(),s._uU(16,"\n    "),s.TgZ(17,"div",2),s._uU(18,"\n      "),s.TgZ(19,"div",5),s._uU(20,"\n        "),s.TgZ(21,"div",6),s._uU(22,"\n          "),s.YNc(23,yd,8,4,"div",7),s._uU(24,"\n          "),s.YNc(25,wd,1,0,"app-secrets-manager-trial-free-stepper",8),s._uU(26,"\n          "),s.YNc(27,bd,1,1,"app-secrets-manager-trial-paid-stepper",9),s._uU(28,"\n        "),s.qZA(),s._uU(29,"\n      "),s.qZA(),s._uU(30,"\n    "),s.qZA(),s._uU(31,"\n  "),s.qZA(),s._uU(32,"\n"),s.BQk(),s._uU(33,"\n")),2&e&&(s.xp6(23),s.Q6J("ngIf",!t.freeOrganization),s.xp6(2),s.Q6J("ngIf",t.freeOrganization),s.xp6(2),s.Q6J("ngIf",!t.freeOrganization))},dependencies:[d.O5,Ru,ud,hd,vd,ee.C],encapsulation:2});var _d=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Ad=["stepper"];function Zd(e,t){1&e&&s._UZ(0,"app-secrets-manager-trial")}function xd(e,t){if(1&e&&(s.TgZ(0,"div",4),s._uU(1,"\n    "),s.TgZ(2,"h1",5),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n    "),s.TgZ(6,"div",6),s._uU(7,"\n      "),s._UZ(8,"app-register-form",7),s._uU(9,"\n    "),s.qZA(),s._uU(10,"\n  "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,5,"createAccount")),s.xp6(5),s.Q6J("queryParamEmail",e.email)("queryParamFromOrgInvite",e.fromOrgInvite)("enforcedPolicyOptions",e.enforcedPolicyOptions)("referenceDataValue",e.referenceData)}}function Sd(e,t){1&e&&s._UZ(0,"app-default-content")}function Td(e,t){1&e&&s._UZ(0,"app-teams-content")}function Cd(e,t){1&e&&s._UZ(0,"app-teams1-content")}function Od(e,t){1&e&&s._UZ(0,"app-teams2-content")}function kd(e,t){1&e&&s._UZ(0,"app-teams3-content")}function Pd(e,t){1&e&&s._UZ(0,"app-enterprise-content")}function qd(e,t){1&e&&s._UZ(0,"app-enterprise1-content")}function Id(e,t){1&e&&s._UZ(0,"app-enterprise2-content")}function Md(e,t){1&e&&s._UZ(0,"app-cnet-enterprise-content")}function Nd(e,t){1&e&&s._UZ(0,"app-cnet-individual-content")}function Ld(e,t){1&e&&s._UZ(0,"app-cnet-teams-content")}function Dd(e,t){1&e&&s._UZ(0,"app-abm-enterprise-content")}function Ed(e,t){1&e&&s._UZ(0,"app-abm-teams-content")}function Fd(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n          "),s.TgZ(2,"div",14),s._uU(3,"\n            "),s._UZ(4,"app-register-form",15),s._uU(5,"\n          "),s.qZA(),s._uU(6,"\n        "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(4),s.Q6J("queryParamEmail",e.email)("enforcedPolicyOptions",e.enforcedPolicyOptions)("referenceDataValue",e.referenceData)}}const Rd=function(e,t,i){return{name:e,email:t,type:i}};function Jd(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-trial-billing-step",35),s.NdJ("steppedBack",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.previousStep())}))("organizationCreated",(function(t){s.CHM(e);const i=s.oxw(4);return s.KtG(i.createdOrganization(t))})),s._uU(1,"\n                "),s.qZA()}if(2&e){const e=s.oxw(4);s.Q6J("organizationInfo",s.kEZ(2,Rd,e.orgInfoFormGroup.get("name").value,e.orgInfoFormGroup.get("email").value,e.trialOrganizationType))("subscriptionProduct",e.SubscriptionProduct.PasswordManager)}}function zd(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",16),s._uU(1,"\n          "),s.TgZ(2,"div",17),s._uU(3,"\n            "),s.TgZ(4,"div",18),s._uU(5,"\n              "),s.TgZ(6,"h2",19),s._uU(7),s.qZA(),s._uU(8,"\n              "),s._UZ(9,"environment-selector",20),s._uU(10,"\n            "),s.qZA(),s._uU(11,"\n            "),s.TgZ(12,"app-vertical-stepper",21,22),s.NdJ("selectionChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.stepSelectionChange(t))})),s._uU(14,"\n              "),s.TgZ(15,"app-vertical-step",23),s._uU(16,"\n                "),s.TgZ(17,"app-register-form",24),s.NdJ("createdAccount",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.createdAccount(t))})),s.qZA(),s._uU(18,"\n              "),s.qZA(),s._uU(19,"\n              "),s.TgZ(20,"app-vertical-step",25),s._uU(21,"\n                "),s._UZ(22,"app-org-info",26),s._uU(23,"\n                "),s.TgZ(24,"button",27),s._uU(25),s.ALo(26,"i18n"),s.qZA(),s._uU(27,"\n              "),s.qZA(),s._uU(28,"\n              "),s.TgZ(29,"app-vertical-step",28),s._uU(30,"\n                "),s.YNc(31,Jd,2,6,"app-trial-billing-step",29),s._uU(32,"\n              "),s.qZA(),s._uU(33,"\n              "),s.TgZ(34,"app-vertical-step",30),s._uU(35,"\n                "),s._UZ(36,"app-trial-confirmation-details",31),s._uU(37,"\n                "),s.TgZ(38,"div",32),s._uU(39,"\n                  "),s.TgZ(40,"button",33),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.navigateToOrgVault())})),s._uU(41),s.ALo(42,"titlecase"),s.ALo(43,"i18n"),s.qZA(),s._uU(44,"\n                  "),s.TgZ(45,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.navigateToOrgInvite())})),s._uU(46),s.ALo(47,"i18n"),s.qZA(),s._uU(48,"\n                "),s.qZA(),s._uU(49,"\n              "),s.qZA(),s._uU(50,"\n            "),s.qZA(),s._uU(51,"\n          "),s.qZA(),s._uU(52,"\n        "),s.qZA()}if(2&e){const e=s.MAs(13),t=s.oxw(3);s.xp6(7),s.hij("\n                ",t.freeTrialText,"\n              "),s.xp6(8),s.Q6J("editable",!1)("subLabel",t.email),s.xp6(2),s.Q6J("isInTrialFlow",!0)("referenceDataValue",t.referenceData),s.xp6(3),s.Q6J("subLabel",t.orgInfoSubLabel),s.xp6(2),s.Q6J("nameOnly",!0)("formGroup",t.orgInfoFormGroup),s.xp6(2),s.Q6J("disabled",t.orgInfoFormGroup.get("name").invalid),s.xp6(1),s.hij("\n                  ",s.lcZ(26,17,"next"),"\n                "),s.xp6(4),s.Q6J("subLabel",t.billingSubLabel),s.xp6(2),s.Q6J("ngIf",2===e.selectedIndex),s.xp6(3),s.Q6J("applyBorder",!1),s.xp6(2),s.Q6J("email",t.email)("orgLabel",t.orgLabel),s.xp6(5),s.hij("\n                    ",s.lcZ(42,19,s.lcZ(43,21,"getStarted")),"\n                  "),s.xp6(5),s.hij("\n                    ",s.lcZ(47,23,"inviteUsers"),"\n                  ")}}function Yd(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n    "),s._UZ(2,"div",8),s._uU(3,"\n    "),s.TgZ(4,"div",9),s._uU(5,"\n      "),s.TgZ(6,"div",10),s._uU(7,"\n        "),s._UZ(8,"img",11),s._uU(9,"\n\n        "),s.TgZ(10,"div",12),s._uU(11,"\n          "),s._uU(12,"\n          "),s.YNc(13,Sd,1,0,"app-default-content",3),s._uU(14,"\n          "),s.YNc(15,Td,1,0,"app-teams-content",3),s._uU(16,"\n          "),s.YNc(17,Cd,1,0,"app-teams1-content",3),s._uU(18,"\n          "),s.YNc(19,Od,1,0,"app-teams2-content",3),s._uU(20,"\n          "),s.YNc(21,kd,1,0,"app-teams3-content",3),s._uU(22,"\n          "),s.YNc(23,Pd,1,0,"app-enterprise-content",3),s._uU(24,"\n          "),s.YNc(25,qd,1,0,"app-enterprise1-content",3),s._uU(26,"\n          "),s.YNc(27,Id,1,0,"app-enterprise2-content",3),s._uU(28,"\n          "),s.YNc(29,Md,1,0,"app-cnet-enterprise-content",3),s._uU(30,"\n          "),s.YNc(31,Nd,1,0,"app-cnet-individual-content",3),s._uU(32,"\n          "),s.YNc(33,Ld,1,0,"app-cnet-teams-content",3),s._uU(34,"\n          "),s.YNc(35,Dd,1,0,"app-abm-enterprise-content",3),s._uU(36,"\n          "),s.YNc(37,Ed,1,0,"app-abm-teams-content",3),s._uU(38,"\n        "),s.qZA(),s._uU(39,"\n      "),s.qZA(),s._uU(40,"\n      "),s.TgZ(41,"div",10),s._uU(42,"\n        "),s.YNc(43,Fd,7,3,"div",3),s._uU(44,"\n        "),s.YNc(45,zd,53,25,"div",13),s._uU(46,"\n      "),s.qZA(),s._uU(47,"\n    "),s.qZA(),s._uU(48,"\n  "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(13),s.Q6J("ngIf",e.layout===e.layouts.default),s.xp6(2),s.Q6J("ngIf",e.layout===e.layouts.teams),s.xp6(2),s.Q6J("ngIf",e.layout===e.layouts.teams1),s.xp6(2),s.Q6J("ngIf",e.layout===e.layouts.teams2),s.xp6(2),s.Q6J("ngIf",e.layout===e.layouts.teams3),s.xp6(2),s.Q6J("ngIf",e.layout===e.layouts.enterprise),s.xp6(2),s.Q6J("ngIf",e.layout===e.layouts.enterprise1),s.xp6(2),s.Q6J("ngIf",e.layout===e.layouts.enterprise2),s.xp6(2),s.Q6J("ngIf",e.layout===e.layouts.cnetcmpgnent),s.xp6(2),s.Q6J("ngIf",e.layout===e.layouts.cnetcmpgnind),s.xp6(2),s.Q6J("ngIf",e.layout===e.layouts.cnetcmpgnteams),s.xp6(2),s.Q6J("ngIf",e.layout===e.layouts.abmenterprise),s.xp6(2),s.Q6J("ngIf",e.layout===e.layouts.abmteams),s.xp6(6),s.Q6J("ngIf",!e.useTrialStepper),s.xp6(2),s.Q6J("ngIf",e.useTrialStepper)}}function Kd(e,t){if(1&e&&(s._uU(0,"\n  "),s.YNc(1,xd,11,7,"div",2),s._uU(2,"\n  "),s.YNc(3,Yd,49,15,"div",3),s._uU(4,"\n")),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngIf",e.accountCreateOnly),s.xp6(2),s.Q6J("ngIf",!e.accountCreateOnly)}}var Bd,Qd;!function(e){e.families="families",e.enterprise="enterprise",e.teams="teams",e.teamsStarter="teamsStarter",e.individual="individual",e.premium="premium",e.free="free"}(Bd||(Bd={})),function(e){e.default="default",e.teams="teams",e.teams1="teams1",e.teams2="teams2",e.teams3="teams3",e.enterprise="enterprise",e.enterprise1="enterprise1",e.enterprise2="enterprise2",e.cnetcmpgnent="cnetcmpgnent",e.cnetcmpgnind="cnetcmpgnind",e.cnetcmpgnteams="cnetcmpgnteams",e.abmenterprise="abmenterprise",e.abmteams="abmteams",e.secretsManager="secretsManager"}(Qd||(Qd={}));class Gd{set referenceDataId(e){if(this.referenceData.id=null!=e?e:("; "+document.cookie).split("; reference=").pop().split(";").shift(),""===this.referenceData.id)this.referenceData.id=null;else{const e=/_ga_QBRN562QQQ=([^.]+)\.([^.]+)\.(\d+)/,t=document.cookie.match(e);t&&(this.referenceData.session=t[3])}}constructor(e,t,i,n,s,o,r,a,c,u){this.route=e,this.router=t,this.formBuilder=i,this.titleCasePipe=n,this.stateService=s,this.logService=o,this.policyApiService=r,this.policyService=a,this.i18nService=c,this.routerService=u,this.email="",this.fromOrgInvite=!1,this.org="",this.orgInfoSubLabel="",this.orgId="",this.orgLabel="",this.billingSubLabel="",this.layout="default",this.accountCreateOnly=!0,this.useTrialStepper=!1,this.trialFlowOrgs=[Bd.teams,Bd.teamsStarter,Bd.enterprise,Bd.families],this.routeFlowOrgs=[Bd.free,Bd.premium,Bd.individual],this.layouts=Qd,this.orgInfoFormGroup=this.formBuilder.group({name:["",{validators:[l.kI.required,l.kI.maxLength(50)],updateOn:"change"}],email:[""]}),this.destroy$=new h.x,this.SubscriptionProduct=Wc}ngOnInit(){return _d(this,void 0,void 0,(function*(){this.route.queryParams.pipe((0,g.R)(this.destroy$)).subscribe((e=>{if(this.referenceData=new $c,null!=e.email&&e.email.indexOf("@")>-1&&(this.email=e.email,this.fromOrgInvite="true"===e.fromOrgInvite),this.referenceDataId=e.reference,Object.values(Qd).includes(e.layout)&&(this.layout=e.layout,this.accountCreateOnly=!1),this.trialFlowOrgs.includes(e.org))this.org=e.org,this.orgLabel=this.titleCasePipe.transform(this.orgDisplayName),this.useTrialStepper=!0,this.referenceData.flow=e.org,this.org===Bd.families?(this.plan=ae.k9.FamiliesAnnually,this.product=le.kv.Families):this.org===Bd.teamsStarter?(this.plan=ae.k9.TeamsStarter,this.product=le.kv.TeamsStarter):this.org===Bd.teams?(this.plan=ae.k9.TeamsAnnually,this.product=le.kv.Teams):this.org===Bd.enterprise&&(this.plan=ae.k9.EnterpriseAnnually,this.product=le.kv.Enterprise);else if(this.routeFlowOrgs.includes(e.org)){this.referenceData.flow=e.org;const t=this.router.createUrlTree(["create-organization"],{queryParams:{plan:e.org}});this.routerService.setPreviousUrl(t.toString())}this.setupFamilySponsorship(e.sponsorshipToken),this.referenceData.initiationPath=this.accountCreateOnly?"Registration form":"Password Manager trial from marketing website"}));const e=yield this.stateService.getOrganizationInvitation();if(null!=e)try{const t=yield this.policyApiService.getPoliciesByToken(e.organizationId,e.token,e.email,e.organizationUserId);null!=t.data&&(this.policies=Ti.G.fromListResponse(t))}catch(t){this.logService.error(t)}null!=this.policies&&this.policyService.masterPasswordPolicyOptions$(this.policies).pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.enforcedPolicyOptions=e})),this.orgInfoFormGroup.controls.name.valueChanges.pipe((0,g.R)(this.destroy$)).subscribe((()=>{this.orgInfoFormGroup.controls.name.markAsTouched()}))}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}stepSelectionChange(e){1===e.selectedIndex&&""===this.orgInfoFormGroup.controls.name.value?this.orgInfoSubLabel="Enter your "+this.titleCasePipe.transform(this.orgDisplayName)+" organization information":1===e.previouslySelectedIndex&&(this.orgInfoSubLabel=this.orgInfoFormGroup.controls.name.value),2===e.selectedIndex&&(this.billingSubLabel=this.i18nService.t("billingTrialSubLabel"))}createdAccount(e){var t;this.email=e,null===(t=this.orgInfoFormGroup.get("email"))||void 0===t||t.setValue(e),this.verticalStepper.next()}billingSuccess(e){this.orgId=null==e?void 0:e.orgId,this.billingSubLabel=null==e?void 0:e.subLabelText,this.verticalStepper.next()}createdOrganization(e){this.orgId=e.organizationId,this.billingSubLabel=e.planDescription,this.verticalStepper.next()}navigateToOrgVault(){this.router.navigate(["organizations",this.orgId,"vault"])}navigateToOrgInvite(){this.router.navigate(["organizations",this.orgId,"members"])}previousStep(){this.verticalStepper.previous()}get orgDisplayName(){return"teamsStarter"===this.org?"Teams Starter":this.org}get freeTrialText(){const e=this.layout===this.layouts.secretsManager?"startYour7DayFreeTrialOfBitwardenSecretsManagerFor":"startYour7DayFreeTrialOfBitwardenFor";return this.i18nService.t(e,this.org)}get trialOrganizationType(){return this.product===le.kv.Free?null:this.product}setupFamilySponsorship(e){if(null!=e){const t=this.router.createUrlTree(["setup/families-for-enterprise"],{queryParams:{plan:e}});this.routerService.setPreviousUrl(t.toString())}}}Gd.ɵfac=function(e){return new(e||Gd)(s.Y36(p.gz),s.Y36(p.F0),s.Y36(l.QS),s.Y36(d.rS),s.Y36(J.b),s.Y36(_e.$),s.Y36(Oi.P),s.Y36(Y.d),s.Y36(M.D),s.Y36(ru.c))},Gd.ɵcmp=s.Xpm({type:Gd,selectors:[["app-trial"]],viewQuery:function(e,t){if(1&e&&s.Gf(Ad,5),2&e){let e;s.iGM(e=s.CRH())&&(t.verticalStepper=e.first)}},decls:6,vars:2,consts:[[4,"ngIf","ngIfElse"],["passwordManagerTrial",""],["class","",4,"ngIf"],[4,"ngIf"],[1,""],[1,"tw-mt-12","tw-text-center","tw-text-xl"],[1,"tw-min-w-xl","tw-m-auto","tw-max-w-xl","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background","tw-p-8"],[3,"queryParamEmail","queryParamFromOrgInvite","enforcedPolicyOptions","referenceDataValue"],[1,"tw-absolute","tw--z-10","tw--mt-48","tw-h-[28rem]","tw-w-full","tw-bg-background-alt2"],[1,"tw-min-w-4xl","tw-mx-auto","tw-flex","tw-max-w-screen-xl","tw-gap-12","tw-px-4"],[1,"tw-w-1/2"],["alt","Bitwarden","src","../../images/register-layout/logo-horizontal-white.svg",1,"tw-mt-6",2,"height","50px","width","335px"],[1,"tw-pt-12"],["class","tw-pt-44",4,"ngIf"],[1,"tw-min-w-xl","tw-m-auto","tw-mt-28","tw-max-w-xl","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background","tw-p-8"],[3,"queryParamEmail","enforcedPolicyOptions","referenceDataValue"],[1,"tw-pt-44"],[1,"tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background"],[1,"tw-flex","tw-h-auto","tw-w-full","tw-gap-5","tw-rounded-t","tw-bg-secondary-100"],[1,"tw-pb-4","tw-pl-4","tw-pt-5","tw-text-base","tw-font-bold","tw-uppercase"],[1,"tw-mr-4","tw-mt-6","tw-flex-shrink-0","tw-text-end"],["linear","",3,"selectionChange"],["stepper",""],["label","Create Account",3,"editable","subLabel"],[3,"isInTrialFlow","referenceDataValue","createdAccount"],["label","Organization Information",3,"subLabel"],[3,"nameOnly","formGroup"],["type","button","bitButton","","buttonType","primary","cdkStepperNext","",3,"disabled"],["label","Billing",3,"subLabel"],[3,"organizationInfo","subscriptionProduct","steppedBack","organizationCreated",4,"ngIf"],["label","Confirmation Details",3,"applyBorder"],[3,"email","orgLabel"],[1,"tw-mb-3","tw-flex"],["type","button","bitButton","","buttonType","primary",3,"click"],["type","button","bitButton","","buttonType","secondary",1,"tw-ml-3","tw-inline-flex","tw-items-center","tw-px-3",3,"click"],[3,"organizationInfo","subscriptionProduct","steppedBack","organizationCreated"]],template:function(e,t){if(1&e&&(s._uU(0,"\n"),s.YNc(1,Zd,1,0,"app-secrets-manager-trial",0),s._uU(2,"\n"),s.YNc(3,Kd,5,2,"ng-template",null,1,s.W1O),s._uU(5,"\n")),2&e){const e=s.MAs(4);s.xp6(1),s.Q6J("ngIf",t.layout===t.layouts.secretsManager)("ngIfElse",e)}},dependencies:[d.O5,l.JL,l.sg,Te.r,au.st,Uu,uu,Nu,De,Ru,ou,Yu,Qu,Gu,ju,Vu,$u,Hu,Wu,ed,id,nd,sd,od,rd,Ud,d.rS,ee.C],encapsulation:2});var jd=i(50203),Vd=i(44609),$d=i(38002),Hd=i(71916),Wd=i(15800),Xd=i(66990);class ep{constructor(e,t,i,n,s,o,r,a){this.win=e,this.webVaultUrl=t,this.webAuthnNewTab=i,this.platformUtilsService=n,this.i18nService=s,this.successCallback=o,this.errorCallback=r,this.infoCallback=a,this.iframe=null,this.parseFunction=this.parseMessage.bind(this),this.connectorLink=e.document.createElement("a")}init(e){const t=new URLSearchParams({data:this.base64Encode(JSON.stringify(e)),parent:encodeURIComponent(this.win.document.location.href),btnText:encodeURIComponent(this.i18nService.t("webAuthnAuthenticate")),v:"1"});this.webAuthnNewTab?(t.append("locale",this.i18nService.translationLocale),this.platformUtilsService.launchUri(`${this.webVaultUrl}/webauthn-fallback-connector.html?${t}`)):(this.connectorLink.href=`${this.webVaultUrl}/webauthn-connector.html?${t}`,this.iframe=this.win.document.getElementById("webauthn_iframe"),this.iframe.allow="publickey-credentials-get "+new URL(this.webVaultUrl).origin,this.iframe.src=this.connectorLink.href,this.win.addEventListener("message",this.parseFunction,!1))}stop(){this.sendMessage("stop")}start(){this.sendMessage("start")}sendMessage(e){this.iframe&&this.iframe.src&&this.iframe.contentWindow&&this.iframe.contentWindow.postMessage(e,this.iframe.src)}base64Encode(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode("0x"+t))))}cleanup(){this.win.removeEventListener("message",this.parseFunction,!1)}parseMessage(e){if(!this.validMessage(e))return;const t=e.data.split("|");"success"===t[0]&&this.successCallback?this.successCallback(t[1]):"error"===t[0]&&this.errorCallback?this.errorCallback(t[1]):"info"===t[0]&&this.infoCallback&&this.infoCallback(t[1])}validMessage(e){return null!=e.origin&&""!==e.origin&&e.origin===this.connectorLink.origin&&null!=e.data&&"string"==typeof e.data&&(0===e.data.indexOf("success|")||0===e.data.indexOf("error|")||0===e.data.indexOf("info|"))}}var tp=i(14921),ip=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class np extends jn{get isDuoProvider(){return this.selectedProviderType===bo.L.Duo||this.selectedProviderType===bo.L.OrganizationDuo}constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v){super(r,i,s),this.loginStrategyService=e,this.router=t,this.i18nService=i,this.apiService=n,this.platformUtilsService=s,this.win=o,this.environmentService=r,this.stateService=a,this.route=l,this.logService=c,this.twoFactorService=u,this.appIdService=d,this.loginEmailService=p,this.userDecryptionOptionsService=h,this.ssoLoginService=g,this.configService=f,this.masterPasswordService=m,this.accountService=v,this.token="",this.remember=!1,this.webAuthnReady=!1,this.webAuthnNewTab=!1,this.providers=Xd.Vz,this.providerType=bo.L,this.selectedProviderType=bo.L.Authenticator,this.webAuthnSupported=!1,this.webAuthn=null,this.title="",this.twoFactorEmail=null,this.orgIdentifier=null,this.duoFrameless=!1,this.duoFramelessUrl=null,this.duoResultListenerInitialized=!1,this.loginRoute="login",this.trustedDeviceEncRoute="login-initiated",this.changePasswordRoute="set-password",this.forcePasswordResetRoute="update-temp-password",this.successRoute="vault",this.webAuthnSupported=this.platformUtilsService.supportsWebAuthn(o)}ngOnInit(){return ip(this,void 0,void 0,(function*(){if((yield this.authing())&&null!=(yield this.twoFactorService.getProviders())){if(this.route.queryParams.pipe((0,oe.P)()).subscribe((e=>{null!=e.identifier&&(this.orgIdentifier=e.identifier)})),(yield this.needsLock())&&(this.successRoute="lock"),null!=this.win&&this.webAuthnSupported){const e=(yield(0,f.z)(this.environmentService.environment$)).getWebVaultUrl();this.webAuthn=new ep(this.win,e,this.webAuthnNewTab,this.platformUtilsService,this.i18nService,(e=>{this.token=e,this.submit()}),(e=>{this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e)}),(e=>{"ready"===e&&(this.webAuthnReady=!0)}))}this.selectedProviderType=yield this.twoFactorService.getDefaultProvider(this.webAuthnSupported),yield this.init()}else this.router.navigate([this.loginRoute])}))}ngOnDestroy(){this.cleanupWebAuthn(),this.webAuthn=null}init(){return ip(this,void 0,void 0,(function*(){if(null==this.selectedProviderType)return void(this.title=this.i18nService.t("loginUnavailable"));this.cleanupWebAuthn(),this.title=Xd.Vz[this.selectedProviderType].name;const e=yield this.twoFactorService.getProviders().then((e=>e.get(this.selectedProviderType)));switch(this.selectedProviderType){case bo.L.WebAuthn:this.webAuthnNewTab||setTimeout((()=>ip(this,void 0,void 0,(function*(){yield this.authWebAuthn()}))),500);break;case bo.L.Duo:case bo.L.OrganizationDuo:e.AuthUrl?(this.duoFrameless=!0,this.duoResultListenerInitialized||(this.setupDuoResultListener(),this.duoResultListenerInitialized=!0),this.duoFramelessUrl=e.AuthUrl):setTimeout((()=>{jd.init({iframe:void 0,host:e.Host,sig_request:e.Signature,submit_callback:e=>ip(this,void 0,void 0,(function*(){const t=e.querySelector('input[name="sig_response"]');null!=t&&(this.token=t.value,yield this.submit())}))})}),0);break;case bo.L.Email:this.twoFactorEmail=e.Email,(yield this.twoFactorService.getProviders()).size>1&&(yield this.sendEmail(!1))}}))}submit(){return ip(this,void 0,void 0,(function*(){if(yield this.setupCaptcha(),null!=this.token&&""!==this.token){if(this.selectedProviderType===bo.L.WebAuthn){if(null==this.webAuthn)return;this.webAuthn.stop()}else this.selectedProviderType!==bo.L.Email&&this.selectedProviderType!==bo.L.Authenticator||(this.token=this.token.replace(" ","").trim());try{yield this.doSubmit()}catch(e){this.selectedProviderType===bo.L.WebAuthn&&null!=this.webAuthn&&this.webAuthn.start()}}else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("verificationCodeRequired"))}))}doSubmit(){return ip(this,void 0,void 0,(function*(){this.formPromise=this.loginStrategyService.logInTwoFactor(new Hd._(this.selectedProviderType,this.token,this.remember),this.captchaToken);const e=yield this.formPromise;yield this.handleLoginResponse(e)}))}handleMigrateEncryptionKey(e){return!!e.requiresEncryptionKeyMigration&&(this.platformUtilsService.showToast("error",this.i18nService.t("errorOccured"),this.i18nService.t("encryptionKeyMigrationRequired")),!0)}setupDuoResultListener(){}handleLoginResponse(e){return ip(this,void 0,void 0,(function*(){if(this.handleCaptchaRequired(e))return;if(this.handleMigrateEncryptionKey(e))return;if(yield this.ssoLoginService.setActiveUserOrganizationSsoIdentifier(this.orgIdentifier),this.loginEmailService.clearValues(),this.isForcePasswordResetRequired(e))return yield this.handleForcePasswordReset(this.orgIdentifier);const t=yield(0,f.z)(this.userDecryptionOptionsService.userDecryptionOptions$);if(yield this.isTrustedDeviceEncEnabled(t.trustedDeviceOption))return yield this.handleTrustedDeviceEncryptionEnabled(e,this.orgIdentifier,t);return!t.hasMasterPassword&&void 0===t.keyConnectorOption||e.resetMasterPassword?yield this.handleChangePasswordRequired(this.orgIdentifier):yield this.handleSuccessfulLogin()}))}isTrustedDeviceEncEnabled(e){return ip(this,void 0,void 0,(function*(){return"true"===this.route.snapshot.queryParamMap.get("sso")&&void 0!==e}))}handleTrustedDeviceEncryptionEnabled(e,t,i){var n;return ip(this,void 0,void 0,(function*(){if(!i.hasMasterPassword&&i.trustedDeviceOption.hasManageResetPasswordPermission){const e=null===(n=yield(0,f.z)(this.accountService.activeAccount$))||void 0===n?void 0:n.id;yield this.masterPasswordService.setForceSetPasswordReason(Gi.w.TdeUserWithoutPasswordHasPasswordResetPermission,e)}null!=this.onSuccessfulLoginTde&&this.onSuccessfulLoginTde(),this.navigateViaCallbackOrRoute(this.onSuccessfulLoginTdeNavigate,[this.trustedDeviceEncRoute])}))}handleChangePasswordRequired(e){return ip(this,void 0,void 0,(function*(){yield this.router.navigate([this.changePasswordRoute],{queryParams:{identifier:e}})}))}isForcePasswordResetRequired(e){return[Gi.w.AdminForcePasswordReset,Gi.w.WeakMasterPassword].includes(e.forcePasswordReset)}handleForcePasswordReset(e){return ip(this,void 0,void 0,(function*(){this.router.navigate([this.forcePasswordResetRoute],{queryParams:{identifier:e}})}))}handleSuccessfulLogin(){return ip(this,void 0,void 0,(function*(){null!=this.onSuccessfulLogin&&this.onSuccessfulLogin(),yield this.navigateViaCallbackOrRoute(this.onSuccessfulLoginNavigate,[this.successRoute])}))}navigateViaCallbackOrRoute(e,t,i){return ip(this,void 0,void 0,(function*(){e?yield e():yield this.router.navigate(t,i)}))}sendEmail(e){return ip(this,void 0,void 0,(function*(){if(this.selectedProviderType===bo.L.Email&&null==this.emailPromise)if(null!=(yield this.loginStrategyService.getEmail())){try{const t=new Wd.U;t.email=yield this.loginStrategyService.getEmail(),t.masterPasswordHash=yield this.loginStrategyService.getMasterPasswordHash(),t.ssoEmail2FaSessionToken=yield this.loginStrategyService.getSsoEmail2FaSessionToken(),t.deviceIdentifier=yield this.appIdService.getAppId(),t.authRequestAccessCode=yield this.loginStrategyService.getAccessCode(),t.authRequestId=yield this.loginStrategyService.getAuthRequestId(),this.emailPromise=this.apiService.postTwoFactorEmail(t),yield this.emailPromise,e&&this.platformUtilsService.showToast("success",null,this.i18nService.t("verificationCodeEmailSent",this.twoFactorEmail))}catch(t){this.logService.error(t)}this.emailPromise=null}else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("sessionTimeout"))}))}authWebAuthn(){return ip(this,void 0,void 0,(function*(){const e=yield this.twoFactorService.getProviders().then((e=>e.get(this.selectedProviderType)));this.webAuthnSupported&&null!=this.webAuthn&&this.webAuthn.init(e)}))}cleanupWebAuthn(){null!=this.webAuthn&&(this.webAuthn.stop(),this.webAuthn.cleanup())}authing(){return ip(this,void 0,void 0,(function*(){return null!==(yield(0,f.z)(this.loginStrategyService.currentAuthType$))}))}needsLock(){return ip(this,void 0,void 0,(function*(){const e=yield(0,f.z)(this.loginStrategyService.currentAuthType$);return e==$d.a.Sso||e==$d.a.UserApiKey}))}launchDuoFrameless(){return ip(this,void 0,void 0,(function*(){}))}}np.ɵfac=function(e){return new(e||np)(s.Y36(Di.m),s.Y36(p.F0),s.Y36(M.D),s.Y36(Ue.s),s.Y36(N.P),s.Y36(Vd.m9),s.Y36($i.L),s.Y36(J.b),s.Y36(p.gz),s.Y36(_e.$),s.Y36(tp.S),s.Y36(Hn.s),s.Y36(Di.rh),s.Y36(Di.Bb),s.Y36(_n.F),s.Y36(Q.E),s.Y36(Xi.R),s.Y36(G.BR))},np.ɵdir=s.lG2({type:np,features:[s.qOj]});var sp=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class op{constructor(e,t,i,n,o,r){this.twoFactorService=e,this.router=t,this.i18nService=i,this.platformUtilsService=n,this.win=o,this.environmentService=r,this.onProviderSelected=new s.vpe,this.onRecoverSelected=new s.vpe,this.providers=[]}ngOnInit(){return sp(this,void 0,void 0,(function*(){this.providers=yield this.twoFactorService.getSupportedProviders(this.win)}))}choose(e){return sp(this,void 0,void 0,(function*(){this.onProviderSelected.emit(e.type)}))}recover(){return sp(this,void 0,void 0,(function*(){const e=(yield(0,f.z)(this.environmentService.environment$)).getWebVaultUrl();this.platformUtilsService.launchUri(e+"/#/recover-2fa"),this.onRecoverSelected.emit()}))}}function rp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",19),s._uU(1,"\n            "),s.TgZ(2,"div",11),s._uU(3,"\n              "),s.TgZ(4,"div",12),s._uU(5,"\n                "),s._UZ(6,"img",20),s._uU(7,"\n              "),s.qZA(),s._uU(8,"\n              "),s.TgZ(9,"div",14),s._uU(10,"\n                "),s.TgZ(11,"h3"),s._uU(12),s.qZA(),s._uU(13),s.qZA(),s._uU(14,"\n              "),s.TgZ(15,"div",15),s._uU(16,"\n                "),s.TgZ(17,"button",16),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw();return s.KtG(i.choose(t))})),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n              "),s.qZA(),s._uU(21,"\n            "),s.qZA(),s._uU(22,"\n          "),s.qZA()}if(2&e){const e=t.$implicit;s.xp6(6),s.Tol("mfaType"+e.type),s.Q6J("alt",e.name+" logo"),s.xp6(6),s.Oqu(e.name),s.xp6(1),s.hij("\n                ",e.description,"\n              "),s.xp6(4),s.uIk("aria-describedby",e.name),s.xp6(1),s.hij("\n                  ",s.lcZ(19,7,"select"),"\n                ")}}op.ɵfac=function(e){return new(e||op)(s.Y36(tp.S),s.Y36(p.F0),s.Y36(M.D),s.Y36(N.P),s.Y36(Window),s.Y36($i.L))},op.ɵdir=s.lG2({type:op,outputs:{onProviderSelected:"onProviderSelected",onRecoverSelected:"onRecoverSelected"}});class ap extends op{constructor(e,t,i,n,s){super(e,t,i,n,window,s)}}ap.ɵfac=function(e){return new(e||ap)(s.Y36(tp.S),s.Y36(p.F0),s.Y36(M.D),s.Y36(N.P),s.Y36($i.L))},ap.ɵcmp=s.Xpm({type:ap,selectors:[["app-two-factor-options"]],features:[s.qOj],decls:65,vars:22,consts:[["role","dialog","aria-modal","true","aria-labelledby","twoStepOptionsTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],[1,"modal-content"],[1,"modal-header"],["id","twoStepOptionsTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],[1,"list-group","list-group-flush-2fa"],["class","list-group-item list-group-item-action",4,"ngFor","ngForOf"],[1,"list-group-item","list-group-item-action",3,"click"],[1,"two-factor-content"],[1,"logo-col"],["alt","rc logo",1,"recovery-code-img"],[1,"text-col"],[1,"btn-col"],["type","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"list-group-item","list-group-item-action"],[3,"alt"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"div",2),s._uU(5,"\n      "),s.TgZ(6,"div",3),s._uU(7,"\n        "),s.TgZ(8,"h1",4),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n        "),s.TgZ(12,"button",5),s.ALo(13,"i18n"),s._uU(14,"\n          "),s.TgZ(15,"span",6),s._uU(16,"×"),s.qZA(),s._uU(17,"\n        "),s.qZA(),s._uU(18,"\n      "),s.qZA(),s._uU(19,"\n      "),s.TgZ(20,"div",7),s._uU(21,"\n        "),s.TgZ(22,"div",8),s._uU(23,"\n          "),s.YNc(24,rp,23,9,"div",9),s._uU(25,"\n          "),s.TgZ(26,"div",10),s.NdJ("click",(function(){return t.recover()})),s._uU(27,"\n            "),s.TgZ(28,"div",11),s._uU(29,"\n              "),s.TgZ(30,"div",12),s._uU(31,"\n                "),s._UZ(32,"img",13),s._uU(33,"\n              "),s.qZA(),s._uU(34,"\n              "),s.TgZ(35,"div",14),s._uU(36,"\n                "),s.TgZ(37,"h3"),s._uU(38),s.ALo(39,"i18n"),s.qZA(),s._uU(40),s.ALo(41,"i18n"),s.qZA(),s._uU(42,"\n              "),s.TgZ(43,"div",15),s._uU(44,"\n                "),s.TgZ(45,"button",16),s.NdJ("click",(function(){return t.recover()})),s.ALo(46,"i18n"),s._uU(47),s.ALo(48,"i18n"),s.qZA(),s._uU(49,"\n              "),s.qZA(),s._uU(50,"\n            "),s.qZA(),s._uU(51,"\n          "),s.qZA(),s._uU(52,"\n        "),s.qZA(),s._uU(53,"\n      "),s.qZA(),s._uU(54,"\n      "),s.TgZ(55,"div",17),s._uU(56,"\n        "),s.TgZ(57,"button",18),s._uU(58),s.ALo(59,"i18n"),s.qZA(),s._uU(60,"\n      "),s.qZA(),s._uU(61,"\n    "),s.qZA(),s._uU(62,"\n  "),s.qZA(),s._uU(63,"\n"),s.qZA(),s._uU(64,"\n")),2&e&&(s.xp6(9),s.Oqu(s.lcZ(10,8,"twoStepOptions")),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(13,10,"close")),s.xp6(12),s.Q6J("ngForOf",t.providers),s.xp6(14),s.Oqu(s.lcZ(39,12,"recoveryCodeTitle")),s.xp6(2),s.hij("\n                ",s.lcZ(41,14,"recoveryCodeDesc"),"\n              "),s.xp6(5),s.uIk("aria-describedby",s.lcZ(46,16,"recoveryCodeTitle")),s.xp6(2),s.hij("\n                  ",s.lcZ(48,18,"select"),"\n                "),s.xp6(11),s.hij("\n          ",s.lcZ(59,20,"close"),"\n        "))},dependencies:[d.sg,ui.B,ee.C],encapsulation:2});var lp=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const cp=["twoFactorOptions"];function up(e,t){1&e&&(s.TgZ(0,"p"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n              ",s.lcZ(2,1,"enterVerificationCodeApp"),"\n            "))}function dp(e,t){if(1&e&&(s.TgZ(0,"p"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.hij("\n              ",s.xi3(2,1,"enterVerificationCodeEmail",e.twoFactorEmail),"\n            ")}}function pp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",25),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.sendEmail(!0))})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}if(2&e){const e=s.oxw(3);s.Q6J("appApiAction",e.emailPromise),s.xp6(1),s.hij("\n                  ",s.lcZ(2,2,"sendVerificationCodeEmailAgain"),"\n                ")}}function hp(e,t){if(1&e&&(s.TgZ(0,"small",23),s._uU(1,"\n                "),s.YNc(2,pp,3,4,"a",24),s._uU(3,"\n              "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(2),s.Q6J("ngIf",e.selectedProviderType===e.providerType.Email)}}function gp(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n            "),s.YNc(2,up,3,3,"p",7),s._uU(3,"\n            "),s.YNc(4,dp,3,4,"p",7),s._uU(5,"\n            "),s.TgZ(6,"div",19),s._uU(7,"\n              "),s.TgZ(8,"label",20),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n              "),s.TgZ(12,"input",21),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.token=t)})),s.qZA(),s._uU(13,"\n              "),s.YNc(14,hp,4,1,"small",22),s._uU(15,"\n            "),s.qZA(),s._uU(16,"\n          "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.selectedProviderType===e.providerType.Authenticator),s.xp6(2),s.Q6J("ngIf",e.selectedProviderType===e.providerType.Email),s.xp6(5),s.Oqu(s.lcZ(10,5,"verificationCode")),s.xp6(3),s.Q6J("ngModel",e.token),s.xp6(2),s.Q6J("ngIf",e.selectedProviderType===e.providerType.Email)}}function fp(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n            "),s.TgZ(2,"p",16),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n            "),s.TgZ(6,"picture"),s._uU(7,"\n              "),s._UZ(8,"source",26),s._uU(9,"\n              "),s._UZ(10,"source",27),s._uU(11,"\n              "),s._UZ(12,"img",28),s._uU(13,"\n            "),s.qZA(),s._uU(14,"\n            "),s.TgZ(15,"div",19),s._uU(16,"\n              "),s.TgZ(17,"label",20),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n              "),s.TgZ(21,"input",29),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.token=t)})),s.qZA(),s._uU(22,"\n            "),s.qZA(),s._uU(23,"\n          "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(3),s.Oqu(s.lcZ(4,3,"insertYubiKey")),s.xp6(15),s.Oqu(s.lcZ(19,5,"verificationCode")),s.xp6(3),s.Q6J("ngModel",e.token)}}function mp(e,t){1&e&&(s.ynx(0),s._uU(1,"\n            "),s.TgZ(2,"div",30),s._uU(3,"\n              "),s._UZ(4,"iframe",31),s._uU(5,"\n            "),s.qZA(),s._uU(6,"\n          "),s.BQk())}function vp(e,t){1&e&&(s.TgZ(0,"p",33),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n                ",s.lcZ(2,1,"duoRequiredByOrgForAccount"),"\n              "))}function yp(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n              "),s.YNc(2,vp,3,3,"p",32),s._uU(3,"\n              "),s.TgZ(4,"p"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n            "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(2),s.Q6J("ngIf",e.selectedProviderType===e.providerType.OrganizationDuo),s.xp6(3),s.Oqu(s.lcZ(6,2,"launchDuoAndFollowStepsToFinishLoggingIn"))}}function wp(e,t){1&e&&(s.ynx(0),s._uU(1,"\n              "),s.TgZ(2,"div",34),s._uU(3,"\n                "),s._UZ(4,"iframe",35),s._uU(5,"\n              "),s.qZA(),s._uU(6,"\n            "),s.BQk())}function bp(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n            "),s.YNc(2,yp,8,4,"ng-container",7),s._uU(3,"\n\n            "),s.YNc(4,wp,7,0,"ng-container",7),s._uU(5,"\n          "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.duoFrameless),s.xp6(2),s.Q6J("ngIf",!e.duoFrameless)}}function Up(e,t){1&e&&(s._UZ(0,"i",36),s.ALo(1,"i18n")),2&e&&s.s9C("title",s.lcZ(1,1,"loading"))}function _p(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",37),s._uU(1,"\n            "),s.TgZ(2,"input",38),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.remember=t)})),s.qZA(),s._uU(3,"\n            "),s.TgZ(4,"label",39),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n          "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngModel",e.remember),s.xp6(3),s.Oqu(s.lcZ(6,2,"rememberMe"))}}function Ap(e,t){1&e&&(s.ynx(0),s._uU(1,"\n            "),s.TgZ(2,"p"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n            "),s.TgZ(6,"p"),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n          "),s.BQk()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,2,"noTwoStepProviders")),s.xp6(4),s.Oqu(s.lcZ(8,4,"noTwoStepProviders2")))}function Zp(e,t){if(1&e&&(s.TgZ(0,"button",40),s._uU(1,"\n              "),s.TgZ(2,"span"),s._uU(3,"\n                "),s._UZ(4,"i",41),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n              "),s._UZ(8,"i",42),s.ALo(9,"i18n"),s._uU(10,"\n            "),s.qZA()),2&e){s.oxw();const e=s.MAs(1);s.Q6J("disabled",e.loading),s.xp6(5),s.hij(" ",s.lcZ(6,3,"continue"),"\n              "),s.xp6(3),s.s9C("title",s.lcZ(9,5,"loading"))}}function xp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",43),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.launchDuoFrameless())})),s._uU(1,"\n              "),s.TgZ(2,"span"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n            "),s.qZA()}if(2&e){s.oxw();const e=s.MAs(1);s.Q6J("disabled",e.loading),s.xp6(3),s.hij(" ",s.lcZ(4,2,"launchDuo")," ")}}function Sp(e,t){}const Tp=function(e){return{"col-9":e}};class Cp extends np{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v,y){super(e,t,i,n,s,y,r,o,l,c,u,d,p,h,g,f,m,v),this.modalService=a,this.win=y,this.goAfterLogIn=()=>lp(this,void 0,void 0,(function*(){this.loginEmailService.clearValues(),this.router.navigate([this.successRoute],{queryParams:{identifier:this.orgIdentifier}})})),this.handleDuoResultMessage=e=>lp(this,void 0,void 0,(function*(){this.token=e.data.code+"|"+e.data.state,yield this.submit()})),this.onSuccessfulLoginNavigate=this.goAfterLogIn}anotherMethod(){return lp(this,void 0,void 0,(function*(){const[e]=yield this.modalService.openViewRef(ap,this.twoFactorOptionsModal,(t=>{t.onProviderSelected.subscribe((t=>lp(this,void 0,void 0,(function*(){e.close(),this.selectedProviderType=t,yield this.init()})))),t.onRecoverSelected.subscribe((()=>{e.close()}))}))}))}handleMigrateEncryptionKey(e){return!!e.requiresEncryptionKeyMigration&&(this.router.navigate(["migrate-legacy-encryption"]),!0)}setupDuoResultListener(){this.duoResultChannel||(this.duoResultChannel=new BroadcastChannel("duoResult"),this.duoResultChannel.addEventListener("message",this.handleDuoResultMessage))}launchDuoFrameless(){return lp(this,void 0,void 0,(function*(){const e={title:this.i18nService.t("youSuccessfullyLoggedIn"),message:this.i18nService.t("thisWindowWillCloseIn5Seconds"),buttonText:this.i18nService.t("close"),isCountdown:!0};document.cookie=`duoHandOffMessage=${JSON.stringify(e)}; SameSite=strict;`,this.platformUtilsService.launchUri(this.duoFramelessUrl)}))}ngOnDestroy(){const e=Object.create(null,{ngOnDestroy:{get:()=>super.ngOnDestroy}});return lp(this,void 0,void 0,(function*(){e.ngOnDestroy.call(this),this.duoResultChannel&&(this.duoResultChannel.removeEventListener("message",this.handleDuoResultMessage),this.duoResultChannel.close())}))}}Cp.ɵfac=function(e){return new(e||Cp)(s.Y36(Di.m),s.Y36(p.F0),s.Y36(M.D),s.Y36(Ue.s),s.Y36(N.P),s.Y36(J.b),s.Y36($i.L),s.Y36(uo.Z),s.Y36(p.gz),s.Y36(_e.$),s.Y36(tp.S),s.Y36(Hn.s),s.Y36(Di.rh),s.Y36(Di.Bb),s.Y36(_n.F),s.Y36(Q.E),s.Y36(Xi.R),s.Y36(G.BR),s.Y36(Vd.m9))},Cp.ɵcmp=s.Xpm({type:Cp,selectors:[["app-two-factor"]],viewQuery:function(e,t){if(1&e&&s.Gf(cp,7,s.s_b),2&e){let e;s.iGM(e=s.CRH())&&(t.twoFactorOptionsModal=e.first)}},features:[s.qOj],decls:63,vars:21,consts:[["ngNativeValidate","","autocomplete","off",1,"container",3,"appApiAction","ngSubmit"],["form",""],[1,"row","justify-content-md-center","mt-5"],[1,"col-5",3,"ngClass"],[1,"lead","text-center","mb-4"],[1,"card","d-block"],[1,"card-body"],[4,"ngIf"],["class","bwi bwi-spinner text-muted bwi-spin pull-right","aria-hidden","true",3,"title",4,"ngIf"],["class","form-check",4,"ngIf"],[3,"hidden"],["id","hcaptcha_iframe","height","80","sandbox","allow-scripts allow-same-origin"],[1,"tw-flex","tw-flex-col","tw-mb-3"],["type","submit","class","btn btn-primary btn-block btn-submit",3,"disabled",4,"ngIf"],["type","button","class","btn btn-primary btn-block",3,"disabled","click",4,"ngIf"],["routerLink","/login",1,"btn","btn-outline-secondary","btn-block"],[1,"text-center"],["href","#","appStopClick","",3,"click"],["twoFactorOptions",""],[1,"form-group"],["for","code",1,"sr-only"],["id","code","type","text","name","Code","required","","appAutofocus","","inputmode","tel","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"],["class","form-text",4,"ngIf"],[1,"form-text"],["href","#","appStopClick","",3,"appApiAction","click",4,"ngIf"],["href","#","appStopClick","",3,"appApiAction","click"],["srcset","../../images/yubikey.avif","type","image/avif"],["srcset","../../images/yubikey.webp","type","image/webp"],["src","../../images/yubikey.jpg","alt","",1,"rounded","img-fluid","mb-3"],["id","code","type","password","name","Code","required","","appAutofocus","","appInputVerbatim","","autocomplete","new-password",1,"form-control",3,"ngModel","ngModelChange"],["id","web-authn-frame",1,"mb-3"],["id","webauthn_iframe","sandbox","allow-scripts allow-same-origin"],["class","tw-mb-0",4,"ngIf"],[1,"tw-mb-0"],["id","duo-frame",1,"mb-3"],["id","duo_iframe","sandbox","allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox"],["aria-hidden","true",1,"bwi","bwi-spinner","text-muted","bwi-spin","pull-right",3,"title"],[1,"form-check"],["id","remember","type","checkbox","name","Remember",1,"form-check-input",3,"ngModel","ngModelChange"],["for","remember",1,"form-check-label"],["type","submit",1,"btn","btn-primary","btn-block","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-sign-in"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button",1,"btn","btn-primary","btn-block",3,"disabled","click"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n  "),s.TgZ(3,"div",2),s._uU(4,"\n    "),s.TgZ(5,"div",3),s._uU(6,"\n      "),s.TgZ(7,"p",4),s._uU(8),s.qZA(),s._uU(9,"\n      "),s.TgZ(10,"div",5),s._uU(11,"\n        "),s.TgZ(12,"div",6),s._uU(13,"\n          "),s.YNc(14,gp,17,7,"ng-container",7),s._uU(15,"\n          "),s.YNc(16,fp,24,7,"ng-container",7),s._uU(17,"\n          "),s.YNc(18,mp,7,0,"ng-container",7),s._uU(19,"\n          "),s._uU(20,"\n          "),s.YNc(21,bp,6,2,"ng-container",7),s._uU(22,"\n          "),s.YNc(23,Up,2,3,"i",8),s._uU(24,"\n          "),s.YNc(25,_p,8,4,"div",9),s._uU(26,"\n          "),s.YNc(27,Ap,10,6,"ng-container",7),s._uU(28,"\n          "),s._UZ(29,"hr"),s._uU(30,"\n          "),s.TgZ(31,"div",10),s._uU(32,"\n            "),s._UZ(33,"iframe",11),s._uU(34,"\n          "),s.qZA(),s._uU(35,"\n          "),s._uU(36,"\n          "),s.TgZ(37,"div",12),s._uU(38,"\n            "),s.YNc(39,Zp,11,7,"button",13),s._uU(40,"\n            "),s.YNc(41,xp,6,4,"button",14),s._uU(42,"\n            "),s.TgZ(43,"a",15),s._uU(44),s.ALo(45,"i18n"),s.qZA(),s._uU(46,"\n          "),s.qZA(),s._uU(47,"\n          "),s.TgZ(48,"div",16),s._uU(49,"\n            "),s.TgZ(50,"a",17),s.NdJ("click",(function(){return t.anotherMethod()})),s._uU(51),s.ALo(52,"i18n"),s.qZA(),s._uU(53,"\n          "),s.qZA(),s._uU(54,"\n        "),s.qZA(),s._uU(55,"\n      "),s.qZA(),s._uU(56,"\n    "),s.qZA(),s._uU(57,"\n  "),s.qZA(),s._uU(58,"\n"),s.qZA(),s._uU(59,"\n"),s.YNc(60,Sp,0,0,"ng-template",null,18,s.W1O),s._uU(62,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(5),s.Q6J("ngClass",s.VKq(19,Tp,!t.duoFrameless&&t.isDuoProvider)),s.xp6(3),s.Oqu(t.title),s.xp6(6),s.Q6J("ngIf",t.selectedProviderType===t.providerType.Email||t.selectedProviderType===t.providerType.Authenticator),s.xp6(2),s.Q6J("ngIf",t.selectedProviderType===t.providerType.Yubikey),s.xp6(2),s.Q6J("ngIf",t.selectedProviderType===t.providerType.WebAuthn),s.xp6(3),s.Q6J("ngIf",t.isDuoProvider),s.xp6(2),s.Q6J("ngIf",e.loading&&t.selectedProviderType===t.providerType.WebAuthn),s.xp6(2),s.Q6J("ngIf",null!=t.selectedProviderType),s.xp6(2),s.Q6J("ngIf",null==t.selectedProviderType),s.xp6(4),s.Q6J("hidden",!t.showCaptcha()),s.xp6(8),s.Q6J("ngIf",null!=t.selectedProviderType&&!t.isDuoProvider&&t.selectedProviderType!==t.providerType.WebAuthn),s.xp6(2),s.Q6J("ngIf",t.duoFrameless&&t.isDuoProvider),s.xp6(3),s.hij("\n              ",s.lcZ(45,15,"cancel"),"\n            "),s.xp6(7),s.Oqu(s.lcZ(52,17,"useAnotherTwoStepMethod"))}},dependencies:[d.mk,d.O5,l.Fj,l.Wl,l.JJ,l.JL,l.Q7,l.On,l.F,p.rH,xe.b,Ji.U,zi.b,wr.O,ee.C],encapsulation:2});var Op=i(70138),kp=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Pp extends Hs{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p){super(t,o,r,n,i,s,l,d,p),this.router=e,this.apiService=a,this.userVerificationService=c,this.logService=u,this.showPassword=!1}togglePassword(e){this.showPassword=!this.showPassword,document.getElementById(e?"masterPasswordRetype":"masterPassword").focus()}cancel(){return kp(this,void 0,void 0,(function*(){yield this.stateService.setOrganizationInvitation(null),this.router.navigate(["/vault"])}))}setupSubmitActions(){return kp(this,void 0,void 0,(function*(){if(null==this.currentMasterPassword||""===this.currentMasterPassword)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPasswordRequired")),!1;const e={type:Op.R.MasterPassword,secret:this.currentMasterPassword};try{yield this.userVerificationService.verifyUser(e)}catch(t){return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),t.message),!1}return this.kdfConfig=yield this.kdfConfigService.getKdfConfig(),!0}))}performSubmitActions(e,t,i){return kp(this,void 0,void 0,(function*(){try{const t=new rc;t.masterPasswordHash=yield this.cryptoService.hashMasterKey(this.currentMasterPassword,yield this.cryptoService.getOrDeriveMasterKey(this.currentMasterPassword)),t.newMasterPasswordHash=e,t.key=i[1].encryptedString,this.apiService.postPassword(t),this.platformUtilsService.showToast("success",this.i18nService.t("masterPasswordChanged"),this.i18nService.t("logBackIn")),null!=this.onSuccessfulChangePassword?this.onSuccessfulChangePassword():this.messagingService.send("logout")}catch(t){this.logService.error(t)}}))}}function qp(e,t){if(1&e&&s._UZ(0,"auth-password-callout",22),2&e){const e=s.oxw();s.Q6J("policy",e.enforcedPolicyOptions)}}Pp.ɵfac=function(e){return new(e||Pp)(s.Y36(p.F0),s.Y36(M.D),s.Y36(N.P),s.Y36(A.UW),s.Y36(Y.d),s.Y36(D.$),s.Y36(fe.o),s.Y36(Ue.s),s.Y36(J.b),s.Y36(nn.i),s.Y36(_e.$),s.Y36(I.x),s.Y36(sn.d))},Pp.ɵdir=s.lG2({type:Pp,features:[s.qOj]});class Ip extends Pp{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p){super(e,t,i,n,s,o,r,a,c,u,l,d,p)}}Ip.ɵfac=function(e){return new(e||Ip)(s.Y36(p.F0),s.Y36(M.D),s.Y36(N.P),s.Y36(A.UW),s.Y36(Y.d),s.Y36(D.$),s.Y36(fe.o),s.Y36(Ue.s),s.Y36(_e.$),s.Y36(J.b),s.Y36(nn.i),s.Y36(I.x),s.Y36(sn.d))},Ip.ɵcmp=s.Xpm({type:Ip,selectors:[["app-update-password"]],features:[s.qOj],decls:91,vars:34,consts:[["ngNativeValidate","","autocomplete","off",3,"appApiAction","ngSubmit"],["form",""],[1,"row","justify-content-md-center","mt-5"],[1,"col-4"],[1,"lead","text-center","mb-4"],[1,"card","d-block"],[1,"card-body"],["type","warning"],[3,"policy",4,"ngIf"],[1,"row"],[1,"col-6"],[1,"form-group"],["for","currentMasterPassword"],["id","currentMasterPassword","type","password","name","MasterPasswordHash","required","","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"],["for","newMasterPassword"],["id","newMasterPassword","type","password","name","NewMasterPasswordHash","required","","appInputVerbatim","","autocomplete","new-password",1,"form-control","mb-1",3,"ngModel","ngModelChange"],[3,"password","email","showText","passwordStrengthResult"],["for","masterPasswordRetype"],["id","masterPasswordRetype","type","password","name","MasterPasswordRetype","required","","appInputVerbatim","","autocomplete","new-password",1,"form-control",3,"ngModel","ngModelChange"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[3,"policy"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n  "),s.TgZ(3,"div",2),s._uU(4,"\n    "),s.TgZ(5,"div",3),s._uU(6,"\n      "),s.TgZ(7,"p",4),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.TgZ(11,"div",5),s._uU(12,"\n        "),s.TgZ(13,"div",6),s._uU(14,"\n          "),s.TgZ(15,"app-callout",7),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n          "),s.YNc(19,qp,1,1,"auth-password-callout",8),s._uU(20,"\n\n          "),s.TgZ(21,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(23,"\n            "),s.TgZ(24,"div",9),s._uU(25,"\n              "),s.TgZ(26,"div",10),s._uU(27,"\n                "),s.TgZ(28,"div",11),s._uU(29,"\n                  "),s.TgZ(30,"label",12),s._uU(31),s.ALo(32,"i18n"),s.qZA(),s._uU(33,"\n                  "),s.TgZ(34,"input",13),s.NdJ("ngModelChange",(function(e){return t.currentMasterPassword=e})),s.qZA(),s._uU(35,"\n                "),s.qZA(),s._uU(36,"\n              "),s.qZA(),s._uU(37,"\n            "),s.qZA(),s._uU(38,"\n            "),s.TgZ(39,"div",9),s._uU(40,"\n              "),s.TgZ(41,"div",10),s._uU(42,"\n                "),s.TgZ(43,"div",11),s._uU(44,"\n                  "),s.TgZ(45,"label",14),s._uU(46),s.ALo(47,"i18n"),s.qZA(),s._uU(48,"\n                  "),s.TgZ(49,"input",15),s.NdJ("ngModelChange",(function(e){return t.masterPassword=e})),s.qZA(),s._uU(50,"\n                  "),s.TgZ(51,"app-password-strength",16),s.NdJ("passwordStrengthResult",(function(e){return t.getStrengthResult(e)})),s.qZA(),s._uU(52,"\n                "),s.qZA(),s._uU(53,"\n              "),s.qZA(),s._uU(54,"\n              "),s.TgZ(55,"div",10),s._uU(56,"\n                "),s.TgZ(57,"div",11),s._uU(58,"\n                  "),s.TgZ(59,"label",17),s._uU(60),s.ALo(61,"i18n"),s.qZA(),s._uU(62,"\n                  "),s.TgZ(63,"input",18),s.NdJ("ngModelChange",(function(e){return t.masterPasswordRetype=e})),s.qZA(),s._uU(64,"\n                "),s.qZA(),s._uU(65,"\n              "),s.qZA(),s._uU(66,"\n            "),s.qZA(),s._uU(67,"\n            "),s.TgZ(68,"button",19),s._uU(69,"\n              "),s._UZ(70,"i",20),s.ALo(71,"i18n"),s._uU(72,"\n              "),s.TgZ(73,"span"),s._uU(74),s.ALo(75,"i18n"),s.qZA(),s._uU(76,"\n            "),s.qZA(),s._uU(77,"\n            "),s.TgZ(78,"button",21),s.NdJ("click",(function(){return t.cancel()})),s._uU(79,"\n              "),s.TgZ(80,"span"),s._uU(81),s.ALo(82,"i18n"),s.qZA(),s._uU(83,"\n            "),s.qZA(),s._uU(84,"\n          "),s.qZA(),s._uU(85,"\n        "),s.qZA(),s._uU(86,"\n      "),s.qZA(),s._uU(87,"\n    "),s.qZA(),s._uU(88,"\n  "),s.qZA(),s._uU(89,"\n"),s.qZA(),s._uU(90,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,18,"updateMasterPassword")),s.xp6(8),s.hij("",s.lcZ(17,20,"masterPasswordInvalidWarning")," "),s.xp6(3),s.Q6J("ngIf",t.enforcedPolicyOptions),s.xp6(2),s.Q6J("appApiAction",t.formPromise),s.xp6(10),s.Oqu(s.lcZ(32,22,"currentMasterPass")),s.xp6(3),s.Q6J("ngModel",t.currentMasterPassword),s.xp6(12),s.Oqu(s.lcZ(47,24,"newMasterPass")),s.xp6(3),s.Q6J("ngModel",t.masterPassword),s.xp6(2),s.Q6J("password",t.masterPassword)("email",t.email)("showText",!0),s.xp6(9),s.Oqu(s.lcZ(61,26,"confirmNewMasterPass")),s.xp6(3),s.Q6J("ngModel",t.masterPasswordRetype),s.xp6(5),s.Q6J("disabled",e.loading),s.xp6(2),s.s9C("title",s.lcZ(71,28,"loading")),s.xp6(4),s.Oqu(s.lcZ(75,30,"changeMasterPassword")),s.xp6(7),s.Oqu(s.lcZ(82,32,"cancel"))}},dependencies:[d.O5,l.Fj,l.JJ,l.JL,l.Q7,l.On,l.F,xe.b,Se.O,zi.b,eo.Z,to.e,ee.C],encapsulation:2});var Mp=i(54427);class Np extends Mp.s{}var Lp=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Dp extends Hs{get requireCurrentPassword(){return this.reason===Gi.w.WeakMasterPassword}constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f){super(e,s,o,i,t,n,a,p,h),this.apiService=r,this.syncService=l,this.logService=c,this.userVerificationService=u,this.router=d,this.accountService=g,this.masterPasswordService=f,this.showPassword=!1,this.reason=Gi.w.None,this.verification={type:Op.R.MasterPassword,secret:""}}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});var t;return Lp(this,void 0,void 0,(function*(){yield this.syncService.fullSync(!0);const i=null===(t=yield(0,f.z)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;this.reason=yield(0,f.z)(this.masterPasswordService.forceSetPasswordReason$(i)),this.reason!=Gi.w.None?yield e.ngOnInit.call(this):this.router.navigate(["/"])}))}get masterPasswordWarningText(){return this.reason==Gi.w.WeakMasterPassword?this.i18nService.t("updateWeakMasterPasswordWarning"):this.i18nService.t("updateMasterPasswordWarning")}togglePassword(e){this.showPassword=!this.showPassword,document.getElementById(e?"masterPasswordRetype":"masterPassword").focus()}setupSubmitActions(){return Lp(this,void 0,void 0,(function*(){return this.email=yield this.stateService.getEmail(),this.kdfConfig=yield this.kdfConfigService.getKdfConfig(),!0}))}submit(){return Lp(this,void 0,void 0,(function*(){if((yield this.strongPassword())&&(yield this.setupSubmitActions()))try{const e=yield this.cryptoService.makeMasterKey(this.masterPassword,this.email.trim().toLowerCase(),this.kdfConfig),t=yield this.cryptoService.hashMasterKey(this.masterPassword,e),i=yield this.cryptoService.getUserKey(),n=yield this.cryptoService.encryptUserKeyWithMasterKey(e,i);yield this.performSubmitActions(t,e,n)}catch(e){this.logService.error(e)}}))}performSubmitActions(e,t,i){var n;return Lp(this,void 0,void 0,(function*(){try{switch(this.reason){case Gi.w.AdminForcePasswordReset:this.formPromise=this.updateTempPassword(e,i);break;case Gi.w.WeakMasterPassword:this.formPromise=this.updatePassword(e,i)}yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("updatedMasterPassword"));const t=null===(n=yield(0,f.z)(this.accountService.activeAccount$))||void 0===n?void 0:n.id;yield this.masterPasswordService.setForceSetPasswordReason(Gi.w.None,t),null!=this.onSuccessfulChangePassword?this.onSuccessfulChangePassword():this.messagingService.send("logout")}catch(t){this.logService.error(t)}}))}updateTempPassword(e,t){return Lp(this,void 0,void 0,(function*(){const i=new Np;return i.key=t[1].encryptedString,i.newMasterPasswordHash=e,i.masterPasswordHint=this.hint,this.apiService.putUpdateTempPassword(i)}))}updatePassword(e,t){return Lp(this,void 0,void 0,(function*(){const i=yield this.userVerificationService.buildRequest(this.verification,rc);return i.masterPasswordHint=this.hint,i.newMasterPasswordHash=e,i.key=t[1].encryptedString,this.apiService.postPassword(i)}))}}function Ep(e,t){if(1&e&&(s.TgZ(0,"auth-password-callout",19),s._uU(1,"\n        "),s.qZA()),2&e){const e=s.oxw();s.Q6J("policy",e.enforcedPolicyOptions)}}function Fp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"bit-form-field"),s._uU(1,"\n          "),s.TgZ(2,"bit-label"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"input",20),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.verification.secret=t)})),s.qZA(),s._uU(7,"\n          "),s._UZ(8,"button",21),s._uU(9,"\n        "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(3),s.Oqu(s.lcZ(4,3,"currentMasterPass")),s.xp6(3),s.Q6J("ngModel",e.verification.secret)("appAutofocus",e.requireCurrentPassword)}}Dp.ɵfac=function(e){return new(e||Dp)(s.Y36(M.D),s.Y36(N.P),s.Y36(A.UW),s.Y36(Y.d),s.Y36(D.$),s.Y36(fe.o),s.Y36(Ue.s),s.Y36(J.b),s.Y36(T._),s.Y36(_e.$),s.Y36(nn.i),s.Y36(p.F0),s.Y36(I.x),s.Y36(sn.d),s.Y36(G.BR),s.Y36(Xi.R))},Dp.ɵdir=s.lG2({type:Dp,features:[s.qOj]});class Rp extends Dp{}Rp.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(Rp)))(t||Rp)}}(),Rp.ɵcmp=s.Xpm({type:Rp,selectors:[["app-update-temp-password"]],features:[s.qOj],decls:78,vars:37,consts:[["ngNativeValidate","","autocomplete","off",3,"appApiAction","ngSubmit"],["form",""],[1,"tw-mt-12","tw-flex","tw-justify-center"],[1,"tw-w-1/3"],["bitTypography","h1",1,"tw-mb-4","tw-text-center"],[1,"tw-block","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background","tw-p-8"],["type","warning"],[3,"policy",4,"ngIf"],[4,"ngIf"],[1,"tw-mb-4"],[1,"!tw-mb-1"],["bitInput","","type","password","appInputVerbatim","","required","","name","masterPassword","id","masterPassword",3,"ngModel","ngModelChange"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","",3,"toggled","toggledChange"],[3,"password","email","showText","passwordStrengthResult"],["bitInput","","type","password","appInputVerbatim","","required","","name","masterPasswordRetype","id","masterPasswordRetype",3,"ngModel","ngModelChange"],["bitInput","","type","text","name","hint","id","hint",3,"ngModel","ngModelChange"],[1,"tw-flex","tw-space-x-2"],["type","submit","bitButton","","buttonType","primary",3,"block","loading","disabled"],["type","button","bitButton","","buttonType","secondary",3,"block","click"],[3,"policy"],["bitInput","","type","password","appInputVerbatim","","required","","name","currentMasterPassword","id","currentMasterPassword",3,"ngModel","appAutofocus","ngModelChange"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n  "),s.TgZ(3,"div",2),s._uU(4,"\n    "),s.TgZ(5,"div",3),s._uU(6,"\n      "),s.TgZ(7,"h1",4),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.TgZ(11,"div",5),s._uU(12,"\n        "),s.TgZ(13,"app-callout",6),s._uU(14),s.qZA(),s._uU(15,"\n        "),s.YNc(16,Ep,2,1,"auth-password-callout",7),s._uU(17,"\n        "),s.YNc(18,Fp,10,5,"bit-form-field",8),s._uU(19,"\n        "),s.TgZ(20,"div",9),s._uU(21,"\n          "),s.TgZ(22,"bit-form-field",10),s._uU(23,"\n            "),s.TgZ(24,"bit-label"),s._uU(25),s.ALo(26,"i18n"),s.qZA(),s._uU(27,"\n            "),s.TgZ(28,"input",11),s.NdJ("ngModelChange",(function(e){return t.masterPassword=e})),s.qZA(),s._uU(29,"\n            "),s.TgZ(30,"button",12),s.NdJ("toggledChange",(function(e){return t.showPassword=e})),s.qZA(),s._uU(31,"\n          "),s.qZA(),s._uU(32,"\n          "),s.TgZ(33,"app-password-strength",13),s.NdJ("passwordStrengthResult",(function(e){return t.getStrengthResult(e)})),s._uU(34,"\n          "),s.qZA(),s._uU(35,"\n        "),s.qZA(),s._uU(36,"\n        "),s.TgZ(37,"bit-form-field"),s._uU(38,"\n          "),s.TgZ(39,"bit-label"),s._uU(40),s.ALo(41,"i18n"),s.qZA(),s._uU(42,"\n          "),s.TgZ(43,"input",14),s.NdJ("ngModelChange",(function(e){return t.masterPasswordRetype=e})),s.qZA(),s._uU(44,"\n          "),s.TgZ(45,"button",12),s.NdJ("toggledChange",(function(e){return t.showPassword=e})),s.qZA(),s._uU(46,"\n        "),s.qZA(),s._uU(47,"\n        "),s.TgZ(48,"bit-form-field"),s._uU(49,"\n          "),s.TgZ(50,"bit-label"),s._uU(51),s.ALo(52,"i18n"),s.qZA(),s._uU(53,"\n          "),s.TgZ(54,"input",15),s.NdJ("ngModelChange",(function(e){return t.hint=e})),s.qZA(),s._uU(55,"\n          "),s.TgZ(56,"bit-hint"),s._uU(57),s.ALo(58,"i18n"),s.qZA(),s._uU(59,"\n        "),s.qZA(),s._uU(60,"\n        "),s._UZ(61,"hr"),s._uU(62,"\n        "),s.TgZ(63,"div",16),s._uU(64,"\n          "),s.TgZ(65,"button",17),s._uU(66),s.ALo(67,"i18n"),s.qZA(),s._uU(68,"\n          "),s.TgZ(69,"button",18),s.NdJ("click",(function(){return t.logOut()})),s._uU(70),s.ALo(71,"i18n"),s.qZA(),s._uU(72,"\n        "),s.qZA(),s._uU(73,"\n      "),s.qZA(),s._uU(74,"\n    "),s.qZA(),s._uU(75,"\n  "),s.qZA(),s._uU(76,"\n"),s.qZA(),s._uU(77,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,23,"updateMasterPassword")),s.xp6(6),s.hij("",t.masterPasswordWarningText," "),s.xp6(2),s.Q6J("ngIf",t.enforcedPolicyOptions),s.xp6(2),s.Q6J("ngIf",t.requireCurrentPassword),s.xp6(7),s.Oqu(s.lcZ(26,25,"newMasterPass")),s.xp6(3),s.Q6J("ngModel",t.masterPassword),s.xp6(2),s.Q6J("toggled",t.showPassword),s.xp6(3),s.Q6J("password",t.masterPassword)("email",t.email)("showText",!0),s.xp6(7),s.Oqu(s.lcZ(41,27,"confirmNewMasterPass")),s.xp6(3),s.Q6J("ngModel",t.masterPasswordRetype),s.xp6(2),s.Q6J("toggled",t.showPassword),s.xp6(6),s.Oqu(s.lcZ(52,29,"masterPassHint")),s.xp6(3),s.Q6J("ngModel",t.hint),s.xp6(3),s.Oqu(s.lcZ(58,31,"masterPassHintDesc")),s.xp6(8),s.Q6J("block",!0)("loading",e.loading)("disabled",e.loading),s.xp6(1),s.hij("\n            ",s.lcZ(67,33,"submit"),"\n          "),s.xp6(3),s.Q6J("block",!0),s.xp6(1),s.hij("\n            ",s.lcZ(71,35,"logOut"),"\n          ")}},dependencies:[d.O5,l.Fj,l.JJ,l.JL,l.Q7,l.On,l.F,xe.b,Ji.U,Se.O,zi.b,eo.Z,Te.r,Oe.d,ke.G,As.w,Zs.e,Pe.u,Cn.M,xs.Q,On.t,to.e,ee.C],encapsulation:2});class Jp{constructor(e,t){this.userId=e,this.token=t}}var zp=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Yp{constructor(e,t,i,n,s,o,r){this.router=e,this.platformUtilsService=t,this.i18nService=i,this.route=n,this.apiService=s,this.logService=o,this.stateService=r}ngOnInit(){this.route.queryParams.pipe((0,oe.P)()).subscribe((e=>zp(this,void 0,void 0,(function*(){if(null!=e.userId&&null!=e.token)try{return yield this.apiService.postAccountVerifyEmailToken(new Jp(e.userId,e.token)),(yield this.stateService.getIsAuthenticated())&&(yield this.apiService.refreshIdentityToken()),this.platformUtilsService.showToast("success",null,this.i18nService.t("emailVerified")),void this.router.navigate(["/"])}catch(t){this.logService.error(t)}this.platformUtilsService.showToast("error",null,this.i18nService.t("emailVerifiedFailed")),this.router.navigate(["/"])}))))}}Yp.ɵfac=function(e){return new(e||Yp)(s.Y36(p.F0),s.Y36(N.P),s.Y36(M.D),s.Y36(p.gz),s.Y36(Ue.s),s.Y36(_e.$),s.Y36(J.b))},Yp.ɵcmp=s.Xpm({type:Yp,selectors:[["app-verify-email-token"]],decls:18,vars:6,consts:[[1,"mt-5","d-flex","justify-content-center"],["alt","Bitwarden",1,"mb-4","logo","logo-themed"],[1,"text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","text-muted",3,"title"],[1,"sr-only"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div"),s._uU(3,"\n    "),s._UZ(4,"img",1),s._uU(5,"\n    "),s.TgZ(6,"p",2),s._uU(7,"\n      "),s._UZ(8,"i",3),s.ALo(9,"i18n"),s._uU(10,"\n      "),s.TgZ(11,"span",4),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n    "),s.qZA(),s._uU(15,"\n  "),s.qZA(),s._uU(16,"\n"),s.qZA(),s._uU(17,"\n")),2&e&&(s.xp6(8),s.s9C("title",s.lcZ(9,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(13,4,"loading")))},dependencies:[ee.C],encapsulation:2});class Kp{constructor(e,t){this.userId=e,this.token=t}}var Bp=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Qp{constructor(e,t,i,n,s,o){this.router=e,this.apiService=t,this.platformUtilsService=i,this.i18nService=n,this.route=s,this.logService=o}ngOnInit(){this.route.queryParams.pipe((0,oe.P)()).subscribe((e=>Bp(this,void 0,void 0,(function*(){null!=e.userId&&null!=e.token&&null!=e.email?(this.userId=e.userId,this.token=e.token,this.email=e.email):this.router.navigate(["/"])}))))}submit(){return Bp(this,void 0,void 0,(function*(){try{const e=new Kp(this.userId,this.token);this.formPromise=this.apiService.postAccountRecoverDeleteToken(e),yield this.formPromise,this.platformUtilsService.showToast("success",this.i18nService.t("accountDeleted"),this.i18nService.t("accountDeletedDesc")),this.router.navigate(["/"])}catch(e){this.logService.error(e)}}))}}Qp.ɵfac=function(e){return new(e||Qp)(s.Y36(p.F0),s.Y36(Ue.s),s.Y36(N.P),s.Y36(M.D),s.Y36(p.gz),s.Y36(_e.$))},Qp.ɵcmp=s.Xpm({type:Qp,selectors:[["app-verify-recover-delete"]],decls:53,vars:21,consts:[["ngNativeValidate","",1,"container",3,"appApiAction","ngSubmit"],["form",""],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],[1,"lead","text-center","mb-4"],[1,"card"],[1,"card-body"],["type","warning"],[1,"text-center"],[1,"d-flex"],["type","submit",1,"btn","btn-danger","btn-block","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["routerLink","/login",1,"btn","btn-outline-secondary","btn-block","ml-2","mt-0"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n  "),s.TgZ(3,"div",2),s._uU(4,"\n    "),s.TgZ(5,"div",3),s._uU(6,"\n      "),s.TgZ(7,"p",4),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n      "),s.TgZ(11,"div",5),s._uU(12,"\n        "),s.TgZ(13,"div",6),s._uU(14,"\n          "),s.TgZ(15,"app-callout",7),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n          "),s.TgZ(19,"p",8),s._uU(20,"\n            "),s.TgZ(21,"strong"),s._uU(22),s.qZA(),s._uU(23,"\n          "),s.qZA(),s._uU(24,"\n          "),s.TgZ(25,"p"),s._uU(26),s.ALo(27,"i18n"),s.qZA(),s._uU(28,"\n          "),s._UZ(29,"hr"),s._uU(30,"\n          "),s.TgZ(31,"div",9),s._uU(32,"\n            "),s.TgZ(33,"button",10),s._uU(34,"\n              "),s.TgZ(35,"span"),s._uU(36),s.ALo(37,"i18n"),s.qZA(),s._uU(38,"\n              "),s._UZ(39,"i",11),s.ALo(40,"i18n"),s._uU(41,"\n            "),s.qZA(),s._uU(42,"\n            "),s.TgZ(43,"a",12),s._uU(44),s.ALo(45,"i18n"),s.qZA(),s._uU(46,"\n          "),s.qZA(),s._uU(47,"\n        "),s.qZA(),s._uU(48,"\n      "),s.qZA(),s._uU(49,"\n    "),s.qZA(),s._uU(50,"\n  "),s.qZA(),s._uU(51,"\n"),s.qZA(),s._uU(52,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,9,"deleteAccount")),s.xp6(8),s.Oqu(s.lcZ(17,11,"deleteAccountWarning")),s.xp6(6),s.Oqu(t.email),s.xp6(4),s.Oqu(s.lcZ(27,13,"deleteRecoverConfirmDesc")),s.xp6(7),s.Q6J("disabled",e.loading),s.xp6(3),s.Oqu(s.lcZ(37,15,"deleteAccount")),s.xp6(3),s.s9C("title",s.lcZ(40,17,"loading")),s.xp6(5),s.hij("\n              ",s.lcZ(45,19,"cancel"),"\n            ")}},dependencies:[l.JL,l.F,p.rH,xe.b,Se.O,ee.C],encapsulation:2});var Gp=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class jp{constructor(e){this.platformUtilsService=e,this.year="2015"}ngOnInit(){return Gp(this,void 0,void 0,(function*(){this.year=(new Date).getFullYear().toString(),this.version=yield this.platformUtilsService.getApplicationVersion(),document.body.classList.add("layout_frontend")}))}ngOnDestroy(){document.body.classList.remove("layout_frontend")}}jp.ɵfac=function(e){return new(e||jp)(s.Y36(N.P))},jp.ɵcmp=s.Xpm({type:jp,selectors:[["app-frontend-layout"]],decls:16,vars:4,consts:[[1,"container","my-5","text-muted","text-center"],[1,"small"]],template:function(e,t){1&e&&(s._UZ(0,"router-outlet"),s._uU(1,"\n"),s.TgZ(2,"div",0),s._uU(3,"\n  Vaultwarden Web"),s._UZ(4,"br"),s._uU(5),s.ALo(6,"i18n"),s._UZ(7,"br")(8,"br"),s._uU(9,"\n  "),s.TgZ(10,"div",1),s._uU(11,"\n    A modified version of the Bitwarden® Web Vault for Vaultwarden (an unofficial rewrite of the\n    Bitwarden® server)."),s._UZ(12,"br"),s._uU(13,"\n    Vaultwarden is not associated with the Bitwarden® project nor Bitwarden Inc.\n  "),s.qZA(),s._uU(14,"\n"),s.qZA(),s._uU(15,"\n")),2&e&&(s.xp6(5),s.hij("\n  ",s.xi3(6,1,"versionNumber",t.version),"\n  "))},dependencies:[p.lC,ee.C],encapsulation:2});var Vp=i(28926);class $p{}var Hp=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Wp(e,t){1&e&&(s.TgZ(0,"p"),s._uU(1,"\n      "),s._UZ(2,"i",7),s.ALo(3,"i18n"),s._uU(4,"\n      "),s.TgZ(5,"span",8),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n    "),s.qZA()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function Xp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",13),s._uU(1,"\n        "),s.TgZ(2,"div",14),s._uU(3,"\n          "),s.TgZ(4,"label",15),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n          "),s.TgZ(8,"textarea",16),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).index,n=s.oxw(2);return s.KtG(n.custom[i]=t)})),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n        "),s.qZA(),s._uU(11,"\n        "),s.TgZ(12,"button",17),s.NdJ("click",(function(){const t=s.CHM(e).index,i=s.oxw(2);return s.KtG(i.remove(t))})),s.ALo(13,"i18n"),s._uU(14,"\n          "),s._UZ(15,"i",18),s._uU(16,"\n        "),s.qZA(),s._uU(17,"\n      "),s.qZA()}if(2&e){const e=t.index,i=s.oxw(2);s.xp6(4),s.MGl("for","customDomain_",e,""),s.xp6(1),s.Oqu(s.xi3(6,7,"customDomainX",e+1)),s.xp6(3),s.MGl("name","CustomDomain[",e,"]")("id","customDomain_",e,"")("placeholder","",s.lcZ(9,10,"ex")," google.com, gmail.com"),s.Q6J("ngModel",i.custom[e]),s.xp6(4),s.s9C("appA11yTitle",s.lcZ(13,12,"remove"))}}function eh(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n      "),s.YNc(2,Xp,18,14,"div",9),s._uU(3,"\n      "),s.TgZ(4,"button",10),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.add())})),s._uU(5,"\n        "),s._UZ(6,"i",11),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n      "),s.TgZ(10,"small",12),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n    "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngForOf",e.custom)("ngForTrackBy",e.indexTrackBy),s.xp6(5),s.hij(" ",s.lcZ(8,4,"newCustomDomain"),"\n      "),s.xp6(4),s.Oqu(s.lcZ(12,6,"newCustomDomainDesc"))}}function th(e,t){1&e&&(s.TgZ(0,"p"),s._uU(1,"\n      "),s._UZ(2,"i",7),s.ALo(3,"i18n"),s._uU(4,"\n      "),s.TgZ(5,"span",8),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n    "),s.qZA()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function ih(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",28),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(2);return s.KtG(i.toggleExcluded(t))})),s._uU(1,"\n                  "),s._UZ(2,"i",30),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n                  ",s.lcZ(4,1,"exclude"),"\n                "))}function nh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",28),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(2);return s.KtG(i.toggleExcluded(t))})),s._uU(1,"\n                  "),s._UZ(2,"i",31),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n                  ",s.lcZ(4,1,"include"),"\n                "))}const sh=function(e){return{"table-list-strike":e}};function oh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr"),s._uU(1,"\n          "),s.TgZ(2,"td",21),s._uU(3),s.qZA(),s._uU(4,"\n          "),s.TgZ(5,"td",22),s._uU(6,"\n            "),s.TgZ(7,"div",23),s._uU(8,"\n              "),s.TgZ(9,"button",24),s.ALo(10,"i18n"),s._uU(11,"\n                "),s._UZ(12,"i",25),s._uU(13,"\n              "),s.qZA(),s._uU(14,"\n              "),s.TgZ(15,"div",26),s._uU(16,"\n                "),s.YNc(17,ih,5,3,"a",27),s._uU(18,"\n                "),s.YNc(19,nh,5,3,"a",27),s._uU(20,"\n                "),s.TgZ(21,"a",28),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(2);return s.KtG(i.customize(t))})),s._uU(22,"\n                  "),s._UZ(23,"i",29),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n              "),s.qZA(),s._uU(27,"\n            "),s.qZA(),s._uU(28,"\n          "),s.qZA(),s._uU(29,"\n        "),s.qZA()}if(2&e){const e=t.$implicit;s.xp6(2),s.Q6J("ngClass",s.VKq(10,sh,e.excluded)),s.xp6(1),s.Oqu(e.domains),s.xp6(6),s.s9C("appA11yTitle",s.lcZ(10,6,"options")),s.xp6(8),s.Q6J("ngIf",!e.excluded),s.xp6(2),s.Q6J("ngIf",e.excluded),s.xp6(5),s.hij("\n                  ",s.lcZ(25,8,"customize"),"\n                ")}}function rh(e,t){if(1&e&&(s.TgZ(0,"table",19),s._uU(1,"\n      "),s.TgZ(2,"tbody"),s._uU(3,"\n        "),s.YNc(4,oh,30,12,"tr",20),s._uU(5,"\n      "),s.qZA(),s._uU(6,"\n    "),s.qZA()),2&e){const e=s.oxw();s.xp6(4),s.Q6J("ngForOf",e.global)}}class ah{constructor(e,t,i,n){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.logService=n,this.loading=!0,this.custom=[],this.global=[]}ngOnInit(){return Hp(this,void 0,void 0,(function*(){const e=yield this.apiService.getSettingsDomains();this.loading=!1,null!=e.equivalentDomains&&(this.custom=e.equivalentDomains.map((e=>e.join(", ")))),null!=e.globalEquivalentDomains&&(this.global=e.globalEquivalentDomains.map((e=>({domains:e.domains.join(", "),excluded:e.excluded,key:e.type}))))}))}toggleExcluded(e){e.excluded=!e.excluded}customize(e){e.excluded=!0,this.custom.push(e.domains)}remove(e){this.custom.splice(e,1)}add(){this.custom.push("")}submit(){return Hp(this,void 0,void 0,(function*(){const e=new $p;e.excludedGlobalEquivalentDomains=this.global.filter((e=>e.excluded)).map((e=>e.key)),0===e.excludedGlobalEquivalentDomains.length&&(e.excludedGlobalEquivalentDomains=null),e.equivalentDomains=this.custom.filter((e=>null!=e&&""!==e.trim())).map((e=>e.split(",").map((e=>e.trim())))),0===e.equivalentDomains.length&&(e.equivalentDomains=null);try{this.formPromise=this.apiService.putSettingsDomains(e),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("domainsUpdated"))}catch(t){this.logService.error(t)}}))}indexTrackBy(e,t){return e}}ah.ɵfac=function(e){return new(e||ah)(s.Y36(Ue.s),s.Y36(M.D),s.Y36(N.P),s.Y36(_e.$))},ah.ɵcmp=s.Xpm({type:ah,selectors:[["app-domain-rules"]],decls:49,vars:28,consts:[["ngNativeValidate","",3,"appApiAction","ngSubmit"],["form",""],[4,"ngIf"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],[1,"spaced-header"],["class","table table-hover table-list",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],["class","form-group d-flex",4,"ngFor","ngForOf","ngForTrackBy"],["type","button",1,"btn","btn-outline-secondary","btn-sm","mb-2",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-fw"],[1,"text-muted","d-block","mb-3"],[1,"form-group","d-flex"],[1,"flex-fill"],[1,"sr-only",3,"for"],["required","",1,"form-control",3,"name","id","ngModel","placeholder","ngModelChange"],["type","button",1,"btn","btn-link","text-danger","ml-2",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-minus-circle","bwi-lg"],[1,"table","table-hover","table-list"],[4,"ngFor","ngForOf"],[3,"ngClass"],[1,"table-list-options"],["appListDropdown","",1,"dropdown"],["type","button","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-cog","bwi-lg"],[1,"dropdown-menu","dropdown-menu-right"],["class","dropdown-item","href","#","appStopClick","",3,"click",4,"ngIf"],["href","#","appStopClick","",1,"dropdown-item",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-cut"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-close"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-plus"]],template:function(e,t){if(1&e&&(s._UZ(0,"app-header"),s._uU(1,"\n\n"),s.TgZ(2,"bit-container"),s._uU(3,"\n  "),s.TgZ(4,"p"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n  "),s.TgZ(8,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(10,"\n    "),s.TgZ(11,"h2"),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n    "),s.YNc(15,Wp,9,6,"p",2),s._uU(16,"\n    "),s.YNc(17,eh,14,8,"ng-container",2),s._uU(18,"\n    "),s.TgZ(19,"button",3),s._uU(20,"\n      "),s._UZ(21,"i",4),s.ALo(22,"i18n"),s._uU(23,"\n      "),s.TgZ(24,"span"),s._uU(25),s.ALo(26,"i18n"),s.qZA(),s._uU(27,"\n    "),s.qZA(),s._uU(28,"\n    "),s.TgZ(29,"h2",5),s._uU(30),s.ALo(31,"i18n"),s.qZA(),s._uU(32,"\n    "),s.YNc(33,th,9,6,"p",2),s._uU(34,"\n    "),s.YNc(35,rh,7,1,"table",6),s._uU(36,"\n    "),s.TgZ(37,"button",3),s._uU(38,"\n      "),s._UZ(39,"i",4),s.ALo(40,"i18n"),s._uU(41,"\n      "),s.TgZ(42,"span"),s._uU(43),s.ALo(44,"i18n"),s.qZA(),s._uU(45,"\n    "),s.qZA(),s._uU(46,"\n  "),s.qZA(),s._uU(47,"\n"),s.qZA(),s._uU(48,"\n")),2&e){const e=s.MAs(9);s.xp6(5),s.Oqu(s.lcZ(6,14,"domainRulesDesc")),s.xp6(3),s.Q6J("appApiAction",t.formPromise),s.xp6(4),s.Oqu(s.lcZ(13,16,"customEqDomains")),s.xp6(3),s.Q6J("ngIf",t.loading),s.xp6(2),s.Q6J("ngIf",!t.loading),s.xp6(2),s.Q6J("disabled",e.loading),s.xp6(2),s.s9C("title",s.lcZ(22,18,"loading")),s.xp6(4),s.Oqu(s.lcZ(26,20,"save")),s.xp6(5),s.Oqu(s.lcZ(31,22,"globalEqDomains")),s.xp6(3),s.Q6J("ngIf",t.loading),s.xp6(2),s.Q6J("ngIf",!t.loading&&t.global.length>0),s.xp6(2),s.Q6J("disabled",e.loading),s.xp6(2),s.s9C("title",s.lcZ(40,24,"loading")),s.xp6(4),s.Oqu(s.lcZ(44,26,"save"))}},dependencies:[d.mk,d.sg,d.O5,l.Fj,l.JJ,l.JL,l.Q7,l.On,l.F,ui.B,xe.b,wr.O,si.e,oi.k,ee.C],encapsulation:2});var lh=i(30933),ch=i(89770),uh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class dh{get showCustom(){return this.form.get("vaultTimeout").value===dh.CUSTOM_VALUE}get exceedsMinimumTimout(){return!this.showCustom||this.customTimeInMinutes()>dh.MIN_CUSTOM_MINUTES}constructor(e,t,i,n){this.formBuilder=e,this.policyService=t,this.vaultTimeoutSettingsService=i,this.i18nService=n,this.form=this.formBuilder.group({vaultTimeout:[null],custom:this.formBuilder.group({hours:[null],minutes:[null]})}),this.destroy$=new h.x}ngOnInit(){return uh(this,void 0,void 0,(function*(){this.policyService.get$(ce.Mi.MaximumVaultTimeout).pipe((0,m.h)((e=>null!=e)),(0,g.R)(this.destroy$)).subscribe((e=>{this.vaultTimeoutPolicy=e,this.applyVaultTimeoutPolicy()})),this.form.valueChanges.pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.onChange&&this.onChange(this.getVaultTimeout(e))})),this.form.controls.vaultTimeout.valueChanges.pipe((0,m.h)((e=>e!==dh.CUSTOM_VALUE)),(0,g.R)(this.destroy$)).subscribe((e=>{const t=Math.max(e,0);this.form.patchValue({custom:{hours:Math.floor(t/60),minutes:t%60}},{emitEvent:!1})})),this.canLockVault$=this.vaultTimeoutSettingsService.availableVaultTimeoutActions$().pipe((0,y.U)((e=>e.includes(Vi.B.Lock))))}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngOnChanges(){this.vaultTimeoutOptions.find((e=>e.value===dh.CUSTOM_VALUE))||this.vaultTimeoutOptions.push({name:this.i18nService.t("custom"),value:dh.CUSTOM_VALUE})}getVaultTimeout(e){return e.vaultTimeout!==dh.CUSTOM_VALUE?e.vaultTimeout:60*e.custom.hours+e.custom.minutes}writeValue(e){null!=e&&(this.vaultTimeoutOptions.every((t=>t.value!==e))?this.form.setValue({vaultTimeout:dh.CUSTOM_VALUE,custom:{hours:Math.floor(e/60),minutes:e%60}}):this.form.patchValue({vaultTimeout:e}))}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}validate(e){var t,i;return this.vaultTimeoutPolicy&&(null===(i=null===(t=this.vaultTimeoutPolicy)||void 0===t?void 0:t.data)||void 0===i?void 0:i.minutes)<e.value?{policyError:!0}:this.exceedsMinimumTimout?null:{minTimeoutError:!0}}registerOnValidatorChange(e){this.validatorChange=e}customTimeInMinutes(){return 60*this.form.value.custom.hours+this.form.value.custom.minutes}applyVaultTimeoutPolicy(){this.vaultTimeoutPolicyHours=Math.floor(this.vaultTimeoutPolicy.data.minutes/60),this.vaultTimeoutPolicyMinutes=this.vaultTimeoutPolicy.data.minutes%60,this.vaultTimeoutOptions=this.vaultTimeoutOptions.filter((e=>e.value<=this.vaultTimeoutPolicy.data.minutes&&(e.value>0||e.value===dh.CUSTOM_VALUE)&&null!=e.value)),this.validatorChange()}}function ph(e,t){if(1&e&&(s.TgZ(0,"option",7),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function hh(e,t){1&e&&(s.TgZ(0,"small",15),s._uU(1,"\n      "),s._UZ(2,"i",16),s._uU(3),s.ALo(4,"i18n"),s.qZA()),2&e&&(s.xp6(3),s.hij(" ",s.lcZ(4,1,"vaultCustomTimeoutMinimum"),"\n    "))}function gh(e,t){if(1&e&&(s.TgZ(0,"div",8),s._uU(1,"\n    "),s.TgZ(2,"label",9),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n    "),s.TgZ(6,"div",10),s._uU(7,"\n      "),s.TgZ(8,"div",11),s._uU(9,"\n        "),s._UZ(10,"input",12),s._uU(11,"\n        "),s.TgZ(12,"small"),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n      "),s.qZA(),s._uU(16,"\n      "),s.TgZ(17,"div",11),s._uU(18,"\n        "),s._UZ(19,"input",13),s._uU(20,"\n        "),s.TgZ(21,"small"),s._uU(22),s.ALo(23,"i18n"),s.qZA(),s._uU(24,"\n      "),s.qZA(),s._uU(25,"\n    "),s.qZA(),s._uU(26,"\n\n    "),s.YNc(27,hh,5,3,"small",14),s._uU(28,"\n  "),s.qZA()),2&e){const e=s.oxw();s.xp6(3),s.Oqu(s.lcZ(4,4,"customVaultTimeout")),s.xp6(10),s.Oqu(s.lcZ(14,6,"hours")),s.xp6(9),s.Oqu(s.lcZ(23,8,"minutes")),s.xp6(5),s.Q6J("ngIf",!e.exceedsMinimumTimout)}}dh.CUSTOM_VALUE=-100,dh.MIN_CUSTOM_MINUTES=0,dh.ɵfac=function(e){return new(e||dh)(s.Y36(l.qu),s.Y36(Y.d),s.Y36(en.E),s.Y36(M.D))},dh.ɵdir=s.lG2({type:dh,inputs:{vaultTimeoutOptions:"vaultTimeoutOptions"},features:[s.TTD]});class fh extends dh{}fh.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(fh)))(t||fh)}}(),fh.ɵcmp=s.Xpm({type:fh,selectors:[["app-vault-timeout-input"]],features:[s._Bn([{provide:l.JU,multi:!0,useExisting:fh},{provide:l.Cf,multi:!0,useExisting:fh}]),s.qOj],decls:22,vars:11,consts:[[3,"formGroup"],[1,"form-group"],["for","vaultTimeout"],["id","vaultTimeout","name","VaultTimeout","formControlName","vaultTimeout",1,"form-control"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"form-text","text-muted"],["class","form-group","formGroupName","custom",4,"ngIf"],[3,"ngValue"],["formGroupName","custom",1,"form-group"],["for","customVaultTimeout"],[1,"row"],[1,"col-6"],["id","hours","type","number","min","0","name","hours","formControlName","hours",1,"form-control"],["id","minutes","type","number","min","0","name","minutes","formControlName","minutes",1,"form-control"],["class","tw-text-danger",4,"ngIf"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-error"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"label",2),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n    "),s.TgZ(8,"select",3),s._uU(9,"\n      "),s.YNc(10,ph,2,2,"option",4),s._uU(11,"\n    "),s.qZA(),s._uU(12,"\n    "),s.TgZ(13,"small",5),s._uU(14),s.ALo(15,"i18n"),s.ALo(16,"async"),s.qZA(),s._uU(17,"\n  "),s.qZA(),s._uU(18,"\n  "),s.YNc(19,gh,29,10,"div",6),s._uU(20,"\n"),s.qZA(),s._uU(21,"\n")),2&e&&(s.Q6J("formGroup",t.form),s.xp6(5),s.Oqu(s.lcZ(6,5,"vaultTimeout")),s.xp6(5),s.Q6J("ngForOf",t.vaultTimeoutOptions),s.xp6(4),s.Oqu(s.lcZ(15,7,s.lcZ(16,9,t.canLockVault$)?"vaultTimeoutDesc":"vaultTimeoutLogoutDesc")),s.xp6(5),s.Q6J("ngIf",t.showCustom))},dependencies:[d.sg,d.O5,l.YN,l.Kr,l.Fj,l.wV,l.EJ,l.JJ,l.JL,l.qQ,l.sg,l.u,l.x0,d.Ov,ee.C],encapsulation:2});var mh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function vh(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"i18n"),s.qZA()),2&e){const e=s.oxw().ngIf;s.xp6(1),s.hij("\n            ",s.gM2(2,1,"vaultTimeoutPolicyWithActionInEffect",e.timeout.hours,e.timeout.minutes,s.lcZ(3,6,e.action)),"\n          ")}}function yh(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw().ngIf;s.xp6(1),s.hij("\n            ",s.Dn7(2,1,"vaultTimeoutPolicyInEffect",e.timeout.hours,e.timeout.minutes),"\n          ")}}function wh(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"i18n"),s.qZA()),2&e){const e=s.oxw().ngIf;s.xp6(1),s.hij("\n            ",s.xi3(2,1,"vaultTimeoutActionPolicyInEffect",s.lcZ(3,4,e.action)),"\n          ")}}function bh(e,t){if(1&e&&(s.TgZ(0,"app-callout",21),s._uU(1,"\n          "),s.YNc(2,vh,4,8,"span",5),s._uU(3,"\n          "),s.YNc(4,yh,3,5,"span",5),s._uU(5,"\n          "),s.YNc(6,wh,4,6,"span",5),s._uU(7,"\n        "),s.qZA()),2&e){const e=t.ngIf;s.xp6(2),s.Q6J("ngIf",e.timeout&&e.action),s.xp6(2),s.Q6J("ngIf",e.timeout&&!e.action),s.xp6(2),s.Q6J("ngIf",!e.timeout&&e.action)}}function Uh(e,t){if(1&e&&(s.TgZ(0,"div",25),s._uU(1,"\n          "),s._UZ(2,"input",26),s._uU(3,"\n          "),s.TgZ(4,"label",27),s._uU(5),s.ALo(6,"i18n"),s.TgZ(7,"small"),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n          "),s.qZA(),s._uU(11,"\n        "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(2),s.s9C("value",e.VaultTimeoutAction.Lock),s.xp6(3),s.hij("\n            ",s.lcZ(6,3,"lock"),"\n            "),s.xp6(3),s.Oqu(s.lcZ(9,5,"vaultTimeoutActionLockDesc"))}}function _h(e,t){if(1&e&&(s.TgZ(0,"div",28),s._uU(1,"\n          "),s._UZ(2,"input",29),s._uU(3,"\n          "),s.TgZ(4,"label",30),s._uU(5),s.ALo(6,"i18n"),s.TgZ(7,"small"),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n          "),s.qZA(),s._uU(11,"\n        "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(2),s.s9C("value",e.VaultTimeoutAction.LogOut),s.xp6(3),s.hij("\n            ",s.lcZ(6,3,"logOut"),"\n            "),s.xp6(3),s.Oqu(s.lcZ(9,5,"vaultTimeoutActionLogOutDesc"))}}function Ah(e,t){if(1&e&&(s.TgZ(0,"div",6),s._uU(1,"\n        "),s.TgZ(2,"label"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n        "),s.YNc(6,Uh,12,7,"div",23),s._uU(7,"\n        "),s.YNc(8,_h,12,7,"div",24),s._uU(9,"\n      "),s.qZA()),2&e){const e=s.oxw().ngIf,t=s.oxw();s.xp6(3),s.Oqu(s.lcZ(4,3,"vaultTimeoutAction")),s.xp6(3),s.Q6J("ngIf",e.includes(t.VaultTimeoutAction.Lock)),s.xp6(2),s.Q6J("ngIf",e.includes(t.VaultTimeoutAction.LogOut))}}function Zh(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n      "),s.YNc(2,Ah,10,5,"div",22),s._uU(3,"\n    "),s.BQk()),2&e){const e=t.ngIf;s.xp6(2),s.Q6J("ngIf",e.length>1)}}function xh(e,t){if(1&e&&(s.TgZ(0,"option",31),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function Sh(e,t){if(1&e&&(s.TgZ(0,"option",31),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}class Th{constructor(e,t,i,n,s,o,r,a){this.formBuilder=e,this.policyService=t,this.i18nService=i,this.vaultTimeoutSettingsService=n,this.platformUtilsService=s,this.themeStateService=o,this.domainSettingsService=r,this.dialogService=a,this.VaultTimeoutAction=Vi.B,this.destroy$=new h.x,this.form=this.formBuilder.group({vaultTimeout:[null],vaultTimeoutAction:[Vi.B.Lock],enableFavicons:!0,theme:[Hi.f8.Light],locale:[null]}),this.vaultTimeoutOptions=[{name:i.t("oneMinute"),value:1},{name:i.t("fiveMinutes"),value:5},{name:i.t("fifteenMinutes"),value:15},{name:i.t("thirtyMinutes"),value:30},{name:i.t("oneHour"),value:60},{name:i.t("fourHours"),value:240},{name:i.t("onRefresh"),value:-1}],this.platformUtilsService.isDev()&&this.vaultTimeoutOptions.push({name:i.t("never"),value:null});const l=[];i.supportedTranslationLocales.forEach((e=>{let t=e;i.localeNames.has(e)&&(t+=" - "+i.localeNames.get(e)),l.push({name:t,value:e})})),l.sort(Ci.c.getSortFunction(i,"name")),l.splice(0,0,{name:i.t("default"),value:null}),this.localeOptions=l,this.themeOptions=[{name:i.t("themeLight"),value:Hi.f8.Light},{name:i.t("themeDark"),value:Hi.f8.Dark},{name:i.t("themeSystem"),value:Hi.f8.System}]}ngOnInit(){var e;return mh(this,void 0,void 0,(function*(){this.availableVaultTimeoutActions$=this.vaultTimeoutSettingsService.availableVaultTimeoutActions$(),this.vaultTimeoutPolicyCallout=this.policyService.get$(ce.Mi.MaximumVaultTimeout).pipe((0,m.h)((e=>null!=e)),(0,y.U)((e=>{var t,i,n,s;let o;return(null===(t=e.data)||void 0===t?void 0:t.minutes)&&(o={hours:Math.floor((null===(i=e.data)||void 0===i?void 0:i.minutes)/60),minutes:(null===(n=e.data)||void 0===n?void 0:n.minutes)%60}),{timeout:o,action:null===(s=e.data)||void 0===s?void 0:s.action}})),(0,Gs.b)((e=>{e.action?this.form.controls.vaultTimeoutAction.disable({emitEvent:!1}):this.form.controls.vaultTimeoutAction.enable({emitEvent:!1})}))),this.form.controls.vaultTimeoutAction.valueChanges.pipe((0,Ki.b)((e=>mh(this,void 0,void 0,(function*(){if(e===Vi.B.LogOut){if(!(yield this.dialogService.openSimpleDialog({title:{key:"vaultTimeoutLogOutConfirmationTitle"},content:{key:"vaultTimeoutLogOutConfirmation"},type:"warning"})))return void this.form.controls.vaultTimeoutAction.patchValue(Vi.B.Lock,{emitEvent:!1})}})))),(0,g.R)(this.destroy$)).subscribe();const t={vaultTimeout:yield this.vaultTimeoutSettingsService.getVaultTimeout(),vaultTimeoutAction:yield(0,f.z)(this.vaultTimeoutSettingsService.vaultTimeoutAction$()),enableFavicons:yield(0,f.z)(this.domainSettingsService.showFavicons$),theme:yield(0,f.z)(this.themeStateService.selectedTheme$),locale:null!==(e=yield(0,f.z)(this.i18nService.userSetLocale$))&&void 0!==e?e:null};this.startingLocale=t.locale,this.form.setValue(t,{emitEvent:!1})}))}submit(){return mh(this,void 0,void 0,(function*(){if(!this.form.controls.vaultTimeout.valid)return void this.platformUtilsService.showToast("error",null,this.i18nService.t("vaultTimeoutRangeError"));const e=this.form.value;yield this.vaultTimeoutSettingsService.setVaultTimeoutOptions(e.vaultTimeout,e.vaultTimeoutAction),yield this.domainSettingsService.setShowFavicons(e.enableFavicons),yield this.themeStateService.setSelectedTheme(e.theme),yield this.i18nService.setLocale(e.locale),e.locale!==this.startingLocale?window.location.reload():this.platformUtilsService.showToast("success",null,this.i18nService.t("preferencesUpdated"))}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Th.ɵfac=function(e){return new(e||Th)(s.Y36(l.qu),s.Y36(Y.d),s.Y36(M.D),s.Y36(en.E),s.Y36(N.P),s.Y36(ch.v),s.Y36(lh.z),s.Y36(I.x))},Th.ɵcmp=s.Xpm({type:Th,selectors:[["app-preferences"]],decls:106,vars:41,consts:[["ngNativeValidate","",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-6"],["type","info",4,"ngIf"],["ngDefaultControl","",3,"vaultTimeoutOptions","formControl"],[4,"ngIf"],[1,"form-group"],[1,"d-flex"],["for","locale"],["href","https://bitwarden.com/help/localization/","target","_blank","rel","noreferrer",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["id","locale","name","Locale","formControlName","locale",1,"form-control"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"form-text","text-muted"],[1,"form-check"],["type","checkbox","id","enableFavicons","name","enableFavicons","formControlName","enableFavicons",1,"form-check-input"],["for","enableFavicons",1,"form-check-label"],["href","https://bitwarden.com/help/website-icons/","target","_blank","rel","noreferrer",3,"appA11yTitle"],["for","theme"],["id","theme","name","theme","formControlName","theme",1,"form-control"],["type","submit",1,"btn","btn-primary"],["type","info"],["class","form-group",4,"ngIf"],["class","form-check form-check-block",4,"ngIf"],["class","form-check mt-2 form-check-block",4,"ngIf"],[1,"form-check","form-check-block"],["type","radio","name","vaultTimeoutAction","id","vaultTimeoutActionLock","formControlName","vaultTimeoutAction",1,"form-check-input",3,"value"],["for","vaultTimeoutActionLock",1,"form-check-label"],[1,"form-check","mt-2","form-check-block"],["type","radio","name","vaultTimeoutAction","id","vaultTimeoutActionLogOut","formControlName","vaultTimeoutAction",1,"form-check-input",3,"value"],["for","vaultTimeoutActionLogOut",1,"form-check-label"],[3,"ngValue"]],template:function(e,t){1&e&&(s._UZ(0,"app-header"),s._uU(1,"\n\n"),s.TgZ(2,"bit-container"),s._uU(3,"\n  "),s.TgZ(4,"p"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n  "),s.TgZ(8,"form",0),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(9,"\n    "),s.TgZ(10,"div",1),s._uU(11,"\n      "),s.TgZ(12,"div",2),s._uU(13,"\n        "),s.YNc(14,bh,8,3,"app-callout",3),s.ALo(15,"async"),s._uU(16,"\n        "),s.TgZ(17,"app-vault-timeout-input",4),s._uU(18,"\n        "),s.qZA(),s._uU(19,"\n      "),s.qZA(),s._uU(20,"\n    "),s.qZA(),s._uU(21,"\n    "),s.YNc(22,Zh,4,1,"ng-container",5),s.ALo(23,"async"),s._uU(24,"\n    "),s.TgZ(25,"div",1),s._uU(26,"\n      "),s.TgZ(27,"div",2),s._uU(28,"\n        "),s.TgZ(29,"div",6),s._uU(30,"\n          "),s.TgZ(31,"div",7),s._uU(32,"\n            "),s.TgZ(33,"label",8),s._uU(34),s.ALo(35,"i18n"),s.qZA(),s._uU(36,"\n            "),s.TgZ(37,"a",9),s.ALo(38,"i18n"),s._uU(39,"\n              "),s._UZ(40,"i",10),s._uU(41,"\n            "),s.qZA(),s._uU(42,"\n          "),s.qZA(),s._uU(43,"\n          "),s.TgZ(44,"select",11),s._uU(45,"\n            "),s.YNc(46,xh,2,2,"option",12),s._uU(47,"\n          "),s.qZA(),s._uU(48,"\n          "),s.TgZ(49,"small",13),s._uU(50),s.ALo(51,"i18n"),s.qZA(),s._uU(52,"\n        "),s.qZA(),s._uU(53,"\n      "),s.qZA(),s._uU(54,"\n    "),s.qZA(),s._uU(55,"\n    "),s.TgZ(56,"div",6),s._uU(57,"\n      "),s.TgZ(58,"div",14),s._uU(59,"\n        "),s._UZ(60,"input",15),s._uU(61,"\n        "),s.TgZ(62,"label",16),s._uU(63),s.ALo(64,"i18n"),s.qZA(),s._uU(65,"\n        "),s.TgZ(66,"a",17),s.ALo(67,"i18n"),s._uU(68,"\n          "),s._UZ(69,"i",10),s._uU(70,"\n        "),s.qZA(),s._uU(71,"\n      "),s.qZA(),s._uU(72,"\n      "),s.TgZ(73,"small",13),s._uU(74),s.ALo(75,"i18n"),s.qZA(),s._uU(76,"\n    "),s.qZA(),s._uU(77,"\n    "),s.TgZ(78,"div",1),s._uU(79,"\n      "),s.TgZ(80,"div",2),s._uU(81,"\n        "),s.TgZ(82,"div",6),s._uU(83,"\n          "),s.TgZ(84,"label",18),s._uU(85),s.ALo(86,"i18n"),s.qZA(),s._uU(87,"\n          "),s.TgZ(88,"select",19),s._uU(89,"\n            "),s.YNc(90,Sh,2,2,"option",12),s._uU(91,"\n          "),s.qZA(),s._uU(92,"\n          "),s.TgZ(93,"small",13),s._uU(94),s.ALo(95,"i18n"),s.qZA(),s._uU(96,"\n        "),s.qZA(),s._uU(97,"\n      "),s.qZA(),s._uU(98,"\n    "),s.qZA(),s._uU(99,"\n    "),s.TgZ(100,"button",20),s._uU(101),s.ALo(102,"i18n"),s.qZA(),s._uU(103,"\n  "),s.qZA(),s._uU(104,"\n"),s.qZA(),s._uU(105,"\n")),2&e&&(s.xp6(5),s.Oqu(s.lcZ(6,17,"preferencesDesc")),s.xp6(3),s.Q6J("formGroup",t.form),s.xp6(6),s.Q6J("ngIf",s.lcZ(15,19,t.vaultTimeoutPolicyCallout)),s.xp6(3),s.Q6J("vaultTimeoutOptions",t.vaultTimeoutOptions)("formControl",t.form.controls.vaultTimeout),s.xp6(5),s.Q6J("ngIf",s.lcZ(23,21,t.availableVaultTimeoutActions$)),s.xp6(12),s.Oqu(s.lcZ(35,23,"language")),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(38,25,"learnMore")),s.xp6(9),s.Q6J("ngForOf",t.localeOptions),s.xp6(4),s.Oqu(s.lcZ(51,27,"languageDesc")),s.xp6(13),s.hij("\n          ",s.lcZ(64,29,"enableFavicon"),"\n        "),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(67,31,"learnMore")),s.xp6(8),s.Oqu(s.lcZ(75,33,"faviconDesc")),s.xp6(11),s.Oqu(s.lcZ(86,35,"theme")),s.xp6(5),s.Q6J("ngForOf",t.themeOptions),s.xp6(4),s.Oqu(s.lcZ(95,37,"themeDesc")),s.xp6(7),s.hij("\n      ",s.lcZ(102,39,"save"),"\n    "))},dependencies:[d.sg,d.O5,l.YN,l.Kr,l.Fj,l.Wl,l.EJ,l._,l.JJ,l.JL,l.oH,l.sg,l.u,ui.B,Se.O,si.e,oi.k,fh,d.Ov,ee.C],encapsulation:2});var Ch=i(59554),Oh=i(27027),kh=i(70673),Ph=i(8257),qh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ih{constructor(e,t,i,n,o,r,a,l){this.passwordGenerationService=e,this.usernameGenerationService=t,this.platformUtilsService=i,this.stateService=n,this.i18nService=o,this.logService=r,this.route=a,this.win=l,this.comingFromAddEdit=!1,this.onSelected=new s.vpe,this.usernameOptions={website:null},this.passwordOptions={},this.username="-",this.password="-",this.showOptions=!1,this.avoidAmbiguous=!1,this.usernameWebsite=null,this._passwordOptionsMinLengthForReader=new Ch.X(kh.z.length.min),this.passwordOptionsMinLengthForReader$=this._passwordOptionsMinLengthForReader.pipe((0,y.U)((e=>e||kh.z.length.min)),(0,Oh.b)(500)),this.typeOptions=[{name:o.t("password"),value:"password"},{name:o.t("username"),value:"username"}],this.passTypeOptions=[{name:o.t("password"),value:"password"},{name:o.t("passphrase"),value:"passphrase"}],this.usernameTypeOptions=[{name:o.t("plusAddressedEmail"),value:"subaddress",desc:o.t("plusAddressedEmailDesc")},{name:o.t("catchallEmail"),value:"catchall",desc:o.t("catchallEmailDesc")},{name:o.t("forwardedEmail"),value:"forwarded",desc:o.t("forwardedEmailDesc")},{name:o.t("randomWord"),value:"word"}],this.subaddressOptions=[{name:o.t("random"),value:"random"}],this.catchallOptions=[{name:o.t("random"),value:"random"}],this.initForwardOptions()}ngOnInit(){return qh(this,void 0,void 0,(function*(){this.route.queryParams.pipe((0,oe.P)()).subscribe((e=>qh(this,void 0,void 0,(function*(){var t;const i=yield this.passwordGenerationService.getOptions();if(this.passwordOptions=i[0],this.enforcedPasswordPolicyOptions=i[1],this.avoidAmbiguous=!this.passwordOptions.ambiguous,this.passwordOptions.type="passphrase"===this.passwordOptions.type?"passphrase":"password",this.usernameOptions=yield this.usernameGenerationService.getOptions(),null==this.usernameOptions.type&&(this.usernameOptions.type="word"),null!=this.usernameOptions.subaddressEmail&&""!==this.usernameOptions.subaddressEmail||(this.usernameOptions.subaddressEmail=yield this.stateService.getEmail()),null==this.usernameWebsite)this.usernameOptions.subaddressType=this.usernameOptions.catchallType="random";else{this.usernameOptions.website=this.usernameWebsite;const e={name:this.i18nService.t("websiteName"),value:"website-name"};this.subaddressOptions.push(e),this.catchallOptions.push(e)}if("username"!==this.type&&"password"!==this.type)if("username"===e.type||"password"===e.type)this.type=e.type;else{const e=yield this.stateService.getGeneratorOptions();this.type=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:"password"}this.regenerateWithoutButtonPress()&&(yield this.regenerate())}))))}))}typeChanged(){return qh(this,void 0,void 0,(function*(){yield this.stateService.setGeneratorOptions({type:this.type}),this.regenerateWithoutButtonPress()&&(yield this.regenerate())}))}regenerate(){return qh(this,void 0,void 0,(function*(){"password"===this.type?yield this.regeneratePassword():"username"===this.type&&(yield this.regenerateUsername())}))}sliderChanged(){return qh(this,void 0,void 0,(function*(){this.savePasswordOptions(!1),yield this.passwordGenerationService.addHistory(this.password)}))}onPasswordOptionsMinNumberInput(e){return qh(this,void 0,void 0,(function*(){this.passwordOptions.number=null,yield this.savePasswordOptions(),e.target.value=`${this.passwordOptions.minNumber}`}))}setPasswordOptionsNumber(e){return qh(this,void 0,void 0,(function*(){this.passwordOptions.number=e,this.passwordOptions.minNumber=null,yield this.savePasswordOptions()}))}onPasswordOptionsMinSpecialInput(e){return qh(this,void 0,void 0,(function*(){this.passwordOptions.special=null,yield this.savePasswordOptions(),e.target.value=`${this.passwordOptions.minSpecial}`}))}setPasswordOptionsSpecial(e){return qh(this,void 0,void 0,(function*(){this.passwordOptions.special=e,this.passwordOptions.minSpecial=null,yield this.savePasswordOptions()}))}sliderInput(){return qh(this,void 0,void 0,(function*(){yield this.normalizePasswordOptions(),this.password=yield this.passwordGenerationService.generatePassword(this.passwordOptions)}))}savePasswordOptions(e=!0){return qh(this,void 0,void 0,(function*(){yield this.normalizePasswordOptions(),yield this.passwordGenerationService.saveOptions(this.passwordOptions),e&&this.regenerateWithoutButtonPress()&&(yield this.regeneratePassword())}))}saveUsernameOptions(e=!0){return qh(this,void 0,void 0,(function*(){yield this.usernameGenerationService.saveOptions(this.usernameOptions),"forwarded"===this.usernameOptions.type&&(this.username="-"),e&&this.regenerateWithoutButtonPress()&&(yield this.regenerateUsername())}))}regeneratePassword(){return qh(this,void 0,void 0,(function*(){this.password=yield this.passwordGenerationService.generatePassword(this.passwordOptions),yield this.passwordGenerationService.addHistory(this.password)}))}regenerateUsername(){return this.generateUsername()}generateUsername(){return qh(this,void 0,void 0,(function*(){try{this.usernameGeneratingPromise=this.usernameGenerationService.generateUsername(this.usernameOptions),this.username=yield this.usernameGeneratingPromise,""!==this.username&&null!==this.username||(this.username="-")}catch(e){this.logService.error(e)}}))}copy(){const e="password"===this.type,t=null!=this.win?{window:this.win}:null;this.platformUtilsService.copyToClipboard(e?this.password:this.username,t),this.platformUtilsService.showToast("info",null,this.i18nService.t("valueCopied",this.i18nService.t(e?"password":"username")))}select(){this.onSelected.emit("password"===this.type?this.password:this.username)}toggleOptions(){this.showOptions=!this.showOptions}regenerateWithoutButtonPress(){return"username"!==this.type||"forwarded"!==this.usernameOptions.type}normalizePasswordOptions(){return qh(this,void 0,void 0,(function*(){if(this.passwordOptions.ambiguous=!this.avoidAmbiguous,!(this.passwordOptions.uppercase||this.passwordOptions.lowercase||this.passwordOptions.number||this.passwordOptions.special)&&(this.passwordOptions.lowercase=!0,null!=this.win)){const e=this.win.document.querySelector("#lowercase");e&&(e.checked=!0)}yield this.passwordGenerationService.enforcePasswordGeneratorPoliciesOnOptions(this.passwordOptions),this._passwordOptionsMinLengthForReader.next(this.passwordOptions.minLength)}))}initForwardOptions(){return qh(this,void 0,void 0,(function*(){this.forwardOptions=[{name:"addy.io",value:"anonaddy",validForSelfHosted:!0},{name:"DuckDuckGo",value:"duckduckgo",validForSelfHosted:!1},{name:"Fastmail",value:"fastmail",validForSelfHosted:!0},{name:"Firefox Relay",value:"firefoxrelay",validForSelfHosted:!1},{name:"SimpleLogin",value:"simplelogin",validForSelfHosted:!0},{name:"Forward Email",value:"forwardemail",validForSelfHosted:!0}],this.usernameOptions=yield this.usernameGenerationService.getOptions(),null!=this.usernameOptions.forwardedService&&""!==this.usernameOptions.forwardedService||this.forwardOptions.push({name:"",value:null,validForSelfHosted:!1}),this.forwardOptions=this.forwardOptions.sort(((e,t)=>e.name.localeCompare(t.name)))}))}}Ih.ɵfac=function(e){return new(e||Ih)(s.Y36(A.UW),s.Y36(Ph.vo),s.Y36(N.P),s.Y36(J.b),s.Y36(M.D),s.Y36(_e.$),s.Y36(p.gz),s.Y36(Window))},Ih.ɵdir=s.lG2({type:Ih,inputs:{comingFromAddEdit:"comingFromAddEdit",type:"type"},outputs:{onSelected:"onSelected"}});var Mh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Nh{constructor(e,t,i,n){this.passwordGenerationService=e,this.platformUtilsService=t,this.i18nService=i,this.win=n,this.history=[],this.clear=()=>Mh(this,void 0,void 0,(function*(){this.history=[],yield this.passwordGenerationService.clear()}))}ngOnInit(){return Mh(this,void 0,void 0,(function*(){this.history=yield this.passwordGenerationService.getHistory()}))}copy(e){const t=null!=this.win?{window:this.win}:null;this.platformUtilsService.copyToClipboard(e,t),this.platformUtilsService.showToast("info",null,this.i18nService.t("valueCopied",this.i18nService.t("password")))}}Nh.ɵfac=function(e){return new(e||Nh)(s.Y36(A.UW),s.Y36(N.P),s.Y36(M.D),s.Y36(Window))},Nh.ɵdir=s.lG2({type:Nh});class Lh{constructor(e,t){this.el=e,this.platformUtilsService=t}onCopy(){if(null==window)return;const e=this.platformUtilsService.getClientType()===le.Bh.Desktop?100:0;setTimeout((()=>{this.platformUtilsService.copyToClipboard(this.copyText,{window})}),e)}}function Dh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr",8),s._uU(1,"\n          "),s.TgZ(2,"td",9),s._uU(3,"\n            "),s._UZ(4,"bit-color-password",10),s._uU(5,"\n            "),s.TgZ(6,"small",11),s._uU(7),s.ALo(8,"date"),s.qZA(),s._uU(9,"\n          "),s.qZA(),s._uU(10,"\n          "),s.TgZ(11,"td",12),s._uU(12,"\n            "),s.TgZ(13,"button",13),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.copy(t.password))})),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n          "),s.qZA(),s._uU(16,"\n        "),s.qZA()}if(2&e){const e=t.$implicit;s.xp6(4),s.Q6J("password",e.password)("appCopyText",e.password),s.xp6(3),s.hij("\n              ",s.xi3(8,4,e.date,"medium"),"\n            "),s.xp6(6),s.Q6J("appA11yTitle",s.lcZ(14,7,"copyPassword"))}}function Eh(e,t){if(1&e&&(s._uU(0,"\n        "),s.YNc(1,Dh,17,9,"tr",7),s._uU(2,"\n      ")),2&e){const e=s.oxw(2);s.xp6(1),s.Q6J("ngForOf",e.history)}}function Fh(e,t){1&e&&(s.TgZ(0,"bit-table"),s._uU(1,"\n      "),s.YNc(2,Eh,3,1,"ng-template",6),s._uU(3,"\n    "),s.qZA())}function Rh(e,t){1&e&&(s.TgZ(0,"div"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n      ",s.lcZ(2,1,"noPasswordsInList"),"\n    "))}Lh.ɵfac=function(e){return new(e||Lh)(s.Y36(s.SBq),s.Y36(N.P))},Lh.ɵdir=s.lG2({type:Lh,selectors:[["","appCopyText",""]],hostBindings:function(e,t){1&e&&s.NdJ("copy",(function(){return t.onCopy()}))},inputs:{copyText:["appCopyText","copyText"]}});class Jh extends Nh{constructor(e,t,i){super(e,t,i,window)}}Jh.ɵfac=function(e){return new(e||Jh)(s.Y36(A.UW),s.Y36(N.P),s.Y36(M.D))},Jh.ɵcmp=s.Xpm({type:Jh,selectors:[["app-password-generator-history"]],features:[s.qOj],decls:24,vars:12,consts:[["bitDialogTitle",""],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["type","button","bitButton","","buttonType","secondary","bitDialogClose",""],["type","button","bitIconButton","bwi-trash","buttonType","danger",1,"tw-ml-auto",3,"title","bitAction"],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["bitCell",""],[1,"tw-block","tw-font-mono",3,"password","appCopyText"],["bitTypography","body2",1,"tw-text-muted"],["bitCell","",1,"tw-w-0"],["type","button","bitIconButton","bwi-clone",3,"appA11yTitle","click"]],template:function(e,t){1&e&&(s.TgZ(0,"bit-dialog"),s._uU(1,"\n  "),s.TgZ(2,"span",0),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n  "),s.TgZ(6,"span",1),s._uU(7,"\n    "),s.YNc(8,Fh,4,0,"bit-table",2),s._uU(9,"\n    "),s.YNc(10,Rh,3,3,"div",2),s._uU(11,"\n  "),s.qZA(),s._uU(12,"\n  "),s.ynx(13,3),s._uU(14,"\n    "),s.TgZ(15,"button",4),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n    "),s._UZ(19,"button",5),s.ALo(20,"i18n"),s._uU(21,"\n  "),s.BQk(),s._uU(22,"\n"),s.qZA(),s._uU(23,"\n")),2&e&&(s.xp6(3),s.hij("\n    ",s.lcZ(4,6,"passwordHistory"),"\n  "),s.xp6(5),s.Q6J("ngIf",t.history.length),s.xp6(2),s.Q6J("ngIf",!t.history.length),s.xp6(6),s.hij("\n      ",s.lcZ(17,8,"close"),"\n    "),s.xp6(3),s.s9C("title",s.lcZ(20,10,"clear")),s.Q6J("bitAction",t.clear))},dependencies:[d.sg,d.O5,ui.B,Lh,xn.Q,Te.r,Da.L,$o.a,Ho.f,xs.Q,Tr.a,Cr.Y,Or.v,Tr.f,On.t,d.uU,ee.C],encapsulation:2});var zh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Yh(e,t){1&e&&(s.TgZ(0,"app-callout",9),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n    ",s.lcZ(2,1,"passwordGeneratorPolicyInEffect"),"\n  "))}function Kh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",10),s._uU(1,"\n      "),s.TgZ(2,"input",11),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.type=t)}))("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.typeChanged())})),s.qZA(),s._uU(3,"\n      "),s.TgZ(4,"label",12),s._uU(5),s.qZA(),s._uU(6,"\n    "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw();s.xp6(2),s.MGl("id","type_",e.value,""),s.Q6J("ngModel",i.type)("value",e.value)("checked",i.type===e.value),s.xp6(2),s.MGl("for","type_",e.value,""),s.xp6(1),s.hij("\n        ",e.name,"\n      ")}}function Bh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",10),s._uU(1,"\n        "),s.TgZ(2,"input",21),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.type=t)}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())})),s.qZA(),s._uU(3,"\n        "),s.TgZ(4,"label",12),s._uU(5),s.qZA(),s._uU(6,"\n      "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw(2);s.xp6(2),s.MGl("id","passwordType_",e.value,""),s.Q6J("ngModel",i.passwordOptions.type)("value",e.value)("checked",i.passwordOptions.type===e.value),s.xp6(2),s.MGl("for","passwordType_",e.value,""),s.xp6(1),s.hij("\n          ",e.name,"\n        ")}}function Qh(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n      "),s.TgZ(2,"div",22),s._uU(3,"\n        "),s.TgZ(4,"div",23),s._uU(5,"\n          "),s.TgZ(6,"label",24),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n          "),s.TgZ(10,"input",25),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.numWords=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())})),s.qZA(),s._uU(11,"\n        "),s.qZA(),s._uU(12,"\n        "),s.TgZ(13,"div",23),s._uU(14,"\n          "),s.TgZ(15,"label",26),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n          "),s.TgZ(19,"input",27),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.wordSeparator=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())})),s.qZA(),s._uU(20,"\n        "),s.qZA(),s._uU(21,"\n      "),s.qZA(),s._uU(22,"\n      "),s.TgZ(23,"label",28),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n      "),s.TgZ(27,"div",29),s._uU(28,"\n        "),s.TgZ(29,"div",30),s._uU(30,"\n          "),s.TgZ(31,"input",31),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.capitalize=t)})),s.qZA(),s._uU(32,"\n          "),s.TgZ(33,"label",32),s._uU(34),s.ALo(35,"i18n"),s.qZA(),s._uU(36,"\n        "),s.qZA(),s._uU(37,"\n        "),s.TgZ(38,"div",30),s._uU(39,"\n          "),s.TgZ(40,"input",33),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.includeNumber=t)})),s.qZA(),s._uU(41,"\n          "),s.TgZ(42,"label",34),s._uU(43),s.ALo(44,"i18n"),s.qZA(),s._uU(45,"\n        "),s.qZA(),s._uU(46,"\n      "),s.qZA(),s._uU(47,"\n    "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,11,"numWords")),s.xp6(3),s.Q6J("ngModel",e.passwordOptions.numWords),s.xp6(6),s.Oqu(s.lcZ(17,13,"wordSeparator")),s.xp6(3),s.Q6J("ngModel",e.passwordOptions.wordSeparator),s.xp6(5),s.Oqu(s.lcZ(25,15,"options")),s.xp6(7),s.Q6J("ngModel",e.passwordOptions.capitalize)("disabled",null==e.enforcedPasswordPolicyOptions?null:e.enforcedPasswordPolicyOptions.capitalize),s.xp6(3),s.Oqu(s.lcZ(35,17,"capitalize")),s.xp6(6),s.Q6J("ngModel",e.passwordOptions.includeNumber)("disabled",null==e.enforcedPasswordPolicyOptions?null:e.enforcedPasswordPolicyOptions.includeNumber),s.xp6(3),s.Oqu(s.lcZ(44,19,"includeNumber"))}}function Gh(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n      "),s.TgZ(2,"div",22),s._uU(3,"\n        "),s.TgZ(4,"div",23),s._uU(5,"\n          "),s.TgZ(6,"label",35),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n          "),s.TgZ(10,"input",36),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.length=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.lengthChanged())})),s.qZA(),s._uU(11,"\n        "),s.qZA(),s._uU(12,"\n        "),s.TgZ(13,"div",23),s._uU(14,"\n          "),s.TgZ(15,"label",37),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n          "),s._UZ(19,"input",38),s._uU(20,"\n          "),s.TgZ(21,"span",39),s.ALo(22,"i18n"),s._uU(23),s.ALo(24,"async"),s.qZA(),s._uU(25,"\n        "),s.qZA(),s._uU(26,"\n        "),s.TgZ(27,"div",23),s._uU(28,"\n          "),s.TgZ(29,"label",40),s._uU(30),s.ALo(31,"i18n"),s.qZA(),s._uU(32,"\n          "),s.TgZ(33,"input",41),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.minNumber=t)}))("input",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.onPasswordOptionsMinNumberInput(t))}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.minNumberChanged())})),s.qZA(),s._uU(34,"\n        "),s.qZA(),s._uU(35,"\n        "),s.TgZ(36,"div",23),s._uU(37,"\n          "),s.TgZ(38,"label",42),s._uU(39),s.ALo(40,"i18n"),s.qZA(),s._uU(41,"\n          "),s.TgZ(42,"input",43),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.minSpecial=t)}))("input",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.onPasswordOptionsMinSpecialInput(t))}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.minSpecialChanged())})),s.qZA(),s._uU(43,"\n        "),s.qZA(),s._uU(44,"\n      "),s.qZA(),s._uU(45,"\n      "),s.TgZ(46,"label",28),s._uU(47),s.ALo(48,"i18n"),s.qZA(),s._uU(49,"\n      "),s.TgZ(50,"div",29),s._uU(51,"\n        "),s.TgZ(52,"div",30),s._uU(53,"\n          "),s.TgZ(54,"input",44),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.uppercase=t)})),s.ALo(55,"i18n"),s.qZA(),s._uU(56,"\n          "),s.TgZ(57,"label",45),s._uU(58,"A-Z"),s.qZA(),s._uU(59,"\n        "),s.qZA(),s._uU(60,"\n        "),s.TgZ(61,"div",30),s._uU(62,"\n          "),s.TgZ(63,"input",46),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.lowercase=t)})),s.ALo(64,"i18n"),s.qZA(),s._uU(65,"\n          "),s.TgZ(66,"label",47),s._uU(67,"a-z"),s.qZA(),s._uU(68,"\n        "),s.qZA(),s._uU(69,"\n        "),s.TgZ(70,"div",30),s._uU(71,"\n          "),s.TgZ(72,"input",48),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.setPasswordOptionsNumber(t))})),s.ALo(73,"i18n"),s.qZA(),s._uU(74,"\n          "),s.TgZ(75,"label",49),s._uU(76,"0-9"),s.qZA(),s._uU(77,"\n        "),s.qZA(),s._uU(78,"\n        "),s.TgZ(79,"div",30),s._uU(80,"\n          "),s.TgZ(81,"input",50),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.setPasswordOptionsSpecial(t))})),s.ALo(82,"i18n"),s.qZA(),s._uU(83,"\n          "),s.TgZ(84,"label",51),s._uU(85,"!@#$%^&*"),s.qZA(),s._uU(86,"\n        "),s.qZA(),s._uU(87,"\n        "),s.TgZ(88,"div",30),s._uU(89,"\n          "),s.TgZ(90,"input",52),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.avoidAmbiguous=t)})),s.qZA(),s._uU(91,"\n          "),s.TgZ(92,"label",53),s._uU(93),s.ALo(94,"i18n"),s.qZA(),s._uU(95,"\n        "),s.qZA(),s._uU(96,"\n      "),s.qZA(),s._uU(97,"\n    "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,26,"length")),s.xp6(3),s.Q6J("min",e.passwordOptions.minLength)("ngModel",e.passwordOptions.length),s.xp6(6),s.Oqu(s.lcZ(17,28,"passwordMinLength")),s.xp6(3),s.Q6J("value",e.passwordOptions.length),s.xp6(2),s.uIk("aria-label",s.lcZ(22,30,"passwordMinLength")),s.xp6(2),s.hij("\n            ",s.lcZ(24,32,e.passwordOptionsMinLengthForReader$),"\n          "),s.xp6(7),s.Oqu(s.lcZ(31,34,"minNumbers")),s.xp6(3),s.Q6J("ngModel",e.passwordOptions.minNumber),s.xp6(6),s.Oqu(s.lcZ(40,36,"minSpecial")),s.xp6(3),s.Q6J("ngModel",e.passwordOptions.minSpecial),s.xp6(5),s.Oqu(s.lcZ(48,38,"options")),s.xp6(7),s.Q6J("ngModel",e.passwordOptions.uppercase)("disabled",null==e.enforcedPasswordPolicyOptions?null:e.enforcedPasswordPolicyOptions.useUppercase),s.uIk("aria-label",s.lcZ(55,40,"uppercase")),s.xp6(9),s.Q6J("ngModel",e.passwordOptions.lowercase)("disabled",null==e.enforcedPasswordPolicyOptions?null:e.enforcedPasswordPolicyOptions.useLowercase),s.uIk("aria-label",s.lcZ(64,42,"lowercase")),s.xp6(9),s.Q6J("ngModel",e.passwordOptions.number)("disabled",null==e.enforcedPasswordPolicyOptions?null:e.enforcedPasswordPolicyOptions.useNumbers),s.uIk("aria-label",s.lcZ(73,44,"numbers")),s.xp6(9),s.Q6J("ngModel",e.passwordOptions.special)("disabled",null==e.enforcedPasswordPolicyOptions?null:e.enforcedPasswordPolicyOptions.useSpecial),s.uIk("aria-label",s.lcZ(82,46,"specialCharacters")),s.xp6(9),s.Q6J("ngModel",e.avoidAmbiguous),s.xp6(3),s.Oqu(s.lcZ(94,48,"ambiguous"))}}function jh(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n    "),s.TgZ(2,"div",13),s._uU(3,"\n      "),s.TgZ(4,"label",14),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n      "),s.YNc(8,Bh,7,6,"div",6),s._uU(9,"\n    "),s.qZA(),s._uU(10,"\n    "),s.YNc(11,Qh,48,21,"ng-container",7),s._uU(12,"\n    "),s.YNc(13,Gh,98,50,"ng-container",7),s._uU(14,"\n    "),s.TgZ(15,"div",15),s._uU(16,"\n      "),s.TgZ(17,"div"),s._uU(18,"\n        "),s.TgZ(19,"button",16),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.regenerate())})),s._uU(20),s.ALo(21,"i18n"),s.qZA(),s._uU(22,"\n        "),s.TgZ(23,"button",17),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.copy())})),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n      "),s.qZA(),s._uU(27,"\n      "),s.TgZ(28,"div",18),s._uU(29,"\n        "),s.TgZ(30,"button",19),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.history())})),s.ALo(31,"i18n"),s._uU(32,"\n          "),s._UZ(33,"i",20),s._uU(34,"\n        "),s.qZA(),s._uU(35,"\n      "),s.qZA(),s._uU(36,"\n    "),s.qZA(),s._uU(37,"\n  "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(5),s.Oqu(s.lcZ(6,7,"passwordType")),s.xp6(3),s.Q6J("ngForOf",e.passTypeOptions),s.xp6(3),s.Q6J("ngIf","passphrase"===e.passwordOptions.type),s.xp6(2),s.Q6J("ngIf","password"===e.passwordOptions.type),s.xp6(7),s.hij("\n          ",s.lcZ(21,9,"regeneratePassword"),"\n        "),s.xp6(4),s.hij("\n          ",s.lcZ(25,11,"copyPassword"),"\n        "),s.xp6(6),s.s9C("appA11yTitle",s.lcZ(31,13,"passwordHistory"))}}function Vh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",30),s._uU(1,"\n        "),s.TgZ(2,"input",64),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.usernameOptions.type=t)}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(3,"\n        "),s.TgZ(4,"label",12),s._uU(5),s.TgZ(6,"div",65),s._uU(7),s.qZA(),s._uU(8,"\n        "),s.qZA(),s._uU(9,"\n      "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw(2);s.xp6(2),s.MGl("id","usernameType_",e.value,""),s.Q6J("ngModel",i.usernameOptions.type)("value",e.value)("checked",i.usernameOptions.type===e.value),s.xp6(2),s.MGl("for","usernameType_",e.value,""),s.xp6(1),s.hij("\n          ",e.name,"\n          "),s.xp6(2),s.Oqu(e.desc)}}function $h(e,t){if(1&e&&(s.TgZ(0,"option",69),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n            ",e.name,"\n          ")}}function Hh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",23),s._uU(1,"\n          "),s.TgZ(2,"label",73),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"input",74),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(4);return s.KtG(i.usernameOptions.forwardedSimpleLoginBaseUrl=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(7,"\n        "),s.qZA()}if(2&e){const e=s.oxw(4);s.xp6(3),s.Oqu(s.lcZ(4,2,"baseUrl")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedSimpleLoginBaseUrl)}}function Wh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",22),s._uU(1,"\n        "),s.TgZ(2,"div",23),s._uU(3,"\n          "),s.TgZ(4,"label",70),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n          "),s.TgZ(8,"input",71),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedSimpleLoginApiKey=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n        "),s.qZA(),s._uU(10,"\n        "),s.YNc(11,Hh,8,4,"div",72),s._uU(12,"\n      "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,3,"apiKey")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedSimpleLoginApiKey),s.xp6(3),s.Q6J("ngIf",e.isSelfHosted)}}function Xh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",22),s._uU(1,"\n        "),s.TgZ(2,"div",23),s._uU(3,"\n          "),s.TgZ(4,"label",75),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n          "),s.TgZ(8,"input",76),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedDuckDuckGoToken=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n        "),s.qZA(),s._uU(10,"\n      "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,2,"apiKey")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedDuckDuckGoToken)}}function eg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",23),s._uU(1,"\n          "),s.TgZ(2,"label",81),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"input",82),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(4);return s.KtG(i.usernameOptions.forwardedAnonAddyBaseUrl=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(7,"\n        "),s.qZA()}if(2&e){const e=s.oxw(4);s.xp6(3),s.Oqu(s.lcZ(4,2,"baseUrl")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedAnonAddyBaseUrl)}}function tg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",22),s._uU(1,"\n        "),s.TgZ(2,"div",23),s._uU(3,"\n          "),s.TgZ(4,"label",77),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n          "),s.TgZ(8,"input",78),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedAnonAddyApiToken=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n        "),s.qZA(),s._uU(10,"\n        "),s.TgZ(11,"div",23),s._uU(12,"\n          "),s.TgZ(13,"label",79),s._uU(14),s.ALo(15,"i18n"),s.qZA(),s._uU(16,"\n          "),s.TgZ(17,"input",80),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedAnonAddyDomain=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(18,"\n        "),s.qZA(),s._uU(19,"\n        "),s.YNc(20,eg,8,4,"div",72),s._uU(21,"\n      "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,5,"apiAccessToken")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedAnonAddyApiToken),s.xp6(6),s.Oqu(s.lcZ(15,7,"aliasDomain")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedAnonAddyDomain),s.xp6(3),s.Q6J("ngIf",e.isSelfHosted)}}function ig(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",22),s._uU(1,"\n        "),s.TgZ(2,"div",23),s._uU(3,"\n          "),s.TgZ(4,"label",83),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n          "),s.TgZ(8,"input",84),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedFirefoxApiToken=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n        "),s.qZA(),s._uU(10,"\n      "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,2,"apiAccessToken")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedFirefoxApiToken)}}function ng(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",22),s._uU(1,"\n        "),s.TgZ(2,"div",23),s._uU(3,"\n          "),s.TgZ(4,"label",85),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n          "),s.TgZ(8,"input",86),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedFastmailApiToken=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n        "),s.qZA(),s._uU(10,"\n      "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,2,"apiAccessToken")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedFastmailApiToken)}}function sg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",22),s._uU(1,"\n        "),s.TgZ(2,"div",23),s._uU(3,"\n          "),s.TgZ(4,"label",87),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n          "),s.TgZ(8,"input",88),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedForwardEmailApiToken=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n        "),s.qZA(),s._uU(10,"\n        "),s.TgZ(11,"div",23),s._uU(12,"\n          "),s.TgZ(13,"label",89),s._uU(14),s.ALo(15,"i18n"),s.qZA(),s._uU(16,"\n          "),s.TgZ(17,"input",90),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedForwardEmailDomain=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(18,"\n        "),s.qZA(),s._uU(19,"\n      "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,4,"apiAccessToken")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedForwardEmailApiToken),s.xp6(6),s.Oqu(s.lcZ(15,6,"aliasDomain")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedForwardEmailDomain)}}function og(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n      "),s.TgZ(2,"div",66),s._uU(3,"\n        "),s.TgZ(4,"label",28),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n        "),s.TgZ(8,"select",67),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.usernameOptions.forwardedService=t)}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.saveUsernameOptions())})),s._uU(9,"\n          "),s.YNc(10,$h,2,2,"option",68),s._uU(11,"\n        "),s.qZA(),s._uU(12,"\n      "),s.qZA(),s._uU(13,"\n      "),s.YNc(14,Wh,13,5,"div",59),s._uU(15,"\n      "),s.YNc(16,Xh,11,4,"div",59),s._uU(17,"\n      "),s.YNc(18,tg,22,9,"div",59),s._uU(19,"\n      "),s.YNc(20,ig,11,4,"div",59),s._uU(21,"\n      "),s.YNc(22,ng,11,4,"div",59),s._uU(23,"\n      "),s.YNc(24,sg,20,8,"div",59),s._uU(25,"\n    "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(s.lcZ(6,9,"service")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedService),s.xp6(2),s.Q6J("ngForOf",e.forwardOptions),s.xp6(4),s.Q6J("ngIf","simplelogin"===e.usernameOptions.forwardedService),s.xp6(2),s.Q6J("ngIf","duckduckgo"===e.usernameOptions.forwardedService),s.xp6(2),s.Q6J("ngIf","anonaddy"===e.usernameOptions.forwardedService),s.xp6(2),s.Q6J("ngIf","firefoxrelay"===e.usernameOptions.forwardedService),s.xp6(2),s.Q6J("ngIf","fastmail"===e.usernameOptions.forwardedService),s.xp6(2),s.Q6J("ngIf","forwardemail"===e.usernameOptions.forwardedService)}}function rg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",22),s._uU(1,"\n      "),s.TgZ(2,"div",23),s._uU(3,"\n        "),s.TgZ(4,"label",91),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n        "),s.TgZ(8,"input",92),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.usernameOptions.subaddressEmail=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n      "),s.qZA(),s._uU(10,"\n    "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(s.lcZ(6,2,"emailAddress")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.subaddressEmail)}}function ag(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",22),s._uU(1,"\n      "),s.TgZ(2,"div",23),s._uU(3,"\n        "),s.TgZ(4,"label",93),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n        "),s.TgZ(8,"input",94),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.usernameOptions.catchallDomain=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n      "),s.qZA(),s._uU(10,"\n    "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(s.lcZ(6,2,"domainName")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.catchallDomain)}}function lg(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n      "),s.TgZ(2,"label",28),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n      "),s.TgZ(6,"div",22),s._uU(7,"\n        "),s.TgZ(8,"div",29),s._uU(9,"\n          "),s.TgZ(10,"div",30),s._uU(11,"\n            "),s.TgZ(12,"input",95),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.saveUsernameOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.usernameOptions.wordCapitalize=t)})),s.qZA(),s._uU(13,"\n            "),s.TgZ(14,"label",96),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n          "),s.qZA(),s._uU(18,"\n          "),s.TgZ(19,"div",30),s._uU(20,"\n            "),s.TgZ(21,"input",97),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.saveUsernameOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.usernameOptions.wordIncludeNumber=t)})),s.qZA(),s._uU(22,"\n            "),s.TgZ(23,"label",98),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n          "),s.qZA(),s._uU(27,"\n        "),s.qZA(),s._uU(28,"\n      "),s.qZA(),s._uU(29,"\n    "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,5,"options")),s.xp6(9),s.Q6J("ngModel",e.usernameOptions.wordCapitalize),s.xp6(3),s.Oqu(s.lcZ(16,7,"capitalize")),s.xp6(6),s.Q6J("ngModel",e.usernameOptions.wordIncludeNumber),s.xp6(3),s.Oqu(s.lcZ(25,9,"includeNumber"))}}function cg(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n    "),s.TgZ(2,"div",54),s._uU(3,"\n      "),s.TgZ(4,"div",28),s._uU(5,"\n        "),s.TgZ(6,"label",55),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n        "),s.TgZ(10,"a",56),s.ALo(11,"i18n"),s._uU(12,"\n          "),s._UZ(13,"i",57),s._uU(14,"\n        "),s.qZA(),s._uU(15,"\n      "),s.qZA(),s._uU(16,"\n      "),s.YNc(17,Vh,10,7,"div",58),s._uU(18,"\n    "),s.qZA(),s._uU(19,"\n    "),s.YNc(20,og,26,11,"ng-container",7),s._uU(21,"\n    "),s.YNc(22,rg,11,4,"div",59),s._uU(23,"\n    "),s.YNc(24,ag,11,4,"div",59),s._uU(25,"\n    "),s.YNc(26,lg,30,11,"ng-container",7),s._uU(27,"\n    "),s.TgZ(28,"div",60,61),s._uU(30,"\n      "),s.TgZ(31,"button",62),s.NdJ("click",(function(){s.CHM(e);const t=s.MAs(29),i=s.oxw();return s.KtG(!t.loading&&i.regenerate())})),s._uU(32,"\n        "),s._UZ(33,"i",63),s.ALo(34,"i18n"),s._uU(35,"\n        "),s.TgZ(36,"span"),s._uU(37),s.ALo(38,"i18n"),s.qZA(),s._uU(39,"\n      "),s.qZA(),s._uU(40,"\n      "),s.TgZ(41,"button",17),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.copy())})),s._uU(42),s.ALo(43,"i18n"),s.qZA(),s._uU(44,"\n    "),s.qZA(),s._uU(45,"\n  "),s.BQk()}if(2&e){const e=s.MAs(29),t=s.oxw();s.xp6(7),s.Oqu(s.lcZ(8,12,"usernameType")),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(11,14,"learnMore")),s.xp6(7),s.Q6J("ngForOf",t.usernameTypeOptions),s.xp6(3),s.Q6J("ngIf","forwarded"===t.usernameOptions.type),s.xp6(2),s.Q6J("ngIf","subaddress"===t.usernameOptions.type),s.xp6(2),s.Q6J("ngIf","catchall"===t.usernameOptions.type),s.xp6(2),s.Q6J("ngIf","word"===t.usernameOptions.type),s.xp6(2),s.Q6J("appApiAction",t.usernameGeneratingPromise),s.xp6(3),s.uIk("aria-disabled",e.loading?"true":null),s.xp6(2),s.s9C("title",s.lcZ(34,16,"loading")),s.xp6(4),s.Oqu(s.lcZ(38,18,"regenerateUsername")),s.xp6(5),s.hij("\n        ",s.lcZ(43,20,"copyUsername"),"\n      ")}}function ug(e,t){}class dg extends Ih{constructor(e,t,i,n,s,o,r,a){super(e,t,n,i,s,o,r,window),this.dialogService=a,n.isSelfHost()&&(this.forwardOptions=this.forwardOptions.filter((e=>e.validForSelfHosted)))}get isSelfHosted(){return this.platformUtilsService.isSelfHost()}history(){return zh(this,void 0,void 0,(function*(){this.dialogService.open(Jh)}))}lengthChanged(){document.getElementById("length").focus()}minNumberChanged(){document.getElementById("min-number").focus()}minSpecialChanged(){document.getElementById("min-special").focus()}}dg.ɵfac=function(e){return new(e||dg)(s.Y36(A.UW),s.Y36(Ph.vo),s.Y36(J.b),s.Y36(N.P),s.Y36(M.D),s.Y36(_e.$),s.Y36(p.gz),s.Y36(I.x))},dg.ɵcmp=s.Xpm({type:dg,selectors:[["app-generator"]],features:[s.qOj],decls:31,vars:9,consts:[["type","info",4,"ngIf"],[1,"card","card-generated","bg-light","my-4"],[1,"card-body"],[3,"password","appCopyText"],["role","radiogroup","aria-labelledby","typeHeading",1,"form-group"],["id","typeHeading",1,"d-block"],["class","form-check form-check-inline",4,"ngFor","ngForOf"],[4,"ngIf"],["historyTemplate",""],["type","info"],[1,"form-check","form-check-inline"],["type","radio","name","Type",1,"form-check-input",3,"ngModel","id","value","checked","ngModelChange","change"],[1,"form-check-label",3,"for"],["aria-labelledby","passwordTypeHeading","role","radiogroup",1,"form-group"],["id","passwordTypeHeading",1,"d-block"],[1,"d-flex"],["type","button",1,"btn","btn-primary",3,"click"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"ml-auto"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-clock","bwi-lg"],["type","radio","name","PasswordType",1,"form-check-input",3,"ngModel","id","value","checked","ngModelChange","change"],[1,"row"],[1,"form-group","col-4"],["for","num-words"],["id","num-words","type","number","min","3","max","20",1,"form-control",3,"ngModel","ngModelChange","blur"],["for","word-separator"],["id","word-separator","type","text","maxlength","1",1,"form-control",3,"ngModel","ngModelChange","blur"],[1,"d-block"],[1,"form-group"],[1,"form-check"],["id","capitalize","type","checkbox",1,"form-check-input",3,"ngModel","disabled","change","ngModelChange"],["for","capitalize",1,"form-check-label"],["id","include-number","type","checkbox",1,"form-check-input",3,"ngModel","disabled","change","ngModelChange"],["for","include-number",1,"form-check-label"],["for","length"],["id","length","type","number","max","128",1,"form-control",3,"min","ngModel","ngModelChange","blur","change"],["for","min-length"],["id","min-length","type","text","readonly","true",1,"form-control",3,"value"],["role","status","aria-live","polite",1,"sr-only"],["for","min-number"],["id","min-number","type","number","min","0","max","9",1,"form-control",3,"ngModel","ngModelChange","input","change"],["for","min-special"],["id","min-special","type","number","min","0","max","9",1,"form-control",3,"ngModel","ngModelChange","input","change"],["id","uppercase","type","checkbox",1,"form-check-input",3,"ngModel","disabled","change","ngModelChange"],["for","uppercase",1,"form-check-label"],["id","lowercase","type","checkbox",1,"form-check-input",3,"ngModel","disabled","change","ngModelChange"],["for","lowercase",1,"form-check-label"],["id","numbers","type","checkbox",1,"form-check-input",3,"ngModel","disabled","change","ngModelChange"],["for","numbers",1,"form-check-label"],["id","special","type","checkbox",1,"form-check-input",3,"ngModel","disabled","ngModelChange"],["for","special",1,"form-check-label"],["id","ambiguous","type","checkbox",1,"form-check-input",3,"ngModel","change","ngModelChange"],["for","ambiguous",1,"form-check-label"],["aria-labelledby","usernameTypeHeading","role","radiogroup",1,"form-group"],["id","usernameTypeHeading"],["href","https://bitwarden.com/help/generator/#username-types","target","_blank","rel","noreferrer",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["class","form-check",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],[3,"appApiAction"],["form",""],["type","button",1,"btn","btn-submit","btn-primary",3,"click"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","radio","name","UsernameType",1,"form-check-input",3,"ngModel","id","value","checked","ngModelChange","change"],[1,"small","text-muted"],["role","listbox",1,"form-group"],["id","ForwardTypeDropdown","name","ForwardType",1,"form-control","w-auto",3,"ngModel","ngModelChange","change"],["role","option",3,"ngValue",4,"ngFor","ngForOf"],["role","option",3,"ngValue"],["for","simplelogin-apikey"],["id","simplelogin-apikey","type","password",1,"form-control",3,"ngModel","ngModelChange","blur"],["class","form-group col-4",4,"ngIf"],["for","simplelogin-baseUrl"],["id","simplelogin-baseUrl","type","text","name","SimpleLoginDomain",1,"form-control",3,"ngModel","ngModelChange","blur"],["for","duckduckgo-apikey"],["id","duckduckgo-apikey","type","password","name","DuckDuckGoApiKey",1,"form-control",3,"ngModel","ngModelChange","blur"],["for","anonaddy-apikey"],["id","anonaddy-apikey","type","password",1,"form-control",3,"ngModel","ngModelChange","blur"],["for","anonaddy-domain"],["id","anonaddy-domain","type","text",1,"form-control",3,"ngModel","ngModelChange","blur"],["for","anonaddy-baseUrl"],["id","anonaddy-baseUrl","type","text","name","AnonAddyDomain",1,"form-control",3,"ngModel","ngModelChange","blur"],["for","firefox-apikey"],["id","firefox-apikey","type","password",1,"form-control",3,"ngModel","ngModelChange","blur"],["for","fastmail-apiToken"],["id","fastmail-apiToken","type","password",1,"form-control",3,"ngModel","ngModelChange","blur"],["for","forwardemail-apikey"],["id","forwardemail-apikey","type","password",1,"form-control",3,"ngModel","ngModelChange","blur"],["for","forwardemail-domain"],["id","forwardemail-domain","type","text",1,"form-control",3,"ngModel","ngModelChange","blur"],["for","subaddress-email"],["id","subaddress-email","type","text",1,"form-control",3,"ngModel","ngModelChange","blur"],["for","catchall-domain"],["id","catchall-domain","type","text",1,"form-control",3,"ngModel","ngModelChange","blur"],["id","capitalizeUsername","type","checkbox",3,"ngModel","change","ngModelChange"],["for","capitalizeUsername",1,"form-check-label"],["id","includeNumberUsername","type","checkbox",3,"ngModel","change","ngModelChange"],["for","includeNumberUsername",1,"form-check-label"]],template:function(e,t){1&e&&(s._UZ(0,"app-header"),s._uU(1,"\n\n"),s.TgZ(2,"bit-container"),s._uU(3,"\n  "),s.YNc(4,Yh,3,3,"app-callout",0),s._uU(5,"\n  "),s.TgZ(6,"div",1),s._uU(7,"\n    "),s.TgZ(8,"div",2),s._uU(9,"\n      "),s._UZ(10,"bit-color-password",3),s._uU(11,"\n    "),s.qZA(),s._uU(12,"\n  "),s.qZA(),s._uU(13,"\n  "),s.TgZ(14,"div",4),s._uU(15,"\n    "),s.TgZ(16,"label",5),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n    "),s.YNc(20,Kh,7,6,"div",6),s._uU(21,"\n  "),s.qZA(),s._uU(22,"\n  "),s.YNc(23,jh,38,15,"ng-container",7),s._uU(24,"\n  "),s.YNc(25,cg,46,22,"ng-container",7),s._uU(26,"\n  "),s.YNc(27,ug,0,0,"ng-template",null,8,s.W1O),s._uU(29,"\n"),s.qZA(),s._uU(30,"\n")),2&e&&(s.xp6(4),s.Q6J("ngIf",(null==t.enforcedPasswordPolicyOptions?null:t.enforcedPasswordPolicyOptions.inEffect())&&"password"===t.type),s.xp6(6),s.Q6J("password","password"===t.type?t.password:t.username)("appCopyText","password"===t.type?t.password:t.username),s.xp6(7),s.Oqu(s.lcZ(18,7,"whatWouldYouLikeToGenerate")),s.xp6(3),s.Q6J("ngForOf",t.typeOptions),s.xp6(3),s.Q6J("ngIf","password"===t.type),s.xp6(2),s.Q6J("ngIf","username"===t.type))},dependencies:[d.sg,d.O5,l.YN,l.Kr,l.Fj,l.wV,l.Wl,l.EJ,l._,l.JJ,l.nD,l.qQ,l.Fd,l.On,ui.B,xe.b,Se.O,Lh,Da.L,si.e,oi.k,d.Ov,ee.C],encapsulation:2});var pg=i(84949),hg=i(41399),gg=i(40160),fg=i(56788),mg=i(67395);class vg{constructor(e){this.id=null,this.name=null,this.type=null,this.text=new mg.z,this.file=new fg.h,this.expirationDate=null,this.creatorIdentifier=null,e&&(this.id=e.id,this.type=e.type,this.expirationDate=e.expirationDate,this.creatorIdentifier=e.creatorIdentifier)}}var yg=i(94312),wg=i(22850),bg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ug extends gg.Z{constructor(e){if(super(),null!=e)switch(this.buildDomainModel(this,e,{id:null,name:null,expirationDate:null,creatorIdentifier:null},["id","expirationDate","creatorIdentifier"]),this.type=e.type,this.type){case hg.n.Text:this.text=new wg.y(e.text);break;case hg.n.File:this.file=new yg.f(e.file)}}decrypt(e){return bg(this,void 0,void 0,(function*(){const t=new vg(this);switch(yield this.decryptObj(t,{name:null},null,e),this.type){case hg.n.File:t.file=yield this.file.decrypt(e);break;case hg.n.Text:t.text=yield this.text.decrypt(e)}return t}))}}class _g{}var Ag=i(67381),Zg=i(98002);const xg=cs.W4`
    <svg xmlns="http://www.w3.org/2000/svg" width="130" height="130" fill="none">
        <path class="tw-fill-secondary-600" fill-rule="evenodd" d="M22.75 29.695c0-4.991 4.074-9.037 9.1-9.037h14.3v2.582h-14.3c-3.59 0-6.5 2.89-6.5 6.455v68.428h-2.6V29.696Zm75.4 76.175V68.428h2.6v37.442c0 4.991-4.074 9.038-9.1 9.038h-53.3v-2.582h53.3c3.59 0 6.5-2.891 6.5-6.456Z" clip-rule="evenodd"/>
        <path class="tw-fill-secondary-600" fill-rule="evenodd" d="M43.55 37.441c0-17.113 13.969-30.986 31.2-30.986s31.2 13.873 31.2 30.986c0 17.114-13.969 30.987-31.2 30.987s-31.2-13.873-31.2-30.986Zm31.2-33.568c-18.667 0-33.8 15.03-33.8 33.569S56.083 71.01 74.75 71.01c18.668 0 33.8-15.03 33.8-33.569S93.418 3.873 74.75 3.873Z" clip-rule="evenodd"/>
        <path class="tw-fill-secondary-600" fill-rule="evenodd" d="M73.972 65.2c0 .357.291.646.65.646 15.968 0 28.925-12.71 28.925-28.404a.648.648 0 0 0-.65-.646.648.648 0 0 0-.65.646c0 14.967-12.36 27.113-27.625 27.113a.648.648 0 0 0-.65.645ZM46.347 38.087c.36 0 .65-.289.65-.645 0-14.968 12.361-27.113 27.625-27.113.36 0 .65-.29.65-.646a.648.648 0 0 0-.65-.646c-15.968 0-28.925 12.71-28.925 28.405 0 .356.291.645.65.645Z" clip-rule="evenodd"/>
        <path class="tw-fill-secondary-600" fill-rule="evenodd" d="M123.729 81.869a1.926 1.926 0 0 1 0 2.739l-1.439 1.43a1.96 1.96 0 0 1-2.758 0L95.577 62.245a1.306 1.306 0 0 0-1.839 0 1.285 1.285 0 0 0 0 1.826l23.956 23.791a4.571 4.571 0 0 0 6.434 0l1.44-1.43a4.497 4.497 0 0 0 0-6.39l-23.956-23.791a1.306 1.306 0 0 0-1.838 0 1.285 1.285 0 0 0 0 1.825l23.955 23.792ZM34.45 36.797c0-.714.582-1.292 1.3-1.292h5.85c.718 0 1.3.578 1.3 1.291 0 .714-.582 1.292-1.3 1.292h-5.85c-.718 0-1.3-.578-1.3-1.291Zm0 10.973c0-.713.582-1.29 1.3-1.29h7.8c.718 0 1.3.578 1.3 1.29 0 .714-.582 1.292-1.3 1.292h-7.8c-.718 0-1.3-.578-1.3-1.291Zm0 10.975c0-.713.582-1.291 1.3-1.291H49.4c.718 0 1.3.578 1.3 1.29 0 .714-.582 1.292-1.3 1.292H35.75c-.718 0-1.3-.578-1.3-1.291Zm0 10.975c0-.714.582-1.292 1.3-1.292H72.8c.718 0 1.3.578 1.3 1.291s-.582 1.291-1.3 1.291H35.75c-.718 0-1.3-.578-1.3-1.29Zm0 10.973c0-.713.582-1.29 1.3-1.29h27.3c.718 0 1.3.577 1.3 1.29 0 .713-.582 1.291-1.3 1.291h-27.3c-.718 0-1.3-.578-1.3-1.29Zm6.5 10.975c0-.713.582-1.291 1.3-1.291H88.4c.718 0 1.3.578 1.3 1.291s-.582 1.291-1.3 1.291H42.25c-.718 0-1.3-.578-1.3-1.291Zm0 10.974c0-.713.582-1.291 1.3-1.291H88.4c.718 0 1.3.578 1.3 1.291s-.582 1.291-1.3 1.291H42.25c-.718 0-1.3-.578-1.3-1.291Z" clip-rule="evenodd"/>
        <path class="tw-fill-secondary-600" fill-rule="evenodd" d="M43.664 86.742c.412.292.617.794.524 1.289l-6.366 33.964a1.305 1.305 0 0 1-1.745.968l-9.692-3.707-4.914 5.689c-.355.41-.928.557-1.438.37a1.292 1.292 0 0 1-.849-1.211v-8.444c0-.305.108-.599.306-.832l14.73-17.357a1.306 1.306 0 0 1 1.831-.156c.549.46.619 1.275.156 1.82L21.784 116.13v4.485l3.225-3.733c.358-.414.94-.56 1.454-.364l9.089 3.476 5.567-29.698-32.42 18.385 6.813 3.082c.653.296.941 1.061.643 1.71a1.303 1.303 0 0 1-1.722.64l-9.122-4.128a1.289 1.289 0 0 1-.106-2.296l37.06-21.017c.44-.249.986-.222 1.399.07Z" clip-rule="evenodd"/>
    </svg>
`;var Sg=i(65901),Tg=(i(55637),function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))});class Cg{constructor(e,t,i,n,s){this.i18nService=e,this.platformUtilsService=t,this.cryptoService=i,this.fileDownloadService=n,this.sendApiService=s,this.download=()=>Tg(this,void 0,void 0,(function*(){if(null==this.send||null==this.decKey)return;const e=yield this.sendApiService.getSendFileDownloadData(this.send,this.accessRequest);if(Ci.c.isNullOrWhitespace(e.url))return void this.platformUtilsService.showToast("error",null,this.i18nService.t("missingSendFile"));const t=yield fetch(new Request(e.url,{cache:"no-store"}));if(200===t.status)try{const e=yield Sg.j.fromResponse(t),i=yield this.cryptoService.decryptFromBytes(e,this.decKey);this.fileDownloadService.download({fileName:this.send.file.fileName,blobData:i,downloadMethod:"save"})}catch(i){this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}else this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}))}}Cg.ɵfac=function(e){return new(e||Cg)(s.Y36(M.D),s.Y36(N.P),s.Y36(D.$),s.Y36(wa._),s.Y36(La.e))},Cg.ɵcmp=s.Xpm({type:Cg,selectors:[["app-send-access-file"]],inputs:{send:"send",decKey:"decKey",accessRequest:"accessRequest"},standalone:!0,features:[s.jDz],decls:9,vars:7,consts:[["bitButton","","type","button","buttonType","primary",3,"bitAction","block"],["aria-hidden","true",1,"bwi","bwi-download"]],template:function(e,t){1&e&&(s.TgZ(0,"p"),s._uU(1),s.qZA(),s._uU(2,"\n"),s.TgZ(3,"button",0),s._uU(4,"\n  "),s._UZ(5,"i",1),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n")),2&e&&(s.xp6(1),s.Oqu(t.send.file.fileName),s.xp6(2),s.Q6J("bitAction",t.download)("block",!0),s.xp6(3),s.AsE("\n  ",s.lcZ(7,5,"downloadAttachments")," (",t.send.file.sizeName,")\n"))},dependencies:[me.m,xn.Q,Te.r,ee.C],encapsulation:2});var Og=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class kg{constructor(e){this.formBuilder=e,this.destroy$=new h.x,this.formGroup=this.formBuilder.group({password:["",[l.kI.required]]}),this.setPasswordEvent=new s.vpe}ngOnInit(){return Og(this,void 0,void 0,(function*(){this.formGroup.controls.password.valueChanges.pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.setPasswordEvent.emit(e)}))}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}function Pg(e,t){1&e&&(s.TgZ(0,"bit-callout",7),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"sendHiddenByDefault")))}kg.ɵfac=function(e){return new(e||kg)(s.Y36(l.qu))},kg.ɵcmp=s.Xpm({type:kg,selectors:[["app-send-access-password"]],inputs:{loading:"loading"},outputs:{setPasswordEvent:"setPasswordEvent"},standalone:!0,features:[s.jDz],decls:34,vars:15,consts:[["bitTypography","body1"],[1,"tw-mb-3",3,"formGroup"],["bitInput","","type","password","formControlName","password","required","","appInputVerbatim","","appAutofocus",""],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],[1,"tw-flex"],["bitButton","","bitFormButton","","type","submit","buttonType","primary",3,"loading","block"],["aria-hidden","true",1,"bwi","bwi-sign-in"]],template:function(e,t){1&e&&(s.TgZ(0,"p",0),s._uU(1),s.ALo(2,"i18n"),s.qZA(),s._uU(3,"\n"),s.TgZ(4,"p",0),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n"),s.TgZ(8,"div",1),s._uU(9,"\n  "),s.TgZ(10,"bit-form-field"),s._uU(11,"\n    "),s.TgZ(12,"bit-label"),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n    "),s._UZ(16,"input",2),s._uU(17,"\n    "),s._UZ(18,"button",3),s._uU(19,"\n  "),s.qZA(),s._uU(20,"\n  "),s.TgZ(21,"div",4),s._uU(22,"\n    "),s.TgZ(23,"button",5),s._uU(24,"\n      "),s.TgZ(25,"span"),s._uU(26," "),s._UZ(27,"i",6),s._uU(28),s.ALo(29,"i18n"),s.qZA(),s._uU(30,"\n    "),s.qZA(),s._uU(31,"\n  "),s.qZA(),s._uU(32,"\n"),s.qZA(),s._uU(33,"\n")),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,7,"sendProtectedPassword")),s.xp6(4),s.Oqu(s.lcZ(6,9,"sendProtectedPasswordDontKnow")),s.xp6(3),s.Q6J("formGroup",t.formGroup),s.xp6(5),s.Oqu(s.lcZ(14,11,"password")),s.xp6(10),s.Q6J("loading",t.loading)("block",!0),s.xp6(5),s.hij(" ",s.lcZ(29,13,"continue")," "))},dependencies:[me.m,l.Fj,l.JJ,l.JL,l.Q7,l.sg,l.u,Ji.U,zi.b,Ao.b,Te.r,Oe.d,ke.G,As.w,Zs.e,Pe.u,xs.Q,On.t,ee.C],encapsulation:2});const qg=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};function Ig(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",8),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.toggleText())})),s._uU(1,"\n    "),s._UZ(2,"i",9),s._uU(3),s.ALo(4,"i18n"),s.qZA()}if(2&e){const e=s.oxw();s.Q6J("block",!0),s.xp6(2),s.Q6J("ngClass",s.WLB(5,qg,!e.showText,e.showText)),s.xp6(1),s.hij("\n    ",s.lcZ(4,3,"toggleVisibility"),"\n  ")}}class Mg{constructor(e,t,i){this.i18nService=e,this.platformUtilsService=t,this.formBuilder=i,this._send=null,this.showText=!1,this.formGroup=this.formBuilder.group({sendText:[""]})}get send(){return this._send}set send(e){this._send=e,this.showText=null==this.send.text||!this.send.text.hidden,null!=this.send&&null!=this.send.text&&this.formGroup.controls.sendText.patchValue(this.showText?this.send.text.text:this.send.text.maskedText)}copyText(){this.platformUtilsService.copyToClipboard(this.send.text.text),this.platformUtilsService.showToast("success",null,this.i18nService.t("valueCopied",this.i18nService.t("sendTypeText")))}toggleText(){this.showText=!this.showText,this.formGroup.controls.sendText.patchValue(this.showText?this.send.text.text:this.send.text.maskedText)}}Mg.ɵfac=function(e){return new(e||Mg)(s.Y36(M.D),s.Y36(N.P),s.Y36(l.qu))},Mg.ɵcmp=s.Xpm({type:Mg,selectors:[["app-send-access-text"]],inputs:{send:"send"},standalone:!0,features:[s.jDz],decls:21,vars:7,consts:[["type","info",4,"ngIf"],[3,"formGroup"],["id","text","bitInput","","rows","8","name","Text","formControlName","sendText","readonly",""],[1,"tw-mb-3"],["bitButton","","type","button","buttonType","secondary",3,"block","click",4,"ngIf"],["bitButton","","type","button","buttonType","primary",3,"block","click"],["aria-hidden","true",1,"bwi","bwi-clone"],["type","info"],["bitButton","","type","button","buttonType","secondary",3,"block","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"]],template:function(e,t){1&e&&(s.YNc(0,Pg,3,3,"bit-callout",0),s._uU(1,"\n"),s.TgZ(2,"bit-form-field",1),s._uU(3,"\n  "),s._UZ(4,"textarea",2),s._uU(5,"\n"),s.qZA(),s._uU(6,"\n"),s.TgZ(7,"div",3),s._uU(8,"\n  "),s.YNc(9,Ig,5,8,"button",4),s._uU(10,"\n"),s.qZA(),s._uU(11,"\n"),s.TgZ(12,"div",3),s._uU(13,"\n  "),s.TgZ(14,"button",5),s.NdJ("click",(function(){return t.copyText()})),s._uU(15,"\n    "),s._UZ(16,"i",6),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n"),s.qZA(),s._uU(20,"\n")),2&e&&(s.Q6J("ngIf",t.send.text.hidden),s.xp6(2),s.Q6J("formGroup",t.formGroup),s.xp6(7),s.Q6J("ngIf",t.send.text.hidden),s.xp6(5),s.Q6J("block",!0),s.xp6(3),s.hij(" ",s.lcZ(18,5,"copyValue"),"\n  "))},dependencies:[me.m,d.mk,d.O5,l.Fj,l.JJ,l.JL,l.sg,l.u,Te.r,_r.O,Oe.d,ke.G,ee.C],encapsulation:2});var Ng=i(63339),Lg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Dg(e,t){if(1&e&&(s.TgZ(0,"div",12),s._uU(1,"\n      "),s.TgZ(2,"p"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n    "),s.qZA()),2&e){const e=s.oxw();s.xp6(3),s.Oqu(s.xi3(4,1,"sendAccessCreatorIdentifier",e.creatorIdentifier))}}function Eg(e,t){1&e&&(s.TgZ(0,"bit-callout",13),s.ALo(1,"i18n"),s._uU(2),s.ALo(3,"i18n"),s.TgZ(4,"a",14),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,".\n    "),s.qZA()),2&e&&(s.s9C("title",s.lcZ(1,3,"warning")),s.xp6(2),s.hij("\n      ",s.lcZ(3,5,"viewSendHiddenEmailWarning"),"\n      "),s.xp6(3),s.Oqu(s.lcZ(6,7,"learnMore")))}function Fg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-send-access-password",18),s.NdJ("setPasswordEvent",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.setPassword(t))})),s.qZA()}}function Rg(e,t){if(1&e&&(s.TgZ(0,"bit-no-items",19),s._uU(1,"\n          "),s.ynx(2,20),s._uU(3),s.ALo(4,"i18n"),s.BQk(),s._uU(5,"\n        "),s.qZA()),2&e){const e=s.oxw(2);s.Q6J("icon",e.expiredSendIcon),s.xp6(3),s.Oqu(s.lcZ(4,2,"sendAccessUnavailable"))}}function Jg(e,t){if(1&e&&(s.TgZ(0,"bit-no-items",19),s._uU(1,"\n          "),s.ynx(2,20),s._uU(3),s.ALo(4,"i18n"),s.BQk(),s._uU(5,"\n        "),s.qZA()),2&e){const e=s.oxw(2);s.Q6J("icon",e.expiredSendIcon),s.xp6(3),s.Oqu(s.lcZ(4,2,"unexpectedErrorSend"))}}function zg(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n            "),s._UZ(2,"app-send-access-text",23),s._uU(3,"\n          "),s.BQk()),2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("send",e.send)}}function Yg(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n            "),s._UZ(2,"app-send-access-file",24),s._uU(3,"\n          "),s.BQk()),2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("send",e.send)("decKey",e.decKey)("accessRequest",e.accessRequest)}}function Kg(e,t){if(1&e&&(s.TgZ(0,"p",25),s._uU(1),s.ALo(2,"date"),s.qZA()),2&e){const e=s.oxw(3);s.xp6(1),s.hij("\n            Expires: ",s.xi3(2,1,e.expirationDate,"medium"),"\n          ")}}function Bg(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n          "),s.TgZ(2,"p",21),s._uU(3,"\n            "),s.TgZ(4,"b"),s._uU(5),s.qZA(),s._uU(6,"\n          "),s.qZA(),s._uU(7,"\n          "),s._UZ(8,"hr"),s._uU(9,"\n          "),s._uU(10,"\n          "),s.YNc(11,zg,4,1,"ng-container",17),s._uU(12,"\n          "),s._uU(13,"\n          "),s.YNc(14,Yg,4,3,"ng-container",17),s._uU(15,"\n          "),s.YNc(16,Kg,3,4,"p",22),s._uU(17,"\n        "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(e.send.name),s.xp6(6),s.Q6J("ngIf",e.send.type===e.sendType.Text),s.xp6(3),s.Q6J("ngIf",e.send.type===e.sendType.File),s.xp6(2),s.Q6J("ngIf",e.expirationDate)}}function Qg(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n        "),s.YNc(2,Fg,1,0,"app-send-access-password",15),s._uU(3,"\n        "),s.YNc(4,Rg,6,4,"bit-no-items",16),s._uU(5,"\n        "),s.YNc(6,Jg,6,4,"bit-no-items",16),s._uU(7,"\n        "),s.YNc(8,Bg,18,4,"div",17),s._uU(9,"\n      "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.passwordRequired&&!e.error),s.xp6(2),s.Q6J("ngIf",e.unavailable),s.xp6(2),s.Q6J("ngIf",e.error),s.xp6(2),s.Q6J("ngIf",!e.passwordRequired&&e.send&&!e.error&&!e.unavailable)}}function Gg(e,t){1&e&&(s._uU(0,"\n        "),s.TgZ(1,"div",21),s._uU(2,"\n          "),s._UZ(3,"i",26),s.ALo(4,"i18n"),s._uU(5,"\n          "),s.TgZ(6,"span",27),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n        "),s.qZA(),s._uU(10,"\n      ")),2&e&&(s.xp6(3),s.s9C("title",s.lcZ(4,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(8,4,"loading")))}class jg{constructor(e,t,i,n,s,o,r){this.cryptoFunctionService=e,this.route=t,this.cryptoService=i,this.sendApiService=n,this.platformUtilsService=s,this.i18nService=o,this.formBuilder=r,this.sendType=hg.n,this.loading=!0,this.passwordRequired=!1,this.unavailable=!1,this.error=!1,this.hideEmail=!1,this.expiredSendIcon=xg,this.formGroup=this.formBuilder.group({}),this.load=()=>Lg(this,void 0,void 0,(function*(){this.unavailable=!1,this.error=!1,this.hideEmail=!1;try{const e=Ci.c.fromUrlB64ToArray(this.key);if(this.accessRequest=new _g,null!=this.password){const t=yield this.cryptoFunctionService.pbkdf2(this.password,e,"sha256",Ag.g);this.accessRequest.password=Ci.c.fromBufferToB64(t)}let t=null;this.loading?t=yield this.sendApiService.postSendAccess(this.id,this.accessRequest):(this.formPromise=this.sendApiService.postSendAccess(this.id,this.accessRequest),t=yield this.formPromise),this.passwordRequired=!1;const i=new Ug(t);this.decKey=yield this.cryptoService.makeSendKey(e),this.send=yield i.decrypt(this.decKey)}catch(e){e instanceof Kn.i?401===e.statusCode?this.passwordRequired=!0:404===e.statusCode?this.unavailable=!0:400===e.statusCode?this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e.message):this.error=!0:this.error=!0}this.loading=!1,this.hideEmail=null==this.creatorIdentifier&&!this.passwordRequired&&!this.loading&&!this.unavailable}))}get expirationDate(){return null==this.send||null==this.send.expirationDate?null:this.send.expirationDate}get creatorIdentifier(){return null==this.send||null==this.send.creatorIdentifier?null:this.send.creatorIdentifier}ngOnInit(){this.route.params.subscribe((e=>Lg(this,void 0,void 0,(function*(){this.id=e.sendId,this.key=e.key,null!=this.key&&null!=this.id&&(yield this.load())}))))}setPassword(e){this.password=e}}jg.ɵfac=function(e){return new(e||jg)(s.Y36($n.O),s.Y36(p.gz),s.Y36(D.$),s.Y36(La.e),s.Y36(N.P),s.Y36(M.D),s.Y36(l.qu))},jg.ɵcmp=s.Xpm({type:jg,selectors:[["app-send-access"]],standalone:!0,features:[s.jDz],decls:33,vars:9,consts:[[3,"formGroup","bitSubmit"],[1,"tw-mx-auto","tw-mt-5","tw-flex","tw-max-w-xl","tw-flex-col","tw-items-center","tw-justify-center","tw-p-8"],["alt","Vaultwarden",1,"logo","logo-themed"],[1,"tw-mt-5","tw-w-full"],["bitTypography","h2",1,"tw-mb-4","tw-text-center"],["class","tw-w-full tw-text-center",4,"ngIf"],["type","warning",3,"title",4,"ngIf"],[1,"tw-mt-3","tw-w-10/12","tw-rounded-md","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background","tw-p-6"],[4,"ngIf","ngIfElse"],["spinner",""],[1,"tw-mt-5","tw-w-10/12","tw-text-center","tw-text-muted"],["bitTypography","body2",1,"tw-mb-0"],[1,"tw-w-full","tw-text-center"],["type","warning",3,"title"],["bitLink","","href","https://bitwarden.com/help/receive-send/","target","_blank","rel","noreferrer"],[3,"setPasswordEvent",4,"ngIf"],["class","tw-text-main",3,"icon",4,"ngIf"],[4,"ngIf"],[3,"setPasswordEvent"],[1,"tw-text-main",3,"icon"],["slot","description"],[1,"tw-text-center"],["class","tw-text-center tw-text-muted",4,"ngIf"],[3,"send"],[3,"send","decKey","accessRequest"],[1,"tw-text-center","tw-text-muted"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s._UZ(4,"img",2),s._uU(5,"\n    "),s.TgZ(6,"div",3),s._uU(7,"\n      "),s.TgZ(8,"h2",4),s._uU(9,"View Send"),s.qZA(),s._uU(10,"\n    "),s.qZA(),s._uU(11,"\n    "),s.YNc(12,Dg,6,4,"div",5),s._uU(13,"\n    "),s.YNc(14,Eg,8,9,"bit-callout",6),s._uU(15,"\n    "),s.TgZ(16,"div",7),s._uU(17,"\n      "),s.YNc(18,Qg,10,4,"ng-container",8),s._uU(19,"\n      "),s.YNc(20,Gg,11,6,"ng-template",null,9,s.W1O),s._uU(22,"\n    "),s.qZA(),s._uU(23,"\n    "),s.TgZ(24,"div",10),s._uU(25,"\n      "),s.TgZ(26,"p",11),s._uU(27),s.ALo(28,"i18n"),s.qZA(),s._uU(29,"\n    "),s.qZA(),s._uU(30,"\n  "),s.qZA(),s._uU(31,"\n"),s.qZA(),s._uU(32,"\n")),2&e){const e=s.MAs(21);s.Q6J("formGroup",t.formGroup)("bitSubmit",t.load),s.xp6(12),s.Q6J("ngIf",null!=t.creatorIdentifier),s.xp6(2),s.Q6J("ngIf",t.hideEmail),s.xp6(4),s.Q6J("ngIf",!t.loading)("ngIfElse",e),s.xp6(9),s.hij("\n        ",s.lcZ(28,7,"sendAccessTaglineProductDesc"),"\n      ")}},dependencies:[Cg,Mg,kg,me.m,d.O5,l._Y,l.JL,l.sg,Zo.u,_r.O,Ss.r,On.t,d.uU,ee.C,Zg.t,Ng.M],encapsulation:2});var Vg=i(86742),$g=i(92649),Hg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Wg{get filteredSends(){return this._filteredSends}set filteredSends(e){this._filteredSends=e}get searchText(){return this._searchText$.value}set searchText(e){this._searchText$.next(e)}constructor(e,t,i,n,s,o,r,a,l,c){this.sendService=e,this.i18nService=t,this.platformUtilsService=i,this.environmentService=n,this.ngZone=s,this.searchService=o,this.policyService=r,this.logService=a,this.sendApiService=l,this.dialogService=c,this.disableSend=!1,this.sendType=hg.n,this.loaded=!1,this.loading=!0,this.refreshing=!1,this.expired=!1,this.type=null,this.sends=[],this.searchPending=!1,this.hasSearched=!1,this.destroy$=new h.x,this._searchText$=new Ch.X(""),this.isSearchable=!1}ngOnInit(){return Hg(this,void 0,void 0,(function*(){this.policyService.policyAppliesToActiveUser$(ce.Mi.DisableSend).pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.disableSend=e})),this._searchText$.pipe((0,dn.w)((e=>(0,gn.D)(this.searchService.isSearchable(e)))),(0,g.R)(this.destroy$)).subscribe((e=>{this.isSearchable=e}))}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}load(e=null){return Hg(this,void 0,void 0,(function*(){this.loading=!0,this.sendService.sendViews$.pipe((0,Vg.z)((e=>Hg(this,void 0,void 0,(function*(){this.sends=e,yield this.search(null)})))),(0,g.R)(this.destroy$)).subscribe(),null!=this.onSuccessfulLoad?yield this.onSuccessfulLoad():this.selectAll(),this.loading=!1,this.loaded=!0}))}reload(e=null){return Hg(this,void 0,void 0,(function*(){this.loaded=!1,this.sends=[],yield this.load(e)}))}refresh(){return Hg(this,void 0,void 0,(function*(){try{this.refreshing=!0,yield this.reload(this.filter)}finally{this.refreshing=!1}}))}applyFilter(e=null){return Hg(this,void 0,void 0,(function*(){this.filter=e,yield this.search(null)}))}search(e=null){return Hg(this,void 0,void 0,(function*(){if(this.searchPending=!1,null!=this.searchTimeout&&clearTimeout(this.searchTimeout),null==e)return this.hasSearched=this.isSearchable,this.filteredSends=this.sends.filter((e=>null==this.filter||this.filter(e))),void this.applyTextSearch();this.searchPending=!0,this.searchTimeout=setTimeout((()=>Hg(this,void 0,void 0,(function*(){this.hasSearched=this.isSearchable,this.filteredSends=this.sends.filter((e=>null==this.filter||this.filter(e))),this.applyTextSearch(),this.searchPending=!1}))),e)}))}removePassword(e){return Hg(this,void 0,void 0,(function*(){if(null!=this.actionPromise||null==e.password)return;if(!(yield this.dialogService.openSimpleDialog({title:{key:"removePassword"},content:{key:"removePasswordConfirmation"},type:"warning"})))return!1;try{this.actionPromise=this.sendApiService.removePassword(e.id),yield this.actionPromise,null!=this.onSuccessfulRemovePassword?this.onSuccessfulRemovePassword():(this.platformUtilsService.showToast("success",null,this.i18nService.t("removedPassword")),yield this.load())}catch(t){this.logService.error(t)}this.actionPromise=null}))}delete(e){return Hg(this,void 0,void 0,(function*(){if(null!=this.actionPromise)return!1;if(!(yield this.dialogService.openSimpleDialog({title:{key:"deleteSend"},content:{key:"deleteSendConfirmation"},type:"warning"})))return!1;try{this.actionPromise=this.sendApiService.delete(e.id),yield this.actionPromise,null!=this.onSuccessfulDelete?this.onSuccessfulDelete():(this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedSend")),yield this.refresh())}catch(t){this.logService.error(t)}return this.actionPromise=null,!0}))}copy(e){return Hg(this,void 0,void 0,(function*(){const t=(yield(0,f.z)(this.environmentService.environment$)).getSendUrl()+e.accessId+"/"+e.urlB64Key;this.platformUtilsService.copyToClipboard(t),this.platformUtilsService.showToast("success",null,this.i18nService.t("valueCopied",this.i18nService.t("sendLink")))}))}searchTextChanged(){this.search(200)}selectAll(){this.clearSelections(),this.selectedAll=!0,this.applyFilter(null)}selectType(e){this.clearSelections(),this.selectedType=e,this.applyFilter((t=>t.type===e))}clearSelections(){this.selectedAll=!1,this.selectedType=null}applyTextSearch(){null!=this.searchText&&(this.filteredSends=this.searchService.searchSends(this.filteredSends,this.searchText))}}Wg.ɵfac=function(e){return new(e||Wg)(s.Y36($g.N),s.Y36(M.D),s.Y36(N.P),s.Y36($i.L),s.Y36(s.R0b),s.Y36(F.o),s.Y36(Y.d),s.Y36(_e.$),s.Y36(La.e),s.Y36(I.x))},Wg.ɵdir=s.lG2({type:Wg});var Xg,ef=i(2138),tf=i(27420),nf=i(69255),sf=i(36320),of=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.OneHour=1]="OneHour",e[e.OneDay=24]="OneDay",e[e.TwoDays=48]="TwoDays",e[e.ThreeDays=72]="ThreeDays",e[e.SevenDays=168]="SevenDays",e[e.ThirtyDays=720]="ThirtyDays",e[e.Custom=0]="Custom",e[e.Never=null]="Never"}(Xg||(Xg={}));class rf{constructor(e,t,i,n,o,r,a,c,u,d,p,g,f,m){this.i18nService=e,this.platformUtilsService=t,this.environmentService=i,this.datePipe=n,this.sendService=o,this.messagingService=r,this.policyService=a,this.logService=c,this.stateService=u,this.sendApiService=d,this.dialogService=p,this.formBuilder=g,this.billingAccountProfileStateService=f,this.accountService=m,this.onSavedSend=new s.vpe,this.onDeletedSend=new s.vpe,this.onCancelled=new s.vpe,this.deletionDatePresets=[{name:this.i18nService.t("oneHour"),value:Xg.OneHour},{name:this.i18nService.t("oneDay"),value:Xg.OneDay},{name:this.i18nService.t("days","2"),value:Xg.TwoDays},{name:this.i18nService.t("days","3"),value:Xg.ThreeDays},{name:this.i18nService.t("days","7"),value:Xg.SevenDays},{name:this.i18nService.t("days","30"),value:Xg.ThirtyDays},{name:this.i18nService.t("custom"),value:Xg.Custom}],this.expirationDatePresets=[{name:this.i18nService.t("never"),value:Xg.Never},...this.deletionDatePresets],this.copyLink=!1,this.disableSend=!1,this.disableHideEmail=!1,this.showPassword=!1,this.sendType=hg.n,this.canAccessPremium=!0,this.emailVerified=!0,this.alertShown=!1,this.showOptions=!1,this.componentName="",this.destroy$=new h.x,this.formGroup=this.formBuilder.group({name:["",l.kI.required],text:[],textHidden:[!1],fileContents:[],file:[null,l.kI.required],link:[],copyLink:!1,maxAccessCount:[],accessCount:[],password:[],notes:[],hideEmail:!1,disabled:!1,type:[],defaultExpirationDateTime:[],defaultDeletionDateTime:["",l.kI.required],selectedDeletionDatePreset:[Xg.SevenDays,l.kI.required],selectedExpirationDatePreset:[]}),this.typeOptions=[{name:e.t("sendTypeFile"),value:hg.n.File,premium:!0},{name:e.t("sendTypeText"),value:hg.n.Text,premium:!1}]}get link(){return null!=this.send&&null!=this.send.id&&null!=this.send.accessId?this.sendLinkBaseUrl+this.send.accessId+"/"+this.send.urlB64Key:null}get isSafari(){return this.platformUtilsService.isSafari()}get isDateTimeLocalSupported(){return!(this.platformUtilsService.isFirefox()||this.platformUtilsService.isSafari())}ngOnInit(){return of(this,void 0,void 0,(function*(){this.policyService.policyAppliesToActiveUser$(ce.Mi.DisableSend).pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.disableSend=e,this.disableSend&&this.formGroup.disable()})),this.policyService.getAll$(ce.Mi.SendOptions).pipe((0,y.U)((e=>null==e?void 0:e.some((e=>e.data.disableHideEmail)))),(0,g.R)(this.destroy$)).subscribe((e=>{(this.disableHideEmail=e)&&!this.formGroup.controls.hideEmail.value?this.formGroup.controls.hideEmail.disable():this.formGroup.controls.hideEmail.enable()})),this.formGroup.controls.type.valueChanges.pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.type=e,this.typeChanged()})),this.formGroup.controls.selectedDeletionDatePreset.valueChanges.pipe((0,g.R)(this.destroy$)).subscribe((e=>{e===Xg.Custom?this.formGroup.controls.defaultDeletionDateTime.enable():this.formGroup.controls.defaultDeletionDateTime.disable()})),this.formGroup.controls.hideEmail.valueChanges.pipe((0,g.R)(this.destroy$)).subscribe((e=>{!e&&this.disableHideEmail&&this.formGroup.controls.hideEmail.enabled&&this.formGroup.controls.hideEmail.disable()}));const e=yield(0,f.z)(this.environmentService.environment$);this.sendLinkBaseUrl=e.getSendUrl(),this.billingAccountProfileStateService.hasPremiumFromAnySource$.pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.canAccessPremium=e})),yield this.load()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get editMode(){return null!=this.sendId}get title(){return this.i18nService.t(this.editMode?"editSend":"createSend")}load(){return of(this,void 0,void 0,(function*(){if(this.emailVerified=yield(0,f.z)(this.accountService.activeAccount$.pipe((0,y.U)((e=>{var t;return null!==(t=null==e?void 0:e.emailVerified)&&void 0!==t&&t})))),this.type=this.canAccessPremium&&this.emailVerified?hg.n.File:hg.n.Text,null==this.send){const e=new Ch.X(this.send);if(e.subscribe({next:e=>{var t;e instanceof sf.i&&(this.send=e,e.type=null!==(t=e.type)&&void 0!==t?t:this.type,this.type=this.send.type,this.updateFormValues(),this.hasPassword=null!=this.send.password&&""!==this.send.password.trim())},error:e=>{var t;const i=null!==(t=e.message)&&void 0!==t?t:"An unknown error occurred";this.logService.error("Failed to decrypt send: "+i)}}),this.editMode)this.sendService.get$(this.sendId).pipe((0,Ki.b)((e=>e instanceof nf.v?e.decrypt():Promise.reject(new Error("Failed to load send.")))),(0,g.R)(this.destroy$)).subscribe(e);else{const t=new sf.i;t.type=this.type,t.file=new fg.h,t.text=new mg.z,t.deletionDate=new Date,t.deletionDate.setDate(t.deletionDate.getDate()+7),e.next(t)}}}))}submit(){return of(this,void 0,void 0,(function*(){if(this.formGroup.markAllAsTouched(),this.disableSend)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("sendDisabledWarning")),!1;if(this.send.name=this.formGroup.controls.name.value,this.send.text.text=this.formGroup.controls.text.value,this.send.text.hidden=this.formGroup.controls.textHidden.value,this.send.maxAccessCount=this.formGroup.controls.maxAccessCount.value,this.send.accessCount=this.formGroup.controls.accessCount.value,this.send.password=this.formGroup.controls.password.value,this.send.notes=this.formGroup.controls.notes.value,this.send.hideEmail=this.formGroup.controls.hideEmail.value,this.send.disabled=this.formGroup.controls.disabled.value,this.send.type=this.type,Ci.c.isNullOrWhitespace(this.send.name))return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nameRequired")),!1;let e=null;if(this.type===hg.n.File&&!this.editMode){const t=document.getElementById("file").files;if(null==t||0===t.length)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectFile"));if(e=t[0],t[0].size>524288e3)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("maxFileSize"))}Ci.c.isNullOrWhitespace(this.send.password)&&(this.send.password=null),this.formPromise=this.encryptSend(e).then((e=>of(this,void 0,void 0,(function*(){const t=this.sendApiService.save(e);yield t,null==this.send.id&&(this.send.id=e[0].id),null==this.send.accessId&&(this.send.accessId=e[0].accessId),this.onSavedSend.emit(this.send),this.formGroup.controls.copyLink.value&&null!=this.link?yield this.handleCopyLinkToClipboard():this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode?"editedSend":"createdSend"))}))));try{return yield this.formPromise,!0}catch(t){this.logService.error(t)}return!1}))}copyLinkToClipboard(e){return of(this,void 0,void 0,(function*(){return Promise.resolve(this.platformUtilsService.copyToClipboard(e))}))}delete(){return of(this,void 0,void 0,(function*(){if(null!=this.deletePromise)return!1;if(!(yield this.dialogService.openSimpleDialog({title:{key:"deleteSend"},content:{key:"deleteSendConfirmation"},type:"warning"})))return!1;try{return this.deletePromise=this.sendApiService.delete(this.send.id),yield this.deletePromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedSend")),yield this.load(),this.onDeletedSend.emit(this.send),!0}catch(e){this.logService.error(e)}return!1}))}typeChanged(){this.type!==hg.n.File||this.alertShown||(this.canAccessPremium?this.emailVerified||(this.alertShown=!0,this.messagingService.send("emailVerificationRequired")):(this.alertShown=!0,this.messagingService.send("premiumRequired"))),this.type===hg.n.Text||this.editMode?this.formGroup.controls.file.disable():this.formGroup.controls.file.enable()}toggleOptions(){this.showOptions=!this.showOptions}loadSend(){return(0,f.z)(this.sendService.get$(this.sendId))}encryptSend(e){return of(this,void 0,void 0,(function*(){const t=yield this.sendService.encrypt(this.send,e,this.send.password,null);try{t[0].deletionDate=null==this.formattedDeletionDate?null:new Date(this.formattedDeletionDate)}catch(i){t[0].deletionDate=null}try{t[0].expirationDate=null==this.formattedExpirationDate?null:new Date(this.formattedExpirationDate)}catch(n){t[0].expirationDate=null}return t}))}togglePasswordVisible(){this.showPassword=!this.showPassword,document.getElementById("password").focus()}updateFormValues(){var e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v,y;this.formGroup.patchValue({name:null!==(t=null===(e=this.send)||void 0===e?void 0:e.name)&&void 0!==t?t:"",text:null!==(s=null===(n=null===(i=this.send)||void 0===i?void 0:i.text)||void 0===n?void 0:n.text)&&void 0!==s?s:"",textHidden:null!==(a=null===(r=null===(o=this.send)||void 0===o?void 0:o.text)||void 0===r?void 0:r.hidden)&&void 0!==a&&a,link:null!==(l=this.link)&&void 0!==l?l:"",maxAccessCount:null===(c=this.send)||void 0===c?void 0:c.maxAccessCount,accessCount:null!==(d=null===(u=this.send)||void 0===u?void 0:u.accessCount)&&void 0!==d?d:0,notes:null!==(h=null===(p=this.send)||void 0===p?void 0:p.notes)&&void 0!==h?h:"",hideEmail:null!==(f=null===(g=this.send)||void 0===g?void 0:g.hideEmail)&&void 0!==f&&f,disabled:null!==(v=null===(m=this.send)||void 0===m?void 0:m.disabled)&&void 0!==v&&v,type:null!==(y=this.send.type)&&void 0!==y?y:this.type,password:null,selectedDeletionDatePreset:this.editMode?Xg.Custom:Xg.SevenDays,selectedExpirationDatePreset:this.editMode?Xg.Custom:Xg.Never,defaultExpirationDateTime:null!=this.send.expirationDate?this.datePipe.transform(new Date(this.send.expirationDate),"yyyy-MM-ddTHH:mm"):null,defaultDeletionDateTime:this.datePipe.transform(new Date(this.send.deletionDate),"yyyy-MM-ddTHH:mm")}),this.send.hideEmail&&this.formGroup.controls.hideEmail.enable()}handleCopyLinkToClipboard(){return of(this,void 0,void 0,(function*(){const e=yield this.copyLinkToClipboard(this.link);null==e||e?this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode?"editedSend":"createdSend")):(yield this.dialogService.openSimpleDialog({title:"",content:{key:this.editMode?"editedSend":"createdSend"},acceptButtonText:{key:"ok"},cancelButtonText:null,type:"success"}),yield this.copyLinkToClipboard(this.link))}))}clearExpiration(){this.formGroup.controls.defaultExpirationDateTime.patchValue(null)}get formattedExpirationDate(){switch(this.formGroup.controls.selectedExpirationDatePreset.value){case Xg.Never:return null;case Xg.Custom:return this.formGroup.controls.defaultExpirationDateTime.value?this.formGroup.controls.defaultExpirationDateTime.value:null;default:{const e=new Date,t=e.setTime(e.getTime()+60*this.formGroup.controls.selectedExpirationDatePreset.value*60*1e3);return new Date(t).toString()}}}get formattedDeletionDate(){switch(this.formGroup.controls.selectedDeletionDatePreset.value){case Xg.Never:return this.formGroup.controls.selectedDeletionDatePreset.patchValue(Xg.SevenDays),this.formattedDeletionDate;case Xg.Custom:return this.formGroup.controls.defaultDeletionDateTime.value;default:{const e=new Date,t=e.setTime(e.getTime()+60*this.formGroup.controls.selectedDeletionDatePreset.value*60*1e3);return new Date(t).toString()}}}}rf.ɵfac=function(e){return new(e||rf)(s.Y36(M.D),s.Y36(N.P),s.Y36($i.L),s.Y36(d.uU),s.Y36($g.N),s.Y36(fe.o),s.Y36(Y.d),s.Y36(_e.$),s.Y36(J.b),s.Y36(La.e),s.Y36(I.x),s.Y36(l.qu),s.Y36(yr.M),s.Y36(G.BR))},rf.ɵdir=s.lG2({type:rf,inputs:{sendId:"sendId",type:"type"},outputs:{onSavedSend:"onSavedSend",onDeletedSend:"onDeletedSend",onCancelled:"onCancelled"}});var af=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function lf(e,t){1&e&&(s.TgZ(0,"bit-callout"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n        ",s.lcZ(2,1,"sendDisabledWarning"),"\n      "))}function cf(e,t){1&e&&(s.TgZ(0,"bit-callout"),s._uU(1),s.ALo(2,"i18n"),s.TgZ(3,"ul",33),s._uU(4,"\n          "),s.TgZ(5,"li"),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n        "),s.qZA(),s._uU(9,"\n      "),s.qZA()),2&e&&(s.xp6(1),s.hij("\n        ",s.lcZ(2,2,"sendOptionsPolicyInEffect"),"\n        "),s.xp6(5),s.Oqu(s.lcZ(7,4,"sendDisableHideEmailInEffect")))}function uf(e,t){1&e&&s._UZ(0,"app-premium-badge",38)}function df(e,t){if(1&e&&(s.TgZ(0,"bit-radio-button",36),s._uU(1,"\n            "),s.TgZ(2,"bit-label"),s._uU(3),s.YNc(4,uf,1,0,"app-premium-badge",37),s._uU(5,"\n            "),s.qZA(),s._uU(6,"\n          "),s.qZA()),2&e){const e=t.$implicit,i=s.oxw(3);s.MGl("id","type_",e.value,""),s.Q6J("value",e.value)("disabled",!i.canAccessPremium&&e.premium),s.xp6(3),s.hij("\n              ",e.name,"\n              "),s.xp6(1),s.Q6J("ngIf",!i.canAccessPremium&&e.premium)}}function pf(e,t){if(1&e&&(s.TgZ(0,"div",21),s._uU(1,"\n        "),s.TgZ(2,"bit-radio-group",34),s._uU(3,"\n          "),s.TgZ(4,"bit-label"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n\n          "),s.YNc(8,df,7,5,"bit-radio-button",35),s._uU(9,"\n        "),s.qZA(),s._uU(10,"\n      "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(s.lcZ(6,2,"whatTypeOfSend")),s.xp6(3),s.Q6J("ngForOf",e.typeOptions)}}function hf(e,t){1&e&&(s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"bit-form-field"),s._uU(3,"\n          "),s.TgZ(4,"bit-label",39),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n          "),s._UZ(8,"textarea",40),s._uU(9,"\n          "),s.TgZ(10,"bit-hint"),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n        "),s.qZA(),s._uU(14,"\n        "),s.TgZ(15,"bit-form-control"),s._uU(16,"\n          "),s._UZ(17,"input",41),s._uU(18,"\n          "),s.TgZ(19,"bit-label"),s._uU(20),s.ALo(21,"i18n"),s.qZA(),s._uU(22,"\n        "),s.qZA(),s._uU(23,"\n      "),s.BQk()),2&e&&(s.xp6(5),s.Oqu(s.lcZ(6,3,"sendTypeText")),s.xp6(6),s.Oqu(s.lcZ(12,5,"sendTextDesc")),s.xp6(9),s.Oqu(s.lcZ(21,7,"textHiddenByDefault")))}function gf(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n            "),s.TgZ(2,"bit-label"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n            "),s.TgZ(6,"p",42),s._uU(7),s.qZA(),s._uU(8,"\n          "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,3,"file")),s.xp6(4),s.AsE("\n              ",e.send.file.fileName," (",e.send.file.sizeName,")\n            ")}}function ff(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"bit-form-field"),s._uU(1,"\n            "),s.TgZ(2,"bit-label"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n            "),s.TgZ(6,"div"),s._uU(7,"\n              "),s.TgZ(8,"button",43),s.NdJ("click",(function(){s.CHM(e);const t=s.MAs(15);return s.KtG(t.click())})),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n            "),s.TgZ(14,"input",44,45),s.NdJ("change",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setSelectedFile(t))})),s.qZA(),s._uU(16,"\n            "),s.TgZ(17,"bit-hint"),s._uU(18),s.ALo(19,"i18n"),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n          "),s.qZA()}if(2&e){const e=s.oxw(3);let t;s.xp6(3),s.Oqu(s.lcZ(4,5,"file")),s.xp6(6),s.hij("\n                ",s.lcZ(10,7,"chooseFile"),"\n              "),s.xp6(2),s.hij("\n              ",null!==(t=null==e.selectedFile?null:e.selectedFile.name)&&void 0!==t?t:s.lcZ(12,9,"noFileChosen"),"\n            "),s.xp6(7),s.AsE("",s.lcZ(19,11,"sendFileDesc")," ",s.lcZ(20,13,"maxFileSize"),"")}}function mf(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"div",21),s._uU(3,"\n          "),s.YNc(4,gf,9,5,"div",9),s._uU(5,"\n          "),s.YNc(6,ff,22,15,"bit-form-field",9),s._uU(7,"\n        "),s.qZA(),s._uU(8,"\n      "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(4),s.Q6J("ngIf",e.editMode),s.xp6(2),s.Q6J("ngIf",!e.editMode)}}function vf(e,t){1&e&&(s.TgZ(0,"bit-form-field"),s._uU(1,"\n        "),s.TgZ(2,"bit-label",46),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n        "),s._UZ(6,"input",47),s._uU(7,"\n      "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,1,"sendLinkLabel")))}function yf(e,t){if(1&e&&s._UZ(0,"bit-option",51),2&e){const e=t.$implicit;s.Q6J("value",e.value)("label",e.name)}}function wf(e,t){1&e&&(s.ynx(0),s._uU(1,"\n                "),s._UZ(2,"input",52),s._uU(3,"\n              "),s.BQk())}function bf(e,t){if(1&e&&(s.TgZ(0,"div",24),s._uU(1,"\n            "),s.TgZ(2,"bit-form-field"),s._uU(3,"\n              "),s.TgZ(4,"bit-label",48),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n              "),s.TgZ(8,"bit-select",49),s._uU(9,"\n                "),s.YNc(10,yf,1,2,"bit-option",50),s._uU(11,"\n              "),s.qZA(),s._uU(12,"\n              "),s.YNc(13,wf,4,0,"ng-container",9),s._uU(14,"\n              "),s.TgZ(15,"bit-hint"),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n            "),s.qZA(),s._uU(19,"\n          "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(s.lcZ(6,4,"deletionDate")),s.xp6(5),s.Q6J("ngForOf",e.deletionDatePresets),s.xp6(3),s.Q6J("ngIf",0===e.formGroup.controls.selectedDeletionDatePreset.value),s.xp6(3),s.Oqu(s.lcZ(17,6,"deletionDateDesc"))}}function Uf(e,t){1&e&&(s.TgZ(0,"div",24),s._uU(1,"\n            "),s.TgZ(2,"bit-form-field"),s._uU(3,"\n              "),s.TgZ(4,"bit-label",48),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n              "),s._UZ(8,"input",52),s._uU(9,"\n              "),s.TgZ(10,"bit-hint"),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n            "),s.qZA(),s._uU(14,"\n          "),s.qZA()),2&e&&(s.xp6(5),s.Oqu(s.lcZ(6,2,"deletionDate")),s.xp6(6),s.Oqu(s.lcZ(12,4,"deletionDateDesc")))}function _f(e,t){if(1&e&&s._UZ(0,"bit-option",51),2&e){const e=t.$implicit;s.Q6J("value",e.value)("label",e.name)}}function Af(e,t){1&e&&(s.ynx(0),s._uU(1,"\n                "),s._UZ(2,"input",56),s._uU(3,"\n              "),s.BQk())}function Zf(e,t){if(1&e&&(s.TgZ(0,"div",53),s._uU(1,"\n            "),s.TgZ(2,"bit-form-field"),s._uU(3,"\n              "),s.TgZ(4,"bit-label",54),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n              "),s.TgZ(8,"bit-select",55),s._uU(9,"\n                "),s.YNc(10,_f,1,2,"bit-option",50),s._uU(11,"\n              "),s.qZA(),s._uU(12,"\n              "),s.YNc(13,Af,4,0,"ng-container",9),s._uU(14,"\n              "),s.TgZ(15,"bit-hint"),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n            "),s.qZA(),s._uU(19,"\n          "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(5),s.hij("\n                ",s.lcZ(6,4,"expirationDate"),"\n              "),s.xp6(5),s.Q6J("ngForOf",e.expirationDatePresets),s.xp6(3),s.Q6J("ngIf",0===e.formGroup.controls.selectedExpirationDatePreset.value),s.xp6(3),s.Oqu(s.lcZ(17,6,"expirationDateDesc"))}}function xf(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",59),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.clearExpiration())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n                  ",s.lcZ(2,1,"clear"),"\n                "))}function Sf(e,t){if(1&e&&(s.TgZ(0,"div",53),s._uU(1,"\n            "),s.TgZ(2,"bit-form-field"),s._uU(3,"\n              "),s.TgZ(4,"bit-label",57),s._uU(5),s.ALo(6,"i18n"),s.YNc(7,xf,3,3,"button",58),s._uU(8,"\n              "),s.qZA(),s._uU(9,"\n              "),s._UZ(10,"input",56),s._uU(11,"\n              "),s.TgZ(12,"bit-hint"),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n            "),s.qZA(),s._uU(16,"\n          "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(5),s.hij("\n                ",s.lcZ(6,3,"expirationDate"),"\n\n                "),s.xp6(2),s.Q6J("ngIf",!e.disableSend),s.xp6(6),s.Oqu(s.lcZ(14,5,"expirationDateDesc"))}}function Tf(e,t){1&e&&(s.TgZ(0,"bit-form-field",53),s._uU(1,"\n            "),s.TgZ(2,"bit-label",60),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n            "),s._UZ(6,"input",61),s._uU(7,"\n          "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,1,"currentAccessCount")))}function Cf(e,t){1&e&&(s.TgZ(0,"bit-label",62),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"password")))}function Of(e,t){1&e&&(s.TgZ(0,"bit-label",62),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"newPassword")))}const kf=function(e,t){return{"bwi-angle-right":e,"bwi-angle-down":t}};function Pf(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"span",8),s._uU(1,"\n      "),s.YNc(2,lf,3,3,"bit-callout",9),s._uU(3,"\n      "),s.YNc(4,cf,10,6,"bit-callout",9),s._uU(5,"\n      "),s.TgZ(6,"bit-form-field",10),s._uU(7,"\n        "),s.TgZ(8,"bit-label",11),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n        "),s._UZ(12,"input",12),s._uU(13,"\n        "),s.TgZ(14,"bit-hint"),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n      "),s.qZA(),s._uU(18,"\n      "),s.YNc(19,pf,11,4,"div",13),s._uU(20,"\n      "),s._uU(21,"\n      "),s.YNc(22,hf,24,9,"ng-container",9),s._uU(23,"\n      "),s._uU(24,"\n      "),s.YNc(25,mf,9,2,"ng-container",9),s._uU(26,"\n      "),s.TgZ(27,"h4",14),s._uU(28),s.ALo(29,"i18n"),s.qZA(),s._uU(30,"\n\n      "),s.YNc(31,vf,8,3,"bit-form-field",9),s._uU(32,"\n\n      "),s.TgZ(33,"bit-form-control"),s._uU(34,"\n        "),s._UZ(35,"input",15),s._uU(36,"\n        "),s.TgZ(37,"bit-label"),s._uU(38),s.ALo(39,"i18n"),s.qZA(),s._uU(40,"\n      "),s.qZA(),s._uU(41,"\n      "),s.TgZ(42,"div",16),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.toggleOptions())})),s._uU(43,"\n        "),s.TgZ(44,"h4",17),s._uU(45,"\n          "),s.TgZ(46,"button",18),s._uU(47,"\n            "),s._UZ(48,"i",19),s._uU(49),s.ALo(50,"i18n"),s.qZA(),s._uU(51,"\n        "),s.qZA(),s._uU(52,"\n      "),s.qZA(),s._uU(53,"\n      "),s.TgZ(54,"div",20),s._uU(55,"\n        "),s.TgZ(56,"div",21),s._uU(57,"\n          "),s.YNc(58,bf,20,8,"div",22),s._uU(59,"\n          "),s.YNc(60,Uf,15,6,"div",22),s._uU(61,"\n          "),s.YNc(62,Zf,20,8,"div",23),s._uU(63,"\n          "),s.YNc(64,Sf,17,7,"div",23),s._uU(65,"\n        "),s.qZA(),s._uU(66,"\n        "),s.TgZ(67,"div",21),s._uU(68,"\n          "),s.TgZ(69,"bit-form-field",24),s._uU(70,"\n            "),s.TgZ(71,"bit-label",25),s._uU(72),s.ALo(73,"i18n"),s.qZA(),s._uU(74,"\n            "),s._UZ(75,"input",26),s._uU(76,"\n            "),s.TgZ(77,"bit-hint"),s._uU(78),s.ALo(79,"i18n"),s.qZA(),s._uU(80,"\n          "),s.qZA(),s._uU(81,"\n          "),s.YNc(82,Tf,8,3,"bit-form-field",23),s._uU(83,"\n        "),s.qZA(),s._uU(84,"\n        "),s.TgZ(85,"div",21),s._uU(86,"\n          "),s.TgZ(87,"bit-form-field",24),s._uU(88,"\n            "),s.YNc(89,Cf,3,3,"bit-label",27),s._uU(90,"\n            "),s.YNc(91,Of,3,3,"bit-label",27),s._uU(92,"\n\n            "),s._UZ(93,"input",28),s._uU(94,"\n            "),s._UZ(95,"button",29),s._uU(96,"\n            "),s.TgZ(97,"bit-hint"),s._uU(98),s.ALo(99,"i18n"),s.qZA(),s._uU(100,"\n          "),s.qZA(),s._uU(101,"\n        "),s.qZA(),s._uU(102,"\n        "),s.TgZ(103,"bit-form-field"),s._uU(104,"\n          "),s.TgZ(105,"bit-label"),s._uU(106),s.ALo(107,"i18n"),s.qZA(),s._uU(108,"\n          "),s._UZ(109,"textarea",30),s._uU(110,"\n          "),s.TgZ(111,"bit-hint"),s._uU(112),s.ALo(113,"i18n"),s.qZA(),s._uU(114,"\n        "),s.qZA(),s._uU(115,"\n\n        "),s.TgZ(116,"bit-form-control"),s._uU(117,"\n          "),s._UZ(118,"input",31),s._uU(119,"\n          "),s.TgZ(120,"bit-label"),s._uU(121),s.ALo(122,"i18n"),s.qZA(),s._uU(123,"\n        "),s.qZA(),s._uU(124,"\n\n        "),s.TgZ(125,"bit-form-control"),s._uU(126,"\n          "),s._UZ(127,"input",32),s._uU(128,"\n          "),s.TgZ(129,"bit-label"),s._uU(130),s.ALo(131,"i18n"),s.qZA(),s._uU(132,"\n        "),s.qZA(),s._uU(133,"\n      "),s.qZA(),s._uU(134,"\n    "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.disableSend),s.xp6(2),s.Q6J("ngIf",!e.disableSend&&e.disableHideEmail),s.xp6(5),s.Oqu(s.lcZ(10,27,"name")),s.xp6(6),s.Oqu(s.lcZ(16,29,"sendNameDesc")),s.xp6(4),s.Q6J("ngIf",!e.editMode),s.xp6(3),s.Q6J("ngIf",e.type===e.sendType.Text),s.xp6(3),s.Q6J("ngIf",e.type===e.sendType.File),s.xp6(3),s.Oqu(s.lcZ(29,31,"share")),s.xp6(3),s.Q6J("ngIf",e.link),s.xp6(7),s.Oqu(s.lcZ(39,33,"copySendLinkOnSave")),s.xp6(10),s.Q6J("ngClass",s.WLB(51,kf,!e.showOptions,e.showOptions)),s.xp6(1),s.hij("\n            ",s.lcZ(50,35,"options"),"\n          "),s.xp6(5),s.Q6J("hidden",!e.showOptions),s.xp6(4),s.Q6J("ngIf",!e.editMode),s.xp6(2),s.Q6J("ngIf",e.editMode),s.xp6(2),s.Q6J("ngIf",!e.editMode),s.xp6(2),s.Q6J("ngIf",e.editMode),s.xp6(8),s.Oqu(s.lcZ(73,37,"maxAccessCount")),s.xp6(6),s.Oqu(s.lcZ(79,39,"maxAccessCountDesc")),s.xp6(4),s.Q6J("ngIf",e.editMode),s.xp6(7),s.Q6J("ngIf",!e.hasPassword),s.xp6(2),s.Q6J("ngIf",e.hasPassword),s.xp6(7),s.Oqu(s.lcZ(99,41,"sendPasswordDesc")),s.xp6(8),s.Oqu(s.lcZ(107,43,"notes")),s.xp6(6),s.Oqu(s.lcZ(113,45,"sendNotesDesc")),s.xp6(9),s.Oqu(s.lcZ(122,47,"hideEmail")),s.xp6(9),s.Oqu(s.lcZ(131,49,"disableThisSend"))}}function qf(e,t){if(1&e&&(s._UZ(0,"button",63),s.ALo(1,"i18n")),2&e){const e=s.oxw();s.Q6J("appA11yTitle",s.lcZ(1,2,"delete"))("bitAction",e.deleteAndClose)}}class If extends rf{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f){super(e,t,i,n,s,r,a,l,o,c,u,d,p,f),this.dialogRef=h,this.componentName="app-send-add-edit",this.submitAndClose=()=>af(this,void 0,void 0,(function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;(yield this.submit())&&this.dialogRef.close()})),this.deleteAndClose=()=>af(this,void 0,void 0,(function*(){(yield this.delete())&&this.dialogRef.close()})),this.sendId=g.sendId}copyLinkToClipboard(e){const t=Object.create(null,{copyLinkToClipboard:{get:()=>super.copyLinkToClipboard}});return af(this,void 0,void 0,(function*(){return new Promise((i=>{window.setTimeout((()=>i(t.copyLinkToClipboard.call(this,e))),500)}))}))}setSelectedFile(e){const t=e.target,i=t.files.length>0?t.files[0]:null;this.selectedFile=i}}If.ɵfac=function(e){return new(e||If)(s.Y36(M.D),s.Y36(N.P),s.Y36($i.L),s.Y36(d.uU),s.Y36($g.N),s.Y36(J.b),s.Y36(fe.o),s.Y36(Y.d),s.Y36(_e.$),s.Y36(La.e),s.Y36(I.x),s.Y36(l.qu),s.Y36(yr.M),s.Y36(jo.zj),s.Y36(jo.Kt),s.Y36(G.BR))},If.ɵcmp=s.Xpm({type:If,selectors:[["app-send-add-edit"]],features:[s.qOj],decls:26,vars:18,consts:[["autocomplete","off",3,"formGroup","bitSubmit","appApiAction"],["dialogSize","large"],["bitDialogTitle",""],["bitDialogContent","",4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"appA11yTitle"],["type","button","bitButton","","buttonType","secondary","bitDialogClose","",3,"appA11yTitle"],["type","button","class","tw-ml-auto","bitIconButton","bwi-trash","buttonType","danger",3,"appA11yTitle","bitAction",4,"ngIf"],["bitDialogContent",""],[4,"ngIf"],[1,"tw-w-1/2"],["for","name"],["bitInput","","type","text","formControlName","name"],["class","tw-flex",4,"ngIf"],["bitTypography","h4",1,"tw-mt-5"],["bitCheckbox","","type","checkbox","formControlName","copyLink"],[1,"tw-mt-5","tw-flex",3,"click"],["bitTypography","h4",1,"tw-mb-0","tw-mr-2"],["type","button","bitLink","","appStopClick",""],["aria-hidden","true",1,"bwi",3,"ngClass"],["id","options",3,"hidden"],[1,"tw-flex"],["class","tw-w-1/2 tw-pr-3",4,"ngIf"],["class","tw-w-1/2 tw-pl-3",4,"ngIf"],[1,"tw-w-1/2","tw-pr-3"],["for","maxAccessCount"],["bitInput","","type","number","formControlName","maxAccessCount","min","1"],["for","password",4,"ngIf"],["bitInput","","type","password","formControlName","password","autocomplete","new-password"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],["bitInput","","formControlName","notes","rows","6"],["bitCheckbox","","type","checkbox","formControlName","hideEmail"],["bitCheckbox","","type","checkbox","formControlName","disabled"],[1,"tw-mb-0"],["formControlName","type"],["class","tw-block",3,"id","value","disabled",4,"ngFor","ngForOf"],[1,"tw-block",3,"id","value","disabled"],["class","tw-mx-1",4,"ngIf"],[1,"tw-mx-1"],["for","text"],["bitInput","","id","text","rows","6","formControlName","text"],["bitCheckbox","","type","checkbox","formControlName","textHidden"],["bitTypography","body1",1,"tw-mb-0"],["bitButton","","type","button","buttonType","secondary",3,"click"],["bitInput","","hidden","","type","file","id","file","name","file","formControlName","file",3,"change"],["fileSelector",""],["for","link"],["bitInput","","type","text","readonly","","formControlName","link"],["for","deletionDate"],["id","deletionDate","name","SelectedDeletionDatePreset","formControlName","selectedDeletionDatePreset"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label"],["bitInput","","id","deletionDateCustom","type","datetime-local","name","DeletionDate","formControlName","defaultDeletionDateTime","placeholder","MM/DD/YYYY HH:MM AM/PM"],[1,"tw-w-1/2","tw-pl-3"],["for","expirationDate"],["bitInput","","id","expirationDate","name","SelectedExpirationDatePreset","formControlName","selectedExpirationDatePreset"],["bitInput","","id","expirationDateCustom","type","datetime-local","name","ExpirationDate","formControlName","defaultExpirationDateTime","placeholder","MM/DD/YYYY HH:MM AM/PM"],["for","expirationDate",1,"tw-flex"],["type","button","bitLink","","appStopClick","","class","tw-ml-auto",3,"click",4,"ngIf"],["type","button","bitLink","","appStopClick","",1,"tw-ml-auto",3,"click"],["for","accessCount"],["bitInput","","type","text","formControlName","accessCount","readonly",""],["for","password"],["type","button","bitIconButton","bwi-trash","buttonType","danger",1,"tw-ml-auto",3,"appA11yTitle","bitAction"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0),s._uU(1,"\n  "),s.TgZ(2,"bit-dialog",1),s._uU(3,"\n    "),s.TgZ(4,"span",2),s._uU(5),s.qZA(),s._uU(6,"\n    "),s.YNc(7,Pf,135,54,"span",3),s._uU(8,"\n    "),s.ynx(9,4),s._uU(10,"\n      "),s.TgZ(11,"button",5),s.ALo(12,"i18n"),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n      "),s.TgZ(16,"button",6),s.ALo(17,"i18n"),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n\n      "),s.YNc(21,qf,2,4,"button",7),s._uU(22,"\n    "),s.BQk(),s._uU(23,"\n  "),s.qZA(),s._uU(24,"\n"),s.qZA(),s._uU(25,"\n")),2&e&&(s.Q6J("formGroup",t.formGroup)("bitSubmit",t.submitAndClose)("appApiAction",t.formPromise),s.xp6(5),s.hij("\n      ",t.title,"\n    "),s.xp6(2),s.Q6J("ngIf",t.send),s.xp6(4),s.Q6J("appA11yTitle",s.lcZ(12,10,"save")),s.xp6(2),s.hij("\n        ",s.lcZ(14,12,"save"),"\n      "),s.xp6(3),s.Q6J("appA11yTitle",s.lcZ(17,14,"cancel")),s.xp6(2),s.hij("\n        ",s.lcZ(19,16,"cancel"),"\n      "),s.xp6(3),s.Q6J("ngIf",t.editMode))},dependencies:[d.mk,d.sg,d.O5,l._Y,l.Fj,l.wV,l.Wl,l.JJ,l.JL,l.qQ,l.sg,l.u,ui.B,xe.b,wr.O,xn.Q,Ao.b,Zo.u,Te.r,_r.O,Sn.b,$o.a,Ho.f,Oe.d,ke.G,As.w,Zs.e,Tn.A,Pe.u,Cn.M,xs.Q,Ss._,tr._,ir.w,nr.H,sr.x,On.t,or.R,ee.C],encapsulation:2});const Mf=cs.W4`
  <svg xmlns="http://www.w3.org/2000/svg" width="120" height="125" fill="none">
    <path class="tw-stroke-secondary-600" stroke-width="3" d="M13.425 11.994H5.99a4.311 4.311 0 0 0-4.311 4.312v62.09a4.311 4.311 0 0 0 4.311 4.311h40.09"/>
    <path class="tw-stroke-secondary-600" stroke-width="3" d="M66.27 75.142h-49.9a3.234 3.234 0 0 1-3.233-3.234V9.818a3.234 3.234 0 0 1 3.234-3.233h35.764a3.233 3.233 0 0 1 2.293.953l14.134 14.216c.602.605.94 1.425.94 2.28v47.874a3.233 3.233 0 0 1-3.233 3.234Z"/>
    <path class="tw-stroke-secondary-600" stroke-width="2" d="M47.021 35.586c0-3.818-2.728-6.915-6.095-6.915-3.367 0-6.096 3.097-6.096 6.915"/>
    <path class="tw-stroke-secondary-600 tw-fill-secondary-100" stroke-width="2" d="M47.38 35.335H34.058a3.593 3.593 0 0 0-3.593 3.592v9.817a3.593 3.593 0 0 0 3.593 3.593H47.38a3.593 3.593 0 0 0 3.593-3.593v-9.817a3.593 3.593 0 0 0-3.593-3.592Z"/>
    <path class="tw-stroke-secondary-600" stroke-linecap="round" stroke-width="2" d="M40.72 44.34v2.618"/>
    <path class="tw-stroke-secondary-600" stroke-linecap="round" stroke-width="4" d="M40.72 42.7v-.373"/>
    <path class="tw-stroke-secondary-600 tw-fill-secondary-100" stroke-width="3" d="M89.326 64.022s1.673-.73 2.252.572c.512 1.138-.822 2.033-.822 2.033L56.757 88.133a3.886 3.886 0 0 0-1.583 2.188l-4.732 16.705a2.665 2.665 0 0 0 .059 1.611 2.596 2.596 0 0 0 1.891 1.663c.331.07.673.071 1.004.004.402-.077.78-.25 1.102-.503l10.11-7.88a3.138 3.138 0 0 1 1.92-.663 3.08 3.08 0 0 1 1.905.662l13.926 10.948a2.556 2.556 0 0 0 3.162 0 2.71 2.71 0 0 0 .727-.879l31.777-61.762c.231-.448.33-.952.284-1.455a2.606 2.606 0 0 0-1.721-2.226 2.499 2.499 0 0 0-1.457-.06l-81.18 20.418c-.465.12-.888.364-1.223.708a2.672 2.672 0 0 0-.632 2.676c.146.46.417.865.78 1.174L46.2 83.1a4.463 4.463 0 0 0 2.565 1.572 4.489 4.489 0 0 0 2.984-.413l37.578-20.237Z"/>
  </svg>
  `;var Nf=i(39617);class Lf{set default(e){this._default=(0,Nf.Ig)(e)}constructor(e){this.table=e}ngOnInit(){this._default&&!this.isActive&&this.setActive()}get ariaSort(){if(this.isActive)return"asc"===this.sort.direction?"ascending":"descending"}setActive(){if(this.table.dataSource){const e=this.isActive&&"asc"===this.direction?"desc":"asc";this.table.dataSource.sort={column:this.bitSortable,direction:e,fn:this.fn}}}get sort(){var e;return null===(e=this.table.dataSource)||void 0===e?void 0:e.sort}get isActive(){var e;return(null===(e=this.sort)||void 0===e?void 0:e.column)===this.bitSortable}get direction(){var e;return null===(e=this.sort)||void 0===e?void 0:e.direction}get icon(){return this.isActive?"asc"===this.direction?"bwi-up-solid":"bwi-down-solid":"bwi-up-down-btn"}get classList(){return["tw-group","tw-min-w-max","-tw-m-1.5","tw-font-bold","tw-border","tw-border-solid","tw-rounded","tw-transition","hover:tw-no-underline","focus:tw-outline-none","tw-bg-transparent","!tw-text-muted","tw-border-transparent","hover:tw-bg-transparent-hover","hover:tw-border-primary-700","focus-visible:before:tw-ring-primary-700","disabled:tw-opacity-60","disabled:hover:tw-border-transparent","disabled:hover:tw-bg-transparent","tw-relative","before:tw-content-['']","before:tw-block","before:tw-absolute","before:-tw-inset-[3px]","before:tw-rounded-md","before:tw-transition","before:tw-ring","before:tw-ring-transparent","focus-visible:tw-z-10"]}}Lf.ɵfac=function(e){return new(e||Lf)(s.Y36(Tr.a))},Lf.ɵcmp=s.Xpm({type:Lf,selectors:[["th","bitSortable",""]],hostVars:1,hostBindings:function(e,t){2&e&&s.uIk("aria-sort",t.ariaSort)},inputs:{bitSortable:"bitSortable",default:"default",fn:"fn"},attrs:["bitSortable",""],ngContentSelectors:["*"],decls:8,vars:3,consts:[[3,"ngClass","click"],[1,"bwi","tw-ml-2",3,"ngClass"]],template:function(e,t){1&e&&(s.F$t(),s._uU(0,"\n    "),s.TgZ(1,"button",0),s.NdJ("click",(function(){return t.setActive()})),s._uU(2,"\n      "),s.Hsn(3),s._uU(4,"\n      "),s._UZ(5,"i",1),s._uU(6,"\n    "),s.qZA(),s._uU(7,"\n  ")),2&e&&(s.xp6(1),s.Q6J("ngClass",t.classList),s.uIk("aria-pressed",t.isActive),s.xp6(4),s.Q6J("ngClass",t.icon))},dependencies:[d.mk],encapsulation:2});var Df=i(94239),Ef=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Ff=["sendAddEdit"];function Rf(e,t){1&e&&(s.ynx(0),s._uU(1,"\n        "),s._UZ(2,"i",27),s.ALo(3,"i18n"),s._uU(4,"\n        "),s.TgZ(5,"span",28),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n      "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function Jf(e,t){1&e&&(s.TgZ(0,"bit-callout",29),s.ALo(1,"i18n"),s._uU(2),s.ALo(3,"i18n"),s.qZA()),2&e&&(s.s9C("title",s.lcZ(1,2,"sendDisabled")),s.xp6(2),s.hij("\n  ",s.lcZ(3,4,"sendDisabledWarning"),"\n"))}function zf(e,t){1&e&&s._UZ(0,"i",52)}function Yf(e,t){1&e&&s._UZ(0,"i",53)}function Kf(e,t){1&e&&(s.ynx(0),s._uU(1,"\n              "),s._UZ(2,"i",54),s.ALo(3,"i18n"),s._uU(4,"\n              "),s.TgZ(5,"span",28),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n            "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"disabled")),s.xp6(4),s.Oqu(s.lcZ(7,4,"disabled")))}function Bf(e,t){1&e&&(s.ynx(0),s._uU(1,"\n              "),s._UZ(2,"i",55),s.ALo(3,"i18n"),s._uU(4,"\n              "),s.TgZ(5,"span",28),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n            "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"password")),s.xp6(4),s.Oqu(s.lcZ(7,4,"password")))}function Qf(e,t){1&e&&(s.ynx(0),s._uU(1,"\n              "),s._UZ(2,"i",56),s.ALo(3,"i18n"),s._uU(4,"\n              "),s.TgZ(5,"span",28),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n            "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"maxAccessCountReached")),s.xp6(4),s.Oqu(s.lcZ(7,4,"maxAccessCountReached")))}function Gf(e,t){1&e&&(s.ynx(0),s._uU(1,"\n              "),s._UZ(2,"i",57),s.ALo(3,"i18n"),s._uU(4,"\n              "),s.TgZ(5,"span",28),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n            "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"expired")),s.xp6(4),s.Oqu(s.lcZ(7,4,"expired")))}function jf(e,t){1&e&&(s.ynx(0),s._uU(1,"\n              "),s._UZ(2,"i",58),s.ALo(3,"i18n"),s._uU(4,"\n              "),s.TgZ(5,"span",28),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n            "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"pendingDeletion")),s.xp6(4),s.Oqu(s.lcZ(7,4,"pendingDeletion")))}function Vf(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",47),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(3);return s.KtG(i.removePassword(t))})),s._uU(1,"\n                "),s._UZ(2,"i",59),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n                ",s.lcZ(4,1,"removePassword"),"\n              "))}function $f(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr",37),s._uU(1,"\n          "),s.TgZ(2,"td",38),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.editSend(t))})),s._uU(3,"\n            "),s.TgZ(4,"span",39),s._uU(5,"\n              "),s.YNc(6,zf,1,0,"i",40),s._uU(7,"\n              "),s.YNc(8,Yf,1,0,"i",41),s._uU(9,"\n            "),s.qZA(),s._uU(10,"\n            "),s.TgZ(11,"button",42),s._uU(12),s.qZA(),s._uU(13,"\n            "),s.YNc(14,Kf,9,6,"ng-container",3),s._uU(15,"\n            "),s.YNc(16,Bf,9,6,"ng-container",3),s._uU(17,"\n            "),s.YNc(18,Qf,9,6,"ng-container",3),s._uU(19,"\n            "),s.YNc(20,Gf,9,6,"ng-container",3),s._uU(21,"\n            "),s.YNc(22,jf,9,6,"ng-container",3),s._uU(23,"\n          "),s.qZA(),s._uU(24,"\n          "),s.TgZ(25,"td",38),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.editSend(t))})),s._uU(26,"\n            "),s.TgZ(27,"small",43),s._uU(28),s.ALo(29,"date"),s.qZA(),s._uU(30,"\n          "),s.qZA(),s._uU(31,"\n          "),s.TgZ(32,"td",44),s._uU(33,"\n            "),s._UZ(34,"button",45),s.ALo(35,"i18n"),s._uU(36,"\n            "),s.TgZ(37,"bit-menu",null,46),s._uU(39,"\n              "),s.TgZ(40,"button",47),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.copy(t))})),s._uU(41,"\n                "),s._UZ(42,"i",48),s._uU(43),s.ALo(44,"i18n"),s.qZA(),s._uU(45,"\n              "),s.YNc(46,Vf,5,3,"button",49),s._uU(47,"\n              "),s.TgZ(48,"button",47),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.delete(t))})),s._uU(49,"\n                "),s.TgZ(50,"span",50),s._uU(51,"\n                  "),s._UZ(52,"i",51),s._uU(53),s.ALo(54,"i18n"),s.qZA(),s._uU(55,"\n              "),s.qZA(),s._uU(56,"\n            "),s.qZA(),s._uU(57,"\n          "),s.qZA(),s._uU(58,"\n        "),s.qZA()}if(2&e){const e=t.$implicit,i=s.MAs(38),n=s.oxw(3);s.xp6(6),s.Q6J("ngIf",e.type==n.sendType.File),s.xp6(2),s.Q6J("ngIf",e.type==n.sendType.Text),s.xp6(4),s.hij("\n              ",e.name,"\n            "),s.xp6(2),s.Q6J("ngIf",e.disabled),s.xp6(2),s.Q6J("ngIf",e.password),s.xp6(2),s.Q6J("ngIf",e.maxAccessCountReached),s.xp6(2),s.Q6J("ngIf",e.expired),s.xp6(2),s.Q6J("ngIf",e.pendingDelete),s.xp6(6),s.Oqu(s.xi3(29,14,e.deletionDate,"medium")),s.xp6(6),s.s9C("appA11yTitle",s.lcZ(35,17,"options")),s.Q6J("bitMenuTriggerFor",i),s.xp6(9),s.hij("\n                ",s.lcZ(44,19,"copySendLink"),"\n              "),s.xp6(3),s.Q6J("ngIf",e.password&&!n.disableSend),s.xp6(7),s.hij("\n                  ",s.lcZ(54,21,"delete"),"\n                ")}}function Hf(e,t){if(1&e&&(s._uU(0,"\n        "),s.YNc(1,$f,59,23,"tr",36),s.ALo(2,"async"),s._uU(3,"\n      ")),2&e){const e=t.$implicit;s.xp6(1),s.Q6J("ngForOf",s.lcZ(2,1,e))}}function Wf(e,t){if(1&e&&(s.TgZ(0,"bit-table",30),s._uU(1,"\n      "),s.ynx(2,31),s._uU(3,"\n        "),s.TgZ(4,"tr"),s._uU(5,"\n          "),s.TgZ(6,"th",32),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n          "),s.TgZ(10,"th",33),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n          "),s.TgZ(14,"th",34),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n        "),s.qZA(),s._uU(18,"\n      "),s.BQk(),s._uU(19,"\n      "),s.YNc(20,Hf,4,3,"ng-template",35),s._uU(21,"\n    "),s.qZA()),2&e){const e=s.oxw();s.Q6J("dataSource",e.dataSource),s.xp6(7),s.Oqu(s.lcZ(8,4,"name")),s.xp6(4),s.Oqu(s.lcZ(12,6,"deletionDate")),s.xp6(4),s.Oqu(s.lcZ(16,8,"options"))}}function Xf(e,t){1&e&&(s.ynx(0),s._uU(1,"\n        "),s._UZ(2,"i",27),s.ALo(3,"i18n"),s._uU(4,"\n        "),s.TgZ(5,"span",28),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n      "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function em(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"bit-no-items",61),s._uU(3,"\n          "),s.ynx(4,62),s._uU(5),s.ALo(6,"i18n"),s.BQk(),s._uU(7,"\n          "),s.ynx(8,63),s._uU(9),s.ALo(10,"i18n"),s.BQk(),s._uU(11,"\n          "),s.TgZ(12,"button",64),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.addSend())})),s._uU(13,"\n            "),s._UZ(14,"i",65),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n        "),s.qZA(),s._uU(18,"\n      "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(2),s.Q6J("icon",e.noItemIcon),s.xp6(3),s.Oqu(s.lcZ(6,4,"sendsNoItemsTitle")),s.xp6(4),s.Oqu(s.lcZ(10,6,"sendsNoItemsMessage")),s.xp6(6),s.hij("\n            ",s.lcZ(16,8,"createSend"),"\n          ")}}function tm(e,t){if(1&e&&(s.TgZ(0,"div",60),s._uU(1,"\n      "),s.YNc(2,Xf,9,6,"ng-container",3),s._uU(3,"\n      "),s.YNc(4,em,19,10,"ng-container",3),s._uU(5,"\n    "),s.qZA()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",!e.loaded),s.xp6(2),s.Q6J("ngIf",e.loaded)}}function im(e,t){}const nm=function(e){return{active:e}},sm="SendComponent";class om extends Wg{set filteredSends(e){super.filteredSends=e,this.dataSource.data=e}get filteredSends(){return super.filteredSends}constructor(e,t,i,n,s,o,r,a,l,c,u){super(e,t,i,n,s,o,r,l,c,u),this.broadcasterService=a,this.noItemIcon=Mf,this.dataSource=new ef.G}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return Ef(this,void 0,void 0,(function*(){yield e.ngOnInit.call(this),yield this.load(),this.broadcasterService.subscribe(sm,(e=>{this.ngZone.run((()=>Ef(this,void 0,void 0,(function*(){if("syncCompleted"===e.command)e.successfully&&(yield this.load())}))))}))}))}ngOnDestroy(){this.dialogService.closeAll(),this.broadcasterService.unsubscribe(sm)}addSend(){return Ef(this,void 0,void 0,(function*(){this.disableSend||(yield this.editSend(null))}))}editSend(e){return Ef(this,void 0,void 0,(function*(){const t=this.dialogService.open(If,{data:{sendId:null==e?null:e.id}});yield(0,se.n)(t.closed),yield this.load()}))}}om.ɵfac=function(e){return new(e||om)(s.Y36($g.N),s.Y36(M.D),s.Y36(N.P),s.Y36($i.L),s.Y36(s.R0b),s.Y36(F.o),s.Y36(Y.d),s.Y36(x.A),s.Y36(_e.$),s.Y36(La.e),s.Y36(I.x))},om.ɵcmp=s.Xpm({type:om,selectors:[["app-send"]],viewQuery:function(e,t){if(1&e&&s.Gf(Ff,7,s.s_b),2&e){let e;s.iGM(e=s.CRH())&&(t.sendAddEditModalRef=e.first)}},standalone:!0,features:[s.qOj,s.jDz],decls:108,vars:37,consts:[["slot","title-suffix"],[3,"appApiAction"],["actionSpinner",""],[4,"ngIf"],["type","button","bitButton","","buttonType","primary",3,"disabled","click"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-fw"],["type","warning",3,"title",4,"ngIf"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"groupings","tw-col-span-3"],[1,"card","vault-filters"],[1,"card-header","d-flex"],[1,"card-body"],[1,"tw-mb-4"],["appAutofocus","",3,"ngModel","placeholder","ngModelChange","input"],[1,"filter"],[1,"filter-options"],[1,"filter-option",3,"ngClass"],[1,"filter-buttons"],["type","button","appStopClick","",1,"filter-button",3,"click"],[1,"bwi","bwi-fw","bwi-filter"],[1,"filter-heading"],[1,"bwi","bwi-fw","bwi-file-text"],[1,"bwi","bwi-fw","bwi-file"],[1,"tw-col-span-9"],[3,"dataSource",4,"ngIf"],["class","no-items",4,"ngIf"],["sendAddEdit",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],["type","warning",3,"title"],[3,"dataSource"],["header",""],["bitCell","","bitSortable","name","default",""],["bitCell","","bitSortable","deletionDate"],["bitCell",""],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["bitCell","",1,"tw-cursor-pointer",3,"click"],["aria-hidden","true",1,"tw-mr-2"],["class","bwi bwi-fw bwi-lg bwi-file",4,"ngIf"],["class","bwi bwi-fw bwi-lg bwi-file-text",4,"ngIf"],["type","button","bitLink",""],["bitTypography","body2","appStopProp",""],["bitCell","",1,"tw-w-0","tw-text-right"],["type","button","bitIconButton","bwi-ellipsis-v",3,"bitMenuTriggerFor","appA11yTitle"],["sendOptions",""],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-clone"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],[1,"bwi","bwi-fw","bwi-lg","bwi-file"],[1,"bwi","bwi-fw","bwi-lg","bwi-file-text"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-exclamation-triangle",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-key",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-ban",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-clock",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-trash",3,"title"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-close"],[1,"no-items"],[1,"tw-text-main",3,"icon"],["slot","title"],["slot","description"],["slot","button","type","button","bitButton","","buttonType","secondary",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus"]],template:function(e,t){if(1&e&&(s.TgZ(0,"app-header"),s._uU(1,"\n  "),s.ynx(2,0),s._uU(3,"\n    "),s.TgZ(4,"small",1,2),s._uU(6,"\n      "),s.YNc(7,Rf,9,6,"ng-container",3),s._uU(8,"\n    "),s.qZA(),s._uU(9,"\n  "),s.BQk(),s._uU(10,"\n\n  "),s.TgZ(11,"button",4),s.NdJ("click",(function(){return t.addSend()})),s._uU(12,"\n    "),s._UZ(13,"i",5),s._uU(14),s.ALo(15,"i18n"),s.qZA(),s._uU(16,"\n"),s.qZA(),s._uU(17,"\n\n"),s.YNc(18,Jf,4,6,"bit-callout",6),s._uU(19,"\n"),s.TgZ(20,"div",7),s._uU(21,"\n  "),s.TgZ(22,"div",8),s._uU(23,"\n    "),s.TgZ(24,"div",9),s._uU(25,"\n      "),s.TgZ(26,"div",10),s._uU(27),s.ALo(28,"i18n"),s.qZA(),s._uU(29,"\n      "),s.TgZ(30,"div",11),s._uU(31,"\n        "),s.TgZ(32,"div",12),s._uU(33,"\n          "),s.TgZ(34,"bit-search",13),s.NdJ("ngModelChange",(function(e){return t.searchText=e}))("input",(function(){return t.searchTextChanged()})),s.ALo(35,"i18n"),s.qZA(),s._uU(36,"\n        "),s.qZA(),s._uU(37,"\n        "),s.TgZ(38,"div",14),s._uU(39,"\n          "),s.TgZ(40,"ul",15),s._uU(41,"\n            "),s.TgZ(42,"li",16),s._uU(43,"\n              "),s.TgZ(44,"span",17),s._uU(45,"\n                "),s.TgZ(46,"button",18),s.NdJ("click",(function(){return t.selectAll()})),s._uU(47,"\n                  "),s._UZ(48,"i",19),s._uU(49),s.ALo(50,"i18n"),s.qZA(),s._uU(51,"\n              "),s.qZA(),s._uU(52,"\n            "),s.qZA(),s._uU(53,"\n          "),s.qZA(),s._uU(54,"\n        "),s.qZA(),s._uU(55,"\n        "),s.TgZ(56,"div",14),s._uU(57,"\n          "),s.TgZ(58,"div",20),s._uU(59,"\n            "),s.TgZ(60,"h3"),s._uU(61),s.ALo(62,"i18n"),s.qZA(),s._uU(63,"\n          "),s.qZA(),s._uU(64,"\n          "),s.TgZ(65,"ul",15),s._uU(66,"\n            "),s.TgZ(67,"li",16),s._uU(68,"\n              "),s.TgZ(69,"span",17),s._uU(70,"\n                "),s.TgZ(71,"button",18),s.NdJ("click",(function(){return t.selectType(t.sendType.Text)})),s._uU(72,"\n                  "),s._UZ(73,"i",21),s._uU(74),s.ALo(75,"i18n"),s.qZA(),s._uU(76,"\n              "),s.qZA(),s._uU(77,"\n            "),s.qZA(),s._uU(78,"\n            "),s.TgZ(79,"li",16),s._uU(80,"\n              "),s.TgZ(81,"span",17),s._uU(82,"\n                "),s.TgZ(83,"button",18),s.NdJ("click",(function(){return t.selectType(t.sendType.File)})),s._uU(84,"\n                  "),s._UZ(85,"i",22),s._uU(86),s.ALo(87,"i18n"),s.qZA(),s._uU(88,"\n              "),s.qZA(),s._uU(89,"\n            "),s.qZA(),s._uU(90,"\n          "),s.qZA(),s._uU(91,"\n        "),s.qZA(),s._uU(92,"\n      "),s.qZA(),s._uU(93,"\n    "),s.qZA(),s._uU(94,"\n  "),s.qZA(),s._uU(95,"\n  "),s.TgZ(96,"div",23),s._uU(97,"\n    "),s._uU(98,"\n    "),s.YNc(99,Wf,22,10,"bit-table",24),s._uU(100,"\n    "),s.YNc(101,tm,6,2,"div",25),s._uU(102,"\n  "),s.qZA(),s._uU(103,"\n"),s.qZA(),s._uU(104,"\n"),s.YNc(105,im,0,0,"ng-template",null,26,s.W1O),s._uU(107,"\n")),2&e){const e=s.MAs(5);s.xp6(4),s.Q6J("appApiAction",t.actionPromise),s.xp6(3),s.Q6J("ngIf",e.loading),s.xp6(4),s.Q6J("disabled",t.disableSend),s.xp6(3),s.hij("\n    ",s.lcZ(15,17,"createSend"),"\n  "),s.xp6(4),s.Q6J("ngIf",t.disableSend),s.xp6(9),s.hij("\n        ",s.lcZ(28,19,"filters"),"\n      "),s.xp6(7),s.Q6J("ngModel",t.searchText)("placeholder",s.lcZ(35,21,"searchSends")),s.xp6(8),s.Q6J("ngClass",s.VKq(31,nm,t.selectedAll)),s.xp6(7),s.hij("",s.lcZ(50,23,"allSends"),"\n                "),s.xp6(12),s.Oqu(s.lcZ(62,25,"types")),s.xp6(6),s.Q6J("ngClass",s.VKq(33,nm,t.selectedType===t.sendType.Text)),s.xp6(7),s.hij("",s.lcZ(75,27,"sendTypeText"),"\n                "),s.xp6(5),s.Q6J("ngClass",s.VKq(35,nm,t.selectedType===t.sendType.File)),s.xp6(7),s.hij("",s.lcZ(87,29,"sendTypeFile"),"\n                "),s.xp6(13),s.Q6J("ngIf",t.filteredSends&&t.filteredSends.length),s.xp6(2),s.Q6J("ngIf",t.filteredSends&&!t.filteredSends.length)}},dependencies:[me.m,d.mk,d.sg,d.O5,l.JJ,l.On,ui.B,xe.b,Ji.U,wr.O,Ql._,Te.r,_r.O,xs.Q,Ss._,Ar.M,Zr.t,xr.e,Tr.a,Cr.Y,Or.v,Lf,Tr.f,On.t,d.Ov,d.uU,ee.C,tf.t,Df.g,Zg.t,Ng.M,ni.O,oi.k],encapsulation:2});var rm=i(40857),am=i(74690),lm=i(35504),cm=i(16857),um=i(6242);class dm{}dm.ɵfac=function(e){return new(e||dm)},dm.ɵmod=s.oAB({type:dm}),dm.ɵinj=s.cJS({imports:[me.m]});var pm=i(63391),hm=i(21151),gm=i(98913),fm=i(75028),mm=i(62212);class vm{}vm.ɵfac=function(e){return new(e||vm)},vm.ɵmod=s.oAB({type:vm}),vm.ɵinj=s.cJS({providers:[{provide:fm.n,useClass:mm.n}],imports:[gm.d,tf.t]});class ym{}var wm=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const bm=new _.vh(_.Ub,"tasks",{deserializer:e=>e});class Um{constructor(e){this.stateProvider=e,this.vaultOnboardingState=this.stateProvider.getActive(bm),this.vaultOnboardingState$=this.vaultOnboardingState.state$}setVaultOnboardingTasks(e){return wm(this,void 0,void 0,(function*(){yield this.vaultOnboardingState.update((()=>Object.assign({},e)))}))}}Um.ɵfac=function(e){return new(e||Um)(s.LFG(_.X9))},Um.ɵprov=s.Yz7({token:Um,factory:Um.ɵfac});var _m=i(62017),Am=i(5344),Zm=i(59281);const xm="hasBwInstalled",Sm="checkIfBWExtensionInstalled";var Tm=i(19244),Cm=i(51676),Om=i(85921);class km{}km.ɵfac=function(e){return new(e||km)},km.ɵmod=s.oAB({type:km}),km.ɵinj=s.cJS({imports:[Om.m,Cm.q]});const Pm=function(e){return{"tw-text-primary-700 tw-line-through tw-decoration-primary-700 tw-opacity-50":e}};function qm(e,t){if(1&e&&(s._uU(0,"\n  "),s._UZ(1,"i",5),s.TgZ(2,"span",6),s._uU(3),s._UZ(4,"i",7),s.qZA(),s._uU(5,"\n")),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngClass",e.completed?"bwi-check tw-text-success":e.icon),s.xp6(1),s.Q6J("ngClass",s.VKq(3,Pm,e.completed)),s.xp6(1),s.Oqu(e.title)}}function Im(e,t){1&e&&s.GkF(0)}function Mm(e,t){if(1&e&&(s.TgZ(0,"a",8),s._uU(1,"\n    "),s.YNc(2,Im,1,0,"ng-container",9),s._uU(3,"\n  "),s.qZA()),2&e){const e=s.oxw(),t=s.MAs(1);s.Q6J("routerLink",e.route),s.xp6(2),s.Q6J("ngTemplateOutlet",t)}}function Nm(e,t){1&e&&s.GkF(0)}function Lm(e,t){if(1&e&&(s.TgZ(0,"button",10),s._uU(1,"\n    "),s.YNc(2,Nm,1,0,"ng-container",9),s._uU(3,"\n  "),s.qZA()),2&e){const e=s.oxw(),t=s.MAs(1);s.Q6J("disabled",e.isDisabled),s.xp6(2),s.Q6J("ngTemplateOutlet",t)}}const Dm=function(e){return{"tw-opacity-50":e}};class Em{constructor(){this.completed=!1,this.icon="bwi-info-circle",this.isDisabled=!1}handleClick(e){e.stopPropagation()}}function Fm(e,t){if(1&e&&(s.TgZ(0,"div",3),s._uU(1,"\n      "),s._uU(2,"\n      "),s.TgZ(3,"div",4),s._uU(4," "),s.qZA(),s._uU(5,"\n      "),s.TgZ(6,"div",5),s._uU(7),s.qZA(),s._uU(8,"\n    "),s.qZA()),2&e){const e=s.oxw();s.xp6(7),s.Oqu(e.textContent)}}Em.ɵfac=function(e){return new(e||Em)},Em.ɵcmp=s.Xpm({type:Em,selectors:[["app-onboarding-task"]],hostAttrs:[1,"tw-max-w-max"],inputs:{completed:"completed",icon:"icon",title:"title",route:"route",isDisabled:"isDisabled"},ngContentSelectors:["*"],decls:15,vars:5,consts:[["content",""],[1,"tw-list-none"],["bitLink","",3,"routerLink",4,"ngIf"],["type","button","bitLink","",3,"disabled",4,"ngIf"],[1,"tw-ml-8","tw-mt-1","tw-text-sm",3,"ngClass","click"],[1,"bwi","bwi-fw","!tw-mr-4",3,"ngClass"],[3,"ngClass"],[1,"bwi","bwi-angle-right","tw-ml-1"],["bitLink","",3,"routerLink"],[4,"ngTemplateOutlet"],["type","button","bitLink","",3,"disabled"]],template:function(e,t){1&e&&(s.F$t(),s.YNc(0,qm,6,5,"ng-template",null,0,s.W1O),s._uU(2,"\n\n"),s.TgZ(3,"li",1),s._uU(4,"\n  "),s.YNc(5,Mm,4,2,"a",2),s._uU(6,"\n  "),s.YNc(7,Lm,4,2,"button",3),s._uU(8,"\n  "),s.TgZ(9,"div",4),s.NdJ("click",(function(e){return t.handleClick(e)})),s._uU(10,"\n    "),s.Hsn(11),s._uU(12,"\n  "),s.qZA(),s._uU(13,"\n"),s.qZA(),s._uU(14,"\n")),2&e&&(s.xp6(5),s.Q6J("ngIf",t.route),s.xp6(2),s.Q6J("ngIf",!t.route),s.xp6(2),s.Q6J("ngClass",s.VKq(3,Dm,t.completed)))},dependencies:[d.mk,d.O5,d.tP,p.rH,Ss.r,Ss._],encapsulation:2});const Rm=function(e){return{width:e}},Jm={small:["tw-h-1"],default:["tw-h-4"],large:["tw-h-6"]},zm={danger:["tw-bg-danger-600"],primary:["tw-bg-primary-600"],success:["tw-bg-success-600"],warning:["tw-bg-warning-600"]};class Ym{constructor(){this.barWidth=0,this.bgColor="primary",this.showText=!0,this.size="default"}get displayText(){return this.showText&&"small"!==this.size}get outerBarStyles(){return["tw-overflow-hidden","tw-rounded","tw-bg-secondary-100"].concat(Jm[this.size])}get innerBarStyles(){return["tw-flex","tw-justify-center","tw-items-center","tw-whitespace-nowrap","tw-text-xs","tw-font-semibold","tw-text-contrast","tw-transition-all"].concat(Jm[this.size]).concat(zm[this.bgColor])}get textContent(){return this.text||this.barWidth+"%"}}function Km(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.hij("\n        ",s.Dn7(2,1,"complete",e.amountCompleted,e.tasks.length),"\n      ")}}function Bm(e,t){1&e&&(s._uU(0,"\n  "),s._UZ(1,"i",13),s._uU(2,"\n"))}Ym.ɵfac=function(e){return new(e||Ym)},Ym.ɵcmp=s.Xpm({type:Ym,selectors:[["bit-progress"]],inputs:{barWidth:"barWidth",bgColor:"bgColor",showText:"showText",size:"size",text:"text"},decls:8,vars:7,consts:[[3,"ngClass"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",3,"ngClass","ngStyle"],["class","tw-flex tw-h-full tw-flex-wrap tw-items-center tw-overflow-hidden",4,"ngIf"],[1,"tw-flex","tw-h-full","tw-flex-wrap","tw-items-center","tw-overflow-hidden"],[1,"tw-h-full"],[1,"tw-pr-1"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.YNc(4,Fm,9,1,"div",2),s._uU(5,"\n  "),s.qZA(),s._uU(6,"\n"),s.qZA(),s._uU(7,"\n")),2&e&&(s.Q6J("ngClass",t.outerBarStyles),s.xp6(2),s.Q6J("ngClass",t.innerBarStyles)("ngStyle",s.VKq(5,Rm,t.barWidth+"%")),s.uIk("aria-valuenow",t.barWidth),s.xp6(2),s.Q6J("ngIf",t.displayText))},dependencies:[d.mk,d.O5,d.PC],encapsulation:2});class Qm{constructor(){this.dismiss=new s.vpe,this.open=!0,this.visible=!1}get amountCompleted(){return this.tasks.filter((e=>e.completed)).length}get barWidth(){return 0===this.tasks.length?0:this.amountCompleted/this.tasks.length*100}toggle(){this.open=!this.open}}Qm.ɵfac=function(e){return new(e||Qm)},Qm.ɵcmp=s.Xpm({type:Qm,selectors:[["app-onboarding"]],contentQueries:function(e,t,i){if(1&e&&s.Suo(i,Em,4),2&e){let e;s.iGM(e=s.CRH())&&(t.tasks=e)}},inputs:{title:"title"},outputs:{dismiss:"dismiss"},ngContentSelectors:["*"],decls:36,vars:9,consts:[["open","",1,"tw-rounded-sm","tw-bg-background-alt","tw-text-main",3,"toggle"],["details",""],[1,"tw-list-none","tw-p-2","tw-px-4"],[1,"tw-flex","tw-select-none","tw-items-center","tw-gap-4"],["aria-hidden","true",1,"bwi","bwi-dashboard","tw-text-3xl","tw-text-primary-600"],[1,"tw-text-lg"],[1,"tw-flex-1",3,"showText","barWidth"],[4,"ngIf","ngIfElse"],["aria-hidden","true",1,"bwi","tw-my-auto",3,"ngClass"],[1,"tw-mb-0","tw-ml-6","tw-flex","tw-flex-col","tw-gap-4"],[1,"tw-p-4","tw-pt-0"],["bitLink","","type","button",1,"tw-ml-auto","tw-block",3,"click"],["spinner",""],[1,"bwi","bwi-spinner","bwi-spin"]],template:function(e,t){if(1&e&&(s.F$t(),s.TgZ(0,"details",0,1),s.NdJ("toggle",(function(){return t.toggle()})),s._uU(2,"\n  "),s.TgZ(3,"summary",2),s._uU(4,"\n    "),s.TgZ(5,"div",3),s._uU(6,"\n      "),s._UZ(7,"i",4),s._uU(8,"\n      "),s.TgZ(9,"div",5),s._uU(10),s.qZA(),s._uU(11,"\n      "),s._UZ(12,"bit-progress",6),s._uU(13,"\n      "),s.YNc(14,Km,3,5,"span",7),s._uU(15,"\n      "),s._UZ(16,"i",8),s._uU(17,"\n    "),s.qZA(),s._uU(18,"\n  "),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"ul",9),s._uU(21,"\n    "),s.Hsn(22),s._uU(23,"\n  "),s.qZA(),s._uU(24,"\n  "),s.TgZ(25,"div",10),s._uU(26,"\n    "),s.TgZ(27,"button",11),s.NdJ("click",(function(){return t.dismiss.emit()})),s._uU(28),s.ALo(29,"i18n"),s.qZA(),s._uU(30,"\n  "),s.qZA(),s._uU(31,"\n"),s.qZA(),s._uU(32,"\n\n"),s.YNc(33,Bm,3,0,"ng-template",null,12,s.W1O),s._uU(35,"\n")),2&e){const e=s.MAs(34);s.xp6(10),s.Oqu(t.title),s.xp6(2),s.Q6J("showText",!1)("barWidth",t.barWidth),s.xp6(2),s.Q6J("ngIf",t.tasks.length>0)("ngIfElse",e),s.xp6(2),s.Q6J("ngClass",t.open?"bwi-angle-down":"bwi-angle-up"),s.xp6(12),s.hij("\n      ",s.lcZ(29,7,"dismiss"),"\n    ")}},dependencies:[d.mk,d.O5,Ss._,Ym,ee.C],encapsulation:2});var Gm=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const jm=function(){return["/tools/import"]};function Vm(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-onboarding",3),s.NdJ("dismiss",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.hideOnboarding())})),s.ALo(1,"i18n"),s._uU(2,"\n    "),s._UZ(3,"app-onboarding-task",4),s.ALo(4,"i18n"),s._uU(5,"\n\n    "),s.TgZ(6,"app-onboarding-task",5),s.ALo(7,"i18n"),s._uU(8,"\n      "),s.TgZ(9,"p",6),s._uU(10),s.ALo(11,"i18n"),s.TgZ(12,"button",7),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.emitToAddCipher())})),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n        "),s.TgZ(16,"span"),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n      "),s.qZA(),s._uU(20,"\n    "),s.qZA(),s._uU(21,"\n\n    "),s.TgZ(22,"app-onboarding-task",8),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.navigateToExtension())})),s.ALo(23,"i18n"),s._uU(24,"\n      "),s.TgZ(25,"span",6),s._uU(26),s.ALo(27,"i18n"),s.qZA(),s._uU(28,"\n    "),s.qZA(),s._uU(29,"\n  "),s.qZA()}if(2&e){const e=s.oxw().ngIf;s.Q6J("title",s.lcZ(1,13,"getStarted")),s.xp6(3),s.Q6J("title",s.lcZ(4,15,"createAnAccount"))("completed",e.createAccount)("isDisabled",!0),s.xp6(3),s.Q6J("title",s.lcZ(7,17,"importData"))("route",s.DdM(29,jm))("completed",e.importData),s.xp6(4),s.hij("\n        ",s.lcZ(11,19,"onboardingImportDataDetailsPartOne"),"\n        "),s.xp6(3),s.hij("\n          ",s.lcZ(14,21,"onboardingImportDataDetailsLink"),"\n        "),s.xp6(4),s.hij("\n          ",s.lcZ(18,23,"onboardingImportDataDetailsPartTwoNoOrgs"),"\n        "),s.xp6(5),s.Q6J("title",s.lcZ(23,25,"installBrowserExtension"))("completed",e.installExtension),s.xp6(4),s.hij("\n        ",s.lcZ(27,27,"installBrowserExtensionDetails"),"\n      ")}}function $m(e,t){if(1&e&&(s.TgZ(0,"div",1),s._uU(1,"\n  "),s.YNc(2,Vm,30,30,"app-onboarding",2),s._uU(3,"\n"),s.qZA()),2&e){const e=t.ngIf;s.xp6(2),s.Q6J("ngIf",e)}}class Hm{constructor(e,t,i,n,o){this.platformUtilsService=e,this.policyService=t,this.apiService=i,this.configService=n,this.vaultOnboardingService=o,this.onAddCipher=new s.vpe,this.destroy$=new h.x,this.onboardingReleaseDate=new Date("2024-04-02"),this.showOnboarding=!1}ngOnInit(){return Gm(this,void 0,void 0,(function*(){this.showOnboardingAccess$=yield this.configService.getFeatureFlag$(Zm.T.VaultOnboarding),this.onboardingTasks$=this.vaultOnboardingService.vaultOnboardingState$,yield this.setOnboardingTasks(),this.setInstallExtLink(),this.individualVaultPolicyCheck(),this.checkForBrowserExtension()}))}ngOnChanges(e){return Gm(this,void 0,void 0,(function*(){if(this.showOnboarding&&(null==e?void 0:e.ciphers)){const e=yield(0,f.z)(this.onboardingTasks$),t={createAccount:!0,importData:this.ciphers.length>0,installExtension:e.installExtension};yield this.vaultOnboardingService.setVaultOnboardingTasks(t)}}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}checkForBrowserExtension(){this.showOnboarding&&((0,_m.R)(window,"message").pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.getMessages(e)})),window.postMessage({command:Sm}))}getMessages(e){return Gm(this,void 0,void 0,(function*(){if(e.data.command===xm&&this.showOnboarding){const e=yield(0,f.z)(this.onboardingTasks$),t={createAccount:e.createAccount,importData:e.importData,installExtension:!0};yield this.vaultOnboardingService.setVaultOnboardingTasks(t)}}))}checkCreationDate(){return Gm(this,void 0,void 0,(function*(){const e=yield this.apiService.getProfile(),t=new Date(e.creationDate);this.isNewAccount=this.onboardingReleaseDate<t,this.isNewAccount||(yield this.hideOnboarding())}))}hideOnboarding(){return Gm(this,void 0,void 0,(function*(){yield this.saveCompletedTasks({createAccount:!0,importData:!0,installExtension:!0})}))}setOnboardingTasks(){var e;return Gm(this,void 0,void 0,(function*(){const t=yield(0,f.z)(this.onboardingTasks$);if(null==t){const t={createAccount:!0,importData:(null===(e=this.ciphers)||void 0===e?void 0:e.length)>0,installExtension:!1};yield this.saveCompletedTasks(t)}else t&&(this.showOnboarding=Object.values(t).includes(!1));this.showOnboarding&&(yield this.checkCreationDate())}))}saveCompletedTasks(e){return Gm(this,void 0,void 0,(function*(){this.showOnboarding=Object.values(e).includes(!1),yield this.vaultOnboardingService.setVaultOnboardingTasks(e)}))}individualVaultPolicyCheck(){this.policyService.policyAppliesToActiveUser$(ce.Mi.PersonalOwnership).pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.isIndividualPolicyVault=e}))}emitToAddCipher(){this.onAddCipher.emit()}setInstallExtLink(){this.platformUtilsService.isChrome()?this.extensionUrl="https://chrome.google.com/webstore/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb":this.platformUtilsService.isFirefox()?this.extensionUrl="https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager/":this.platformUtilsService.isSafari()?this.extensionUrl="https://apps.apple.com/us/app/bitwarden/id1352778147?mt=12":this.platformUtilsService.isOpera()?this.extensionUrl="https://addons.opera.com/extensions/details/bitwarden-free-password-manager/":this.platformUtilsService.isEdge()?this.extensionUrl="https://microsoftedge.microsoft.com/addons/detail/jbkfoedolllekgbhcbcoahefnbanhhlh":this.extensionUrl="https://bitwarden.com/download/#downloads-web-browser"}navigateToExtension(){window.open(this.extensionUrl,"_blank")}}Hm.ɵfac=function(e){return new(e||Hm)(s.Y36(N.P),s.Y36(Y.d),s.Y36(Ue.s),s.Y36(Q.E),s.Y36(ym))},Hm.ɵcmp=s.Xpm({type:Hm,selectors:[["app-vault-onboarding"]],inputs:{ciphers:"ciphers",orgs:"orgs"},outputs:{onAddCipher:"onAddCipher"},standalone:!0,features:[s.TTD,s.jDz],decls:4,vars:5,consts:[["class","tw-mb-6",4,"ngIf"],[1,"tw-mb-6"],[3,"title","dismiss",4,"ngIf"],[3,"title","dismiss"],[3,"title","completed","isDisabled"],["icon","bwi-save",3,"title","route","completed"],[1,"tw-pl-1"],["type","button","bitLink","",3,"click"],["icon","bwi-cli","route","[]",3,"title","completed","click"]],template:function(e,t){1&e&&(s.YNc(0,$m,4,1,"div",0),s.ALo(1,"async"),s.ALo(2,"async"),s._uU(3,"\n")),2&e&&s.Q6J("ngIf",s.lcZ(1,1,t.isNewAccount&&t.showOnboarding&&s.lcZ(2,3,t.showOnboardingAccess$)&&t.onboardingTasks$))},dependencies:[km,Qm,Em,d.ez,d.O5,d.Ov,Am.b,ee.C,Tm.L,Ss._],encapsulation:2});var Wm,Xm=i(33031),ev=i(84598),tv=i(5712),iv=i(72285),nv=i(68134),sv=i(53061),ov=i(39194),rv=i(83505),av=i(75230),lv=i(77140),cv=i(91480),uv=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function dv(e,t){if(1&e&&(s.TgZ(0,"option",10),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.id),s.xp6(1),s.Oqu(e.name)}}!function(e){e.Moved="moved",e.Canceled="canceled"}(Wm||(Wm={}));class pv{constructor(e,t,i,n,s,o,r){var a;this.dialogRef=t,this.cipherService=i,this.platformUtilsService=n,this.i18nService=s,this.folderService=o,this.formBuilder=r,this.cipherIds=[],this.formGroup=this.formBuilder.group({folderId:["",[l.kI.nullValidator]]}),this.submit=()=>uv(this,void 0,void 0,(function*(){this.formGroup.invalid||(yield this.cipherService.moveManyWithServer(this.cipherIds,this.formGroup.value.folderId),this.platformUtilsService.showToast("success",null,this.i18nService.t("movedItems")),this.close(Wm.Moved))})),this.cipherIds=null!==(a=e.cipherIds)&&void 0!==a?a:[]}ngOnInit(){return uv(this,void 0,void 0,(function*(){this.folders$=this.folderService.folderViews$,this.formGroup.patchValue({folderId:(yield(0,f.z)(this.folders$))[0].id})}))}cancel(){this.close(Wm.Canceled)}close(e){this.dialogRef.close(e)}}function hv(e){return!!e.checked}pv.ɵfac=function(e){return new(e||pv)(s.Y36(jo.Kt),s.Y36(jo.zj),s.Y36(C.u),s.Y36(N.P),s.Y36(M.D),s.Y36(S.s),s.Y36(l.qu))},pv.ɵcmp=s.Xpm({type:pv,selectors:[["ng-component"]],decls:41,vars:21,consts:[[3,"formGroup","bitSubmit"],["dialogSize","small"],["bitDialogTitle",""],["bitDialogContent",""],["for","folder"],["bitInput","","formControlName","folderId"],[3,"ngValue",4,"ngFor","ngForOf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"click"],[3,"ngValue"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0),s._uU(1,"\n  "),s.TgZ(2,"bit-dialog",1),s._uU(3,"\n    "),s.TgZ(4,"span",2),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n    "),s.TgZ(8,"span",3),s._uU(9,"\n      "),s.TgZ(10,"p"),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n      "),s.TgZ(14,"bit-form-field"),s._uU(15,"\n        "),s.TgZ(16,"bit-label",4),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n        "),s.TgZ(20,"select",5),s._uU(21,"\n          "),s.YNc(22,dv,2,2,"option",6),s.ALo(23,"async"),s._uU(24,"\n        "),s.qZA(),s._uU(25,"\n      "),s.qZA(),s._uU(26,"\n    "),s.qZA(),s._uU(27,"\n    "),s.ynx(28,7),s._uU(29,"\n      "),s.TgZ(30,"button",8),s._uU(31),s.ALo(32,"i18n"),s.qZA(),s._uU(33,"\n      "),s.TgZ(34,"button",9),s.NdJ("click",(function(){return t.cancel()})),s._uU(35),s.ALo(36,"i18n"),s.qZA(),s._uU(37,"\n    "),s.BQk(),s._uU(38,"\n  "),s.qZA(),s._uU(39,"\n"),s.qZA(),s._uU(40,"\n")),2&e&&(s.Q6J("formGroup",t.formGroup)("bitSubmit",t.submit),s.xp6(5),s.hij("\n      ",s.lcZ(6,8,"moveSelected"),"\n    "),s.xp6(6),s.Oqu(s.xi3(12,10,"moveSelectedItemsDesc",t.cipherIds.length)),s.xp6(6),s.Oqu(s.lcZ(18,13,"folder")),s.xp6(5),s.Q6J("ngForOf",s.lcZ(23,15,t.folders$)),s.xp6(9),s.hij("\n        ",s.lcZ(32,17,"save"),"\n      "),s.xp6(4),s.hij("\n        ",s.lcZ(36,19,"cancel"),"\n      "))},dependencies:[d.sg,l._Y,l.YN,l.Kr,l.EJ,l.JJ,l.JL,l.sg,l.u,Ao.b,Zo.u,Te.r,$o.a,Oe.d,ke.G,Pe.u,d.Ov,ee.C],encapsulation:2});var gv,fv=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function mv(e,t){if(1&e&&(s.TgZ(0,"option",13),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.id),s.xp6(1),s.Oqu(e.name)}}function vv(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",14),s._uU(1,"\n        "),s.TgZ(2,"button",15),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.selectAll(!0))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n        "),s.TgZ(6,"button",15),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.selectAll(!1))})),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n      "),s.qZA()}2&e&&(s.xp6(3),s.hij("\n          ",s.lcZ(4,2,"selectAll"),"\n        "),s.xp6(4),s.hij("\n          ",s.lcZ(8,4,"unselectAll"),"\n        "))}function yv(e,t){1&e&&(s.TgZ(0,"div"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n      ",s.lcZ(2,1,"noCollectionsInList"),"\n    "))}function wv(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr",18),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(2);return s.KtG(i.check(t))})),s._uU(1,"\n          "),s.TgZ(2,"td",19),s._uU(3,"\n            "),s.TgZ(4,"input",20),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.checked=t)})),s.qZA(),s._uU(5,"\n          "),s.qZA(),s._uU(6,"\n          "),s.TgZ(7,"td"),s._uU(8),s.qZA(),s._uU(9,"\n        "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index;s.xp6(4),s.MGl("name","Collection[",i,"].Checked"),s.Q2q("aria-label","Check ",e.name,""),s.Q6J("ngModel",e.checked),s.xp6(4),s.hij("\n            ",e.name,"\n          ")}}function bv(e,t){if(1&e&&(s.TgZ(0,"table",16),s._uU(1,"\n      "),s.TgZ(2,"tbody"),s._uU(3,"\n        "),s.YNc(4,wv,10,4,"tr",17),s._uU(5,"\n      "),s.qZA(),s._uU(6,"\n    "),s.qZA()),2&e){const e=s.oxw();s.xp6(4),s.Q6J("ngForOf",e.collections)}}!function(e){e.Shared="shared",e.Canceled="canceled"}(gv||(gv={}));class Uv{constructor(e,t,i,n,s,o,r,a){var l;this.dialogRef=t,this.cipherService=i,this.platformUtilsService=n,this.i18nService=s,this.collectionService=o,this.organizationService=r,this.logService=a,this.ciphers=[],this.nonShareableCount=0,this.collections=[],this.organizations=[],this.shareableCiphers=[],this.writeableCollections=[],this.submit=()=>fv(this,void 0,void 0,(function*(){var e,t;const i=this.collections.filter(hv).map((e=>e.id));try{yield this.cipherService.shareManyWithServer(this.shareableCiphers,this.organizationId,i);const n=null!==(t=null===(e=this.organizations.find((e=>e.id===this.organizationId)))||void 0===e?void 0:e.name)&&void 0!==t?t:this.i18nService.t("organization");this.platformUtilsService.showToast("success",null,this.i18nService.t("movedItemsToOrg",n)),this.close(gv.Shared)}catch(n){this.logService.error(n)}})),this.ciphers=null!==(l=e.ciphers)&&void 0!==l?l:[],this.organizationId=e.organizationId}ngOnInit(){return fv(this,void 0,void 0,(function*(){this.shareableCiphers=this.ciphers.filter((e=>!e.hasOldAttachments&&null==e.organizationId)),this.nonShareableCount=this.ciphers.length-this.shareableCiphers.length;const e=yield this.collectionService.getAllDecrypted();this.writeableCollections=e.filter((e=>!e.readOnly)),this.organizations=yield this.organizationService.getAll(),null==this.organizationId&&this.organizations.length>0&&(this.organizationId=this.organizations[0].id),this.filterCollections()}))}ngOnDestroy(){this.selectAll(!1)}filterCollections(){this.selectAll(!1),null==this.organizationId||0===this.writeableCollections.length?this.collections=[]:this.collections=this.writeableCollections.filter((e=>e.organizationId===this.organizationId))}check(e,t){e.checked=null==t?!e.checked:t}selectAll(e){(e?this.collections:this.writeableCollections).forEach((t=>this.check(t,e)))}get canSave(){if(null!=this.shareableCiphers&&this.shareableCiphers.length>0&&null!=this.collections)for(let e=0;e<this.collections.length;e++)if(this.collections[e].checked)return!0;return!1}cancel(){this.close(gv.Canceled)}close(e){this.dialogRef.close(e)}}Uv.ɵfac=function(e){return new(e||Uv)(s.Y36(jo.Kt),s.Y36(jo.zj),s.Y36(C.u),s.Y36(N.P),s.Y36(M.D),s.Y36(E.a),s.Y36(w.Mn),s.Y36(_e.$))},Uv.ɵcmp=s.Xpm({type:Uv,selectors:[["ng-component"]],decls:54,vars:30,consts:[["bitDialogTitle",""],["bitDialogContent",""],["for","organization"],["bitInput","","id","organization",3,"ngModel","ngModelChange","change"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"d-flex"],[1,"tw-mb-1","tw-block","tw-font-semibold","tw-text-main"],["class","tw-ml-auto tw-flex tw-gap-2",4,"ngIf"],[4,"ngIf"],["class","table table-hover table-list mb-0","id","collections",4,"ngIf"],["bitDialogFooter",""],["bitButton","","type","submit","buttonType","primary",3,"bitAction"],["bitButton","","type","button","buttonType","secondary",3,"click"],[3,"ngValue"],[1,"tw-ml-auto","tw-flex","tw-gap-2"],["bitLink","","type","button",1,"tw-px-2",3,"click"],["id","collections",1,"table","table-hover","table-list","mb-0"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],[1,"table-list-checkbox"],["bitInput","","type","checkbox","appStopProp","",3,"ngModel","name","ngModelChange"]],template:function(e,t){1&e&&(s.TgZ(0,"bit-dialog"),s._uU(1,"\n  "),s.TgZ(2,"span",0),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n  "),s.TgZ(6,"span",1),s._uU(7,"\n    "),s.TgZ(8,"p"),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n    "),s.TgZ(12,"p"),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n    "),s.TgZ(16,"bit-form-field"),s._uU(17,"\n      "),s.TgZ(18,"bit-label",2),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n      "),s.TgZ(22,"select",3),s.NdJ("ngModelChange",(function(e){return t.organizationId=e}))("change",(function(){return t.filterCollections()})),s._uU(23,"\n        "),s.YNc(24,mv,2,2,"option",4),s._uU(25,"\n      "),s.qZA(),s._uU(26,"\n    "),s.qZA(),s._uU(27,"\n\n    "),s.TgZ(28,"div",5),s._uU(29,"\n      "),s.TgZ(30,"label",6),s._uU(31),s.ALo(32,"i18n"),s.qZA(),s._uU(33,"\n      "),s.YNc(34,vv,10,6,"div",7),s._uU(35,"\n    "),s.qZA(),s._uU(36,"\n    "),s.YNc(37,yv,3,3,"div",8),s._uU(38,"\n    "),s.YNc(39,bv,7,1,"table",9),s._uU(40,"\n  "),s.qZA(),s._uU(41,"\n  "),s.ynx(42,10),s._uU(43,"\n    "),s.TgZ(44,"button",11),s._uU(45),s.ALo(46,"i18n"),s.qZA(),s._uU(47,"\n    "),s.TgZ(48,"button",12),s.NdJ("click",(function(){return t.cancel()})),s._uU(49),s.ALo(50,"i18n"),s.qZA(),s._uU(51,"\n  "),s.BQk(),s._uU(52,"\n"),s.qZA(),s._uU(53,"\n")),2&e&&(s.xp6(3),s.hij("\n    ",s.lcZ(4,13,"moveSelectedToOrg"),"\n  "),s.xp6(6),s.Oqu(s.lcZ(10,15,"moveManyToOrgDesc")),s.xp6(4),s.hij("\n      ",s.gM2(14,17,"moveSelectedItemsCountDesc",t.ciphers.length,t.shareableCiphers.length,t.nonShareableCount),"\n    "),s.xp6(6),s.Oqu(s.lcZ(20,22,"organization")),s.xp6(3),s.Q6J("ngModel",t.organizationId),s.xp6(2),s.Q6J("ngForOf",t.organizations),s.xp6(7),s.Oqu(s.lcZ(32,24,"collections")),s.xp6(3),s.Q6J("ngIf",t.collections&&t.collections.length),s.xp6(3),s.Q6J("ngIf",!t.collections||!t.collections.length),s.xp6(2),s.Q6J("ngIf",t.collections&&t.collections.length),s.xp6(5),s.Q6J("bitAction",t.submit),s.xp6(1),s.hij("\n      ",s.lcZ(46,26,"save"),"\n    "),s.xp6(4),s.hij("\n      ",s.lcZ(50,28,"cancel"),"\n    "))},dependencies:[d.sg,d.O5,l.YN,l.Kr,l.Wl,l.EJ,l.JJ,l.On,Ql._,xn.Q,Te.r,$o.a,Oe.d,ke.G,Pe.u,Ss._,ee.C],encapsulation:2});var _v=i(17475),Av=i(90364),Zv=i(22492),xv=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Sv{constructor(e,t,i,n,o,r,a){this.folderService=e,this.folderApiService=t,this.i18nService=i,this.platformUtilsService=n,this.logService=o,this.dialogService=r,this.formBuilder=a,this.onSavedFolder=new s.vpe,this.onDeletedFolder=new s.vpe,this.editMode=!1,this.folder=new Av.a,this.componentName="",this.formGroup=this.formBuilder.group({name:["",[l.kI.required]]})}ngOnInit(){return xv(this,void 0,void 0,(function*(){yield this.init()}))}submit(){return xv(this,void 0,void 0,(function*(){if(this.folder.name=this.formGroup.controls.name.value,null==this.folder.name||""===this.folder.name)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nameRequired")),!1;try{const e=yield this.folderService.encrypt(this.folder);return this.formPromise=this.folderApiService.save(e),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode?"editedFolder":"addedFolder")),this.onSavedFolder.emit(this.folder),!0}catch(e){this.logService.error(e)}return!1}))}delete(){return xv(this,void 0,void 0,(function*(){if(!(yield this.dialogService.openSimpleDialog({title:{key:"deleteFolder"},content:{key:"deleteFolderConfirmation"},type:"warning"})))return!1;try{this.deletePromise=this.folderApiService.delete(this.folder.id),yield this.deletePromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedFolder")),this.onDeletedFolder.emit(this.folder)}catch(e){this.logService.error(e)}return!0}))}init(){return xv(this,void 0,void 0,(function*(){if(this.editMode=null!=this.folderId,this.editMode){this.editMode=!0,this.title=this.i18nService.t("editFolder");const e=yield this.folderService.get(this.folderId);this.folder=yield e.decrypt()}else this.title=this.i18nService.t("addFolder");this.formGroup.controls.name.setValue(this.folder.name)}))}}Sv.ɵfac=function(e){return new(e||Sv)(s.Y36(S.s),s.Y36(Zv.s),s.Y36(M.D),s.Y36(N.P),s.Y36(_e.$),s.Y36(I.x),s.Y36(l.qu))},Sv.ɵdir=s.lG2({type:Sv,inputs:{folderId:"folderId"},outputs:{onSavedFolder:"onSavedFolder",onDeletedFolder:"onDeletedFolder"}});var Tv,Cv=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Ov(e,t){if(1&e&&(s._UZ(0,"button",9),s.ALo(1,"i18n")),2&e){const e=s.oxw();s.s9C("appA11yTitle",s.lcZ(1,2,"delete")),s.Q6J("bitAction",e.deleteAndClose)}}class kv extends Sv{constructor(e,t,i,n,s,o,r,a,l){super(e,t,i,n,s,o,r),this.dialogRef=a,this.componentName="app-folder-add-edit",this.deleteAndClose=()=>Cv(this,void 0,void 0,(function*(){if(yield this.dialogService.openSimpleDialog({title:{key:"deleteFolder"},content:{key:"deleteFolderConfirmation"},type:"warning"})){try{this.deletePromise=this.folderApiService.delete(this.folder.id),yield this.deletePromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedFolder")),this.onDeletedFolder.emit(this.folder)}catch(e){this.logService.error(e)}this.dialogRef.close(Tv.Deleted)}})),this.submitAndClose=()=>Cv(this,void 0,void 0,(function*(){if(this.folder.name=this.formGroup.controls.name.value,null!=this.folder.name&&""!==this.folder.name)try{const e=yield this.folderService.encrypt(this.folder);this.formPromise=this.folderApiService.save(e),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode?"editedFolder":"addedFolder")),this.onSavedFolder.emit(this.folder),this.dialogRef.close(Tv.Saved)}catch(e){this.logService.error(e)}else this.formGroup.controls.name.markAsTouched()})),(null==l?void 0:l.folderId)&&(this.folderId=l.folderId)}}function Pv(e,t){return e.open(kv,t)}kv.ɵfac=function(e){return new(e||kv)(s.Y36(S.s),s.Y36(Zv.s),s.Y36(M.D),s.Y36(N.P),s.Y36(_e.$),s.Y36(I.x),s.Y36(l.qu),s.Y36(jo.zj),s.Y36(jo.Kt))},kv.ɵcmp=s.Xpm({type:kv,selectors:[["app-folder-add-edit"]],features:[s.qOj],decls:40,vars:13,consts:[[3,"bitSubmit","formGroup"],["bitDialogTitle",""],["bitDialogContent",""],["bitInput","","id","name","formControlName","name"],["bitDialogFooter",""],["bitButton","","buttonType","primary","bitFormButton","","type","submit"],["bitButton","","buttonType","secondary","bitDialogClose","","type","button","data-dismiss","modal"],[1,"tw-m-0","tw-ml-auto"],["buttonType","danger","bitIconButton","bwi-trash","bitFormButton","","type","button",3,"appA11yTitle","bitAction",4,"ngIf"],["buttonType","danger","bitIconButton","bwi-trash","bitFormButton","","type","button",3,"appA11yTitle","bitAction"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0),s._uU(1,"\n  "),s.TgZ(2,"bit-dialog"),s._uU(3,"\n    "),s.TgZ(4,"span",1),s._uU(5),s.qZA(),s._uU(6,"\n    "),s.TgZ(7,"span",2),s._uU(8,"\n      "),s.TgZ(9,"bit-form-field"),s._uU(10,"\n        "),s.TgZ(11,"bit-label"),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n        "),s._UZ(15,"input",3),s._uU(16,"\n      "),s.qZA(),s._uU(17,"\n    "),s.qZA(),s._uU(18,"\n    "),s.ynx(19,4),s._uU(20,"\n      "),s.TgZ(21,"button",5),s._uU(22,"\n        "),s.TgZ(23,"span"),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n      "),s.qZA(),s._uU(27,"\n      "),s.TgZ(28,"button",6),s._uU(29),s.ALo(30,"i18n"),s.qZA(),s._uU(31,"\n      "),s.TgZ(32,"div",7),s._uU(33,"\n        "),s.YNc(34,Ov,2,4,"button",8),s._uU(35,"\n      "),s.qZA(),s._uU(36,"\n    "),s.BQk(),s._uU(37,"\n  "),s.qZA(),s._uU(38,"\n"),s.qZA(),s._uU(39,"\n")),2&e&&(s.Q6J("bitSubmit",t.submitAndClose)("formGroup",t.formGroup),s.xp6(5),s.hij("\n      ",t.title,"\n    "),s.xp6(7),s.Oqu(s.lcZ(13,7,"name")),s.xp6(12),s.Oqu(s.lcZ(25,9,"save")),s.xp6(5),s.hij("\n        ",s.lcZ(30,11,"cancel"),"\n      "),s.xp6(5),s.Q6J("ngIf",t.editMode))},dependencies:[d.O5,l._Y,l.Fj,l.JJ,l.JL,l.sg,l.u,ui.B,xn.Q,Ao.b,Zo.u,Te.r,$o.a,Ho.f,Oe.d,ke.G,Pe.u,xs.Q,ee.C],encapsulation:2}),function(e){e.Deleted="deleted",e.Canceled="canceled",e.Saved="saved"}(Tv||(Tv={}));var qv=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Iv{constructor(e,t,i,n,o,r){this.collectionService=e,this.platformUtilsService=t,this.i18nService=i,this.cipherService=n,this.logService=o,this.organizationService=r,this.onSharedCipher=new s.vpe,this.collections=[],this.writeableCollections=[],this._destroy=new h.x}ngOnInit(){return qv(this,void 0,void 0,(function*(){yield this.load()}))}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}load(){return qv(this,void 0,void 0,(function*(){const e=yield this.collectionService.getAllDecrypted();this.writeableCollections=e.map((e=>e)).filter((e=>!e.readOnly)),this.organizations$=this.organizationService.memberOrganizations$.pipe((0,y.U)((e=>e.filter((e=>e.enabled&&e.status===ce.Dn.Confirmed)).sort(Ci.c.getSortFunction(this.i18nService,"name"))))),this.organizations$.pipe((0,g.R)(this._destroy)).subscribe((e=>{null==this.organizationId&&e.length>0&&(this.organizationId=e[0].id,this.filterCollections())}));const t=yield this.cipherService.get(this.cipherId);this.cipher=yield t.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(t))}))}filterCollections(){this.writeableCollections.forEach((e=>e.checked=!1)),null==this.organizationId||0===this.writeableCollections.length?this.collections=[]:this.collections=this.writeableCollections.filter((e=>e.organizationId===this.organizationId))}submit(){var e,t;return qv(this,void 0,void 0,(function*(){const i=this.collections.filter(hv).map((e=>e.id));if(0===i.length)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectOneCollection"));const n=yield this.cipherService.get(this.cipherId),s=yield n.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(n)),o=yield(0,f.z)(this.organizations$),r=null!==(t=null===(e=o.find((e=>e.id===this.organizationId)))||void 0===e?void 0:e.name)&&void 0!==t?t:this.i18nService.t("organization");try{return this.formPromise=this.cipherService.shareWithServer(s,this.organizationId,i).then((()=>qv(this,void 0,void 0,(function*(){this.onSharedCipher.emit(),this.platformUtilsService.showToast("success",null,this.i18nService.t("movedItemToOrg",s.name,r))})))),yield this.formPromise,!0}catch(a){this.logService.error(a)}return!1}))}get canSave(){if(null!=this.collections)for(let e=0;e<this.collections.length;e++)if(this.collections[e].checked)return!0;return!1}}function Mv(e,t){if(1&e&&(s.TgZ(0,"small"),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.Oqu(e.cipher.name)}}function Nv(e,t){1&e&&(s.TgZ(0,"div",14),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n          ",s.lcZ(2,1,"noOrganizationsList"),"\n        "))}function Lv(e,t){if(1&e&&(s.TgZ(0,"option",22),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.id),s.xp6(1),s.Oqu(e.name)}}function Dv(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",23),s._uU(1,"\n              "),s.TgZ(2,"button",24),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.selectAll(!0))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n              "),s.TgZ(6,"button",24),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.selectAll(!1))})),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n            "),s.qZA()}2&e&&(s.xp6(3),s.hij("\n                ",s.lcZ(4,2,"selectAll"),"\n              "),s.xp6(4),s.hij("\n                ",s.lcZ(8,4,"unselectAll"),"\n              "))}function Ev(e,t){1&e&&(s.TgZ(0,"div"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n            ",s.lcZ(2,1,"noCollectionsInList"),"\n          "))}function Fv(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"tr",27),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(4);return s.KtG(i.check(t))})),s._uU(1,"\n                "),s.TgZ(2,"td",28),s._uU(3,"\n                  "),s.TgZ(4,"input",29),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.checked=t)})),s.qZA(),s._uU(5,"\n                "),s.qZA(),s._uU(6,"\n                "),s.TgZ(7,"td"),s._uU(8),s.qZA(),s._uU(9,"\n              "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index;s.xp6(4),s.MGl("name","Collection[",i,"].Checked"),s.Q6J("ngModel",e.checked),s.xp6(4),s.hij("\n                  ",e.name,"\n                ")}}function Rv(e,t){if(1&e&&(s.TgZ(0,"table",25),s._uU(1,"\n            "),s.TgZ(2,"tbody"),s._uU(3,"\n              "),s.YNc(4,Fv,10,3,"tr",26),s._uU(5,"\n            "),s.qZA(),s._uU(6,"\n          "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(4),s.Q6J("ngForOf",e.collections)}}function Jv(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",14),s._uU(1,"\n          "),s.TgZ(2,"p"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n          "),s.TgZ(6,"div",15),s._uU(7,"\n            "),s.TgZ(8,"label",16),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n            "),s.TgZ(12,"select",17),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.organizationId=t)}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.filterCollections())})),s._uU(13,"\n              "),s.YNc(14,Lv,2,2,"option",18),s._uU(15,"\n            "),s.qZA(),s._uU(16,"\n          "),s.qZA(),s._uU(17,"\n          "),s.TgZ(18,"div",19),s._uU(19,"\n            "),s.TgZ(20,"h3"),s._uU(21),s.ALo(22,"i18n"),s.qZA(),s._uU(23,"\n            "),s.YNc(24,Dv,10,6,"div",20),s._uU(25,"\n          "),s.qZA(),s._uU(26,"\n          "),s.YNc(27,Ev,3,3,"div",6),s._uU(28,"\n          "),s.YNc(29,Rv,7,1,"table",21),s._uU(30,"\n        "),s.qZA()}if(2&e){const e=s.oxw().ngIf,t=s.oxw();s.xp6(3),s.Oqu(s.lcZ(4,8,"moveToOrgDesc")),s.xp6(6),s.Oqu(s.lcZ(10,10,"organization")),s.xp6(3),s.Q6J("ngModel",t.organizationId),s.xp6(2),s.Q6J("ngForOf",e),s.xp6(7),s.Oqu(s.lcZ(22,12,"collections")),s.xp6(3),s.Q6J("ngIf",t.collections&&t.collections.length),s.xp6(3),s.Q6J("ngIf",!t.collections||!t.collections.length),s.xp6(2),s.Q6J("ngIf",t.collections&&t.collections.length)}}Iv.ɵfac=function(e){return new(e||Iv)(s.Y36(E.a),s.Y36(N.P),s.Y36(M.D),s.Y36(C.u),s.Y36(_e.$),s.Y36(w.Mn))},Iv.ɵdir=s.lG2({type:Iv,inputs:{cipherId:"cipherId",organizationId:"organizationId"},outputs:{onSharedCipher:"onSharedCipher"}});const zv=function(e){return{loading:e}};function Yv(e,t){if(1&e&&(s.TgZ(0,"button",30),s._uU(1,"\n            "),s._UZ(2,"i",31),s.ALo(3,"i18n"),s._uU(4,"\n            "),s.TgZ(5,"span"),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n          "),s.qZA()),2&e){const e=s.oxw(2),t=s.MAs(5);s.Q6J("disabled",t.loading||!e.canSave)("ngClass",s.VKq(8,zv,t.loading)),s.xp6(2),s.s9C("title",s.lcZ(3,4,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,6,"save"))}}function Kv(e,t){1&e&&(s.TgZ(0,"a",32),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n            ",s.lcZ(2,1,"newOrganization"),"\n          "))}function Bv(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n        "),s.YNc(2,Nv,3,3,"div",9),s._uU(3,"\n        "),s.YNc(4,Jv,31,14,"div",9),s._uU(5,"\n        "),s.TgZ(6,"div",10),s._uU(7,"\n          "),s.YNc(8,Yv,9,10,"button",11),s._uU(9,"\n          "),s.YNc(10,Kv,3,3,"a",12),s._uU(11,"\n          "),s.TgZ(12,"button",13),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n        "),s.qZA(),s._uU(16,"\n      "),s.BQk()),2&e){const e=t.ngIf;s.xp6(2),s.Q6J("ngIf",!e||!e.length),s.xp6(2),s.Q6J("ngIf",e&&e.length),s.xp6(4),s.Q6J("ngIf",e&&e.length),s.xp6(2),s.Q6J("ngIf",!e||!e.length),s.xp6(3),s.hij("\n            ",s.lcZ(14,5,"cancel"),"\n          ")}}class Qv extends Iv{constructor(e,t,i,n,s,o){super(e,t,i,n,o,s)}ngOnDestroy(){this.selectAll(!1)}check(e,t){e.checked=null==t?!e.checked:t}selectAll(e){(e?this.collections:this.writeableCollections).forEach((t=>this.check(t,e)))}}Qv.ɵfac=function(e){return new(e||Qv)(s.Y36(E.a),s.Y36(N.P),s.Y36(M.D),s.Y36(C.u),s.Y36(w.Mn),s.Y36(_e.$))},Qv.ɵcmp=s.Xpm({type:Qv,selectors:[["app-vault-share"]],features:[s.qOj],decls:29,vars:11,consts:[["role","dialog","aria-modal","true","aria-labelledby","shareTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],[1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","shareTitle",1,"modal-title"],[4,"ngIf"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit manual",3,"disabled","ngClass",4,"ngIf"],["href","#","routerLink","/create-organization","class","btn btn-primary",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"modal-body"],[1,"form-group"],["for","organization"],["id","organization","name","OrganizationId",1,"form-control",3,"ngModel","ngModelChange","change"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"d-flex"],["class","ml-auto d-flex",4,"ngIf"],["class","table table-hover table-list mb-0",4,"ngIf"],[3,"ngValue"],[1,"ml-auto","d-flex"],["type","button",1,"btn","btn-link","btn-sm","py-0",3,"click"],[1,"table","table-hover","table-list","mb-0"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],[1,"table-list-checkbox"],["type","checkbox","appStopProp","",3,"ngModel","name","ngModelChange"],["type","submit",1,"btn","btn-primary","btn-submit","manual",3,"disabled","ngClass"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["href","#","routerLink","/create-organization",1,"btn","btn-primary"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.TgZ(4,"form",2,3),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(6,"\n      "),s.TgZ(7,"div",4),s._uU(8,"\n        "),s.TgZ(9,"h1",5),s._uU(10),s.ALo(11,"i18n"),s.YNc(12,Mv,2,1,"small",6),s._uU(13,"\n        "),s.qZA(),s._uU(14,"\n        "),s.TgZ(15,"button",7),s.ALo(16,"i18n"),s._uU(17,"\n          "),s.TgZ(18,"span",8),s._uU(19,"×"),s.qZA(),s._uU(20,"\n        "),s.qZA(),s._uU(21,"\n      "),s.qZA(),s._uU(22,"\n      "),s.YNc(23,Bv,17,7,"ng-container",6),s.ALo(24,"async"),s._uU(25,"\n    "),s.qZA(),s._uU(26,"\n  "),s.qZA(),s._uU(27,"\n"),s.qZA(),s._uU(28,"\n")),2&e&&(s.xp6(4),s.Q6J("appApiAction",t.formPromise),s.xp6(6),s.hij("\n          ",s.lcZ(11,5,"moveToOrganization"),"\n          "),s.xp6(2),s.Q6J("ngIf",t.cipher),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(16,7,"close")),s.xp6(8),s.Q6J("ngIf",s.lcZ(24,9,t.organizations$)))},dependencies:[d.mk,d.sg,d.O5,l._Y,l.YN,l.Kr,l.Wl,l.EJ,l.JJ,l.JL,l.On,l.F,p.rH,ui.B,xe.b,Ql._,d.Ov,ee.C],encapsulation:2});var Gv=i(30276),jv=i(37417),Vv=i(95638),$v=i(4003),Hv=i(16776),Wv=i(27643),Xv=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ey{constructor(e,t,i,n,o){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.logService=n,this.tokenService=o,this.onVerified=new s.vpe,this.send=()=>Xv(this,void 0,void 0,(function*(){yield this.verifyEmail()}))}verifyEmail(){return Xv(this,void 0,void 0,(function*(){if(yield this.apiService.refreshIdentityToken(),yield this.tokenService.getEmailVerified())return this.onVerified.emit(!0),void this.platformUtilsService.showToast("success",null,this.i18nService.t("emailVerified"));yield this.apiService.postAccountVerifyEmail(),this.platformUtilsService.showToast("success",null,this.i18nService.t("checkInboxForVerification"))}))}}ey.ɵfac=function(e){return new(e||ey)(s.Y36(Ue.s),s.Y36(M.D),s.Y36(N.P),s.Y36(_e.$),s.Y36(bn.B))},ey.ɵcmp=s.Xpm({type:ey,selectors:[["app-verify-email"]],outputs:{onVerified:"onVerified"},decls:20,vars:10,consts:[[1,"tw-rounded","tw-border","tw-border-solid","tw-border-warning-600","tw-bg-background"],[1,"tw-bg-warning-600","tw-px-5","tw-py-2.5","tw-font-bold","tw-uppercase","tw-text-contrast"],["aria-hidden","true",1,"bwi","bwi-envelope","bwi-fw"],[1,"tw-p-5"],["id","sendBtn","bitButton","","type","button","block","",3,"bitAction"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s._UZ(4,"i",2),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n  "),s.TgZ(8,"div",3),s._uU(9,"\n    "),s.TgZ(10,"p"),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n    "),s.TgZ(14,"button",4),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n  "),s.qZA(),s._uU(18,"\n"),s.qZA(),s._uU(19,"\n")),2&e&&(s.xp6(5),s.hij(" ",s.lcZ(6,4,"verifyEmail"),"\n  "),s.xp6(6),s.Oqu(s.lcZ(12,6,"verifyEmailDesc")),s.xp6(3),s.Q6J("bitAction",t.send),s.xp6(1),s.hij("\n      ",s.lcZ(16,8,"sendEmail"),"\n    "))},dependencies:[xn.Q,Te.r,ee.C],encapsulation:2});class ty{}ty.ɵfac=function(e){return new(e||ty)},ty.ɵcmp=s.Xpm({type:ty,selectors:[["app-low-kdf"]],decls:20,vars:10,consts:[[1,"tw-rounded","tw-border","tw-border-solid","tw-border-warning-600","tw-bg-background"],[1,"tw-bg-warning-600","tw-px-5","tw-py-2.5","tw-font-bold","tw-uppercase","tw-text-contrast"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle","bwi-fw"],[1,"tw-p-5"],["bitButton","","buttonType","secondary","routerLink","/settings/security/security-keys",3,"block"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s._UZ(4,"i",2),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n  "),s.TgZ(8,"div",3),s._uU(9,"\n    "),s.TgZ(10,"p"),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n    "),s.TgZ(14,"a",4),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n  "),s.qZA(),s._uU(18,"\n"),s.qZA(),s._uU(19,"\n")),2&e&&(s.xp6(5),s.hij("\n    ",s.lcZ(6,4,"lowKdfIterations"),"\n  "),s.xp6(6),s.Oqu(s.lcZ(12,6,"updateLowKdfIterationsDesc")),s.xp6(3),s.Q6J("block",!0),s.xp6(1),s.hij("\n      ",s.lcZ(16,8,"updateKdfSettings"),"\n    "))},dependencies:[p.rH,Te.r,ee.C],encapsulation:2});var iy=i(98583),ny=i(8427),sy=i(93814),oy=i(36409),ry=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ay=function(){return[]},ly=function(e,t){return{organizationId:e,collectionId:t}};function cy(e,t){if(1&e&&(s.TgZ(0,"bit-breadcrumb",8),s._uU(1),s.ALo(2,"orgNameFromId"),s.ALo(3,"lowercase"),s.ALo(4,"i18n"),s.qZA()),2&e){const e=s.oxw(2);s.Q6J("route",s.DdM(11,ay))("queryParams",s.WLB(12,ly,e.activeOrganizationId,e.All)),s.xp6(1),s.AsE("\n      ",s.xi3(2,4,e.activeOrganizationId,e.organizations)," ",s.lcZ(3,7,s.lcZ(4,9,"vault")),"\n    ")}}const uy=function(e){return{collectionId:e}};function dy(e,t){if(1&e&&(s.TgZ(0,"bit-breadcrumb",9),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("route",s.DdM(3,ay))("queryParams",s.VKq(4,uy,e.id)),s.xp6(1),s.hij("\n        ",e.name,"\n      ")}}function py(e,t){if(1&e&&(s.TgZ(0,"bit-breadcrumbs",5),s._uU(1,"\n    "),s.YNc(2,cy,5,15,"bit-breadcrumb",6),s._uU(3,"\n    "),s.ynx(4),s._uU(5,"\n      "),s.YNc(6,dy,2,6,"bit-breadcrumb",7),s._uU(7,"\n    "),s.BQk(),s._uU(8,"\n  "),s.qZA()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.activeOrganizationId),s.xp6(4),s.Q6J("ngForOf",e.collections)}}function hy(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",13),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.editCollection(t.CollectionDialogTabType.Info))})),s._uU(1,"\n          "),s._UZ(2,"i",14),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n          ",s.lcZ(4,1,"editInfo"),"\n        "))}function gy(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",13),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.editCollection(t.CollectionDialogTabType.Access))})),s._uU(1,"\n          "),s._UZ(2,"i",15),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n          ",s.lcZ(4,1,"access"),"\n        "))}function fy(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",13),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.deleteCollection())})),s._uU(1,"\n          "),s.TgZ(2,"span",16),s._uU(3,"\n            "),s._UZ(4,"i",17),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n        "),s.qZA()}2&e&&(s.xp6(5),s.hij("\n            ",s.lcZ(6,1,"delete"),"\n          "))}function my(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n      "),s._UZ(2,"button",10),s._uU(3,"\n      "),s.TgZ(4,"bit-menu",null,11),s._uU(6,"\n        "),s.YNc(7,hy,5,3,"button",12),s._uU(8,"\n        "),s.YNc(9,gy,5,3,"button",12),s._uU(10,"\n        "),s.YNc(11,fy,8,3,"button",12),s._uU(12,"\n      "),s.qZA(),s._uU(13,"\n    "),s.BQk()),2&e){const e=s.MAs(5),t=s.oxw();s.xp6(2),s.Q6J("bitMenuTriggerFor",e),s.xp6(5),s.Q6J("ngIf",t.canEditCollection),s.xp6(2),s.Q6J("ngIf",t.canEditCollection),s.xp6(2),s.Q6J("ngIf",t.canDeleteCollection)}}function vy(e,t){1&e&&(s.TgZ(0,"small"),s._uU(1,"\n      "),s._UZ(2,"i",18),s.ALo(3,"i18n"),s._uU(4,"\n      "),s.TgZ(5,"span",19),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n    "),s.qZA()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function yy(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",13),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.addCollection())})),s._uU(1,"\n          "),s._UZ(2,"i",28),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n          ",s.lcZ(4,1,"collection"),"\n        "))}function wy(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",20),s._uU(1,"\n    "),s.TgZ(2,"div",21),s._uU(3,"\n      "),s.TgZ(4,"button",22),s.ALo(5,"i18n"),s._uU(6),s.ALo(7,"i18n"),s._UZ(8,"i",23),s._uU(9,"\n      "),s.qZA(),s._uU(10,"\n      "),s.TgZ(11,"bit-menu",24,25),s._uU(13,"\n        "),s.TgZ(14,"button",13),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.addCipher())})),s._uU(15,"\n          "),s._UZ(16,"i",26),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n        "),s.TgZ(20,"button",13),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.addFolder())})),s._uU(21,"\n          "),s._UZ(22,"i",27),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n        "),s.YNc(26,yy,5,3,"button",12),s._uU(27,"\n      "),s.qZA(),s._uU(28,"\n    "),s.qZA(),s._uU(29,"\n  "),s.qZA()}if(2&e){const e=s.MAs(12),t=s.oxw();s.xp6(4),s.s9C("appA11yTitle",s.lcZ(5,6,"new")),s.Q6J("bitMenuTriggerFor",e),s.xp6(2),s.hij("\n        ",s.lcZ(7,8,"new"),""),s.xp6(11),s.hij("\n          ",s.lcZ(18,10,"item"),"\n        "),s.xp6(6),s.hij("\n          ",s.lcZ(24,12,"folder"),"\n        "),s.xp6(3),s.Q6J("ngIf",t.canCreateCollections)}}class by{constructor(e,t){this.i18nService=e,this.configService=t,this.Unassigned=Hv.JK,this.All=Hv.oT,this.CollectionDialogTabType=am.sn,this.organizations=[],this.onAddCipher=new s.vpe,this.onAddCollection=new s.vpe,this.onAddFolder=new s.vpe,this.onEditCollection=new s.vpe,this.onDeleteCollection=new s.vpe,this.flexibleCollectionsV1Enabled=!1}ngOnInit(){return ry(this,void 0,void 0,(function*(){this.flexibleCollectionsV1Enabled=yield(0,f.z)(this.configService.getFeatureFlag$(Zm.T.FlexibleCollectionsV1))}))}get activeOrganizationId(){return null!=this.collection?this.collection.node.organizationId:void 0!==this.filter.organizationId?this.filter.organizationId:void 0}get activeOrganization(){var e;const t=this.activeOrganizationId;return null===(e=this.organizations)||void 0===e?void 0:e.find((e=>e.id===t))}get showBreadcrumbs(){return void 0!==this.filter.collectionId&&this.filter.collectionId!==Hv.oT}get title(){if(this.filter.collectionId===Hv.JK)return this.i18nService.t("unassigned");if(this.collection)return this.collection.node.name;if(this.filter.organizationId===Hv.JK)return this.i18nService.t("myVault");const e=this.activeOrganization;return e?`${e.name} ${this.i18nService.t("vault").toLowerCase()}`:this.i18nService.t("allVaults")}get icon(){return this.filter.collectionId&&this.filter.collectionId!==Hv.oT?"bwi-collection":""}get collections(){if(null==this.collection)return[];const e=[this.collection];for(;null!=e[e.length-1].parent;)e.push(e[e.length-1].parent);return e.slice(1).reverse().map((e=>e.node))}get canEditCollection(){if(null==this.collection)return!1;const e=this.organizations.find((e=>{var t;return e.id===(null===(t=this.collection)||void 0===t?void 0:t.node.organizationId)}));return this.collection.node.canEdit(e,this.flexibleCollectionsV1Enabled)}editCollection(e){return ry(this,void 0,void 0,(function*(){this.onEditCollection.emit({tab:e})}))}get canDeleteCollection(){if(void 0===this.collection)return!1;const e=this.organizations.find((e=>{var t;return e.id===(null===(t=this.collection)||void 0===t?void 0:t.node.organizationId)}));return this.collection.node.canDelete(e)}deleteCollection(){this.onDeleteCollection.emit()}addCipher(){this.onAddCipher.emit()}addFolder(){return ry(this,void 0,void 0,(function*(){this.onAddFolder.emit()}))}addCollection(){return ry(this,void 0,void 0,(function*(){this.onAddCollection.emit()}))}}by.ɵfac=function(e){return new(e||by)(s.Y36(M.D),s.Y36(Q.E))},by.ɵcmp=s.Xpm({type:by,selectors:[["app-vault-header"]],inputs:{loading:"loading",filter:"filter",organizations:"organizations",collection:"collection",canCreateCollections:"canCreateCollections"},outputs:{onAddCipher:"onAddCipher",onAddCollection:"onAddCollection",onAddFolder:"onAddFolder",onEditCollection:"onEditCollection",onDeleteCollection:"onDeleteCollection"},decls:14,vars:6,consts:[[3,"title","icon"],["slot","breadcrumbs",4,"ngIf"],["slot","title-suffix"],[4,"ngIf"],["class","tw-shrink-0",4,"ngIf"],["slot","breadcrumbs"],["queryParamsHandling","merge",3,"route","queryParams",4,"ngIf"],["icon","bwi-collection","queryParamsHandling","merge",3,"route","queryParams",4,"ngFor","ngForOf"],["queryParamsHandling","merge",3,"route","queryParams"],["icon","bwi-collection","queryParamsHandling","merge",3,"route","queryParams"],["bitIconButton","bwi-angle-down","size","small","type","button","aria-haspopup","true",3,"bitMenuTriggerFor"],["editCollectionMenu",""],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-pencil-square"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-users"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-shrink-0"],["appListDropdown",""],["bitButton","","buttonType","primary","type","button","id","newItemDropdown",3,"bitMenuTriggerFor","appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-angle-down","tw-ml-2"],["aria-labelledby","newItemDropdown"],["addOptions",""],["aria-hidden","true",1,"bwi","bwi-fw","bwi-globe"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-folder"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-collection"]],template:function(e,t){1&e&&(s.TgZ(0,"app-header",0),s._uU(1,"\n  "),s.YNc(2,py,9,2,"bit-breadcrumbs",1),s._uU(3,"\n\n  "),s.ynx(4,2),s._uU(5,"\n    "),s.YNc(6,my,14,4,"ng-container",3),s._uU(7,"\n    "),s.YNc(8,vy,9,6,"small",3),s._uU(9,"\n  "),s.BQk(),s._uU(10,"\n\n  "),s.YNc(11,wy,30,14,"div",4),s._uU(12,"\n"),s.qZA(),s._uU(13,"\n")),2&e&&(s.Q6J("title",t.title)("icon",t.icon),s.xp6(2),s.Q6J("ngIf",t.showBreadcrumbs),s.xp6(4),s.Q6J("ngIf",null!=t.collection&&(t.canEditCollection||t.canDeleteCollection)),s.xp6(2),s.Q6J("ngIf",t.loading),s.xp6(3),s.Q6J("ngIf","trash"!==t.filter.type))},dependencies:[d.sg,d.O5,ui.B,Te.r,xs.Q,Ar.M,Zr.t,xr.e,oi.k,ny.n,sy.L,oy.l,d.i8,ee.C],encapsulation:2,changeDetection:0});var Uy=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const _y=["vaultFilter"],Ay=["attachments"],Zy=["folderAddEdit"],xy=["cipherAddEdit"],Sy=["share"],Ty=["collectionsModal"];function Cy(e,t){if(1&e&&(s.TgZ(0,"app-callout",23),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.hij("\n      ",e.trashCleanupWarning,"\n    ")}}function Oy(e,t){1&e&&(s.TgZ(0,"div",24),s._uU(1,"\n      "),s._UZ(2,"i",25),s.ALo(3,"i18n"),s._uU(4,"\n      "),s.TgZ(5,"span",26),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n    "),s.qZA()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"loading")),s.xp6(4),s.Oqu(s.lcZ(7,4,"loading")))}function ky(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",29),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.addCipher())})),s._uU(1,"\n        "),s._UZ(2,"i",30),s._uU(3),s.ALo(4,"i18n"),s.qZA()}2&e&&(s.xp6(3),s.hij("\n        ",s.lcZ(4,1,"newItem"),"\n      "))}function Py(e,t){if(1&e&&(s.TgZ(0,"div",24),s._uU(1,"\n      "),s._UZ(2,"bit-icon",27),s._uU(3,"\n      "),s.TgZ(4,"p"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n      "),s.YNc(8,ky,5,3,"button",28),s._uU(9,"\n    "),s.qZA()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("icon",e.noItemIcon),s.xp6(3),s.Oqu(s.lcZ(6,3,"noItemsInList")),s.xp6(3),s.Q6J("ngIf","trash"!==e.filter.type)}}function qy(e,t){1&e&&(s.TgZ(0,"app-low-kdf",31),s._uU(1," "),s.qZA())}function Iy(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-verify-email",32),s.NdJ("onVerified",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.emailVerified(t))})),s.qZA()}}function My(e,t){1&e&&(s.TgZ(0,"div",33),s._uU(1,"\n      "),s.TgZ(2,"div",34),s._uU(3,"\n        "),s._UZ(4,"i",35),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n      "),s.TgZ(8,"div",36),s._uU(9,"\n        "),s.TgZ(10,"p"),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n        "),s.TgZ(14,"a",37),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n      "),s.qZA(),s._uU(18,"\n    "),s.qZA()),2&e&&(s.xp6(5),s.hij("\n        ",s.lcZ(6,3,"updateBrowser"),"\n      "),s.xp6(6),s.Oqu(s.lcZ(12,5,"updateBrowserDesc")),s.xp6(4),s.hij("\n          ",s.lcZ(16,7,"updateBrowser"),"\n        "))}function Ny(e,t){1&e&&(s.TgZ(0,"div",38),s._uU(1,"\n      "),s.TgZ(2,"div",39),s._uU(3,"\n        "),s._UZ(4,"i",40),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n      "),s.TgZ(8,"div",36),s._uU(9,"\n        "),s.TgZ(10,"p"),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n        "),s.TgZ(14,"a",41),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n      "),s.qZA(),s._uU(18,"\n    "),s.qZA()),2&e&&(s.xp6(5),s.hij(" ",s.lcZ(6,3,"goPremium"),"\n      "),s.xp6(6),s.Oqu(s.lcZ(12,5,"premiumUpgradeUnlockFeatures")),s.xp6(4),s.hij("\n          ",s.lcZ(16,7,"goPremium"),"\n        "))}function Ly(e,t){}function Dy(e,t){}function Ey(e,t){}function Fy(e,t){}function Ry(e,t){}function Jy(e,t){}const zy=function(e,t){return{"col-6":e,"col-9":t}},Yy="VaultComponent";class Ky{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,g,f,m,v,y,w,b,U,_,A,Z,x,S,T,C,O,k){this.syncService=e,this.route=t,this.router=i,this.changeDetectorRef=n,this.i18nService=s,this.modalService=o,this.dialogService=r,this.tokenService=a,this.messagingService=l,this.platformUtilsService=c,this.broadcasterService=u,this.ngZone=d,this.stateService=p,this.organizationService=g,this.vaultFilterService=f,this.routedVaultFilterService=m,this.routedVaultFilterBridgeService=v,this.cipherService=y,this.passwordRepromptService=w,this.collectionService=b,this.logService=U,this.totpService=_,this.eventCollectionService=A,this.searchService=Z,this.searchPipe=x,this.configService=S,this.apiService=T,this.userVerificationService=C,this.billingAccountProfileStateService=O,this.kdfConfigService=k,this.showVerifyEmail=!1,this.showBrowserOutdated=!1,this.showPremiumCallout=!1,this.showLowKdf=!1,this.trashCleanupWarning=null,this.activeFilter=new Wv.l,this.noItemIcon=rv.o,this.performingInitialLoad=!0,this.refreshing=!1,this.processingEvent=!1,this.filter={},this.allOrganizations=[],this.canCreateCollections=!1,this.flexibleCollectionsV1Enabled$=this.configService.getFeatureFlag$(Zm.T.FlexibleCollectionsV1),this.searchText$=new h.x,this.refresh$=new Ch.X(null),this.destroy$=new h.x,this.addFolder=()=>Uy(this,void 0,void 0,(function*(){Pv(this.dialogService)})),this.editFolder=e=>Uy(this,void 0,void 0,(function*(){const t=Pv(this.dialogService,{data:{folderId:e.id}});(yield(0,se.n)(t.closed))===Tv.Deleted&&this.router.navigate([],{queryParams:{folderId:null},queryParamsHandling:"merge",replaceUrl:!0})}))}ngOnInit(){return Uy(this,void 0,void 0,(function*(){this.showBrowserOutdated=-1!==window.navigator.userAgent.indexOf("MSIE"),this.trashCleanupWarning=this.i18nService.t(this.platformUtilsService.isSelfHost()?"trashCleanupWarningSelfHosted":"trashCleanupWarning");const e=this.route.queryParams.pipe((0,oe.P)(),(0,dn.w)((e=>Uy(this,void 0,void 0,(function*(){this.showVerifyEmail=!(yield this.tokenService.getEmailVerified()),this.showLowKdf=!!(yield this.userVerificationService.hasMasterPassword())&&(yield this.isLowKdfIteration()),yield this.syncService.fullSync(!1);const t=yield(0,f.z)(this.billingAccountProfileStateService.hasPremiumFromAnySource$);this.showPremiumCallout=!this.showVerifyEmail&&!t&&!this.platformUtilsService.isSelfHost();const i=By(e);if(!i)return;const n=new sv.$;n.id=i,"clone"===e.action?yield this.cloneCipher(n):"edit"===e.action&&(yield this.editCipher(n))})))),(0,ev.d)({refCount:!0,bufferSize:1}));this.broadcasterService.subscribe(Yy,(e=>{this.ngZone.run((()=>Uy(this,void 0,void 0,(function*(){if("syncCompleted"===e.command)e.successfully&&(this.refresh(),this.changeDetectorRef.detectChanges())}))))})),this.routedVaultFilterBridgeService.activeFilter$.pipe((0,g.R)(this.destroy$)).subscribe((e=>{this.activeFilter=e}));const t=this.routedVaultFilterService.filter$,i=this.collectionService.decryptedCollections$,n=i.pipe((0,y.U)((e=>(0,av.o)(e))));this.searchText$.pipe((0,Oh.b)(200),(0,g.R)(this.destroy$)).subscribe((e=>this.router.navigate([],{queryParams:{search:Ci.c.isNullOrEmpty(e)?null:e},queryParamsHandling:"merge",replaceUrl:!0}))),this.currentSearchText$=this.route.queryParams.pipe((0,y.U)((e=>e.search)));const s=(0,Xm.a)([Ci.c.asyncToObservable((()=>this.cipherService.getAllDecrypted())),t,this.currentSearchText$]).pipe((0,m.h)((([e,t])=>null!=e&&null!=t)),(0,Ki.b)((([e,t,i])=>Uy(this,void 0,void 0,(function*(){const n=(0,$v.E)(t);return(yield this.searchService.isSearchable(i))?yield this.searchService.searchCiphers(i,[n],e):e.filter(n)})))),(0,ev.d)({refCount:!0,bufferSize:1})),o=(0,Xm.a)([n,t,this.currentSearchText$]).pipe((0,m.h)((([e,t])=>null!=e&&null!=t)),(0,Ki.b)((([e,t,i])=>Uy(this,void 0,void 0,(function*(){var n;if(void 0===t.collectionId||t.collectionId===Hv.JK)return[];let s=[];if(void 0!==t.organizationId&&t.collectionId===Hv.oT)s=e.filter((e=>e.node.organizationId===t.organizationId)).map((e=>e.node));else if(t.collectionId===Hv.oT)s=e.map((e=>e.node));else{const i=ov.L.getTreeNodeObjectFromList(e,t.collectionId);s=null!==(n=null==i?void 0:i.children.map((e=>e.node)))&&void 0!==n?n:[]}return(yield this.searchService.isSearchable(i))&&(s=this.searchPipe.transform(s,i,(e=>e.name),(e=>e.id))),s})))),(0,ev.d)({refCount:!0,bufferSize:1})),r=(0,Xm.a)([n,t]).pipe((0,m.h)((([e,t])=>null!=e&&null!=t)),(0,y.U)((([e,t])=>{if(void 0!==t.collectionId&&t.collectionId!==Hv.oT&&t.collectionId!==Hv.JK)return ov.L.getTreeNodeObjectFromList(e,t.collectionId)})),(0,ev.d)({refCount:!0,bufferSize:1}));e.pipe((0,dn.w)((()=>this.route.queryParams)),(0,dn.w)((e=>Uy(this,void 0,void 0,(function*(){const t=By(e);t&&(null!=(yield this.cipherService.get(t))?this.editCipherId(t):(this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("unknownCipher")),this.router.navigate([],{queryParams:{itemId:null,cipherId:null},queryParamsHandling:"merge"})))})))),(0,g.R)(this.destroy$)).subscribe(),e.pipe((0,dn.w)((()=>this.refresh$)),(0,Gs.b)((()=>this.refreshing=!0)),(0,dn.w)((()=>(0,Xm.a)([t,this.billingAccountProfileStateService.hasPremiumFromAnySource$,i,this.organizationService.organizations$,s,o,r]))),(0,g.R)(this.destroy$)).subscribe((([e,t,i,n,s,o,r])=>{this.filter=e,this.canAccessPremium=t,this.allCollections=i,this.allOrganizations=n,this.ciphers=s,this.collections=o,this.selectedCollection=r,this.canCreateCollections=null==n?void 0:n.some((e=>e.canCreateNewCollections&&!e.isProviderUser)),this.showBulkMove="trash"!==e.type&&(void 0===e.organizationId||e.organizationId===Hv.JK),this.isEmpty=0===(null==o?void 0:o.length)&&0===(null==s?void 0:s.length),this.performingInitialLoad=!1,this.refreshing=!1}))}))}get isShowingCards(){return this.showBrowserOutdated||this.showPremiumCallout||this.showVerifyEmail||this.showLowKdf}emailVerified(e){this.showVerifyEmail=!e}ngOnDestroy(){this.broadcasterService.unsubscribe(Yy),this.destroy$.next(),this.destroy$.complete()}onVaultItemsEvent(e){return Uy(this,void 0,void 0,(function*(){this.processingEvent=!0;try{"viewAttachments"===e.type?yield this.editCipherAttachments(e.item):"viewCollections"===e.type?yield this.editCipherCollections(e.item):"clone"===e.type?yield this.cloneCipher(e.item):"restore"===e.type?1===e.items.length?yield this.restore(e.items[0]):yield this.bulkRestore(e.items):"delete"===e.type?yield this.handleDeleteEvent(e.items):"moveToFolder"===e.type?yield this.bulkMove(e.items):"moveToOrganization"===e.type?1===e.items.length?yield this.shareCipher(e.items[0]):yield this.bulkShare(e.items):"copyField"===e.type?yield this.copy(e.item,e.field):"editCollection"===e.type?yield this.editCollection(e.item,am.sn.Info):"viewCollectionAccess"===e.type&&(yield this.editCollection(e.item,am.sn.Access))}finally{this.processingEvent=!1}}))}applyOrganizationFilter(e){var t,i;return Uy(this,void 0,void 0,(function*(){null==e&&(e="MyVault");const n=yield(0,f.z)(this.filterComponent.filters.organizationFilter.data$),s=ov.L.getTreeNodeObject(n,e);null===(i=null===(t=this.filterComponent.filters)||void 0===t?void 0:t.organizationFilter)||void 0===i||i.action(s)}))}filterSearchText(e){this.searchText$.next(e)}editCipherAttachments(e){return Uy(this,void 0,void 0,(function*(){if(0!==(null==e?void 0:e.reprompt)&&!(yield this.passwordRepromptService.showPasswordPrompt()))return void this.go({cipherId:null,itemId:null});if(null==e.organizationId&&!this.canAccessPremium)return void this.messagingService.send("premiumRequired");if(null!=e.organizationId){const t=yield this.organizationService.get(e.organizationId);if(null!=t&&(null==t.maxStorageGb||0===t.maxStorageGb))return void this.messagingService.send("upgradeOrganization",{organizationId:e.organizationId})}let t=!1;const[i]=yield this.modalService.openViewRef(lv.t,this.attachmentsModalRef,(i=>{i.cipherId=e.id,i.onUploadedAttachment.pipe((0,g.R)(this.destroy$)).subscribe((()=>t=!0)),i.onDeletedAttachment.pipe((0,g.R)(this.destroy$)).subscribe((()=>t=!0)),i.onReuploadedAttachment.pipe((0,g.R)(this.destroy$)).subscribe((()=>t=!0))}));i.onClosed.pipe((0,g.R)(this.destroy$)).subscribe((()=>{t&&this.refresh(),t=!1}))}))}shareCipher(e){return Uy(this,void 0,void 0,(function*(){if(0!==(null==e?void 0:e.reprompt)&&!(yield this.passwordRepromptService.showPasswordPrompt()))return void this.go({cipherId:null,itemId:null});const[t]=yield this.modalService.openViewRef(Qv,this.shareModalRef,(i=>{i.cipherId=e.id,i.onSharedCipher.pipe((0,g.R)(this.destroy$)).subscribe((()=>{t.close(),this.refresh()}))}))}))}editCipherCollections(e){return Uy(this,void 0,void 0,(function*(){(0,_v._l)(this.dialogService,{data:{cipherId:e.id}})}))}addCipher(){var e;return Uy(this,void 0,void 0,(function*(){const t=yield this.editCipher(null);t.type=this.activeFilter.cipherType,"MyVault"!==this.activeFilter.organizationId&&(t.organizationId=this.activeFilter.organizationId,t.collections=(yield(0,f.z)(this.vaultFilterService.filteredCollections$)).filter((e=>!e.readOnly&&null!=e.id)));const i=this.activeFilter.collectionId;"AllCollections"!==i&&(t.organizationId=null===(e=t.collections.find((e=>e.id===i)))||void 0===e?void 0:e.organizationId,t.collectionIds=[i]),t.folderId=this.activeFilter.folderId}))}navigateToCipher(e){return Uy(this,void 0,void 0,(function*(){this.go({itemId:null==e?void 0:e.id})}))}editCipher(e){return Uy(this,void 0,void 0,(function*(){return this.editCipherId(null==e?void 0:e.id)}))}editCipherId(e){return Uy(this,void 0,void 0,(function*(){const t=yield this.cipherService.get(e);if(t&&0!==t.reprompt&&!(yield this.passwordRepromptService.showPasswordPrompt()))return void this.go({cipherId:null,itemId:null});const[i,n]=yield this.modalService.openViewRef(qa.Z,this.cipherAddEditModalRef,(t=>{t.cipherId=e,t.onSavedCipher.pipe((0,g.R)(this.destroy$)).subscribe((()=>{i.close(),this.refresh()})),t.onDeletedCipher.pipe((0,g.R)(this.destroy$)).subscribe((()=>{i.close(),this.refresh()})),t.onRestoredCipher.pipe((0,g.R)(this.destroy$)).subscribe((()=>{i.close(),this.refresh()}))}));return i.onClosedPromise().then((()=>{this.go({cipherId:null,itemId:null})})),n}))}addCollection(){return Uy(this,void 0,void 0,(function*(){const e=(0,am.ku)(this.dialogService,{data:{organizationId:this.allOrganizations.filter((e=>e.canCreateNewCollections&&!e.isProviderUser)).sort(Ci.c.getSortFunction(this.i18nService,"name"))[0].id,parentCollectionId:this.filter.collectionId,showOrgSelector:!0,collectionIds:this.allCollections.map((e=>e.id))}}),t=yield(0,se.n)(e.closed);if(t.action===am.a8.Saved){if(t.collection){const e=new nv.Z(t.collection);yield this.collectionService.upsert(e)}this.refresh()}}))}editCollection(e,t){var i,n,s,o;return Uy(this,void 0,void 0,(function*(){const r=(0,am.ku)(this.dialogService,{data:{collectionId:null==e?void 0:e.id,organizationId:e.organizationId,initialTab:t}}),a=yield(0,se.n)(r.closed);if(a.action===am.a8.Saved){if(a.collection){const e=new nv.Z(a.collection);yield this.collectionService.upsert(e)}this.refresh()}else a.action===am.a8.Deleted&&(yield this.collectionService.delete(null===(i=a.collection)||void 0===i?void 0:i.id),this.refresh(),(null===(n=this.selectedCollection)||void 0===n?void 0:n.node.id)===(null==e?void 0:e.id)&&this.router.navigate([],{queryParams:{collectionId:null!==(o=null===(s=this.selectedCollection.parent)||void 0===s?void 0:s.node.id)&&void 0!==o?o:null},queryParamsHandling:"merge",replaceUrl:!0}))}))}deleteCollection(e){var t,i,n;return Uy(this,void 0,void 0,(function*(){const s=yield this.organizationService.get(e.organizationId);if(!e.canDelete(s))return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("missingPermissions"));if(yield this.dialogService.openSimpleDialog({title:e.name,content:{key:"deleteCollectionConfirmation"},type:"warning"}))try{yield this.apiService.deleteCollection(e.organizationId,e.id),yield this.collectionService.delete(e.id),this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedCollectionId",e.name)),(null===(t=this.selectedCollection)||void 0===t?void 0:t.node.id)===e.id&&this.router.navigate([],{queryParams:{collectionId:null!==(n=null===(i=this.selectedCollection.parent)||void 0===i?void 0:i.node.id)&&void 0!==n?n:null},queryParamsHandling:"merge",replaceUrl:!0}),this.refresh()}catch(o){this.logService.error(o)}}))}cloneCipher(e){var t;return Uy(this,void 0,void 0,(function*(){if(null===(t=e.login)||void 0===t?void 0:t.hasFido2Credentials){if(!(yield this.dialogService.openSimpleDialog({title:{key:"passkeyNotCopied"},content:{key:"passkeyNotCopiedAlert"},type:"info"})))return!1}(yield this.editCipher(e)).cloneMode=!0}))}restore(e){return Uy(this,void 0,void 0,(function*(){if((yield this.repromptCipher([e]))&&e.isDeleted)try{yield this.cipherService.restoreWithServer(e.id),this.platformUtilsService.showToast("success",null,this.i18nService.t("restoredItem")),this.refresh()}catch(t){this.logService.error(t)}}))}bulkRestore(e){return Uy(this,void 0,void 0,(function*(){if(!(yield this.repromptCipher(e)))return;const t=e.map((e=>e.id));0!==t.length?(yield this.cipherService.restoreManyWithServer(t),this.platformUtilsService.showToast("success",null,this.i18nService.t("restoredItems")),this.refresh()):this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nothingSelected"))}))}handleDeleteEvent(e){return Uy(this,void 0,void 0,(function*(){const t=e.filter((e=>void 0===e.collection)).map((e=>e.cipher)),i=e.filter((e=>void 0===e.cipher)).map((e=>e.collection));if(1===t.length&&0===i.length)yield this.deleteCipher(t[0]);else if(0===t.length&&1===i.length)yield this.deleteCollection(i[0]);else{const n=e.filter((e=>void 0===e.cipher)).map((e=>e.collection.organizationId)),s=yield(0,f.z)(this.organizationService.organizations$.pipe((0,y.U)((e=>e.filter((e=>n.includes(e.id)))))));yield this.bulkDelete(t,i,s)}}))}deleteCipher(e){return Uy(this,void 0,void 0,(function*(){if(!(yield this.repromptCipher([e])))return;const t=e.isDeleted;if(!(yield this.dialogService.openSimpleDialog({title:{key:t?"permanentlyDeleteItem":"deleteItem"},content:{key:t?"permanentlyDeleteItemConfirmation":"deleteItemConfirmation"},type:"warning"})))return!1;try{yield this.deleteCipherWithServer(e.id,t),this.platformUtilsService.showToast("success",null,this.i18nService.t(t?"permanentlyDeletedItem":"deletedItem")),this.refresh()}catch(i){this.logService.error(i)}}))}bulkDelete(e,t,i){return Uy(this,void 0,void 0,(function*(){if(!(yield this.repromptCipher(e)))return;if(0===e.length&&0===t.length)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nothingSelected"));const n=(0,cv.E)(this.dialogService,{data:{permanent:"trash"===this.filter.type,cipherIds:e.map((e=>e.id)),organizations:i,collections:t}});(yield(0,se.n)(n.closed))===cv.Jg.Deleted&&this.refresh()}))}bulkMove(e){return Uy(this,void 0,void 0,(function*(){if(!(yield this.repromptCipher(e)))return;const t=e.map((e=>e.id));if(0===t.length)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nothingSelected"));const i=(n=this.dialogService,s={data:{cipherIds:t}},n.open(pv,s));var n,s;(yield(0,se.n)(i.closed))===Wm.Moved&&this.refresh()}))}copy(e,t){return Uy(this,void 0,void 0,(function*(){let i,n,s;if("username"===t)i="Username",n=e.login.username,s="username";else if("password"===t)i="Password",n=e.login.password,s="password";else{if("totp"!==t)return void this.platformUtilsService.showToast("info",null,this.i18nService.t("unexpectedError"));i="TOTP",n=yield this.totpService.getCode(e.login.totp),s="verificationCodeTotp"}this.passwordRepromptService.protectedFields().includes(i)&&!(yield this.repromptCipher([e]))||e.viewPassword&&(this.platformUtilsService.copyToClipboard(n,{window}),this.platformUtilsService.showToast("info",null,this.i18nService.t("valueCopied",this.i18nService.t(s))),"password"===t?this.eventCollectionService.collect(le.tw.Cipher_ClientCopiedPassword,e.id):"totp"===t&&this.eventCollectionService.collect(le.tw.Cipher_ClientCopiedHiddenField,e.id))}))}bulkShare(e){return Uy(this,void 0,void 0,(function*(){if(!(yield this.repromptCipher(e)))return;if(0===e.length)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nothingSelected"));const t=(i=this.dialogService,n={data:{ciphers:e}},i.open(Uv,n));var i,n;(yield(0,se.n)(t.closed))===gv.Shared&&this.refresh()}))}deleteCipherWithServer(e,t){return t?this.cipherService.deleteWithServer(e):this.cipherService.softDeleteWithServer(e)}isLowKdfIteration(){return Uy(this,void 0,void 0,(function*(){const e=yield this.kdfConfigService.getKdfConfig();return e.kdfType===Hi.G3.PBKDF2_SHA256&&e.iterations<Hi.qv.defaultValue}))}repromptCipher(e){return Uy(this,void 0,void 0,(function*(){return!e.find((e=>e.reprompt!==iv.N.None))||(yield this.passwordRepromptService.showPasswordPrompt())}))}refresh(){this.refresh$.next()}go(e=null){null==e&&(e={favorites:this.activeFilter.isFavorites||null,type:this.activeFilter.cipherType,folderId:this.activeFilter.folderId,collectionId:this.activeFilter.collectionId,deleted:this.activeFilter.isDeleted||null}),this.router.navigate([],{relativeTo:this.route,queryParams:e,queryParamsHandling:"merge",replaceUrl:!0})}}Ky.ɵfac=function(e){return new(e||Ky)(s.Y36(T._),s.Y36(p.gz),s.Y36(p.F0),s.Y36(s.sBO),s.Y36(M.D),s.Y36(uo.Z),s.Y36(I.x),s.Y36(bn.B),s.Y36(fe.o),s.Y36(N.P),s.Y36(x.A),s.Y36(s.R0b),s.Y36(J.b),s.Y36(w.Mn),s.Y36(fm.n),s.Y36(Vv.q),s.Y36(jv.b),s.Y36(C.u),s.Y36(Pa.C),s.Y36(E.a),s.Y36(_e.$),s.Y36(Ma.w),s.Y36(Na.j),s.Y36(F.o),s.Y36(tv.C),s.Y36(Q.E),s.Y36(Ue.s),s.Y36(nn.i),s.Y36(yr.M),s.Y36(sn.d))},Ky.ɵcmp=s.Xpm({type:Ky,selectors:[["app-vault"]],viewQuery:function(e,t){if(1&e&&(s.Gf(_y,7),s.Gf(Ay,7,s.s_b),s.Gf(Zy,7,s.s_b),s.Gf(xy,7,s.s_b),s.Gf(Sy,7,s.s_b),s.Gf(Ty,7,s.s_b)),2&e){let e;s.iGM(e=s.CRH())&&(t.filterComponent=e.first),s.iGM(e=s.CRH())&&(t.attachmentsModalRef=e.first),s.iGM(e=s.CRH())&&(t.folderAddEditModalRef=e.first),s.iGM(e=s.CRH())&&(t.cipherAddEditModalRef=e.first),s.iGM(e=s.CRH())&&(t.shareModalRef=e.first),s.iGM(e=s.CRH())&&(t.collectionsModalRef=e.first)}},features:[s._Bn([Vv.q,jv.b])],decls:66,vars:38,consts:[[3,"filter","loading","organizations","canCreateCollections","collection","onAddCipher","onAddCollection","onAddFolder","onEditCollection","onDeleteCollection"],[3,"ciphers","orgs","onAddCipher"],[1,"row"],[1,"col-3"],[1,"groupings"],[1,"content"],[1,"inner-content"],[3,"activeFilter","searchText","searchTextChanged","onEditFolder"],["vaultFilter",""],[3,"ngClass"],["type","warning","icon","bwi-exclamation-triangle",4,"ngIf"],[3,"ciphers","collections","allCollections","allOrganizations","disabled","showOwner","showCollections","showGroups","showPremiumFeatures","showBulkMove","showBulkTrashOptions","useEvents","showAdminActions","flexibleCollectionsV1Enabled","onEvent"],["class","tw-mt-6 tw-flex tw-h-full tw-flex-col tw-items-center tw-justify-start",4,"ngIf"],["class","d-block mb-4",4,"ngIf"],["class","d-block mb-4",3,"onVerified",4,"ngIf"],["class","card border-warning mb-4",4,"ngIf"],["class","card border-success mb-4",4,"ngIf"],["attachments",""],["folderAddEdit",""],["cipherAddEdit",""],["share",""],["collectionsModal",""],["updateKeyTemplate",""],["type","warning","icon","bwi-exclamation-triangle"],[1,"tw-mt-6","tw-flex","tw-h-full","tw-flex-col","tw-items-center","tw-justify-start"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","text-muted",3,"title"],[1,"sr-only"],["aria-hidden","true",3,"icon"],["type","button","buttonType","primary","bitButton","",3,"click",4,"ngIf"],["type","button","buttonType","primary","bitButton","",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-fw"],[1,"d-block","mb-4"],[1,"d-block","mb-4",3,"onVerified"],[1,"card","border-warning","mb-4"],[1,"card-header","bg-warning","text-white"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle","bwi-fw"],[1,"card-body"],["target","_blank","href","https://browser-update.org/update-browser.html","rel","noreferrer",1,"btn","btn-block","btn-outline-secondary"],[1,"card","border-success","mb-4"],[1,"card-header","bg-success","text-white"],["aria-hidden","true",1,"bwi","bwi-star-f","bwi-fw"],["routerLink","/settings/subscription/premium",1,"btn","btn-block","btn-outline-secondary"]],template:function(e,t){1&e&&(s.TgZ(0,"app-vault-header",0),s.NdJ("onAddCipher",(function(){return t.addCipher()}))("onAddCollection",(function(){return t.addCollection()}))("onAddFolder",(function(){return t.addFolder()}))("onEditCollection",(function(e){return t.editCollection(t.selectedCollection.node,e.tab)}))("onDeleteCollection",(function(){return t.deleteCollection(t.selectedCollection.node)})),s.qZA(),s._uU(1,"\n\n"),s.TgZ(2,"app-vault-onboarding",1),s.NdJ("onAddCipher",(function(){return t.addCipher()})),s._uU(3,"\n"),s.qZA(),s._uU(4,"\n\n"),s.TgZ(5,"div",2),s._uU(6,"\n  "),s.TgZ(7,"div",3),s._uU(8,"\n    "),s.TgZ(9,"div",4),s._uU(10,"\n      "),s.TgZ(11,"div",5),s._uU(12,"\n        "),s.TgZ(13,"div",6),s._uU(14,"\n          "),s.TgZ(15,"app-vault-filter",7,8),s.NdJ("searchTextChanged",(function(e){return t.filterSearchText(e)}))("onEditFolder",(function(e){return t.editFolder(e)})),s.ALo(17,"async"),s.qZA(),s._uU(18,"\n        "),s.qZA(),s._uU(19,"\n      "),s.qZA(),s._uU(20,"\n    "),s.qZA(),s._uU(21,"\n  "),s.qZA(),s._uU(22,"\n  "),s.TgZ(23,"div",9),s._uU(24,"\n    "),s.YNc(25,Cy,2,1,"app-callout",10),s._uU(26,"\n    "),s.TgZ(27,"app-vault-items",11),s.NdJ("onEvent",(function(e){return t.onVaultItemsEvent(e)})),s.ALo(28,"async"),s._uU(29,"\n    "),s.qZA(),s._uU(30,"\n    "),s.YNc(31,Oy,9,6,"div",12),s._uU(32,"\n    "),s.YNc(33,Py,10,5,"div",12),s._uU(34,"\n  "),s.qZA(),s._uU(35,"\n  "),s.TgZ(36,"div",3),s._uU(37,"\n    "),s.YNc(38,qy,2,0,"app-low-kdf",13),s._uU(39,"\n\n    "),s.YNc(40,Iy,1,0,"app-verify-email",14),s._uU(41,"\n\n    "),s.YNc(42,My,19,9,"div",15),s._uU(43,"\n    "),s.YNc(44,Ny,19,9,"div",16),s._uU(45,"\n  "),s.qZA(),s._uU(46,"\n"),s.qZA(),s._uU(47,"\n\n"),s.YNc(48,Ly,0,0,"ng-template",null,17,s.W1O),s._uU(50,"\n"),s.YNc(51,Dy,0,0,"ng-template",null,18,s.W1O),s._uU(53,"\n"),s.YNc(54,Ey,0,0,"ng-template",null,19,s.W1O),s._uU(56,"\n"),s.YNc(57,Fy,0,0,"ng-template",null,20,s.W1O),s._uU(59,"\n"),s.YNc(60,Ry,0,0,"ng-template",null,21,s.W1O),s._uU(62,"\n"),s.YNc(63,Jy,0,0,"ng-template",null,22,s.W1O),s._uU(65,"\n")),2&e&&(s.Q6J("filter",t.filter)("loading",t.refreshing&&!t.performingInitialLoad)("organizations",t.allOrganizations)("canCreateCollections",t.canCreateCollections)("collection",t.selectedCollection),s.xp6(2),s.Q6J("ciphers",t.ciphers)("orgs",t.allOrganizations),s.xp6(13),s.Q6J("activeFilter",t.activeFilter)("searchText",s.lcZ(17,31,t.currentSearchText$)),s.xp6(8),s.Q6J("ngClass",s.WLB(35,zy,t.isShowingCards,!t.isShowingCards)),s.xp6(2),s.Q6J("ngIf",t.activeFilter.isDeleted),s.xp6(2),s.Q6J("ciphers",t.ciphers)("collections",t.collections)("allCollections",t.allCollections)("allOrganizations",t.allOrganizations)("disabled",t.refreshing)("showOwner",!0)("showCollections",!1)("showGroups",!1)("showPremiumFeatures",t.canAccessPremium)("showBulkMove",t.showBulkMove)("showBulkTrashOptions","trash"===t.filter.type)("useEvents",!1)("showAdminActions",!1)("flexibleCollectionsV1Enabled",s.lcZ(28,33,t.flexibleCollectionsV1Enabled$)),s.xp6(4),s.Q6J("ngIf",t.performingInitialLoad),s.xp6(2),s.Q6J("ngIf",t.isEmpty&&!t.performingInitialLoad),s.xp6(5),s.Q6J("ngIf",t.showLowKdf),s.xp6(2),s.Q6J("ngIf",t.showVerifyEmail),s.xp6(2),s.Q6J("ngIf",t.showBrowserOutdated),s.xp6(2),s.Q6J("ngIf",t.showPremiumCallout))},dependencies:[Gv.P,p.rH,d.mk,d.O5,Se.O,Te.r,ps.G,ey,ty,iy.JS,Hm,by,d.Ov,ee.C],encapsulation:2});const By=e=>e.itemId||e.cipherId,Qy=[{path:"",component:Ky,data:{titleId:"vaults"}}];class Gy{}Gy.ɵfac=function(e){return new(e||Gy)},Gy.ɵmod=s.oAB({type:Gy}),Gy.ɵinj=s.cJS({imports:[p.Bz.forChild(Qy),p.Bz]});class jy{}jy.ɵfac=function(e){return new(e||jy)},jy.ɵmod=s.oAB({type:jy}),jy.ɵinj=s.cJS({providers:[{provide:ym,useClass:Um}],imports:[vm,Gy,pm.D,um.x,cm.e,hm.D,me.m,me.f,dm,rm.J,lm.z,am.WK,Hm]});const Vy=[{path:"",component:jp,data:{doNotSaveUrl:!0},children:[{path:"",pathMatch:"full",children:[],canActivate:[(0,W.Qp)()]},{path:"login",component:Is,canActivate:[W.at]},{path:"login-with-device",component:os,data:{titleId:"loginWithDevice"}},{path:"login-with-passkey",component:fs,data:{titleId:"loginWithPasskey"}},{path:"admin-approval-requested",component:os,data:{titleId:"adminApprovalRequested"}},{path:"2fa",component:Cp,canActivate:[W.at]},{path:"login-initiated",component:Fn,canActivate:[(0,W.Br)()]},{path:"register",component:Gd,canActivate:[W.at],data:{titleId:"createAccount"}},{path:"trial",redirectTo:"register",pathMatch:"full"},{path:"sso",component:Vc,canActivate:[W.at],data:{titleId:"enterpriseSingleSignOn"}},{path:"set-password",component:co,data:{titleId:"setMasterPassword"}},{path:"hint",component:Yi,canActivate:[W.at],data:{titleId:"passwordHint"}},{path:"lock",component:cn,canActivate:[(0,Li.k)(),(0,W.nw)()]},{path:"verify-email",component:Yp},{path:"accept-organization",component:Ni,canActivate:[(0,Li.k)()],data:{titleId:"joinOrganization",doNotSaveUrl:!1}},{path:"accept-emergency",canActivate:[(0,Li.k)()],data:{titleId:"acceptEmergency",doNotSaveUrl:!1},loadComponent:()=>i.e(77).then(i.bind(i,97077)).then((e=>e.AcceptEmergencyComponent))},{path:"accept-families-for-enterprise",component:ne,canActivate:[(0,Li.k)()],data:{titleId:"acceptFamilySponsorship",doNotSaveUrl:!1}},{path:"recover",pathMatch:"full",redirectTo:"recover-2fa"},{path:"recover-2fa",component:Fs,canActivate:[W.at],data:{titleId:"recoverAccountTwoStep"}},{path:"recover-delete",component:Ls,canActivate:[W.at],data:{titleId:"deleteAccount"}},{path:"verify-recover-delete",component:Qp,canActivate:[W.at],data:{titleId:"deleteAccount"}},{path:"verify-recover-delete-provider",component:ii,canActivate:[W.at],data:{titleId:"deleteAccount"}},{path:"send/:sendId/:key",component:jg,data:{title:"Bitwarden Send"}},{path:"update-temp-password",component:Rp,canActivate:[W.a1],data:{titleId:"updateTempPassword"}},{path:"update-password",component:Ip,canActivate:[W.a1],data:{titleId:"updatePassword"}},{path:"remove-password",component:Qs,canActivate:[W.a1],data:{titleId:"removeMasterPassword"}},{path:"migrate-legacy-encryption",loadComponent:()=>i.e(968).then(i.bind(i,20968)).then((e=>e.MigrateFromLegacyEncryptionComponent))}]},{path:"",component:Vp.z,canActivate:[(0,Li.k)(),W.a1],children:[{path:"vault",loadChildren:()=>jy},{path:"sends",component:om,data:{titleId:"send"}},{path:"create-organization",component:ai,data:{titleId:"newOrganization"}},{path:"settings",children:[{path:"",pathMatch:"full",redirectTo:"account"},{path:"account",component:Jo,data:{titleId:"myAccount"}},{path:"preferences",component:Th,data:{titleId:"preferences"}},{path:"security",loadChildren:()=>Yc},{path:"domain-rules",component:ah,data:{titleId:"domainRules"}},{path:"emergency-access",children:[{path:"",component:va,data:{titleId:"emergencyAccess"}},{path:":id",component:oc,data:{titleId:"emergencyAccess"}}]},{path:"sponsored-families",component:Zi,data:{titleId:"sponsoredFamilies"}}]},{path:"tools",canActivate:[W.a1],children:[{path:"",pathMatch:"full",redirectTo:"generator"},{path:"import",loadComponent:()=>Promise.all([i.e(395),i.e(409),i.e(651)]).then(i.bind(i,32651)).then((e=>e.ImportWebComponent)),data:{titleId:"importData"}},{path:"export",loadChildren:()=>Promise.all([i.e(229),i.e(125)]).then(i.bind(i,33125)).then((e=>e.ExportModule))},{path:"generator",component:dg,data:{titleId:"generator"}}]},{path:"reports",loadChildren:()=>pg.Fz},{path:"setup/families-for-enterprise",component:Xt}]},{path:"organizations",loadChildren:()=>i.e(838).then(i.bind(i,71838)).then((e=>e.OrganizationModule))}];class $y{}$y.ɵfac=function(e){return new(e||$y)},$y.ɵmod=s.oAB({type:$y}),$y.ɵinj=s.cJS({imports:[p.Bz.forRoot(Vy,{useHash:!0,paramsInheritanceStrategy:"always"}),p.Bz]});var Hy=i(33970),Wy=i(41366),Xy=i(72444),ew=i(4519);class tw{}tw.ɵfac=function(e){return new(e||tw)},tw.ɵmod=s.oAB({type:tw}),tw.ɵinj=s.cJS({imports:[Om.m,l.u5,l.UX,ew.Zn,Xy.n]});class iw{}iw.ɵfac=function(e){return new(e||iw)},iw.ɵmod=s.oAB({type:iw}),iw.ɵinj=s.cJS({imports:[me.m,tw,Ko.x,Hy.ey,Wy.N]});class nw{}nw.ɵfac=function(e){return new(e||nw)},nw.ɵmod=s.oAB({type:nw}),nw.ɵinj=s.cJS({imports:[iw,iw]});var sw=i(49831);class ow{constructor(e,t){this.options=e,this.token=t}}class rw{constructor(e,t,i){this.createOptions=e,this.deviceResponse=t,this.supportsPrf=i}}class aw{constructor(e,t,i){this.id=e,this.name=t,this.prfStatus=i}}var lw=i(85540),cw=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class uw{constructor(){this.cryptoService=(0,s.f3M)(D.$),this.encryptService=(0,s.f3M)(lw.U)}createKeySet(e){return cw(this,void 0,void 0,(function*(){const[t,i]=yield this.cryptoService.makeKeyPair(e),n=yield this.cryptoService.getUserKey(),s=Ci.c.fromB64ToArray(t),o=yield this.cryptoService.rsaEncrypt(n.key,s),r=yield this.encryptService.encrypt(s,n);return new Di.VJ(o,r,i)}))}}uw.ɵfac=function(e){return new(e||uw)},uw.ɵprov=s.Yz7({token:uw,factory:uw.ɵfac,providedIn:"root"});class dw{}class pw{}class hw{constructor(e){this.id=e.id,this.rawId=Ci.c.fromBufferToB64(e.rawId),this.type=e.type,this.extensions={}}}class gw extends hw{constructor(e){if(super(e),!(e.response instanceof AuthenticatorAttestationResponse))throw new Error("Invalid authenticator response");this.response={attestationObject:Ci.c.fromBufferToB64(e.response.attestationObject),clientDataJson:Ci.c.fromBufferToB64(e.response.clientDataJSON)}}}var fw=i(16284),mw=i(70908),vw=i(58043);class yw extends vw.c{constructor(e){super(e),this.options=new mw.ap(this.getResponseProperty("options")),this.token=this.getResponseProperty("token")}}var ww=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class bw{constructor(e){this.apiService=e}getCredentialCreateOptions(e){return ww(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/webauthn/attestation-options",e,!0,!0);return new yw(t)}))}getCredentialAssertionOptions(e){return ww(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/webauthn/assertion-options",e,!0,!0);return new fw.D(t)}))}saveCredential(e){return ww(this,void 0,void 0,(function*(){return yield this.apiService.send("POST","/webauthn",e,!0,!0),!0}))}getCredentials(){return this.apiService.send("GET","/webauthn",null,!0,!0)}deleteCredential(e,t){return ww(this,void 0,void 0,(function*(){yield this.apiService.send("POST",`/webauthn/${e}/delete`,t,!0,!0)}))}updateCredential(e){return ww(this,void 0,void 0,(function*(){yield this.apiService.send("PUT","/webauthn",e,!0,!0)}))}}bw.ɵfac=function(e){return new(e||bw)(s.LFG(Ue.s))},bw.ɵprov=s.Yz7({token:bw,factory:bw.ɵfac,providedIn:"root"});var Uw=i(77442),_w=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Aw{constructor(e,t,i,n,s,o){this.apiService=e,this.userVerificationService=t,this.rotateableKeySetService=i,this.webAuthnLoginPrfCryptoService=n,this.logService=o,this._refresh$=new Ch.X(void 0),this._loading$=new Ch.X(!0),this.credentials$=this._refresh$.pipe((0,Gs.b)((()=>this._loading$.next(!0))),(0,dn.w)((()=>this.fetchCredentials$())),(0,Gs.b)((()=>this._loading$.next(!1))),(0,ev.d)({bufferSize:1,refCount:!0})),this.loading$=this._loading$.asObservable(),this.navigatorCredentials=null!=s?s:navigator.credentials}getCredentialAssertOptions(e){return _w(this,void 0,void 0,(function*(){const t=yield this.userVerificationService.buildRequest(e),i=yield this.apiService.getCredentialAssertionOptions(t);return new sw.s(i.options,i.token)}))}getCredentialAttestationOptions(e){return _w(this,void 0,void 0,(function*(){const t=yield this.userVerificationService.buildRequest(e),i=yield this.apiService.getCredentialCreateOptions(t);return new ow(i.options,i.token)}))}createCredential(e){var t,i;return _w(this,void 0,void 0,(function*(){const n={publicKey:e.options};n.publicKey.extensions={prf:{}};try{const i=yield this.navigatorCredentials.create(n);if(!(i instanceof PublicKeyCredential))return;const s=Boolean(null===(t=i.getClientExtensionResults().prf)||void 0===t?void 0:t.enabled);return new rw(e,i,s)}catch(s){return void(null===(i=this.logService)||void 0===i||i.error(s))}}))}createKeySet(e){var t,i,n;return _w(this,void 0,void 0,(function*(){const s={publicKey:{challenge:e.createOptions.options.challenge,allowCredentials:[{id:e.deviceResponse.rawId,type:"public-key"}],rpId:e.createOptions.options.rp.id,timeout:e.createOptions.options.timeout,userVerification:e.createOptions.options.authenticatorSelection.userVerification,extensions:{prf:{eval:{first:yield this.webAuthnLoginPrfCryptoService.getLoginWithPrfSalt()}}}}};try{const e=yield this.navigatorCredentials.get(s);if(!(e instanceof PublicKeyCredential))return;const n=null===(i=null===(t=e.getClientExtensionResults().prf)||void 0===t?void 0:t.results)||void 0===i?void 0:i.first;if(void 0===n)return;const o=yield this.webAuthnLoginPrfCryptoService.createSymmetricKeyFromPrf(n);return yield this.rotateableKeySetService.createKeySet(o)}catch(o){return void(null===(n=this.logService)||void 0===n||n.error(o))}}))}saveCredential(e,t,i){return _w(this,void 0,void 0,(function*(){const n=new pw;n.deviceResponse=new gw(t.deviceResponse),n.token=t.createOptions.token,n.name=e,n.supportsPrf=t.supportsPrf,n.encryptedUserKey=null==i?void 0:i.encryptedUserKey.encryptedString,n.encryptedPublicKey=null==i?void 0:i.encryptedPublicKey.encryptedString,n.encryptedPrivateKey=null==i?void 0:i.encryptedPrivateKey.encryptedString,yield this.apiService.saveCredential(n),this.refresh()}))}enableCredentialEncryption(e){return _w(this,void 0,void 0,(function*(){if(void 0===e||void 0===(null==e?void 0:e.prfKey))throw new Error("invalid credential");const t=yield this.rotateableKeySetService.createKeySet(e.prfKey),i=new dw;i.token=e.token,i.deviceResponse=e.deviceResponse,i.encryptedUserKey=t.encryptedUserKey.encryptedString,i.encryptedPublicKey=t.encryptedPublicKey.encryptedString,i.encryptedPrivateKey=t.encryptedPrivateKey.encryptedString,yield this.apiService.updateCredential(i),this.refresh()}))}getCredentials$(){return this.credentials$}getCredential$(e){return this.credentials$.pipe((0,y.U)((t=>t.find((t=>t.id===e)))),(0,m.h)((e=>void 0!==e)))}deleteCredential(e,t){return _w(this,void 0,void 0,(function*(){const i=yield this.userVerificationService.buildRequest(t);yield this.apiService.deleteCredential(e,i),this.refresh()}))}fetchCredentials$(){return(0,gn.D)(this.apiService.getCredentials()).pipe((0,y.U)((e=>e.data.map((e=>new aw(e.id,e.name,e.prfStatus))))))}refresh(){this._refresh$.next()}}Aw.MaxCredentialCount=5,Aw.ɵfac=function(e){return new(e||Aw)(s.LFG(bw),s.LFG(nn.i),s.LFG(uw),s.LFG(Uw.Z),s.LFG(CredentialsContainer,8),s.LFG(_e.$,8))},Aw.ɵprov=s.Yz7({token:Aw,factory:Aw.ɵfac,providedIn:"root"});class Zw{}Zw.ɵfac=function(e){return new(e||Zw)},Zw.ɵmod=s.oAB({type:Zw}),Zw.ɵinj=s.cJS({imports:[me.m,Xy.n]});var xw=i(49106),Sw=i(99005),Tw=i(59784);class Cw{}Cw.ɵfac=function(e){return new(e||Cw)},Cw.ɵmod=s.oAB({type:Cw}),Cw.ɵinj=s.cJS({imports:[me.m]});class Ow{}Ow.ɵfac=function(e){return new(e||Ow)},Ow.ɵmod=s.oAB({type:Ow}),Ow.ɵinj=s.cJS({providers:[d.rS],imports:[me.m,au.U5,Cw,xw.k,Sw.Q,ve,Tw.I,ye.pV,ye.Fi,ou]});class kw{}kw.ɵfac=function(e){return new(e||kw)},kw.ɵmod=s.oAB({type:kw}),kw.ɵinj=s.cJS({imports:[me.m,me.f,Ow,vm,pm.D,Zw,nw,jg,me.m,me.f,Ow,vm,pm.D,Zw]});class Pw{}Pw.ɵfac=function(e){return new(e||Pw)},Pw.ɵmod=s.oAB({type:Pw}),Pw.ɵinj=s.cJS({imports:[p.Bz.forChild([{path:"**",redirectTo:""}]),p.Bz]});class qw{}qw.ɵfac=function(e){return new(e||qw)},qw.ɵmod=s.oAB({type:qw,bootstrap:[$]}),qw.ɵinj=s.cJS({imports:[kw,c.PW,l.u5,H.IR,u.Rq,r._t,a.xu,$y,Pw]}),i(67234),i(21834),(0,s.G48)(),n.q6().bootstrapModule(qw,{preserveWhitespaces:!0})},45995:(e,t,i)=>{"use strict";i.d(t,{o:()=>A});var n=i(99042),s=i(19887),o=i(78243),r=i(36788),a=i(56934),l=i(27646),c=i(39553),u=i(85762),d=i(1153),p=i(8111),h=i(78627),g=i(58172),f=i(99721),m=i(55602),v=i(79865),y=i(66459),w=i(65254),b=i(42842),U=i(47724),_=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class A{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f){this.ssoLoginService=e,this.loginStrategyService=t,this.router=i,this.i18nService=n,this.route=s,this.stateService=o,this.platformUtilsService=r,this.apiService=a,this.cryptoFunctionService=l,this.environmentService=c,this.passwordGenerationService=u,this.logService=d,this.userDecryptionOptionsService=p,this.configService=h,this.masterPasswordService=g,this.accountService=f,this.loggingIn=!1,this.twoFactorRoute="2fa",this.successRoute="lock",this.trustedDeviceEncRoute="login-initiated",this.changePasswordRoute="set-password",this.forcePasswordResetRoute="update-temp-password"}ngOnInit(){return _(this,void 0,void 0,(function*(){this.route.queryParams.pipe((0,s.P)()).subscribe((e=>_(this,void 0,void 0,(function*(){if(null!=e.code&&null!=e.state){const t=yield this.ssoLoginService.getCodeVerifier(),i=yield this.ssoLoginService.getSsoState();if(yield this.ssoLoginService.setCodeVerifier(null),yield this.ssoLoginService.setSsoState(null),null!=e.code&&null!=t&&null!=i&&this.checkState(i,e.state)){const i=this.getOrgIdentifierFromState(e.state);yield this.logIn(e.code,t,i)}}else null!=e.clientId&&null!=e.redirectUri&&null!=e.state&&null!=e.codeChallenge&&(this.redirectUri=e.redirectUri,this.state=e.state,this.codeChallenge=e.codeChallenge,this.clientId=e.clientId)}))))}))}submit(e,t){return _(this,void 0,void 0,(function*(){if(null==this.identifier||""===this.identifier)return void this.platformUtilsService.showToast("error",this.i18nService.t("ssoValidationFailed"),this.i18nService.t("ssoIdentifierRequired"));this.initiateSsoFormPromise=this.apiService.preValidateSso(this.identifier);const i=yield this.initiateSsoFormPromise,n=yield this.buildAuthorizeUrl(e,t,i.token);this.platformUtilsService.launchUri(n,{sameWindow:!0})}))}buildAuthorizeUrl(e,t,i){return _(this,void 0,void 0,(function*(){let s=this.codeChallenge,o=this.state;const r={type:"password",length:64,uppercase:!0,lowercase:!0,numbers:!0,special:!1};if(null==s){const e=yield this.passwordGenerationService.generatePassword(r),t=yield this.cryptoFunctionService.hash(e,"sha256");s=l.c.fromBufferToUrlB64(t),yield this.ssoLoginService.setCodeVerifier(e)}null==o&&(o=yield this.passwordGenerationService.generatePassword(r),e&&(o+=`_returnUri='${e}'`)),o+=`_identifier=${this.identifier}`,yield this.ssoLoginService.setSsoState(o);let a=(yield(0,n.z)(this.environmentService.environment$)).getIdentityUrl()+"/connect/authorize?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&scope=api offline_access&state="+o+"&code_challenge="+s+"&code_challenge_method=S256&response_mode=query&domain_hint="+encodeURIComponent(this.identifier)+"&ssoToken="+encodeURIComponent(i);if(t){const e=yield this.apiService.getSsoUserIdentifier();a+=`&user_identifier=${encodeURIComponent(e)}`}return a}))}logIn(e,t,i){return _(this,void 0,void 0,(function*(){this.loggingIn=!0;try{const s=yield this.ssoLoginService.getSsoEmail(),a=new o.Or(e,t,this.redirectUri,i,s);this.formPromise=this.loginStrategyService.logIn(a);const l=yield this.formPromise;if(l.requiresTwoFactor)return yield this.handleTwoFactorRequired(i);if(yield this.ssoLoginService.setActiveUserOrganizationSsoIdentifier(i),l.forcePasswordReset==r.w.AdminForcePasswordReset)return yield this.handleForcePasswordReset(i);const c=yield(0,n.z)(this.userDecryptionOptionsService.userDecryptionOptions$);if(yield this.isTrustedDeviceEncEnabled(c.trustedDeviceOption))return yield this.handleTrustedDeviceEncryptionEnabled(l,i,c);return!c.hasMasterPassword&&void 0===c.keyConnectorOption||l.resetMasterPassword?yield this.handleChangePasswordRequired(i):yield this.handleSuccessfulLogin()}catch(s){yield this.handleLoginError(s)}}))}isTrustedDeviceEncEnabled(e){return _(this,void 0,void 0,(function*(){return void 0!==e}))}handleTwoFactorRequired(e){return _(this,void 0,void 0,(function*(){yield this.navigateViaCallbackOrRoute(this.onSuccessfulLoginTwoFactorNavigate,[this.twoFactorRoute],{queryParams:{identifier:e,sso:"true"}})}))}handleTrustedDeviceEncryptionEnabled(e,t,i){var s;return _(this,void 0,void 0,(function*(){if(!i.hasMasterPassword&&i.trustedDeviceOption.hasManageResetPasswordPermission){const e=null===(s=yield(0,n.z)(this.accountService.activeAccount$))||void 0===s?void 0:s.id;yield this.masterPasswordService.setForceSetPasswordReason(r.w.TdeUserWithoutPasswordHasPasswordResetPermission,e)}null!=this.onSuccessfulLoginTde&&this.onSuccessfulLoginTde(),this.navigateViaCallbackOrRoute(this.onSuccessfulLoginTdeNavigate,[this.trustedDeviceEncRoute])}))}handleChangePasswordRequired(e){return _(this,void 0,void 0,(function*(){yield this.navigateViaCallbackOrRoute(this.onSuccessfulLoginChangePasswordNavigate,[this.changePasswordRoute],{queryParams:{identifier:e}})}))}handleForcePasswordReset(e){return _(this,void 0,void 0,(function*(){yield this.navigateViaCallbackOrRoute(this.onSuccessfulLoginForceResetNavigate,[this.forcePasswordResetRoute],{queryParams:{identifier:e}})}))}handleSuccessfulLogin(){return _(this,void 0,void 0,(function*(){null!=this.onSuccessfulLogin&&this.onSuccessfulLogin(),yield this.navigateViaCallbackOrRoute(this.onSuccessfulLoginNavigate,[this.successRoute])}))}handleLoginError(e){return _(this,void 0,void 0,(function*(){this.logService.error(e),"Key Connector error"===e.message&&this.platformUtilsService.showToast("error",null,this.i18nService.t("ssoKeyConnectorError"))}))}navigateViaCallbackOrRoute(e,t,i){return _(this,void 0,void 0,(function*(){e?yield e():yield this.router.navigate(t,i)}))}getOrgIdentifierFromState(e){if(null==e)return null;const t=e.split("_identifier=");return t.length>1?t[1]:null}checkState(e,t){if(null==e)return!1;if(null==t)return!1;const i=e.split("_identifier="),n=t.split("_identifier=");return i[0]===n[0]}}A.ɵfac=function(e){return new(e||A)(u.Y36(d.F),u.Y36(o.m),u.Y36(p.F0),u.Y36(h.D),u.Y36(p.gz),u.Y36(g.b),u.Y36(f.P),u.Y36(m.s),u.Y36(v.O),u.Y36(a.L),u.Y36(c.UW),u.Y36(y.$),u.Y36(o.Bb),u.Y36(w.E),u.Y36(b.R),u.Y36(U.BR))},A.ɵdir=u.lG2({type:A})},78493:(e,t,i)=>{"use strict";i.d(t,{a:()=>g});var n=i(99042),s=i(67855),o=i(36788),r=i(34961),a=i(85762),l=i(2184),c=i(8111),u=i(1008),d=i(47724),p=i(42842),h=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class g{constructor(e,t,i,n,s,o){this.authService=e,this.router=t,this.messagingService=i,this.keyConnectorService=n,this.accountService=s,this.masterPasswordService=o}canActivate(e,t){return h(this,void 0,void 0,(function*(){const e=yield this.authService.getAuthStatus();if(e===s.y.LoggedOut)return this.messagingService.send("authBlocked",{url:t.url}),!1;if(e===s.y.Locked)return null!=t&&this.messagingService.send("lockedUrl",{url:t.url}),this.router.createUrlTree(["lock"],{queryParams:{promptBiometric:!0}});if(!t.url.includes("remove-password")&&(yield this.keyConnectorService.getConvertAccountRequired()))return this.router.createUrlTree(["/remove-password"]);const i=(yield(0,n.z)(this.accountService.activeAccount$)).id,r=yield(0,n.z)(this.masterPasswordService.forceSetPasswordReason$(i));return r!==o.w.TdeUserWithoutPasswordHasPasswordResetPermission||t.url.includes("set-password")?!(r!==o.w.None&&!t.url.includes("update-temp-password"))||this.router.createUrlTree(["/update-temp-password"]):this.router.createUrlTree(["/set-password"])}))}}g.ɵfac=function(e){return new(e||g)(a.LFG(l.e),a.LFG(c.F0),a.LFG(r.o),a.LFG(u.J),a.LFG(d.BR),a.LFG(p.j))},g.ɵprov=a.Yz7({token:g,factory:g.ɵfac})},66463:(e,t,i)=>{"use strict";i.d(t,{a1:()=>n.a,at:()=>_.a,nw:()=>m,Qp:()=>w,Br:()=>U});var n=i(78493),s=i(85762),o=i(8111),r=i(99042),a=i(2184),l=i(51651),c=i(42304),u=i(67855),d=i(51303),p=i(76528),h=i(34961),g=i(99721),f=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function m(){return(e,t)=>f(this,void 0,void 0,(function*(){const t=(0,s.f3M)(a.e),i=(0,s.f3M)(p.$),n=(0,s.f3M)(l.U),f=(0,s.f3M)(g.P),m=(0,s.f3M)(h.o),v=(0,s.f3M)(o.F0),y=(0,s.f3M)(c.i);if((yield t.getAuthStatus())!==u.y.Locked)return v.createUrlTree(["/"]);if(yield i.isLegacyUser())return f.getClientType()===d.Bh.Web?v.createUrlTree(["migrate-legacy-encryption"]):(m.send("logout"),!1);const w=yield(0,r.z)(n.supportsDeviceTrust$);if("login-initiated"===e.queryParams.from&&w&&(yield y.hasMasterPassword()))return!0;const b=yield(0,r.z)(i.everHadUserKey$);return!(w&&!b)||v.createUrlTree(["/"])}))}var v=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const y={loggedIn:"/vault",loggedOut:"/login",locked:"/lock",notDecrypted:"/login-initiated"};function w(e={}){const t=Object.assign(Object.assign({},y),e);return e=>v(this,void 0,void 0,(function*(){const i=(0,s.f3M)(a.e),n=(0,s.f3M)(p.$),c=(0,s.f3M)(l.U),d=(0,s.f3M)(o.F0),h=yield i.getAuthStatus();if(h===u.y.LoggedOut)return d.createUrlTree([t.loggedOut],{queryParams:e.queryParams});if(h===u.y.Unlocked)return d.createUrlTree([t.loggedIn],{queryParams:e.queryParams});const g=yield(0,r.z)(c.supportsDeviceTrust$),f=yield(0,r.z)(n.everHadUserKey$);return h===u.y.Locked&&g&&!f?d.createUrlTree([t.notDecrypted],{queryParams:e.queryParams}):h===u.y.Locked?d.createUrlTree([t.locked],{queryParams:e.queryParams}):d.createUrlTree(["/"])}))}var b=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function U(){return(e,t)=>b(this,void 0,void 0,(function*(){const e=(0,s.f3M)(a.e),t=(0,s.f3M)(p.$),i=(0,s.f3M)(l.U),n=(0,s.f3M)(o.F0),c=yield e.getAuthStatus(),d=yield(0,r.z)(i.supportsDeviceTrust$),h=yield(0,r.z)(t.everHadUserKey$);return!(c!==u.y.Locked||!d||h)||n.createUrlTree(["/"])}))}var _=i(70979)},70979:(e,t,i)=>{"use strict";i.d(t,{a:()=>l});var n=i(67855),s=i(85762),o=i(2184),r=i(8111),a=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class l{constructor(e,t){this.authService=e,this.router=t,this.homepage="vault"}canActivate(){return a(this,void 0,void 0,(function*(){const e=yield this.authService.getAuthStatus();return e===n.y.LoggedOut||(e===n.y.Locked?this.router.createUrlTree(["lock"]):this.router.createUrlTree([this.homepage]))}))}}l.ɵfac=function(e){return new(e||l)(s.LFG(o.e),s.LFG(r.F0))},l.ɵprov=s.Yz7({token:l,factory:l.ɵfac})},53707:(e,t,i)=>{"use strict";i.d(t,{O:()=>v});i(85623);var n=i(85762),s=i(78627),o=i(28508),r=i(82933);function a(e,t){if(1&e&&n._UZ(0,"i",6),2&e){const e=n.oxw(2);n.Gre("bwi ",e.icon,"")}}function l(e,t){if(1&e&&(n.TgZ(0,"h3",4),n._uU(1,"\n    "),n.YNc(2,a,1,3,"i",5),n._uU(3),n.qZA()),2&e){const e=n.oxw();n.xp6(2),n.Q6J("ngIf",e.icon),n.xp6(1),n.hij("\n    ",e.title,"\n  ")}}function c(e,t){if(1&e&&(n.TgZ(0,"li"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e){const e=n.oxw(2);n.xp6(1),n.hij("\n        ",n.xi3(2,1,"policyInEffectMinComplexity",e.getPasswordScoreAlertDisplay()),"\n      ")}}function u(e,t){if(1&e&&(n.TgZ(0,"li"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e){const e=n.oxw(2);n.xp6(1),n.hij("\n        ",n.xi3(2,1,"policyInEffectMinLength",null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.minLength.toString()),"\n      ")}}function d(e,t){1&e&&(n.TgZ(0,"li"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.hij("\n        ",n.lcZ(2,1,"policyInEffectUppercase"),"\n      "))}function p(e,t){1&e&&(n.TgZ(0,"li"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.hij("\n        ",n.lcZ(2,1,"policyInEffectLowercase"),"\n      "))}function h(e,t){1&e&&(n.TgZ(0,"li"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.hij("\n        ",n.lcZ(2,1,"policyInEffectNumbers"),"\n      "))}function g(e,t){1&e&&(n.TgZ(0,"li"),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e&&(n.xp6(1),n.hij("\n        ",n.xi3(2,1,"policyInEffectSpecial","!@#$%^&*"),"\n      "))}function f(e,t){if(1&e&&(n.TgZ(0,"div",7),n._uU(1),n.TgZ(2,"ul"),n._uU(3,"\n      "),n.YNc(4,c,3,4,"li",8),n._uU(5,"\n      "),n.YNc(6,u,3,4,"li",8),n._uU(7,"\n      "),n.YNc(8,d,3,3,"li",8),n._uU(9,"\n      "),n.YNc(10,p,3,3,"li",8),n._uU(11,"\n      "),n.YNc(12,h,3,3,"li",8),n._uU(13,"\n      "),n.YNc(14,g,3,4,"li",8),n._uU(15,"\n    "),n.qZA(),n._uU(16,"\n  "),n.qZA()),2&e){const e=n.oxw();n.xp6(1),n.hij("\n    ",e.enforcedPolicyMessage,"\n    "),n.xp6(3),n.Q6J("ngIf",(null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.minComplexity)>0),n.xp6(2),n.Q6J("ngIf",(null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.minLength)>0),n.xp6(2),n.Q6J("ngIf",null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.requireUpper),n.xp6(2),n.Q6J("ngIf",null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.requireLower),n.xp6(2),n.Q6J("ngIf",null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.requireNumbers),n.xp6(2),n.Q6J("ngIf",null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.requireSpecial)}}const m=function(e){return{clickable:e}};class v{constructor(e){this.i18nService=e,this.type="info",this.useAlertRole=!1}ngOnInit(){this.calloutStyle=this.type,void 0===this.enforcedPolicyMessage&&(this.enforcedPolicyMessage=this.i18nService.t("masterPasswordPolicyInEffect")),"warning"===this.type||"danger"===this.type?("danger"===this.type&&(this.calloutStyle="danger"),void 0===this.title&&(this.title=this.i18nService.t("warning")),void 0===this.icon&&(this.icon="bwi-exclamation-triangle")):"error"===this.type?(this.calloutStyle="danger",void 0===this.title&&(this.title=this.i18nService.t("error")),void 0===this.icon&&(this.icon="bwi-error")):"tip"===this.type&&(this.calloutStyle="success",void 0===this.title&&(this.title=this.i18nService.t("tip")),void 0===this.icon&&(this.icon="bwi-lightbulb"))}getPasswordScoreAlertDisplay(){if(null==this.enforcedPolicyOptions)return"";let e;switch(this.enforcedPolicyOptions.minComplexity){case 4:e=this.i18nService.t("strong");break;case 3:e=this.i18nService.t("good");break;default:e=this.i18nService.t("weak")}return e+" ("+this.enforcedPolicyOptions.minComplexity+")"}}v.ɵfac=function(e){return new(e||v)(n.Y36(s.D))},v.ɵcmp=n.Xpm({type:v,selectors:[["app-callout"]],inputs:{type:"type",icon:"icon",title:"title",clickable:"clickable",enforcedPolicyOptions:"enforcedPolicyOptions",enforcedPolicyMessage:"enforcedPolicyMessage",useAlertRole:"useAlertRole"},ngContentSelectors:["*"],decls:10,vars:9,consts:[[3,"ngClass"],["callout",""],["class","callout-heading",4,"ngIf"],["class","enforced-policy-options",4,"ngIf"],[1,"callout-heading"],["aria-hidden","true",3,"class",4,"ngIf"],["aria-hidden","true"],[1,"enforced-policy-options"],[4,"ngIf"]],template:function(e,t){1&e&&(n.F$t(),n.TgZ(0,"div",0,1),n._uU(2,"\n  "),n.YNc(3,l,4,2,"h3",2),n._uU(4,"\n  "),n.YNc(5,f,17,7,"div",3),n._uU(6,"\n  "),n.Hsn(7),n._uU(8,"\n"),n.qZA(),n._uU(9,"\n")),2&e&&(n.Gre("callout callout-",t.calloutStyle,""),n.Q6J("ngClass",n.VKq(7,m,t.clickable)),n.uIk("role",t.useAlertRole?"alert":null),n.xp6(3),n.Q6J("ngIf",t.title),n.xp6(2),n.Q6J("ngIf",t.enforcedPolicyOptions))},dependencies:[o.mk,o.O5,r.C],encapsulation:2})},33245:(e,t,i)=>{"use strict";i.d(t,{B:()=>s});var n=i(85762);class s{set appA11yTitle(e){this.title=e}constructor(e,t){this.el=e,this.renderer=t}ngOnInit(){this.el.nativeElement.hasAttribute("title")||this.renderer.setAttribute(this.el.nativeElement,"title",this.title),this.el.nativeElement.hasAttribute("aria-label")||this.renderer.setAttribute(this.el.nativeElement,"aria-label",this.title)}}s.ɵfac=function(e){return new(e||s)(n.Y36(n.SBq),n.Y36(n.Qsj))},s.ɵdir=n.lG2({type:s,selectors:[["","appA11yTitle",""]],inputs:{appA11yTitle:"appA11yTitle"}})},24610:(e,t,i)=>{"use strict";i.d(t,{b:()=>r});var n=i(85762),s=i(14494),o=i(66459);class r{constructor(e,t,i){this.el=e,this.validationService=t,this.logService=i}ngOnChanges(e){null!=this.appApiAction&&null!=this.appApiAction.then&&(this.el.nativeElement.loading=!0,this.appApiAction.then((e=>{this.el.nativeElement.loading=!1}),(e=>{var t;this.el.nativeElement.loading=!1,e.captchaRequired?this.logService.error("Captcha required error response: "+e.getSingleMessage()):(null===(t=this.logService)||void 0===t||t.error(`Received API exception: ${e}`),this.validationService.showError(e))})))}}r.ɵfac=function(e){return new(e||r)(n.Y36(n.SBq),n.Y36(s.R),n.Y36(o.$))},r.ɵdir=n.lG2({type:r,selectors:[["","appApiAction",""]],inputs:{appApiAction:"appApiAction"},features:[n.TTD]})},85356:(e,t,i)=>{"use strict";i.d(t,{b:()=>s});var n=i(85762);class s{set appInputVerbatim(e){this.disableComplete=""===e||!0===e}constructor(e,t){this.el=e,this.renderer=t}ngOnInit(){this.disableComplete&&!this.el.nativeElement.hasAttribute("autocomplete")&&this.renderer.setAttribute(this.el.nativeElement,"autocomplete","off"),this.el.nativeElement.hasAttribute("autocapitalize")||this.renderer.setAttribute(this.el.nativeElement,"autocapitalize","none"),this.el.nativeElement.hasAttribute("autocorrect")||this.renderer.setAttribute(this.el.nativeElement,"autocorrect","none"),this.el.nativeElement.hasAttribute("spellcheck")||this.renderer.setAttribute(this.el.nativeElement,"spellcheck","false"),this.el.nativeElement.hasAttribute("inputmode")||this.renderer.setAttribute(this.el.nativeElement,"inputmode","verbatim")}}s.ɵfac=function(e){return new(e||s)(n.Y36(n.SBq),n.Y36(n.Qsj))},s.ɵdir=n.lG2({type:s,selectors:[["","appInputVerbatim",""]],inputs:{appInputVerbatim:"appInputVerbatim"}})},2051:(e,t,i)=>{"use strict";i.d(t,{O:()=>s});var n=i(85762);class s{onClick(e){e.preventDefault()}}s.ɵfac=function(e){return new(e||s)},s.ɵdir=n.lG2({type:s,selectors:[["","appStopClick",""]],hostBindings:function(e,t){1&e&&n.NdJ("click",(function(e){return t.onClick(e)}))}})},12963:(e,t,i)=>{"use strict";i.d(t,{_:()=>s});var n=i(85762);class s{onClick(e){e.stopPropagation()}}s.ɵfac=function(e){return new(e||s)},s.ɵdir=n.lG2({type:s,selectors:[["","appStopProp",""]],hostBindings:function(e,t){1&e&&n.NdJ("click",(function(e){return t.onClick(e)}))}})},5344:(e,t,i)=>{"use strict";i.d(t,{b:()=>O});var n=i(28508),s=i(37513),o=i(3769),r=i(85762),a=i(41938),l=i(36903),c=i(49399),u=i(21656);function d(e,t){if(1&e&&(r.TgZ(0,"p",7),r._uU(1),r.qZA()),2&e){const e=r.oxw();r.xp6(1),r.Oqu(e.title)}}function p(e,t){if(1&e&&(r.TgZ(0,"p",8),r._uU(1),r.qZA()),2&e){const e=t.$implicit;r.xp6(1),r.hij("\n        ",e,"\n      ")}}const h={success:{icon:"bwi-check",bgColor:"tw-bg-success-600"},error:{icon:"bwi-error",bgColor:"tw-bg-danger-600"},info:{icon:"bwi-info-circle",bgColor:"tw-bg-info-600"},warning:{icon:"bwi-exclamation-triangle",bgColor:"tw-bg-warning-600"}};class g{constructor(){this.variant="info",this.progressWidth=0,this.onClose=new r.vpe}get iconClass(){return h[this.variant].icon}get bgColor(){return h[this.variant].bgColor}get messageArray(){return Array.isArray(this.message)?this.message:[this.message]}}g.ɵfac=function(e){return new(e||g)},g.ɵcmp=r.Xpm({type:g,selectors:[["bit-toast"]],inputs:{variant:"variant",message:"message",title:"title",progressWidth:"progressWidth"},outputs:{onClose:"onClose"},standalone:!0,features:[r.jDz],decls:23,vars:13,consts:[[1,"tw-flex","tw-items-center","tw-gap-4","tw-px-2","tw-pb-1","tw-pt-2"],["aria-hidden","true"],[1,"tw-sr-only"],["data-testid","toast-title","class","tw-font-semibold tw-mb-0",4,"ngIf"],["data-testid","toast-message","class","tw-mb-2 last:tw-mb-0",4,"ngFor","ngForOf"],["bitIconButton","bwi-close","buttonType","contrast","type","button",1,"tw-ml-auto",3,"click"],[1,"tw-h-1","tw-w-full","tw-bg-text-contrast/70"],["data-testid","toast-title",1,"tw-font-semibold","tw-mb-0"],["data-testid","toast-message",1,"tw-mb-2","last:tw-mb-0"]],template:function(e,t){1&e&&(r.TgZ(0,"div"),r._uU(1,"\n  "),r.TgZ(2,"div",0),r._uU(3,"\n    "),r._UZ(4,"i",1),r._uU(5,"\n    "),r.TgZ(6,"div"),r._uU(7,"\n      "),r.TgZ(8,"span",2),r._uU(9),r.ALo(10,"i18n"),r.qZA(),r._uU(11,"\n      "),r.YNc(12,d,2,1,"p",3),r._uU(13,"\n      "),r.YNc(14,p,2,1,"p",4),r._uU(15,"\n    "),r.qZA(),r._uU(16,"\n    "),r.TgZ(17,"button",5),r.NdJ("click",(function(){return t.onClose.emit()})),r.qZA(),r._uU(18,"\n  "),r.qZA(),r._uU(19,"\n  "),r._UZ(20,"div",6),r._uU(21,"\n"),r.qZA(),r._uU(22,"\n")),2&e&&(r.Gre("tw-mb-1 tw-min-w-[--bit-toast-width] tw-text-contrast tw-flex tw-flex-col tw-justify-between tw-rounded-md tw-pointer-events-auto tw-cursor-default ",t.bgColor,""),r.xp6(4),r.Gre("bwi tw-text-xl tw-py-1.5 tw-px-2.5 ",t.iconClass,""),r.xp6(5),r.Oqu(r.lcZ(10,11,t.variant)),r.xp6(3),r.Q6J("ngIf",t.title),r.xp6(2),r.Q6J("ngForOf",t.messageArray),r.xp6(6),r.Udp("width",t.progressWidth+"%"))},dependencies:[l.m,n.sg,n.O5,c.C,a.v,u.Q],encapsulation:2});var f=i(88444);class m extends o.FN{}m.ɵfac=function(){let e;return function(t){return(e||(e=r.n5z(m)))(t||m)}}(),m.ɵcmp=r.Xpm({type:m,selectors:[["ng-component"]],features:[r.qOj],decls:1,vars:4,consts:[[3,"title","variant","message","progressWidth","onClose"]],template:function(e,t){1&e&&(r.TgZ(0,"bit-toast",0),r.NdJ("onClose",(function(){return t.remove()})),r.qZA()),2&e&&r.Q6J("title",null==t.options||null==t.options.payload?null:t.options.payload.title)("variant",null==t.options||null==t.options.payload?null:t.options.payload.variant)("message",null==t.options||null==t.options.payload?null:t.options.payload.message)("progressWidth",t.width)},dependencies:[g],encapsulation:2,data:{animation:[(0,f.X$)("flyInOut",[(0,f.SB)("inactive",(0,f.oB)({opacity:0})),(0,f.SB)("active",(0,f.oB)({opacity:1})),(0,f.SB)("removed",(0,f.oB)({opacity:0})),(0,f.eR)("inactive => active",(0,f.jt)("{{ easeTime }}ms {{ easing }}")),(0,f.eR)("active => removed",(0,f.jt)("{{ easeTime }}ms {{ easing }}"))])]}});class v{static forRoot(e={}){return{ngModule:v,providers:[{provide:o.$e,useValue:{default:y,config:e}}]}}}v.ɵfac=function(e){return new(e||v)},v.ɵmod=r.oAB({type:v}),v.ɵinj=r.cJS({imports:[n.ez,g]});const y=Object.assign(Object.assign({},o.mU),{toastComponent:m,tapToDismiss:!1,timeOut:5e3,extendedTimeOut:2e3,maxOpened:5,autoDismiss:!0,progressBar:!0}),w={Visa:[{cardLength:16,blocks:[4,4,4,4]}],Mastercard:[{cardLength:16,blocks:[4,4,4,4]}],Maestro:[{cardLength:16,blocks:[4,4,4,4]},{cardLength:13,blocks:[4,4,5]},{cardLength:15,blocks:[4,6,5]},{cardLength:19,blocks:[4,4,4,4,3]}],Discover:[{cardLength:16,blocks:[4,4,4,4]}],"Diners Club":[{cardLength:14,blocks:[4,6,4]}],JCB:[{cardLength:16,blocks:[4,4,4,4]}],UnionPay:[{cardLength:16,blocks:[4,4,4,4]},{cardLength:19,blocks:[6,13]}],Amex:[{cardLength:15,blocks:[4,6,5]}],Other:[{cardLength:16,blocks:[4,4,4,4]}]};class b{transform(e,t){let i=w[t];null==i&&(i=w.Other);const n=e.length;let s=i.find((e=>e.cardLength==n));null==s&&(s=i[0]);const o=s.blocks,r=[];let a=0;return o.forEach((t=>{r.push(e.slice(a,a+t)),a+=t})),n>a&&r.push(e.slice(a)),r.join(" ")}}b.ɵfac=function(e){return new(e||b)},b.ɵpipe=r.Yjl({name:"creditCardNumber",type:b,pure:!0});var U=i(5712),_=i(19576),A=i(73672),Z=i(27646),x=i(76528),S=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class T{constructor(e){this.cryptoService=e}transform(e,t){return S(this,void 0,void 0,(function*(){try{"string"==typeof e&&(e=Z.c.fromB64ToArray(e));const i=yield this.cryptoService.getFingerprint(t,e);return null!=i?i.join("-"):""}catch(i){return""}}))}}T.ɵfac=function(e){return new(e||T)(r.Y36(x.$,16))},T.ɵpipe=r.Yjl({name:"fingerprint",type:T,pure:!0});var C=i(82933);class O{}O.ɵfac=function(e){return new(e||O)},O.ɵmod=r.oAB({type:O}),O.ɵinj=r.cJS({providers:[b,n.uU,C.C,U.C,_.z,A.t,T],imports:[v.forRoot({maxOpened:5,autoDismiss:!0,closeButton:!0}),n.ez,s.u5,s.UX,v]})},5712:(e,t,i)=>{"use strict";i.d(t,{C:()=>s});var n=i(85762);class s{transform(e,t,i,n,s){return null==e||0===e.length?[]:null==t||t.length<2?e:(t=t.trim().toLowerCase(),e.filter((e=>{if(null!=i){const n="function"==typeof i?i(e):e[i];if((null==n?void 0:n.toString().toLowerCase().indexOf(t))>-1)return!0}if(null!=n){const i="function"==typeof n?n(e):e[n];if((null==i?void 0:i.toString().toLowerCase().indexOf(t))>-1)return!0}if(null!=s){const i="function"==typeof s?s(e):e[s];if((null==i?void 0:i.toString().toLowerCase().indexOf(t))>-1)return!0}return!1})))}}s.ɵfac=function(e){return new(e||s)},s.ɵpipe=n.Yjl({name:"search",type:s,pure:!0})},19576:(e,t,i)=>{"use strict";i.d(t,{z:()=>s});var n=i(85762);class s{transform(e){return null==e||null==e.name&&null==e.email?null:null==e.name||""===e.name.trim()?e.email:e.name}}s.ɵfac=function(e){return new(e||s)},s.ɵpipe=n.Yjl({name:"userName",type:s,pure:!0})},73672:(e,t,i)=>{"use strict";i.d(t,{t:()=>r});var n=i(92614),s=i(85762),o=i(78627);class r{constructor(e){this.i18nService=e}transform(e){if(null==e)return this.i18nService.t("unknown");switch(e){case n.je.Owner:return this.i18nService.t("owner");case n.je.Admin:return this.i18nService.t("admin");case n.je.User:return this.i18nService.t("user");case n.je.Manager:return this.i18nService.t("manager");case n.je.Custom:return this.i18nService.t("custom")}}}r.ɵfac=function(e){return new(e||r)(s.Y36(o.D,16))},r.ɵpipe=s.Yjl({name:"userType",type:r,pure:!0})},69842:(e,t,i)=>{"use strict";i.d(t,{q:()=>n});class n{}},82933:(e,t,i)=>{"use strict";i.d(t,{C:()=>o});var n=i(85762),s=i(78627);class o{constructor(e){this.i18nService=e}transform(e,t,i,n){return this.i18nService.t(e,t,i,n)}}o.ɵfac=function(e){return new(e||o)(n.Y36(s.D,16))},o.ɵpipe=n.Yjl({name:"i18n",type:o,pure:!0})},81301:(e,t,i)=>{"use strict";i.d(t,{v:()=>n});class n{}},44609:(e,t,i)=>{"use strict";i.d(t,{FZ:()=>c,JN:()=>p,PE:()=>f,TY:()=>w,YZ:()=>m,Zk:()=>g,cy:()=>u,jo:()=>a,lF:()=>r,m9:()=>o,n3:()=>v,qV:()=>b,r5:()=>d,x3:()=>l,xI:()=>h,zU:()=>y});var n=i(85762);class s extends n.OlP{}const o=new s("WINDOW"),r=new s("OBSERVABLE_MEMORY_STORAGE"),a=new s("OBSERVABLE_DISK_STORAGE"),l=new s("OBSERVABLE_DISK_LOCAL_STORAGE"),c=new s("MEMORY_STORAGE"),u=new s("SECURE_STORAGE"),d=new s("STATE_FACTORY"),p=new s("LOGOUT_CALLBACK"),h=new s("LOCKED_CALLBACK"),g=new s("SUPPORTS_SECURE_STORAGE"),f=new s("LOCALES_DIRECTORY"),m=new s("SYSTEM_LANGUAGE"),v=new s("LOG_MAC_FAILURES"),y=new s("SYSTEM_THEME_OBSERVABLE"),w=new s("INTRAPROCESS_MESSAGING_SUBJECT"),b=new s("CLIENT_TYPE")},61374:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var n=i(19887),s=i(85762),o=i(66267),r=i(54019);class a{constructor(){this._onCreated=new r.x,this._onClose=new r.x,this._onClosed=new r.x,this._onShow=new r.x,this._onShown=new r.x,this.onCreated=this._onCreated.asObservable(),this.onClose=this._onClose.asObservable(),this.onClosed=this._onClosed.asObservable(),this.onShow=this._onShow.asObservable(),this.onShown=this._onShow.asObservable()}show(){this._onShow.next()}shown(){this._onShown.next()}close(e){this.lastResult=e,this._onClose.next(e)}closed(){this._onClosed.next(this.lastResult)}created(e){this._onCreated.next(e)}onClosedPromise(){return this.onClosed.pipe((0,n.P)()).toPromise()}}const l=["modalContent"];function c(e,t){}class u{constructor(e,t,i,n){this.cd=e,this.el=t,this.focusTrapFactory=i,this.modalRef=n}ngAfterViewInit(){this.loadChildComponent(this.childComponentType),null!=this.setComponentParameters&&this.setComponentParameters(this.componentRef.instance),this.cd.detectChanges(),this.modalRef.created(this.el.nativeElement),this.focusTrap=this.focusTrapFactory.create(this.el.nativeElement.querySelector(".modal-dialog")),null==this.el.nativeElement.querySelector("[appAutoFocus]")&&this.focusTrap.focusFirstTabbableElementWhenReady()}loadChildComponent(e){this.modalContentRef.clear(),this.componentRef=this.modalContentRef.createComponent(e)}ngOnDestroy(){this.componentRef&&this.componentRef.destroy(),this.focusTrap.destroy()}close(){this.modalRef.close()}getFocus(){const e=this.el.nativeElement.querySelector("[appAutoFocus]");null==e||e.focus()}}u.ɵfac=function(e){return new(e||u)(s.Y36(s.sBO),s.Y36(s.SBq),s.Y36(o.vO),s.Y36(a))},u.ɵcmp=s.Xpm({type:u,selectors:[["app-modal"]],viewQuery:function(e,t){if(1&e&&s.Gf(l,7,s.s_b),2&e){let e;s.iGM(e=s.CRH())&&(t.modalContentRef=e.first)}},decls:2,vars:0,consts:[["modalContent",""]],template:function(e,t){1&e&&s.YNc(0,c,0,0,"ng-template",null,0,s.W1O)},encapsulation:2});class d{constructor(e,t){this._parentInjector=e,this._additionalTokens=t}get(e,t,i){var n;return null!==(n=this._additionalTokens.get(e))&&void 0!==n?n:this._parentInjector.get(e,t)}}var p=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class h{constructor(e){this.injector=e,this.modalList=[],document.addEventListener("keyup",(e=>{"Escape"===e.key&&this.modalCount>0&&this.topModal.instance.close()}))}get modalCount(){return this.modalList.length}get topModal(){return this.modalList[this.modalCount-1]}openViewRef(e,t,i=null){return p(this,void 0,void 0,(function*(){const[s,o]=this.openInternal(t,e);return o.instance.setComponentParameters=i,t.insert(o.hostView),yield s.onCreated.pipe((0,n.P)()).toPromise(),[s,o.instance.componentRef.instance]}))}closeAll(){this.modalList.forEach((e=>e.instance.close()))}openInternal(e,t){const[i,s]=this.createModalComponent(e);return s.instance.childComponentType=t,i.onClosed.pipe((0,n.P)()).subscribe((()=>{s.destroy(),this.modalList.pop(),this.modalCount>0&&this.topModal.instance.getFocus()})),this.setupHandlers(i),this.modalList.push(s),[i,s]}setupHandlers(e){let t=null;e.onCreated.pipe((0,n.P)()).subscribe((i=>{document.body.classList.add("modal-open");const n=i.querySelector(".modal"),s=n.querySelector(".modal-dialog");t=document.createElement("div"),t.className="modal-backdrop fade",t.style.zIndex=`${this.modalCount}040`,n.prepend(t),s.addEventListener("click",(e=>{e.stopPropagation()})),s.style.zIndex=`${this.modalCount}050`;const o=Array.from(i.querySelectorAll('.modal-backdrop, .modal *[data-dismiss="modal"]'));for(const t of o)t.addEventListener("click",(()=>{e.close()}))})),e.onClose.pipe((0,n.P)()).subscribe((()=>{e.closed(),0===this.modalCount&&document.body.classList.remove("modal-open")}))}createModalComponent(e){const t=new a,i=new WeakMap;i.set(a,t);const n=new d(this.injector,i);return[t,e.createComponent(u,{injector:n})]}}h.ɵfac=function(e){return new(e||h)(s.LFG(s.zs3))},h.ɵprov=s.Yz7({token:h,factory:h.ɵfac})},56945:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var n=i(85762),s=i(51453),o=i(78627),r=i(28508);function a(e,t){if(1&e&&(n.ynx(0),n._uU(1),n.BQk()),2&e){const e=n.oxw();n.xp6(1),n.hij("\n      ",e.text,"\n    ")}}const l=function(e){return{width:e}};class c{set password(e){this.updatePasswordStrength(e)}get masterPasswordScoreColor(){switch(this.masterPasswordScore){case 4:return"success";case 3:return"primary";case 2:return"warning";default:return"danger"}}get masterPasswordScoreText(){switch(this.masterPasswordScore){case 4:return this.i18nService.t("strong");case 3:return this.i18nService.t("good");case 2:return this.i18nService.t("weak");default:return null!=this.masterPasswordScore?this.i18nService.t("weak"):null}}constructor(e,t){this.i18nService=e,this.passwordStrengthService=t,this.showText=!1,this.passwordStrengthResult=new n.vpe,this.passwordScoreColor=new n.vpe,this.scoreWidth=0,this.color="bg-danger"}ngOnChanges(){this.masterPasswordStrengthTimeout=setTimeout((()=>{switch(this.scoreWidth=null==this.masterPasswordScore?0:20*(this.masterPasswordScore+1),this.masterPasswordScore){case 4:this.color="bg-success",this.text=this.i18nService.t("strong");break;case 3:this.color="bg-primary",this.text=this.i18nService.t("good");break;case 2:this.color="bg-warning",this.text=this.i18nService.t("weak");break;default:this.color="bg-danger",this.text=null!=this.masterPasswordScore?this.i18nService.t("weak"):null}this.setPasswordScoreText(this.color,this.text)}),300)}updatePasswordStrength(e){var t;const i=e;null!=this.masterPasswordStrengthTimeout&&clearTimeout(this.masterPasswordStrengthTimeout);const n=this.passwordStrengthService.getPasswordStrength(i,this.email,null===(t=this.name)||void 0===t?void 0:t.trim().toLowerCase().split(" "));this.passwordStrengthResult.emit(n),this.masterPasswordScore=null==n?null:n.score}setPasswordScoreText(e,t){e=e.slice(3),this.passwordScoreColor.emit({color:e,text:t})}}c.ɵfac=function(e){return new(e||c)(n.Y36(o.D),n.Y36(s.A))},c.ɵcmp=n.Xpm({type:c,selectors:[["app-password-strength"]],inputs:{showText:"showText",email:"email",name:"name",password:"password"},outputs:{passwordStrengthResult:"passwordStrengthResult",passwordScoreColor:"passwordScoreColor"},features:[n.TTD],decls:8,vars:8,consts:[[1,"progress"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",3,"ngStyle"],[4,"ngIf"]],template:function(e,t){1&e&&(n.TgZ(0,"div",0),n._uU(1,"\n  "),n.TgZ(2,"div",1),n._uU(3,"\n    "),n.YNc(4,a,2,1,"ng-container",2),n._uU(5,"\n  "),n.qZA(),n._uU(6,"\n"),n.qZA(),n._uU(7,"\n")),2&e&&(n.xp6(2),n.Gre("progress-bar ",t.color,""),n.Q6J("ngStyle",n.VKq(6,l,t.scoreWidth+"%")),n.uIk("aria-valuenow",t.scoreWidth),n.xp6(2),n.Q6J("ngIf",t.showText&&t.text))},dependencies:[r.O5,r.PC],encapsulation:2})},91548:(e,t,i)=>{"use strict";i.d(t,{t:()=>y});var n=i(85762),s=i(99042),o=i(25679),r=i(65901),a=i(92236),l=i(78627),c=i(76528),u=i(99721),d=i(55602),p=i(66459),h=i(58172),g=i(53481),f=i(73369),m=i(384),v=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class y{constructor(e,t,i,s,o,r,a,l,c,u,d){this.cipherService=e,this.i18nService=t,this.cryptoService=i,this.platformUtilsService=s,this.apiService=o,this.win=r,this.logService=a,this.stateService=l,this.fileDownloadService=c,this.dialogService=u,this.billingAccountProfileStateService=d,this.onUploadedAttachment=new n.vpe,this.onDeletedAttachment=new n.vpe,this.onReuploadedAttachment=new n.vpe,this.deletePromises={},this.reuploadPromises={},this.emergencyAccessId=null,this.componentName=""}ngOnInit(){return v(this,void 0,void 0,(function*(){yield this.init()}))}submit(){return v(this,void 0,void 0,(function*(){const e=document.getElementById("file"),t=e.files;if(null!=t&&0!==t.length)if(t[0].size>524288e3)this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("maxFileSize"));else{try{this.formPromise=this.saveCipherAttachment(t[0]),this.cipherDomain=yield this.formPromise,this.cipher=yield this.cipherDomain.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(this.cipherDomain)),this.platformUtilsService.showToast("success",null,this.i18nService.t("attachmentSaved")),this.onUploadedAttachment.emit()}catch(i){this.logService.error(i)}e.type="",e.type="file",e.value=""}else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectFile"))}))}delete(e){return v(this,void 0,void 0,(function*(){if(null!=this.deletePromises[e.id])return;if(yield this.dialogService.openSimpleDialog({title:{key:"deleteAttachment"},content:{key:"deleteAttachmentConfirmation"},type:"warning"})){try{this.deletePromises[e.id]=this.deleteCipherAttachment(e.id),yield this.deletePromises[e.id],this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedAttachment"));const t=this.cipher.attachments.indexOf(e);t>-1&&this.cipher.attachments.splice(t,1)}catch(t){this.logService.error(t)}this.deletePromises[e.id]=null,this.onDeletedAttachment.emit()}}))}download(e){return v(this,void 0,void 0,(function*(){const t=e;if(t.downloading)return;if(!this.canAccessAttachments)return void this.platformUtilsService.showToast("error",this.i18nService.t("premiumRequired"),this.i18nService.t("premiumRequiredDesc"));let i;try{i=(yield this.apiService.getAttachmentData(this.cipher.id,e.id,this.emergencyAccessId)).url}catch(s){if(!(s instanceof o.i&&404===s.statusCode))throw s instanceof o.i?new Error(s.getSingleMessage()):s;i=e.url}t.downloading=!0;const n=yield fetch(new Request(i,{cache:"no-store"}));if(200!==n.status)return this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred")),void(t.downloading=!1);try{const t=yield r.j.fromResponse(n),i=null!=e.key?e.key:yield this.cryptoService.getOrgKey(this.cipher.organizationId),s=yield this.cryptoService.decryptFromBytes(t,i);this.fileDownloadService.download({fileName:e.fileName,blobData:s})}catch(s){this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}t.downloading=!1}))}init(){return v(this,void 0,void 0,(function*(){this.cipherDomain=yield this.loadCipher(),this.cipher=yield this.cipherDomain.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(this.cipherDomain));const e=yield(0,s.z)(this.billingAccountProfileStateService.hasPremiumFromAnySource$);if(this.canAccessAttachments=e||null!=this.cipher.organizationId,!this.canAccessAttachments){(yield this.dialogService.openSimpleDialog({title:{key:"premiumRequired"},content:{key:"premiumRequiredDesc"},acceptButtonText:{key:"learnMore"},type:"success"}))&&this.platformUtilsService.launchUri("https://vault.bitwarden.com/#/settings/subscription/premium")}}))}reuploadCipherAttachment(e,t){return v(this,void 0,void 0,(function*(){const i=e;if(null==e.key&&!i.downloading&&null==this.reuploadPromises[e.id])try{this.reuploadPromises[e.id]=Promise.resolve().then((()=>v(this,void 0,void 0,(function*(){i.downloading=!0;const n=yield fetch(new Request(e.url,{cache:"no-store"}));if(200!==n.status)return this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred")),void(i.downloading=!1);try{const i=yield r.j.fromResponse(n),s=null!=e.key?e.key:yield this.cryptoService.getOrgKey(this.cipher.organizationId),o=yield this.cryptoService.decryptFromBytes(i,s);this.cipherDomain=yield this.cipherService.saveAttachmentRawWithServer(this.cipherDomain,e.fileName,o,t),this.cipher=yield this.cipherDomain.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(this.cipherDomain)),this.deletePromises[e.id]=this.deleteCipherAttachment(e.id),yield this.deletePromises[e.id];const a=this.cipher.attachments.filter((t=>t.id===e.id));if(a.length>0){const e=this.cipher.attachments.indexOf(a[0]);e>-1&&this.cipher.attachments.splice(e,1)}this.platformUtilsService.showToast("success",null,this.i18nService.t("attachmentSaved")),this.onReuploadedAttachment.emit()}catch(s){this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}i.downloading=!1})))),yield this.reuploadPromises[e.id]}catch(n){this.logService.error(n)}}))}loadCipher(){return this.cipherService.get(this.cipherId)}saveCipherAttachment(e){return this.cipherService.saveAttachmentWithServer(this.cipherDomain,e)}deleteCipherAttachment(e){return this.cipherService.deleteAttachmentWithServer(this.cipher.id,e)}reupload(e){return v(this,void 0,void 0,(function*(){}))}}y.ɵfac=function(e){return new(e||y)(n.Y36(a.u),n.Y36(l.D),n.Y36(c.$),n.Y36(u.P),n.Y36(d.s),n.Y36(Window),n.Y36(p.$),n.Y36(h.b),n.Y36(g._),n.Y36(f.x),n.Y36(m.M))},y.ɵdir=n.lG2({type:y,inputs:{cipherId:"cipherId"},outputs:{onUploadedAttachment:"onUploadedAttachment",onDeletedAttachment:"onDeletedAttachment",onReuploadedAttachment:"onReuploadedAttachment"}})},15252:(e,t,i)=>{"use strict";i.d(t,{o:()=>w});var n=i(59554),s=i(33031),o=i(92786),r=i(72591),a=i(67775),l=i(30933),c=i(56934),u=i(27646),d=i(31182);i(53061);var p=i(85762),h=i(28508);class g{constructor(e){this.el=e,this.tryFallback=!0}onError(){this.tryFallback&&(this.el.nativeElement.src=this.appFallbackSrc,this.tryFallback=!1)}}g.ɵfac=function(e){return new(e||g)(p.Y36(p.SBq))},g.ɵdir=p.lG2({type:g,selectors:[["","appFallbackSrc",""]],hostBindings:function(e,t){1&e&&p.NdJ("error",(function(){return t.onError()}))},inputs:{appFallbackSrc:"appFallbackSrc"}});var f=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function m(e,t){if(1&e&&p._UZ(0,"img",4),2&e){const e=p.oxw().ngIf;p.Q6J("src",e.image,p.LSH)("appFallbackSrc",e.fallbackImage)}}function v(e,t){if(1&e&&p._UZ(0,"i"),2&e){const e=p.oxw().ngIf;p.Gre("tw-text-muted bwi bwi-lg ",e.icon,"")}}function y(e,t){if(1&e&&(p.ynx(0),p._uU(1,"\n    "),p.YNc(2,m,1,2,"img",2),p._uU(3,"\n    "),p.YNc(4,v,1,3,"i",3),p._uU(5,"\n  "),p.BQk()),2&e){const e=t.ngIf;p.xp6(2),p.Q6J("ngIf",e.imageEnabled&&e.image),p.xp6(2),p.Q6J("ngIf",!e.imageEnabled||!e.image)}}class w{set cipher(e){this.cipher$.next(e)}constructor(e,t){this.environmentService=e,this.domainSettingsService=t,this.cipher$=new n.X(void 0)}ngOnInit(){return f(this,void 0,void 0,(function*(){this.data$=(0,s.a)([this.environmentService.environment$.pipe((0,o.U)((e=>e.getIconsUrl()))),this.domainSettingsService.showFavicons$.pipe((0,r.x)()),this.cipher$.pipe((0,a.h)((e=>void 0!==e)))]).pipe((0,o.U)((([e,t,i])=>function(e,t,i){let n,s,o="";const r={Visa:"card-visa",Mastercard:"card-mastercard",Amex:"card-amex",Discover:"card-discover","Diners Club":"card-diners-club",JCB:"card-jcb",Maestro:"card-maestro",UnionPay:"card-union-pay",RuPay:"card-ru-pay"};switch(t.type){case d.O.Login:if(n="bwi-globe",t.login.uri){let r=t.login.uri,l=!1;if(0===r.indexOf("androidapp://")?(n="bwi-android",s=null):0===r.indexOf("iosapp://")?(n="bwi-apple",s=null):i&&-1===r.indexOf("://")&&r.indexOf(".")>-1?(r=`http://${r}`,l=!0):i&&(l=0===r.indexOf("http")&&r.indexOf(".")>-1),i&&l)try{s=`${e}/${u.c.getHostname(r)}/icon.png`,o="images/bwi-globe.png"}catch(a){}}else s=null;break;case d.O.SecureNote:n="bwi-sticky-note";break;case d.O.Card:n="bwi-credit-card",i&&t.card.brand in r&&(n=`credit-card-icon ${r[t.card.brand]}`);break;case d.O.Identity:n="bwi-id-card"}return{imageEnabled:i,image:s,fallbackImage:o,icon:n}}(e,i,t))))}))}}w.ɵfac=function(e){return new(e||w)(p.Y36(c.L),p.Y36(l.z))},w.ɵcmp=p.Xpm({type:w,selectors:[["app-vault-icon"]],inputs:{cipher:"cipher"},decls:6,vars:3,consts:[["aria-hidden","true",1,"icon"],[4,"ngIf"],["alt","","decoding","async","loading","lazy",3,"src","appFallbackSrc",4,"ngIf"],[3,"class",4,"ngIf"],["alt","","decoding","async","loading","lazy",3,"src","appFallbackSrc"]],template:function(e,t){1&e&&(p.TgZ(0,"div",0),p._uU(1,"\n  "),p.YNc(2,y,6,2,"ng-container",1),p.ALo(3,"async"),p._uU(4,"\n"),p.qZA(),p._uU(5,"\n")),2&e&&(p.xp6(2),p.Q6J("ngIf",p.lcZ(3,1,t.data$)))},dependencies:[h.O5,g,h.Ov],encapsulation:2,changeDetection:0})},54935:(e,t,i)=>{"use strict";i.d(t,{k:()=>n});const n=i(66997).W4`
<svg xmlns="http://www.w3.org/2000/svg" width="63" height="65" fill="none">
    <path class="tw-fill-secondary-600" fill="#89929F" fill-rule="evenodd" d="M6.539 13.582C12.113 5.786 21.228.7 31.529.7c15.02 0 27.512 10.808 30.203 25.086a2 2 0 1 1-3.93.74C55.457 14.093 44.578 4.7 31.528 4.7c-8.952 0-16.879 4.416-21.736 11.21a2 2 0 0 1-3.254-2.327Zm-.955 5.384A2 2 0 0 1 6.7 21.565a26.876 26.876 0 0 0-1.91 9.988v8.833a2 2 0 1 1-4 0v-8.833c0-4.05.778-7.923 2.195-11.472a2 2 0 0 1 2.599-1.115Zm54.685 10.587a2 2 0 0 1 2 2v8.244a2 2 0 0 1-4 0v-8.244a2 2 0 0 1 2-2Z" clip-rule="evenodd"/>
    <path class="tw-fill-secondary-600" fill="#89929F" fill-rule="evenodd" d="M8.476 21.293c3.898-8.848 12.751-15.032 23.053-15.032a25.08 25.08 0 0 1 14.296 4.448A2 2 0 1 1 43.552 14a21.08 21.08 0 0 0-12.023-3.739c-8.66 0-16.11 5.196-19.392 12.645a2 2 0 1 1-3.661-1.613Zm39.328-6.481a2 2 0 0 1 2.82.211 25.062 25.062 0 0 1 6.082 16.4v19.629a2 2 0 1 1-4 0V31.423c0-5.27-1.925-10.085-5.114-13.79a2 2 0 0 1 .212-2.821ZM8.728 26.786A2 2 0 0 1 10.49 29c-.09.794-.137 1.603-.137 2.423v19.629a2 2 0 1 1-4 0V31.423c0-.972.055-1.931.163-2.876a2 2 0 0 1 2.213-1.76Z" clip-rule="evenodd"/>
    <path class="tw-fill-secondary-600" fill="#89929F" fill-rule="evenodd" d="M12.223 31.097c0-10.648 8.647-19.273 19.306-19.273s19.306 8.625 19.306 19.273v25.321a2 2 0 1 1-4 0v-25.32c0-8.433-6.85-15.274-15.306-15.274s-15.305 6.841-15.305 15.273v9.913a2 2 0 1 1-4 0v-9.913Zm2 13.409a2 2 0 0 1 2 2v9.912a2 2 0 1 1-4 0v-9.912a2 2 0 0 1 2-2Z" clip-rule="evenodd"/>
    <path class="tw-fill-secondary-600" fill="#89929F" fill-rule="evenodd" d="M24.698 19.044a13.418 13.418 0 0 1 6.831-1.857c7.411 0 13.434 5.984 13.434 13.385v7.851a2 2 0 1 1-4 0v-7.851c0-5.175-4.216-9.385-9.434-9.385a9.419 9.419 0 0 0-4.8 1.304 2 2 0 0 1-2.031-3.447Zm-1.76 3.755a2 2 0 0 1 .613 2.762 9.296 9.296 0 0 0-1.456 5.01v29.64a2 2 0 0 1-4 0v-29.64c0-2.63.763-5.087 2.081-7.158a2 2 0 0 1 2.761-.614Zm20.025 20.298a2 2 0 0 1 2 2v15.114a2 2 0 1 1-4 0V45.097a2 2 0 0 1 2-2Z" clip-rule="evenodd"/>
    <path class="tw-fill-secondary-600" fill="#89929F" fill-rule="evenodd" d="M23.967 30.18c0-4.163 3.408-7.497 7.562-7.497s7.563 3.334 7.563 7.496v12.563a2 2 0 0 1-4 0V30.179c0-1.908-1.573-3.496-3.563-3.496-1.99 0-3.562 1.588-3.562 3.496v31.603a2 2 0 0 1-4 0V30.179ZM37.092 46.04a2 2 0 0 1 2 2v13.74a2 2 0 0 1-4 0v-13.74a2 2 0 0 1 2-2Z" clip-rule="evenodd"/>
    <path class="tw-fill-secondary-600" fill="#89929F" fill-rule="evenodd" d="M31.546 28.375a2 2 0 0 1 2 2v4.908a2 2 0 1 1-4 0v-4.908a2 2 0 0 1 2-2Zm-.018 10.334a2 2 0 0 1 2.001 1.999l.017 22.25a2 2 0 1 1-4 .003l-.017-22.25a2 2 0 0 1 1.999-2.002Z" clip-rule="evenodd"/>
</svg>
`},33970:(e,t,i)=>{"use strict";i.d(t,{ey:()=>h.e,NK:()=>E,FI:()=>b.F});i(54935);var n=i(28783),s=i(5344),o=i(40925),r=i(29445),a=i(85762),l=i(82933),c=i(81974),u=i(70094),d=i(18362);class p{constructor(e){this.data=e}static open(e,t){return e.open(p,{data:t})}}p.ɵfac=function(e){return new(e||p)(a.Y36(n.Kt))},p.ɵcmp=a.Xpm({type:p,selectors:[["ng-component"]],standalone:!0,features:[a.jDz],decls:28,vars:10,consts:[["bitDialogIcon","","aria-hidden","true",1,"bwi","bwi-info-circle","tw-text-3xl"],["bitDialogTitle",""],["bitDialogContent",""],["bitDialogFooter",""],["bitButton","","href","https://bitwarden.com/help/fingerprint-phrase/","target","_blank","rel","noreferrer","buttonType","primary","bitDialogClose",""],["aria-hidden","true",1,"bwi","bwi-external-link","bwi-fw"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(a.TgZ(0,"bit-simple-dialog"),a._uU(1,"\n  "),a._UZ(2,"i",0),a._uU(3,"\n  "),a.TgZ(4,"span",1),a._uU(5),a.ALo(6,"i18n"),a.qZA(),a._uU(7,"\n  "),a.TgZ(8,"span",2),a._uU(9,"\n    "),a.TgZ(10,"strong"),a._uU(11),a.qZA(),a._uU(12,"\n  "),a.qZA(),a._uU(13,"\n  "),a.ynx(14,3),a._uU(15,"\n    "),a.TgZ(16,"a",4),a._uU(17),a.ALo(18,"i18n"),a._UZ(19,"i",5),a._uU(20,"\n    "),a.qZA(),a._uU(21,"\n    "),a.TgZ(22,"button",6),a._uU(23),a.ALo(24,"i18n"),a.qZA(),a._uU(25,"\n  "),a.BQk(),a._uU(26,"\n"),a.qZA(),a._uU(27,"\n")),2&e&&(a.xp6(5),a.hij("",a.lcZ(6,4,"yourAccountsFingerprint"),":"),a.xp6(6),a.Oqu(t.data.fingerprint.join("-")),a.xp6(6),a.hij("\n      ",a.lcZ(18,6,"learnMore"),"\n      "),a.xp6(6),a.hij("\n      ",a.lcZ(24,8,"close"),"\n    "))},dependencies:[s.b,l.C,o.h,c.r,r.S,u.r,d.f,u.a],encapsulation:2});var h=i(33401),g=i(28508),f=i(37513),m=i(99042),v=i(2012),y=i(7266),w=i(77127),b=i(62026),U=i(42304),_=i(99721),A=i(78627),Z=i(29465),x=i(46246),S=i(36338),T=i(24083),C=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function O(e,t){if(1&e&&(a.TgZ(0,"p",9),a._uU(1),a.ALo(2,"i18n"),a.qZA()),2&e){const e=a.oxw(2);a.xp6(1),a.hij("\n          ",a.lcZ(2,1,e.dialogOptions.bodyText),"\n        ")}}function k(e,t){if(1&e&&(a.TgZ(0,"bit-callout",10),a._uU(1),a.ALo(2,"i18n"),a.qZA()),2&e){const e=a.oxw(2);a.Q6J("type",e.dialogOptions.calloutOptions.type),a.xp6(1),a.hij("\n          ",a.lcZ(2,2,e.dialogOptions.calloutOptions.text),"\n        ")}}function P(e,t){if(1&e&&(a.ynx(0),a._uU(1,"\n        "),a.YNc(2,O,3,3,"p",7),a._uU(3,"\n\n        "),a.YNc(4,k,3,4,"bit-callout",8),a._uU(5,"\n      "),a.BQk()),2&e){const e=a.oxw();a.xp6(2),a.Q6J("ngIf",e.dialogOptions.bodyText),a.xp6(2),a.Q6J("ngIf",e.dialogOptions.calloutOptions)}}function q(e,t){1&e&&(a.ynx(0),a._uU(1,"\n        "),a.TgZ(2,"p",9),a._uU(3),a.ALo(4,"i18n"),a.qZA(),a._uU(5,"\n      "),a.BQk()),2&e&&(a.xp6(3),a.hij("\n          ",a.lcZ(4,1,"verificationRequiredForActionSetPinToContinue"),"\n        "))}function I(e,t){1&e&&(a.TgZ(0,"button",13),a._uU(1),a.ALo(2,"i18n"),a.qZA()),2&e&&(a.xp6(1),a.hij("\n            ",a.lcZ(2,1,"submit"),"\n          "))}function M(e,t){if(1&e&&(a.TgZ(0,"button",14),a._uU(1),a.ALo(2,"i18n"),a.qZA()),2&e){const e=a.oxw(3);a.Q6J("buttonType",e.dialogOptions.confirmButtonOptions.type),a.xp6(1),a.hij("\n            ",a.lcZ(2,2,e.dialogOptions.confirmButtonOptions.text),"\n          ")}}function N(e,t){if(1&e&&(a.ynx(0),a._uU(1,"\n          "),a._uU(2,"\n          "),a.YNc(3,I,3,3,"button",11),a._uU(4,"\n\n          "),a._uU(5,"\n          "),a.YNc(6,M,3,4,"button",12),a._uU(7,"\n        "),a.BQk()),2&e){const e=a.oxw(2);a.xp6(3),a.Q6J("ngIf",!e.dialogOptions.confirmButtonOptions),a.xp6(3),a.Q6J("ngIf",e.dialogOptions.confirmButtonOptions)}}function L(e,t){1&e&&(a.ynx(0),a._uU(1,"\n          "),a._uU(2,"\n          "),a.TgZ(3,"button",13),a._uU(4),a.ALo(5,"i18n"),a.qZA(),a._uU(6,"\n        "),a.BQk()),2&e&&(a.xp6(4),a.hij("\n            ",a.lcZ(5,1,"setPin"),"\n          "))}function D(e,t){if(1&e&&(a.ynx(0),a._uU(1,"\n        "),a._uU(2,"\n        "),a.YNc(3,N,8,2,"ng-container",3),a._uU(4,"\n\n        "),a.YNc(5,L,7,3,"ng-container",3),a._uU(6,"\n      "),a.BQk()),2&e){const e=a.oxw();a.xp6(3),a.Q6J("ngIf",e.activeClientVerificationOption!==e.ActiveClientVerificationOption.None),a.xp6(2),a.Q6J("ngIf",e.activeClientVerificationOption===e.ActiveClientVerificationOption.None)}}class E{get secret(){return this.verificationForm.controls.secret}constructor(e,t,i,n,s,o){this.dialogOptions=e,this.dialogRef=t,this.formBuilder=i,this.userVerificationService=n,this.platformUtilsService=s,this.i18nService=o,this.verificationForm=this.formBuilder.group({secret:this.formBuilder.control(null)}),this.invalidSecret=!1,this.ActiveClientVerificationOption=w.H,this.submit=()=>C(this,void 0,void 0,(function*(){if(this.activeClientVerificationOption!==w.H.None){if(this.verificationForm.markAllAsTouched(),!this.verificationForm.invalid)try{(yield this.userVerificationService.verifyUser(this.secret.value))?(this.invalidSecret=!1,this.close({userAction:"confirm",verificationSuccess:!0,noAvailableClientVerificationMethods:!1})):(this.invalidSecret=!0,this.activeClientVerificationOption===w.H.Pin?this.platformUtilsService.showToast("error",this.i18nService.t("error"),this.i18nService.t("invalidPin")):this.platformUtilsService.showToast("error",null,this.i18nService.t("unexpectedError")))}catch(e){return this.invalidSecret=!0,void this.platformUtilsService.showToast("error",this.i18nService.t("error"),e.message)}}else this.close({userAction:"confirm",verificationSuccess:!1,noAvailableClientVerificationMethods:!0})}))}static open(e,t){return C(this,void 0,void 0,(function*(){const i=e.open(E,{data:t}),n=yield(0,m.z)(i.closed);return"string"==typeof n||void 0===n?{userAction:"cancel",verificationSuccess:!1}:n}))}handleActiveClientVerificationOptionChange(e){this.activeClientVerificationOption=e}handleBiometricsVerificationResultChange(e){e&&this.close({userAction:"confirm",verificationSuccess:!0,noAvailableClientVerificationMethods:!1})}cancel(){this.close({userAction:"cancel",verificationSuccess:!1})}close(e){this.dialogRef.close(e)}}E.ɵfac=function(e){return new(e||E)(a.Y36(n.Kt),a.Y36(n.zj),a.Y36(f.qu),a.Y36(U.i),a.Y36(_.P),a.Y36(A.D))},E.ɵcmp=a.Xpm({type:E,selectors:[["ng-component"]],standalone:!0,features:[a.jDz],decls:32,vars:15,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[4,"ngIf"],["formControlName","secret",3,"invalidSecret","verificationType","invalidSecretChange","activeClientVerificationOptionChange","biometricsVerificationResultChange"],["bitDialogFooter",""],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"click"],["bitTypography","body1",4,"ngIf"],[3,"type",4,"ngIf"],["bitTypography","body1"],[3,"type"],["type","submit","bitButton","","bitFormButton","","buttonType","primary",4,"ngIf"],["type","submit","bitButton","","bitFormButton","",3,"buttonType",4,"ngIf"],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","submit","bitButton","","bitFormButton","",3,"buttonType"]],template:function(e,t){1&e&&(a.TgZ(0,"form",0),a._uU(1,"\n  "),a.TgZ(2,"bit-dialog"),a._uU(3,"\n    "),a.TgZ(4,"span",1),a._uU(5),a.ALo(6,"i18n"),a.ALo(7,"i18n"),a.qZA(),a._uU(8,"\n    "),a.ynx(9,2),a._uU(10,"\n      "),a._uU(11,"\n      "),a.YNc(12,P,6,2,"ng-container",3),a._uU(13,"\n\n      "),a._uU(14,"\n      "),a.YNc(15,q,6,3,"ng-container",3),a._uU(16,"\n\n      "),a.TgZ(17,"app-user-verification-form-input",4),a.NdJ("invalidSecretChange",(function(e){return t.invalidSecret=e}))("activeClientVerificationOptionChange",(function(e){return t.handleActiveClientVerificationOptionChange(e)}))("biometricsVerificationResultChange",(function(e){return t.handleBiometricsVerificationResultChange(e)})),a.qZA(),a._uU(18,"\n    "),a.BQk(),a._uU(19,"\n    "),a.ynx(20,5),a._uU(21,"\n      "),a._uU(22,"\n      "),a.YNc(23,D,7,2,"ng-container",3),a._uU(24,"\n\n      "),a.TgZ(25,"button",6),a.NdJ("click",(function(){return t.cancel()})),a._uU(26),a.ALo(27,"i18n"),a.qZA(),a._uU(28,"\n    "),a.BQk(),a._uU(29,"\n  "),a.qZA(),a._uU(30,"\n"),a.qZA(),a._uU(31,"\n")),2&e&&(a.Q6J("formGroup",t.verificationForm)("bitSubmit",t.submit),a.xp6(5),a.hij("\n      ",t.dialogOptions.title?a.lcZ(6,9,t.dialogOptions.title):a.lcZ(7,11,"verificationRequired"),""),a.xp6(7),a.Q6J("ngIf",!t.dialogOptions.clientSideOnlyVerification||t.dialogOptions.clientSideOnlyVerification&&t.activeClientVerificationOption!==t.ActiveClientVerificationOption.None),a.xp6(3),a.Q6J("ngIf",t.dialogOptions.clientSideOnlyVerification&&t.activeClientVerificationOption===t.ActiveClientVerificationOption.None),a.xp6(2),a.Q6J("invalidSecret",t.invalidSecret)("verificationType",t.dialogOptions.clientSideOnlyVerification?"client":"server"),a.xp6(6),a.Q6J("ngIf",!t.dialogOptions.clientSideOnlyVerification||t.dialogOptions.clientSideOnlyVerification&&t.activeClientVerificationOption!==t.ActiveClientVerificationOption.Biometrics),a.xp6(3),a.hij("\n        ",a.lcZ(27,13,"cancel"),"\n      "))},dependencies:[g.ez,g.O5,f.UX,f._Y,f.JJ,f.JL,f.sg,f.u,s.b,l.C,o.h,c.r,r.S,Z.a,v.G,x.b,S.u,b.F,y.d,T.O],encapsulation:2})},33401:(e,t,i)=>{"use strict";i.d(t,{e:()=>v});var n=i(28508),s=i(5344),o=(i(85623),i(7266)),r=i(85762),a=i(78627),l=i(82933),c=i(24083);function u(e,t){if(1&e&&(r.TgZ(0,"li"),r._uU(1),r.ALo(2,"i18n"),r.qZA()),2&e){const e=r.oxw(2);r.xp6(1),r.hij("\n      ",r.xi3(2,1,"policyInEffectMinComplexity",e.getPasswordScoreAlertDisplay()),"\n    ")}}function d(e,t){if(1&e&&(r.TgZ(0,"li"),r._uU(1),r.ALo(2,"i18n"),r.qZA()),2&e){const e=r.oxw(2);r.xp6(1),r.hij("\n      ",r.xi3(2,1,"policyInEffectMinLength",null==e.policy?null:e.policy.minLength.toString()),"\n    ")}}function p(e,t){1&e&&(r.TgZ(0,"li"),r._uU(1),r.ALo(2,"i18n"),r.qZA()),2&e&&(r.xp6(1),r.hij("\n      ",r.lcZ(2,1,"policyInEffectUppercase"),"\n    "))}function h(e,t){1&e&&(r.TgZ(0,"li"),r._uU(1),r.ALo(2,"i18n"),r.qZA()),2&e&&(r.xp6(1),r.hij("\n      ",r.lcZ(2,1,"policyInEffectLowercase"),"\n    "))}function g(e,t){1&e&&(r.TgZ(0,"li"),r._uU(1),r.ALo(2,"i18n"),r.qZA()),2&e&&(r.xp6(1),r.hij("\n      ",r.lcZ(2,1,"policyInEffectNumbers"),"\n    "))}function f(e,t){1&e&&(r.TgZ(0,"li"),r._uU(1),r.ALo(2,"i18n"),r.qZA()),2&e&&(r.xp6(1),r.hij("\n      ",r.xi3(2,1,"policyInEffectSpecial","!@#$%^&*"),"\n    "))}function m(e,t){if(1&e&&(r.TgZ(0,"ul",1),r._uU(1,"\n    "),r.YNc(2,u,3,4,"li",2),r._uU(3,"\n    "),r.YNc(4,d,3,4,"li",2),r._uU(5,"\n    "),r.YNc(6,p,3,3,"li",2),r._uU(7,"\n    "),r.YNc(8,h,3,3,"li",2),r._uU(9,"\n    "),r.YNc(10,g,3,3,"li",2),r._uU(11,"\n    "),r.YNc(12,f,3,4,"li",2),r._uU(13,"\n  "),r.qZA()),2&e){const e=r.oxw();r.xp6(2),r.Q6J("ngIf",(null==e.policy?null:e.policy.minComplexity)>0),r.xp6(2),r.Q6J("ngIf",(null==e.policy?null:e.policy.minLength)>0),r.xp6(2),r.Q6J("ngIf",null==e.policy?null:e.policy.requireUpper),r.xp6(2),r.Q6J("ngIf",null==e.policy?null:e.policy.requireLower),r.xp6(2),r.Q6J("ngIf",null==e.policy?null:e.policy.requireNumbers),r.xp6(2),r.Q6J("ngIf",null==e.policy?null:e.policy.requireSpecial)}}class v{constructor(e){this.i18nService=e,this.message="masterPasswordPolicyInEffect"}getPasswordScoreAlertDisplay(){let e;switch(this.policy.minComplexity){case 4:e=this.i18nService.t("strong");break;case 3:e=this.i18nService.t("good");break;default:e=this.i18nService.t("weak")}return e+" ("+this.policy.minComplexity+")"}}v.ɵfac=function(e){return new(e||v)(r.Y36(a.D))},v.ɵcmp=r.Xpm({type:v,selectors:[["auth-password-callout"]],inputs:{message:"message",policy:"policy"},standalone:!0,features:[r.jDz],decls:6,vars:4,consts:[["class","tw-mb-0",4,"ngIf"],[1,"tw-mb-0"],[4,"ngIf"]],template:function(e,t){1&e&&(r.TgZ(0,"bit-callout"),r._uU(1),r.ALo(2,"i18n"),r.YNc(3,m,14,6,"ul",0),r._uU(4,"\n"),r.qZA(),r._uU(5,"\n")),2&e&&(r.xp6(1),r.hij("\n  ",r.lcZ(2,2,t.message),"\n\n  "),r.xp6(2),r.Q6J("ngIf",t.policy))},dependencies:[n.ez,n.O5,s.b,l.C,o.d,c.O],encapsulation:2})},77127:(e,t,i)=>{"use strict";var n;i.d(t,{H:()=>n}),function(e){e.MasterPassword="masterPassword",e.Pin="pin",e.Biometrics="biometrics",e.None="none"}(n||(n={}))},62026:(e,t,i)=>{"use strict";i.d(t,{F:()=>ne});var n=i(88444),s=i(28508),o=i(85762),r=i(37513),a=i(59554),l=i(54019),c=i(68362),u=i(5344),d=i(70138),p=i(27646),h=i(49106),g=i(2012),f=i(41938),m=i(5261),v=i(19244),y=i(40925),w=i(7266),b=i(54935),U=i(77127),_=i(42304),A=i(78627),Z=i(62357),x=i(85356),S=i(82933),T=i(24637),C=i(11512),O=i(54666),k=i(1e4),P=i(36179),q=i(44358),I=i(21656),M=i(22221),N=i(12492),L=i(24083),D=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function E(e,t){1&e&&o.GkF(0)}function F(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n      "),o.YNc(2,E,1,0,"ng-container",4),o._uU(3,"\n    "),o.BQk()),2&e){o.oxw(2);const e=o.MAs(5);o.xp6(2),o.Q6J("ngTemplateOutlet",e)}}function R(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n      "),o.TgZ(2,"bit-form-field",5),o._uU(3,"\n        "),o.TgZ(4,"bit-label"),o._uU(5),o.ALo(6,"i18n"),o.qZA(),o._uU(7,"\n        "),o._UZ(8,"input",6),o._uU(9,"\n        "),o._UZ(10,"button",7),o._uU(11,"\n        "),o.TgZ(12,"bit-hint"),o._uU(13),o.ALo(14,"i18n"),o.qZA(),o._uU(15,"\n      "),o.qZA(),o._uU(16,"\n    "),o.BQk()),2&e){const e=o.oxw(2);o.xp6(5),o.Oqu(o.lcZ(6,3,"pin")),o.xp6(3),o.Q6J("formControl",e.secret),o.xp6(5),o.Oqu(o.lcZ(14,5,"confirmIdentity"))}}function J(e,t){1&e&&(o.TgZ(0,"div"),o._uU(1,"\n          "),o._UZ(2,"i",12),o.ALo(3,"i18n"),o._uU(4),o.ALo(5,"i18n"),o.qZA()),2&e&&(o.xp6(2),o.s9C("title",o.lcZ(3,2,"loading")),o.xp6(2),o.hij("\n          ",o.lcZ(5,4,"awaitingConfirmation"),"\n        "))}function z(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"bit-callout",13),o._uU(1),o.ALo(2,"i18n"),o.TgZ(3,"button",14),o.NdJ("click",(function(){o.CHM(e);const t=o.oxw(3);return o.KtG(t.verifyUserViaBiometrics())})),o._uU(4),o.ALo(5,"i18n"),o.qZA(),o._uU(6,"\n      "),o.qZA()}2&e&&(o.xp6(1),o.hij("\n        ",o.lcZ(2,2,"couldNotCompleteBiometrics"),"\n        "),o.xp6(3),o.hij("\n          ",o.lcZ(5,4,"tryAgain"),"\n        "))}function Y(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n      "),o.TgZ(2,"div",8),o._uU(3,"\n        "),o._UZ(4,"bit-icon",9),o._uU(5,"\n        "),o.TgZ(6,"p",10),o._uU(7),o.ALo(8,"i18n"),o.qZA(),o._uU(9,"\n        "),o.YNc(10,J,6,6,"div",0),o._uU(11,"\n      "),o.qZA(),o._uU(12,"\n\n      "),o.YNc(13,z,7,6,"bit-callout",11),o._uU(14,"\n    "),o.BQk()),2&e){const e=o.oxw(2);o.xp6(4),o.Q6J("icon",e.Icons.UserVerificationBiometricsIcon),o.xp6(3),o.Oqu(o.lcZ(8,4,"verifyWithBiometrics")),o.xp6(3),o.Q6J("ngIf",!e.biometricsVerificationFailed),o.xp6(3),o.Q6J("ngIf",e.biometricsVerificationFailed)}}function K(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",19),o.NdJ("click",(function(){o.CHM(e);const t=o.oxw(3);return o.KtG(t.activeClientVerificationOption=t.ActiveClientVerificationOption.Biometrics)})),o._uU(1),o.ALo(2,"i18n"),o.qZA()}2&e&&(o.xp6(1),o.hij("\n        ",o.lcZ(2,1,"useBiometrics"),"\n      "))}function B(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",19),o.NdJ("click",(function(){o.CHM(e);const t=o.oxw(3);return o.KtG(t.activeClientVerificationOption=t.ActiveClientVerificationOption.Pin)})),o._uU(1),o.ALo(2,"i18n"),o.qZA()}2&e&&(o.xp6(1),o.hij("\n        ",o.lcZ(2,1,"usePin"),"\n      "))}function Q(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",20),o.NdJ("click",(function(){o.CHM(e);const t=o.oxw(3);return o.KtG(t.activeClientVerificationOption=t.ActiveClientVerificationOption.MasterPassword)})),o._uU(1),o.ALo(2,"i18n"),o.qZA()}2&e&&(o.xp6(1),o.hij("\n        ",o.lcZ(2,1,"useMasterPassword"),"\n      "))}function G(e,t){if(1&e&&(o.TgZ(0,"div",15),o._uU(1,"\n      "),o.TgZ(2,"p",16),o._uU(3),o.ALo(4,"i18n"),o.qZA(),o._uU(5,"\n\n      "),o.YNc(6,K,3,3,"button",17),o._uU(7,"\n\n      "),o.YNc(8,B,3,3,"button",17),o._uU(9,"\n\n      "),o.YNc(10,Q,3,3,"button",18),o._uU(11,"\n    "),o.qZA()),2&e){const e=o.oxw(2);o.xp6(3),o.Oqu(o.lcZ(4,4,"needADifferentMethod")),o.xp6(3),o.Q6J("ngIf",e.userVerificationOptions.client.biometrics&&e.activeClientVerificationOption!==e.ActiveClientVerificationOption.Biometrics),o.xp6(2),o.Q6J("ngIf",e.userVerificationOptions.client.pin&&e.activeClientVerificationOption!==e.ActiveClientVerificationOption.Pin),o.xp6(2),o.Q6J("ngIf",e.userVerificationOptions.client.masterPassword&&e.activeClientVerificationOption!==e.ActiveClientVerificationOption.MasterPassword)}}function j(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n  "),o.TgZ(2,"div",2),o._uU(3,"\n    "),o._uU(4,"\n    "),o.YNc(5,F,4,1,"ng-container",0),o._uU(6,"\n\n    "),o._uU(7,"\n    "),o.YNc(8,R,17,7,"ng-container",0),o._uU(9,"\n\n    "),o._uU(10,"\n    "),o.YNc(11,Y,15,6,"ng-container",0),o._uU(12,"\n\n    "),o._uU(13,"\n    "),o.YNc(14,G,12,6,"div",3),o._uU(15,"\n  "),o.qZA(),o._uU(16,"\n"),o.BQk()),2&e){const e=o.oxw();o.xp6(5),o.Q6J("ngIf",e.userVerificationOptions.client.masterPassword&&e.activeClientVerificationOption==e.ActiveClientVerificationOption.MasterPassword),o.xp6(3),o.Q6J("ngIf",e.userVerificationOptions.client.pin&&e.activeClientVerificationOption==e.ActiveClientVerificationOption.Pin),o.xp6(3),o.Q6J("ngIf",e.userVerificationOptions.client.biometrics&&e.activeClientVerificationOption==e.ActiveClientVerificationOption.Biometrics),o.xp6(3),o.Q6J("ngIf",e.hasMultipleClientVerificationOptions)}}function V(e,t){1&e&&o.GkF(0)}function $(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n    "),o.YNc(2,V,1,0,"ng-container",4),o._uU(3,"\n  "),o.BQk()),2&e){o.oxw(2);const e=o.MAs(5);o.xp6(2),o.Q6J("ngTemplateOutlet",e)}}function H(e,t){1&e&&(o.TgZ(0,"div",23),o._uU(1,"\n      "),o._UZ(2,"i",12),o.ALo(3,"i18n"),o._uU(4,"\n    "),o.qZA()),2&e&&(o.xp6(2),o.s9C("title",o.lcZ(3,1,"loading")))}function W(e,t){1&e&&(o.TgZ(0,"span",26),o._uU(1,"\n          "),o._UZ(2,"i",27),o._uU(3),o.ALo(4,"i18n"),o.qZA()),2&e&&(o.Q6J("@sent",void 0),o.xp6(3),o.hij("\n          ",o.lcZ(4,2,"codeSent"),"\n        "))}function X(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",23),o._uU(1),o.ALo(2,"i18n"),o.TgZ(3,"p",24),o._uU(4,"\n        "),o.TgZ(5,"button",14),o.NdJ("click",(function(){o.CHM(e);const t=o.oxw(3);return o.KtG(t.requestOTP())})),o._uU(6),o.ALo(7,"i18n"),o.qZA(),o._uU(8,"\n\n        "),o.YNc(9,W,5,4,"span",25),o._uU(10,"\n      "),o.qZA(),o._uU(11,"\n    "),o.qZA()}if(2&e){const e=o.oxw(3);o.xp6(1),o.hij("\n      ",o.lcZ(2,3,"enterVerificationCodeSentToEmail"),"\n\n      "),o.xp6(5),o.hij("\n          ",o.lcZ(7,5,"resendCode"),"\n        "),o.xp6(3),o.Q6J("ngIf",e.sentCode)}}function ee(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n    "),o.YNc(2,H,5,3,"div",21),o._uU(3,"\n\n    "),o.YNc(4,X,12,7,"div",21),o._uU(5,"\n\n    "),o.TgZ(6,"bit-form-field",5),o._uU(7,"\n      "),o.TgZ(8,"bit-label"),o._uU(9),o.ALo(10,"i18n"),o.qZA(),o._uU(11,"\n      "),o._UZ(12,"input",22),o._uU(13,"\n      "),o.TgZ(14,"bit-hint"),o._uU(15),o.ALo(16,"i18n"),o.qZA(),o._uU(17,"\n    "),o.qZA(),o._uU(18,"\n  "),o.BQk()),2&e){const e=o.oxw(2);o.xp6(2),o.Q6J("ngIf",!e.sentInitialCode),o.xp6(2),o.Q6J("ngIf",e.sentInitialCode),o.xp6(5),o.Oqu(o.lcZ(10,5,"verificationCode")),o.xp6(3),o.Q6J("formControl",e.secret),o.xp6(3),o.Oqu(o.lcZ(16,7,"confirmIdentity"))}}function te(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n  "),o.YNc(2,$,4,1,"ng-container",0),o._uU(3,"\n  "),o.YNc(4,ee,19,9,"ng-container",0),o._uU(5,"\n"),o.BQk()),2&e){const e=o.oxw();o.xp6(2),o.Q6J("ngIf",e.userVerificationOptions.server.masterPassword),o.xp6(2),o.Q6J("ngIf",e.userVerificationOptions.server.otp)}}function ie(e,t){if(1&e&&(o._uU(0,"\n  "),o.TgZ(1,"bit-form-field",5),o._uU(2,"\n    "),o.TgZ(3,"bit-label"),o._uU(4),o.ALo(5,"i18n"),o.qZA(),o._uU(6,"\n    "),o._UZ(7,"input",28),o._uU(8,"\n    "),o._UZ(9,"button",7),o._uU(10,"\n    "),o.TgZ(11,"bit-hint"),o._uU(12),o.ALo(13,"i18n"),o.qZA(),o._uU(14,"\n  "),o.qZA(),o._uU(15,"\n")),2&e){const e=o.oxw();o.xp6(4),o.Oqu(o.lcZ(5,3,"masterPass")),o.xp6(3),o.Q6J("formControl",e.secret),o.xp6(5),o.Oqu(o.lcZ(13,5,"confirmIdentity"))}}class ne{get invalidSecret(){return this._invalidSecret}set invalidSecret(e){this._invalidSecret=e,this.invalidSecretChange.emit(e),e&&this.secret.markAsTouched(),this.secret.updateValueAndValidity({emitEvent:!1})}set activeClientVerificationOption(e){this._activeClientVerificationOptionSubject.next(e)}get activeClientVerificationOption(){return this._activeClientVerificationOptionSubject.getValue()}get hasMultipleClientVerificationOptions(){let e=0;return this.userVerificationOptions.client.masterPassword&&e++,this.userVerificationOptions.client.pin&&e++,this.userVerificationOptions.client.biometrics&&e++,e>=2}getInvalidSecretErrorMessage(){return"server"===this.verificationType?this.userVerificationOptions.server.masterPassword?this.i18nService.t("incorrectPassword"):this.i18nService.t("incorrectCode"):this.activeClientVerificationOption===U.H.MasterPassword?this.i18nService.t("incorrectPassword"):this.activeClientVerificationOption===U.H.Pin?this.i18nService.t("incorrectPin"):void 0}constructor(e,t){this.userVerificationService=e,this.i18nService=t,this.verificationType="server",this._invalidSecret=!1,this.invalidSecretChange=new o.vpe,this.activeClientVerificationOptionChange=new o.vpe,this.biometricsVerificationResultChange=new o.vpe,this.Icons={UserVerificationBiometricsIcon:b.k},this.userVerificationOptions={client:{masterPassword:!1,pin:!1,biometrics:!1},server:{masterPassword:!1,otp:!1}},this.ActiveClientVerificationOption=U.H,this._activeClientVerificationOptionSubject=new a.X(null),this.activeClientVerificationOption$=this._activeClientVerificationOptionSubject.asObservable(),this.biometricsVerificationFailed=!1,this.disableRequestOTP=!1,this.sentInitialCode=!1,this.sentCode=!1,this.secret=new r.NI("",[r.kI.required,()=>{if(this.invalidSecret)return{invalidSecret:{message:this.getInvalidSecretErrorMessage()}}}]),this.destroy$=new l.x,this.requestOTP=()=>D(this,void 0,void 0,(function*(){if(!this.userVerificationOptions.server.masterPassword){this.disableRequestOTP=!0;try{yield this.userVerificationService.requestOTP(),this.sentCode=!0,this.sentInitialCode=!0,setTimeout((()=>{this.sentCode=!1}),3e3)}finally{this.disableRequestOTP=!1}}}))}ngOnInit(){return D(this,void 0,void 0,(function*(){this.userVerificationOptions=yield this.userVerificationService.getAvailableVerificationOptions(this.verificationType),"client"===this.verificationType?(this.setDefaultActiveClientVerificationOption(),this.setupClientVerificationOptionChangeHandler()):this.userVerificationOptions.server.otp&&this.requestOTP(),this.activeClientVerificationOption===U.H.Biometrics&&this.processSecretChanges(this.secret.value),this.secret.valueChanges.pipe((0,c.R)(this.destroy$)).subscribe((e=>this.processSecretChanges(e)))}))}setDefaultActiveClientVerificationOption(){this.userVerificationOptions.client.biometrics?this.activeClientVerificationOption=U.H.Biometrics:this.userVerificationOptions.client.pin?this.activeClientVerificationOption=U.H.Pin:this.userVerificationOptions.client.masterPassword?this.activeClientVerificationOption=U.H.MasterPassword:this.activeClientVerificationOption=U.H.None}setupClientVerificationOptionChangeHandler(){this.activeClientVerificationOption$.pipe((0,c.R)(this.destroy$)).subscribe((e=>{this.handleActiveClientVerificationOptionChange(e)}))}handleActiveClientVerificationOptionChange(e){return D(this,void 0,void 0,(function*(){this.activeClientVerificationOptionChange.emit(e),this.secret.setValue(null),this.secret.markAsUntouched(),this.secret.updateValueAndValidity({emitEvent:!1}),"biometrics"===e&&(this.biometricsVerificationFailed=!1,yield this.verifyUserViaBiometrics())}))}verifyUserViaBiometrics(){return D(this,void 0,void 0,(function*(){this.biometricsVerificationFailed=!1;const e=yield this.userVerificationService.verifyUser({type:d.R.Biometrics});this.biometricsVerificationResultChange.emit(e),this.biometricsVerificationFailed=!e}))}writeValue(e){this.secret.setValue(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disableRequestOTP=e,e?this.secret.disable():this.secret.enable()}processSecretChanges(e){this.invalidSecret=!1,this.activeClientVerificationOption!==U.H.Biometrics&&null!=this.onChange&&this.onChange({type:this.determineVerificationWithSecretType(),secret:p.c.isNullOrWhitespace(e)?null:e})}determineVerificationWithSecretType(){return"server"===this.verificationType?this.userVerificationOptions.server.masterPassword?d.R.MasterPassword:d.R.OTP:this.userVerificationOptions.client.masterPassword&&this.activeClientVerificationOption===U.H.MasterPassword?d.R.MasterPassword:d.R.PIN}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}ne.ɵfac=function(e){return new(e||ne)(o.Y36(_.i),o.Y36(A.D))},ne.ɵcmp=o.Xpm({type:ne,selectors:[["app-user-verification-form-input"]],inputs:{verificationType:"verificationType",invalidSecret:"invalidSecret"},outputs:{invalidSecretChange:"invalidSecretChange",activeClientVerificationOptionChange:"activeClientVerificationOptionChange",biometricsVerificationResultChange:"biometricsVerificationResultChange"},standalone:!0,features:[o._Bn([{provide:r.JU,multi:!0,useExisting:ne}]),o.jDz],decls:7,vars:2,consts:[[4,"ngIf"],["masterPasswordFormField",""],[1,"tw-flex","tw-flex-col"],["class","tw-flex tw-flex-col tw-items-center tw-justify-center tw-mt-2",4,"ngIf"],[4,"ngTemplateOutlet"],["disableMargin",""],["bitInput","","id","pin","type","password","name","pin","appAutofocus","","appInputVerbatim","",3,"formControl"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],[1,"tw-flex","tw-flex-col","tw-items-center"],[1,"tw-mb-4",3,"icon"],[1,"tw-font-bold","tw-mb-1"],["type","danger",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","danger"],["bitLink","","type","button","linkType","primary",3,"click"],[1,"tw-flex","tw-flex-col","tw-items-center","tw-justify-center","tw-mt-2"],[1,"tw-mb-1"],["type","button","class","tw-mb-1","bitLink","","linkType","primary",3,"click",4,"ngIf"],["type","button","bitLink","","linkType","primary",3,"click",4,"ngIf"],["type","button","bitLink","","linkType","primary",1,"tw-mb-1",3,"click"],["type","button","bitLink","","linkType","primary",3,"click"],["class","tw-mb-6",4,"ngIf"],["bitInput","","type","text","id","verificationCode","name","verificationCode","appInputVerbatim","",3,"formControl"],[1,"tw-mb-6"],[1,"mb-0"],["class","tw-ml-2 tw-text-success","role","alert",4,"ngIf"],["role","alert",1,"tw-ml-2","tw-text-success"],["aria-hidden","true",1,"bwi","bwi-check-circle"],["bitInput","","id","masterPassword","type","password","name","MasterPasswordHash","appAutofocus","","appInputVerbatim","",3,"formControl"]],template:function(e,t){1&e&&(o.YNc(0,j,17,4,"ng-container",0),o._uU(1,"\n\n"),o.YNc(2,te,6,2,"ng-container",0),o._uU(3,"\n\n"),o.YNc(4,ie,16,7,"ng-template",null,1,o.W1O),o._uU(6,"\n")),2&e&&(o.Q6J("ngIf","client"===t.verificationType),o.xp6(2),o.Q6J("ngIf","server"===t.verificationType))},dependencies:[s.ez,s.O5,s.tP,r.UX,r.Fj,r.JJ,r.oH,u.b,Z.U,x.b,S.C,h.k,T.d,C.G,O.w,k.e,P.u,q.M,g.G,f.v,I.Q,m.Q,M.G,v.L,N._,y.h,w.d,L.O],encapsulation:2,data:{animation:[(0,n.X$)("sent",[(0,n.eR)(":enter",[(0,n.oB)({opacity:0}),(0,n.jt)("100ms",(0,n.oB)({opacity:1}))])])]}})},78243:(e,t,i)=>{"use strict";i.d(t,{U1:()=>m,x8:()=>De,JD:()=>l,UK:()=>a,pS:()=>T,rh:()=>s,s:()=>Ce,m:()=>o,tE:()=>g,uZ:()=>A,Rv:()=>n,VJ:()=>c,Or:()=>f,mJ:()=>Pe,Bb:()=>r,iU:()=>v,fh:()=>Ee});class n{}class s{}class o{}class r{}class a extends r{}class l{}class c{constructor(e,t,i){this.encryptedUserKey=e,this.encryptedPublicKey=t,this.encryptedPrivateKey=i}}var u=i(38002),d=i(71916),p=i(10064),h=i(55637);class g{constructor(e,t,i,n){this.email=e,this.masterPassword=t,this.captchaToken=i,this.twoFactor=n,this.type=u.a.Password}}class f{constructor(e,t,i,n,s,o){this.code=e,this.codeVerifier=t,this.redirectUrl=i,this.orgId=n,this.email=s,this.twoFactor=o,this.type=u.a.Sso}}class m{constructor(e,t,i,n,s,o,r){this.email=e,this.accessCode=t,this.authRequestId=i,this.decryptedUserKey=n,this.decryptedMasterKey=s,this.decryptedMasterKeyHash=o,this.twoFactor=r,this.type=u.a.AuthRequest}static fromJSON(e){return Object.assign(new m(e.email,e.accessCode,e.authRequestId,null,null,e.decryptedMasterKeyHash,e.twoFactor?new d._(e.twoFactor.provider,e.twoFactor.token,e.twoFactor.remember):e.twoFactor),{decryptedUserKey:h.N.fromJSON(e.decryptedUserKey),decryptedMasterKey:h.N.fromJSON(e.decryptedMasterKey)})}}class v{constructor(e,t,i){this.token=e,this.deviceResponse=t,this.prfKey=i,this.type=u.a.WebAuthn}static fromJSON(e){return new v(e.token,Object.assign(Object.create(p.J.prototype),e.deviceResponse),h.N.fromJSON(e.prfKey))}}class y{static fromResponse(e){var t;if(null==e)return;const i=new y;return i.keyConnectorUrl=null!==(t=null==e?void 0:e.keyConnectorUrl)&&void 0!==t?t:null,i}static fromJSON(e){if(null!=e)return Object.assign(new y,e)}}class w{static fromResponse(e){var t,i,n;if(null==e)return;const s=new w;return s.hasAdminApproval=null!==(t=null==e?void 0:e.hasAdminApproval)&&void 0!==t&&t,s.hasLoginApprovingDevice=null!==(i=null==e?void 0:e.hasLoginApprovingDevice)&&void 0!==i&&i,s.hasManageResetPasswordPermission=null!==(n=null==e?void 0:e.hasManageResetPasswordPermission)&&void 0!==n&&n,s}static fromJSON(e){if(null!=e)return Object.assign(new w,e)}}class b{static fromResponse(e){if(null==e)throw new Error("User Decryption Options are required for client initialization.");const t=new b;if(e.userDecryptionOptions){const i=e.userDecryptionOptions;t.hasMasterPassword=i.hasMasterPassword,t.trustedDeviceOption=w.fromResponse(i.trustedDeviceOption),t.keyConnectorOption=y.fromResponse(i.keyConnectorOption)}else{const i=null!=e.keyConnectorUrl;t.hasMasterPassword=!i,i&&(t.keyConnectorOption=new y,t.keyConnectorOption.keyConnectorUrl=e.keyConnectorUrl)}return t}static fromJSON(e){const t=Object.assign(new b,e);return t.trustedDeviceOption=w.fromJSON(null==e?void 0:e.trustedDeviceOption),t.keyConnectorOption=y.fromJSON(null==e?void 0:e.keyConnectorOption),t}}var U=i(70427),_=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class A{constructor(e,t,i,n,s){this.stateService=e,this.cryptoService=t,this.vaultTimeoutSettingsService=i,this.logService=n,this.kdfConfigService=s}decryptUserKeyWithPin(e){return _(this,void 0,void 0,(function*(){try{const t=yield this.vaultTimeoutSettingsService.isPinLockSet(),{pinKeyEncryptedUserKey:i,oldPinKeyEncryptedMasterKey:n}=yield this.getPinKeyEncryptedKeys(t),s=yield this.kdfConfigService.getKdfConfig();let o;const r=yield this.stateService.getEmail();return o=n?yield this.cryptoService.decryptAndMigrateOldPinKey("TRANSIENT"===t,e,r,s,n):yield this.cryptoService.decryptUserKeyWithPin(e,r,s,i),o?(yield this.validatePin(o,e))?o:(this.logService.warning("Pin key decryption successful but pin validation failed."),null):(this.logService.warning("User key null after pin key decryption."),null)}catch(t){return this.logService.error(`Error decrypting user key with pin: ${t}`),null}}))}getPinKeyEncryptedKeys(e){return _(this,void 0,void 0,(function*(){switch(e){case"PERSISTANT":{const e=yield this.stateService.getPinKeyEncryptedUserKey(),t=yield this.stateService.getEncryptedPinProtected();return{pinKeyEncryptedUserKey:e,oldPinKeyEncryptedMasterKey:t?new U._(t):void 0}}case"TRANSIENT":return{pinKeyEncryptedUserKey:yield this.stateService.getPinKeyEncryptedUserKeyEphemeral(),oldPinKeyEncryptedMasterKey:yield this.stateService.getDecryptedPinProtected()};case"DISABLED":throw new Error("Pin is disabled");default:return e}}))}validatePin(e,t){return _(this,void 0,void 0,(function*(){const i=yield this.stateService.getProtectedPin();return(yield this.cryptoService.decryptToUtf8(new U._(i),e))===t}))}}var Z=i(36957),x=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const S=new Z.vh(Z.IK,"storedEmail",{deserializer:e=>e});class T{constructor(e){this.stateProvider=e,this.storedEmailState=this.stateProvider.getGlobal(S),this.storedEmail$=this.storedEmailState.state$}getEmail(){return this.email}setEmail(e){this.email=e}getRememberEmail(){return this.rememberEmail}setRememberEmail(e){this.rememberEmail=e}clearValues(){this.email=null,this.rememberEmail=null}saveEmailSettings(){return x(this,void 0,void 0,(function*(){yield this.storedEmailState.update((()=>this.rememberEmail?this.email:null)),this.clearValues()}))}}var C=i(72591),O=i(37260),k=i(84598),P=i(99042),q=i(92786),I=i(88160);class M{constructor(e,t,i,n){this.key=e,this.masterPasswordHash=t,this.deviceIdentifier=i,this.requestApproved=n}}class N{constructor(e){this.email=e}}var L=i(25679),D=i(21032),E=i(27646),F=i(59554),R=i(65193),J=i(15110);class z extends J.g{constructor(e,t,i,n,s){super(n,s),this.email=e,this.masterPasswordHash=t,this.captchaResponse=i,this.twoFactor=n}toIdentityToken(e){const t=super.toIdentityToken(e);return t.grant_type="password",t.username=this.email,t.password=this.masterPasswordHash,null!=this.captchaResponse&&(t.captchaResponse=this.captchaResponse),t}alterIdentityTokenHeaders(e){e.set("Auth-Email",E.c.fromUtf8ToUrlB64(this.email))}static fromJSON(e){return Object.assign(Object.create(z.prototype),e,{device:e.device?R.x.fromJSON(e.device):void 0,twoFactor:e.twoFactor?Object.assign(new d._,e.twoFactor):void 0})}}var Y=i(67775),K=i(91246),B=i(48103),Q=i(36788);class G{constructor(){this.captchaSiteKey="",this.resetMasterPassword=!1,this.forcePasswordReset=Q.w.None,this.twoFactorProviders=null}get requiresCaptcha(){return!E.c.isNullOrWhitespace(this.captchaSiteKey)}get requiresTwoFactor(){return null!=this.twoFactorProviders}}var j=i(55793),V=i(88674),$=i(4502),H=i(51303),W=i(98405),X=i(44879),ee=i(487),te=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ie{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h){this.accountService=e,this.masterPasswordService=t,this.cryptoService=i,this.apiService=n,this.tokenService=s,this.appIdService=o,this.platformUtilsService=r,this.messagingService=a,this.logService=l,this.stateService=c,this.twoFactorService=u,this.userDecryptionOptionsService=d,this.billingAccountProfileStateService=p,this.KdfConfigService=h}logInTwoFactor(e,t=null){return te(this,void 0,void 0,(function*(){const t=this.cache.value;t.tokenRequest.setTwoFactor(e),this.cache.next(t);const[i]=yield this.startLogIn();return i}))}startLogIn(){return te(this,void 0,void 0,(function*(){yield this.twoFactorService.clearSelectedProvider();const e=this.cache.value.tokenRequest,t=yield this.apiService.postIdentityToken(e);if(t instanceof $.b)return[yield this.processTwoFactorResponse(t),t];if(t instanceof j.b)return[yield this.processCaptchaResponse(t),t];if(t instanceof V.O)return[yield this.processTokenResponse(t),t];throw new Error("Invalid response object.")}))}buildDeviceRequest(){return te(this,void 0,void 0,(function*(){const e=yield this.appIdService.getAppId();return new R.x(e,this.platformUtilsService)}))}buildTwoFactor(e,t){return te(this,void 0,void 0,(function*(){if(null!=e)return e;if(t){const e=yield this.tokenService.getTwoFactorToken(t);if(null!=e)return new d._(B.L.Remember,e,!1)}return new d._}))}saveAccountInformation(e){return te(this,void 0,void 0,(function*(){const t=yield this.tokenService.decodeAccessToken(e.accessToken),i=t.sub,n=yield this.stateService.getVaultTimeoutAction({userId:i}),s=yield this.stateService.getVaultTimeout({userId:i});return yield this.accountService.addAccount(i,{name:t.name,email:t.email,emailVerified:t.email_verified}),yield this.tokenService.setTokens(e.accessToken,n,s,e.refreshToken),yield this.accountService.switchAccount(i),yield this.stateService.addAccount(new ee.mR({profile:Object.assign(Object.assign({},new ee.dn),{userId:i,name:t.name,email:t.email})})),yield this.verifyAccountAdded(i),yield this.userDecryptionOptionsService.setUserDecryptionOptions(b.fromResponse(e)),yield this.KdfConfigService.setKdfConfig(i,e.kdf===X.G3.PBKDF2_SHA256?new I.S(e.kdfIterations):new I.H(e.kdfIterations,e.kdfMemory,e.kdfParallelism)),yield this.billingAccountProfileStateService.setHasPremium(t.premium,!1),i}))}processTokenResponse(e){return te(this,void 0,void 0,(function*(){const t=new G;if(this.encryptionKeyMigrationRequired(e)&&(t.requiresEncryptionKeyMigration=!0,this.platformUtilsService.getClientType()!==H.Bh.Web))return t;t.resetMasterPassword=e.resetMasterPassword,e.forcePasswordReset&&(t.forcePasswordReset=Q.w.AdminForcePasswordReset);const i=yield this.saveAccountInformation(e);if(t.userId=i,null!=e.twoFactorToken){const t=yield this.tokenService.getEmail();yield this.tokenService.setTwoFactorToken(t,e.twoFactorToken)}return yield this.setMasterKey(e,i),yield this.setUserKey(e,i),yield this.setPrivateKey(e,i),this.messagingService.send("loggedIn"),t}))}encryptionKeyMigrationRequired(e){return!1}createKeyPairForOldAccount(e){return te(this,void 0,void 0,(function*(){try{const t=yield this.cryptoService.getUserKeyWithLegacySupport(e),[i,n]=yield this.cryptoService.makeKeyPair(t);return yield this.apiService.postAccountKeys(new W.C(i,n.encryptedString)),n.encryptedString}catch(t){this.logService.error(t)}}))}processTwoFactorResponse(e){var t;return te(this,void 0,void 0,(function*(){yield this.clearTwoFactorToken();const i=new G;return i.twoFactorProviders=e.twoFactorProviders2,yield this.twoFactorService.setProviders(e),this.cache.next(Object.assign(Object.assign({},this.cache.value),{captchaBypassToken:null!==(t=e.captchaToken)&&void 0!==t?t:null})),i.ssoEmail2FaSessionToken=e.ssoEmail2faSessionToken,i.email=e.email,i}))}clearTwoFactorToken(){return te(this,void 0,void 0,(function*(){const e=this.cache.value.userEnteredEmail;e&&(yield this.tokenService.clearTwoFactorToken(e))}))}processCaptchaResponse(e){return te(this,void 0,void 0,(function*(){const t=new G;return t.captchaSiteKey=e.siteKey,t}))}verifyAccountAdded(e){return te(this,void 0,void 0,(function*(){yield(0,P.z)(this.accountService.activeAccount$.pipe((0,Y.h)((t=>(null==t?void 0:t.id)===e)),(0,K.V)({first:1e3,with:()=>{throw new Error("Expected user never made active user after initialization.")}})))}))}}var ne=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class se{static fromJSON(e){return Object.assign(new se,e,{tokenRequest:z.fromJSON(e.tokenRequest),authRequestCredentials:m.fromJSON(e.authRequestCredentials)})}}class oe extends ie{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f){super(t,i,n,s,o,r,a,l,c,u,d,p,g,f),this.deviceTrustService=h,this.cache=new F.X(e),this.email$=this.cache.pipe((0,q.U)((e=>e.tokenRequest.email))),this.accessCode$=this.cache.pipe((0,q.U)((e=>e.authRequestCredentials.accessCode))),this.authRequestId$=this.cache.pipe((0,q.U)((e=>e.authRequestCredentials.authRequestId)))}logIn(e){return ne(this,void 0,void 0,(function*(){const t=new se;t.tokenRequest=new z(e.email,e.accessCode,null,yield this.buildTwoFactor(e.twoFactor,e.email),yield this.buildDeviceRequest()),t.tokenRequest.setAuthRequestAccessCode(e.authRequestId),t.authRequestCredentials=e,this.cache.next(t);const[i]=yield this.startLogIn();return i}))}logInTwoFactor(e,t){const i=Object.create(null,{logInTwoFactor:{get:()=>super.logInTwoFactor}});return ne(this,void 0,void 0,(function*(){const n=this.cache.value;return n.tokenRequest.captchaResponse=null!=t?t:n.captchaBypassToken,this.cache.next(n),i.logInTwoFactor.call(this,e)}))}setMasterKey(e,t){return ne(this,void 0,void 0,(function*(){const e=this.cache.value.authRequestCredentials;e.decryptedMasterKey&&e.decryptedMasterKeyHash&&(yield this.masterPasswordService.setMasterKey(e.decryptedMasterKey,t),yield this.masterPasswordService.setMasterKeyHash(e.decryptedMasterKeyHash,t))}))}setUserKey(e,t){return ne(this,void 0,void 0,(function*(){const i=this.cache.value.authRequestCredentials;yield this.cryptoService.setMasterKeyEncryptedUserKey(e.key),i.decryptedUserKey?yield this.cryptoService.setUserKey(i.decryptedUserKey):(yield this.trySetUserKeyWithMasterKey(t),yield this.deviceTrustService.trustDeviceIfRequired(t))}))}trySetUserKeyWithMasterKey(e){return ne(this,void 0,void 0,(function*(){const t=yield(0,P.z)(this.masterPasswordService.masterKey$(e));if(t){const e=yield this.cryptoService.decryptUserKeyWithMasterKey(t);yield this.cryptoService.setUserKey(e)}}))}setPrivateKey(e,t){var i;return ne(this,void 0,void 0,(function*(){yield this.cryptoService.setPrivateKey(null!==(i=e.privateKey)&&void 0!==i?i:yield this.createKeyPairForOldAccount(t),t)}))}exportCache(){return{authRequest:this.cache.value}}}var re=i(85623),ae=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class le{constructor(){this.forcePasswordResetReason=Q.w.None}static fromJSON(e){return Object.assign(new le,e,{tokenRequest:z.fromJSON(e.tokenRequest),masterKey:h.N.fromJSON(e.masterKey)})}}class ce extends ie{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v){super(t,i,n,s,o,r,a,l,c,u,d,p,m,v),this.stateService=u,this.passwordStrengthService=h,this.policyService=g,this.loginStrategyService=f,this.cache=new F.X(e),this.email$=this.cache.pipe((0,q.U)((e=>e.tokenRequest.email))),this.serverMasterKeyHash$=this.cache.pipe((0,q.U)((e=>e.tokenRequest.masterPasswordHash))),this.localMasterKeyHash$=this.cache.pipe((0,q.U)((e=>e.localMasterKeyHash)))}logIn(e){return ae(this,void 0,void 0,(function*(){const{email:t,masterPassword:i,captchaToken:n,twoFactor:s}=e,o=new le;o.masterKey=yield this.loginStrategyService.makePreloginKey(i,t),o.userEnteredEmail=t,o.localMasterKeyHash=yield this.cryptoService.hashMasterKey(i,o.masterKey,X.RR.LocalAuthorization);const r=yield this.cryptoService.hashMasterKey(i,o.masterKey);o.tokenRequest=new z(t,r,n,yield this.buildTwoFactor(s,t),yield this.buildDeviceRequest()),this.cache.next(o);const[a,l]=yield this.startLogIn();if(l instanceof j.b)return a;const c=this.getMasterPasswordPolicyOptionsFromResponse(l);if(null==c?void 0:c.enforceOnLogin){if(this.evaluateMasterPassword(e,c))return a;l instanceof $.b?this.cache.next(Object.assign(Object.assign({},this.cache.value),{forcePasswordResetReason:Q.w.WeakMasterPassword})):(yield this.masterPasswordService.setForceSetPasswordReason(Q.w.WeakMasterPassword,a.userId),a.forcePasswordReset=Q.w.WeakMasterPassword)}return a}))}logInTwoFactor(e,t){const i=Object.create(null,{logInTwoFactor:{get:()=>super.logInTwoFactor}});return ae(this,void 0,void 0,(function*(){const n=this.cache.value;n.tokenRequest.captchaResponse=null!=t?t:n.captchaBypassToken,this.cache.next(n);const s=yield i.logInTwoFactor.call(this,e),o=this.cache.value.forcePasswordResetReason;return s.requiresTwoFactor||s.requiresCaptcha||o==Q.w.None||(yield this.masterPasswordService.setForceSetPasswordReason(o,s.userId),s.forcePasswordReset=o),s}))}setMasterKey(e,t){return ae(this,void 0,void 0,(function*(){const{masterKey:e,localMasterKeyHash:i}=this.cache.value;yield this.masterPasswordService.setMasterKey(e,t),yield this.masterPasswordService.setMasterKeyHash(i,t)}))}setUserKey(e,t){return ae(this,void 0,void 0,(function*(){if(this.encryptionKeyMigrationRequired(e))return;yield this.cryptoService.setMasterKeyEncryptedUserKey(e.key,t);const i=yield(0,P.z)(this.masterPasswordService.masterKey$(t));if(i){const e=yield this.cryptoService.decryptUserKeyWithMasterKey(i);yield this.cryptoService.setUserKey(e,t)}}))}setPrivateKey(e,t){var i;return ae(this,void 0,void 0,(function*(){yield this.cryptoService.setPrivateKey(null!==(i=e.privateKey)&&void 0!==i?i:yield this.createKeyPairForOldAccount(t),t)}))}encryptionKeyMigrationRequired(e){return!e.key}getMasterPasswordPolicyOptionsFromResponse(e){return null==e?null:re.v.fromResponse(e.masterPasswordPolicy)}evaluateMasterPassword({masterPassword:e,email:t},i){var n;const s=null===(n=this.passwordStrengthService.getPasswordStrength(e,t))||void 0===n?void 0:n.score;return this.policyService.evaluateMasterPassword(s,e,i)}exportCache(){return{password:this.cache.value}}}class ue extends J.g{constructor(e,t,i,n,s){super(n,s),this.code=e,this.codeVerifier=t,this.redirectUri=i,this.twoFactor=n}toIdentityToken(e){const t=super.toIdentityToken(e);return t.grant_type="authorization_code",t.code=this.code,t.code_verifier=this.codeVerifier,t.redirect_uri=this.redirectUri,t}static fromJSON(e){return Object.assign(Object.create(ue.prototype),e,{device:e.device?R.x.fromJSON(e.device):void 0,twoFactor:e.twoFactor?Object.assign(new d._,e.twoFactor):void 0})}}var de=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class pe{static fromJSON(e){return Object.assign(new pe,e,{tokenRequest:ue.fromJSON(e.tokenRequest)})}}class he extends ie{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v,y){super(t,i,n,s,o,r,a,l,c,u,d,p,v,y),this.keyConnectorService=h,this.deviceTrustService=g,this.authRequestService=f,this.i18nService=m,this.cache=new F.X(e),this.email$=this.cache.pipe((0,q.U)((e=>e.email))),this.orgId$=this.cache.pipe((0,q.U)((e=>e.orgId))),this.ssoEmail2FaSessionToken$=this.cache.pipe((0,q.U)((e=>e.ssoEmail2FaSessionToken)))}logIn(e){return de(this,void 0,void 0,(function*(){const t=new pe;t.orgId=e.orgId,t.userEnteredEmail=e.email,t.tokenRequest=new ue(e.code,e.codeVerifier,e.redirectUrl,yield this.buildTwoFactor(e.twoFactor,e.email),yield this.buildDeviceRequest()),this.cache.next(t);const[i]=yield this.startLogIn(),n=i.email,s=i.ssoEmail2FaSessionToken;return i.forcePasswordReset==Q.w.AdminForcePasswordReset&&(yield this.masterPasswordService.setForceSetPasswordReason(i.forcePasswordReset,i.userId)),this.cache.next(Object.assign(Object.assign({},this.cache.value),{email:n,ssoEmail2FaSessionToken:s})),i}))}setMasterKey(e,t){return de(this,void 0,void 0,(function*(){if(this.shouldSetMasterKeyFromKeyConnector(e)){if(null==e.key)yield this.keyConnectorService.convertNewSsoUserToKeyConnector(e,this.cache.value.orgId,t);else{const i=this.getKeyConnectorUrl(e);yield this.keyConnectorService.setMasterKeyFromUrl(i,t)}}}))}shouldSetMasterKeyFromKeyConnector(e){var t;const i=null==e?void 0:e.userDecryptionOptions;if(null!=i){const e=i.hasMasterPassword;return null!=(null===(t=i.keyConnectorOption)||void 0===t?void 0:t.keyConnectorUrl)&&!e}return null!=e.keyConnectorUrl}getKeyConnectorUrl(e){var t,i;const n=null==e?void 0:e.userDecryptionOptions;return null!==(t=e.keyConnectorUrl)&&void 0!==t?t:null===(i=null==n?void 0:n.keyConnectorOption)||void 0===i?void 0:i.keyConnectorUrl}setUserKey(e,t){return de(this,void 0,void 0,(function*(){const i=e.key;i&&(yield this.cryptoService.setMasterKeyEncryptedUserKey(i,t));const n=null==e?void 0:e.userDecryptionOptions;if(null==n?void 0:n.trustedDeviceOption){yield this.trySetUserKeyWithApprovedAdminRequestIfExists(t);(yield this.cryptoService.hasUserKey(t))||(yield this.trySetUserKeyWithDeviceKey(e,t))}else null!=i&&null!=this.getKeyConnectorUrl(e)&&(yield this.trySetUserKeyWithMasterKey(t))}))}trySetUserKeyWithApprovedAdminRequestIfExists(e){return de(this,void 0,void 0,(function*(){const t=yield this.authRequestService.getAdminAuthRequest(e);if(!t)return;let i;try{i=yield this.apiService.getAuthRequest(t.id)}catch(n){return void(n instanceof L.i&&n.statusCode===H.WE.NotFound&&(yield this.authRequestService.clearAdminAuthRequest(e)))}(null==i?void 0:i.requestApproved)&&(i.masterPasswordHash?yield this.authRequestService.setKeysAfterDecryptingSharedMasterKeyAndHash(i,t.privateKey):yield this.authRequestService.setUserKeyAfterDecryptingSharedUserKey(i,t.privateKey),(yield this.cryptoService.hasUserKey())&&(yield this.deviceTrustService.trustDeviceIfRequired(e),yield this.authRequestService.clearAdminAuthRequest(e),this.platformUtilsService.showToast("success",null,this.i18nService.t("loginApproved"))))}))}trySetUserKeyWithDeviceKey(e,t){var i;return de(this,void 0,void 0,(function*(){const n=null===(i=e.userDecryptionOptions)||void 0===i?void 0:i.trustedDeviceOption,s=yield this.deviceTrustService.getDeviceKey(t),o=null==n?void 0:n.encryptedPrivateKey,r=null==n?void 0:n.encryptedUserKey;if(!s||!o||!r)return;const a=yield this.deviceTrustService.decryptUserKeyWithDeviceKey(t,o,r,s);a&&(yield this.cryptoService.setUserKey(a))}))}trySetUserKeyWithMasterKey(e){return de(this,void 0,void 0,(function*(){const t=yield(0,P.z)(this.masterPasswordService.masterKey$(e));if(!t)return;const i=yield this.cryptoService.decryptUserKeyWithMasterKey(t);yield this.cryptoService.setUserKey(i)}))}setPrivateKey(e,t){var i;return de(this,void 0,void 0,(function*(){null==e.key||(yield this.cryptoService.setPrivateKey(null!==(i=e.privateKey)&&void 0!==i?i:yield this.createKeyPairForOldAccount(t),t))}))}exportCache(){return{sso:this.cache.value}}}var ge=i(38889),fe=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class me{static fromJSON(e){return Object.assign(new me,e,{tokenRequest:ge.Z.fromJSON(e.tokenRequest)})}}class ve extends ie{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m){super(t,i,n,s,o,r,a,l,c,u,d,p,f,m),this.environmentService=h,this.keyConnectorService=g,this.kdfConfigService=m,this.cache=new F.X(e)}logIn(e){return fe(this,void 0,void 0,(function*(){const t=new me;t.tokenRequest=new ge.Z(e.clientId,e.clientSecret,yield this.buildTwoFactor(),yield this.buildDeviceRequest()),this.cache.next(t);const[i]=yield this.startLogIn();return i}))}setMasterKey(e,t){return fe(this,void 0,void 0,(function*(){if(e.apiUseKeyConnector){const e=(yield(0,P.z)(this.environmentService.environment$)).getKeyConnectorUrl();yield this.keyConnectorService.setMasterKeyFromUrl(e,t)}}))}setUserKey(e,t){return fe(this,void 0,void 0,(function*(){if(yield this.cryptoService.setMasterKeyEncryptedUserKey(e.key),e.apiUseKeyConnector){const e=yield(0,P.z)(this.masterPasswordService.masterKey$(t));if(e){const i=yield this.cryptoService.decryptUserKeyWithMasterKey(e);yield this.cryptoService.setUserKey(i,t)}}}))}setPrivateKey(e,t){var i;return fe(this,void 0,void 0,(function*(){yield this.cryptoService.setPrivateKey(null!==(i=e.privateKey)&&void 0!==i?i:yield this.createKeyPairForOldAccount(t),t)}))}saveAccountInformation(e){const t=Object.create(null,{saveAccountInformation:{get:()=>super.saveAccountInformation}});return fe(this,void 0,void 0,(function*(){const i=yield t.saveAccountInformation.call(this,e),n=yield this.stateService.getVaultTimeout(),s=yield this.stateService.getVaultTimeoutAction(),o=this.cache.value.tokenRequest;return yield this.tokenService.setClientId(o.clientId,s,n),yield this.tokenService.setClientSecret(o.clientSecret,s,n),i}))}exportCache(){return{userApiKey:this.cache.value}}}class ye extends J.g{constructor(e,t,i){super(void 0,i),this.token=e,this.deviceResponse=t}toIdentityToken(e){const t=super.toIdentityToken(e);return t.grant_type="webauthn",t.token=this.token,t.deviceResponse=JSON.stringify(this.deviceResponse),t}static fromJSON(e){return Object.assign(Object.create(ye.prototype),e,{deviceResponse:p.J.fromJSON(e.deviceResponse),device:e.device?R.x.fromJSON(e.device):void 0,twoFactor:e.twoFactor?Object.assign(new d._,e.twoFactor):void 0})}}var we=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class be{static fromJSON(e){return Object.assign(new be,e,{tokenRequest:ye.fromJSON(e.tokenRequest),credentials:v.fromJSON(e.credentials)})}}class Ue extends ie{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g){super(t,i,n,s,o,r,a,l,c,u,d,p,h,g),this.cache=new F.X(e)}logIn(e){return we(this,void 0,void 0,(function*(){const t=new be;t.credentials=e,t.tokenRequest=new ye(e.token,e.deviceResponse,yield this.buildDeviceRequest()),this.cache.next(t);const[i]=yield this.startLogIn();return i}))}logInTwoFactor(){return we(this,void 0,void 0,(function*(){throw new Error("2FA not supported yet for WebAuthn Login.")}))}setMasterKey(e,t){return we(this,void 0,void 0,(function*(){return Promise.resolve()}))}setUserKey(e,t){var i;return we(this,void 0,void 0,(function*(){const n=e.key;n&&(yield this.cryptoService.setMasterKeyEncryptedUserKey(n,t));const s=null==e?void 0:e.userDecryptionOptions;if(null==s?void 0:s.webAuthnPrfOption){const n=null===(i=e.userDecryptionOptions)||void 0===i?void 0:i.webAuthnPrfOption,s=this.cache.value.credentials;if(!s.prfKey)return;const o=yield this.cryptoService.decryptToBytes(n.encryptedPrivateKey,s.prfKey),r=yield this.cryptoService.rsaDecrypt(n.encryptedUserKey.encryptedString,o);r&&(yield this.cryptoService.setUserKey(new h.N(r),t))}}))}setPrivateKey(e,t){var i;return we(this,void 0,void 0,(function*(){yield this.cryptoService.setPrivateKey(null!==(i=e.privateKey)&&void 0!==i?i:yield this.createKeyPairForOldAccount(t),t)}))}exportCache(){return{webAuthn:this.cache.value}}}const _e=new Z.vh(Z.Jp,"currentLoginStrategy",{deserializer:e=>e}),Ae=new Z.vh(Z.Jp,"loginStrategyCacheExpiration",{deserializer:e=>e?null:new Date(e)}),Ze=new Z.vh(Z.Jp,"authRequestPushNotification",{deserializer:e=>e}),xe=new Z.vh(Z.Jp,"loginStrategyCache",{deserializer:e=>null==e?null:{password:e.password?le.fromJSON(e.password):void 0,sso:e.sso?pe.fromJSON(e.sso):void 0,userApiKey:e.userApiKey?me.fromJSON(e.userApiKey):void 0,authRequest:e.authRequest?se.fromJSON(e.authRequest):void 0,webAuthn:e.webAuthn?be.fromJSON(e.webAuthn):void 0}});var Se=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Te=12e4;class Ce{constructor(e,t,i,n,s,o,r,a,l,c,u,d,p,h,g,f,m,v,y,w,b,U,_){this.accountService=e,this.masterPasswordService=t,this.cryptoService=i,this.apiService=n,this.tokenService=s,this.appIdService=o,this.platformUtilsService=r,this.messagingService=a,this.logService=l,this.keyConnectorService=c,this.environmentService=u,this.stateService=d,this.twoFactorService=p,this.i18nService=h,this.encryptService=g,this.passwordStrengthService=f,this.policyService=m,this.deviceTrustService=v,this.authRequestService=y,this.userDecryptionOptionsService=w,this.stateProvider=b,this.billingAccountProfileStateService=U,this.kdfConfigService=_,this.currentAuthnTypeState=this.stateProvider.get(_e),this.loginStrategyCacheState=this.stateProvider.get(xe),this.loginStrategyCacheExpirationState=this.stateProvider.get(Ae),this.authRequestPushNotificationState=this.stateProvider.get(Ze),this.currentAuthType$=this.currentAuthnTypeState.state$,this.loginStrategy$=this.currentAuthnTypeState.state$.pipe((0,C.x)(),(0,O.V)(this.loginStrategyCacheState.state$),this.initializeLoginStrategy.bind(this),(0,k.d)({refCount:!0,bufferSize:1}))}getEmail(){return Se(this,void 0,void 0,(function*(){const e=yield(0,P.z)(this.loginStrategy$);return"email$"in e?yield(0,P.z)(e.email$):null}))}getMasterPasswordHash(){return Se(this,void 0,void 0,(function*(){const e=yield(0,P.z)(this.loginStrategy$);return"serverMasterKeyHash$"in e?yield(0,P.z)(e.serverMasterKeyHash$):null}))}getSsoEmail2FaSessionToken(){return Se(this,void 0,void 0,(function*(){const e=yield(0,P.z)(this.loginStrategy$);return"ssoEmail2FaSessionToken$"in e?yield(0,P.z)(e.ssoEmail2FaSessionToken$):null}))}getAccessCode(){return Se(this,void 0,void 0,(function*(){const e=yield(0,P.z)(this.loginStrategy$);return"accessCode$"in e?yield(0,P.z)(e.accessCode$):null}))}getAuthRequestId(){return Se(this,void 0,void 0,(function*(){const e=yield(0,P.z)(this.loginStrategy$);return"authRequestId$"in e?yield(0,P.z)(e.authRequestId$):null}))}logIn(e){return Se(this,void 0,void 0,(function*(){yield this.clearCache(),yield this.currentAuthnTypeState.update((t=>e.type));const t=yield(0,P.z)(this.loginStrategy$),i=Object.assign({},e),n=yield t.logIn(i);return null==n||n.requiresTwoFactor?(yield this.loginStrategyCacheState.update((e=>t.exportCache())),yield this.startSessionTimeout()):yield this.clearCache(),n}))}logInTwoFactor(e,t){return Se(this,void 0,void 0,(function*(){if(!(yield this.isSessionValid()))throw new Error(this.i18nService.t("sessionTimeout"));const i=yield(0,P.z)(this.loginStrategy$);if(null==i)throw new Error("No login strategy found.");try{const n=yield i.logInTwoFactor(e,t);return null==n||n.requiresTwoFactor||n.requiresCaptcha||(yield this.clearCache()),n}catch(n){throw n instanceof L.i||(yield this.clearCache()),n}}))}makePreloginKey(e,t){return Se(this,void 0,void 0,(function*(){t=t.trim().toLowerCase();let i=null;try{const e=yield this.apiService.postPrelogin(new N(t));null!=e&&(i=e.kdf===D.G3.PBKDF2_SHA256?new I.S(e.kdfIterations):new I.H(e.kdfIterations,e.kdfMemory,e.kdfParallelism))}catch(n){if(null==n||404!==n.statusCode)throw n}return yield this.cryptoService.makeMasterKey(e,t,i)}))}passwordlessLogin(e,t,i){return Se(this,void 0,void 0,(function*(){const n=E.c.fromB64ToArray(t),s=(yield(0,P.z)(this.accountService.activeAccount$)).id,o=yield(0,P.z)(this.masterPasswordService.masterKey$(s));let r,a=null;if(o){r=o.encKey;const e=yield(0,P.z)(this.masterPasswordService.masterKeyHash$(s));null!=e&&(a=yield this.cryptoService.rsaEncrypt(E.c.fromUtf8ToArray(e),n))}else{r=(yield this.cryptoService.getUserKey()).key}const l=yield this.cryptoService.rsaEncrypt(r,n),c=new M(l.encryptedString,null==a?void 0:a.encryptedString,yield this.appIdService.getAppId(),i);return yield this.apiService.putAuthRequest(e,c)}))}clearCache(){return Se(this,void 0,void 0,(function*(){yield this.currentAuthnTypeState.update((e=>null)),yield this.loginStrategyCacheState.update((e=>null)),yield this.clearSessionTimeout()}))}startSessionTimeout(){return Se(this,void 0,void 0,(function*(){yield this.clearSessionTimeout(),yield this.loginStrategyCacheExpirationState.update((e=>new Date(Date.now()+Te))),this.sessionTimeout=setTimeout((()=>this.clearCache()),Te)}))}clearSessionTimeout(){return Se(this,void 0,void 0,(function*(){yield this.loginStrategyCacheExpirationState.update((e=>null)),this.sessionTimeout=null}))}isSessionValid(){return Se(this,void 0,void 0,(function*(){if(null==(yield(0,P.z)(this.loginStrategyCacheState.state$)))return!1;const e=yield(0,P.z)(this.loginStrategyCacheExpirationState.state$);return!(null!=e&&e<new Date)||(yield this.clearCache(),!1)}))}initializeLoginStrategy(e){return e.pipe((0,q.U)((([e,t])=>{if(null==e)return null;switch(e){case u.a.Password:return new ce(null==t?void 0:t.password,this.accountService,this.masterPasswordService,this.cryptoService,this.apiService,this.tokenService,this.appIdService,this.platformUtilsService,this.messagingService,this.logService,this.stateService,this.twoFactorService,this.userDecryptionOptionsService,this.passwordStrengthService,this.policyService,this,this.billingAccountProfileStateService,this.kdfConfigService);case u.a.Sso:return new he(null==t?void 0:t.sso,this.accountService,this.masterPasswordService,this.cryptoService,this.apiService,this.tokenService,this.appIdService,this.platformUtilsService,this.messagingService,this.logService,this.stateService,this.twoFactorService,this.userDecryptionOptionsService,this.keyConnectorService,this.deviceTrustService,this.authRequestService,this.i18nService,this.billingAccountProfileStateService,this.kdfConfigService);case u.a.UserApiKey:return new ve(null==t?void 0:t.userApiKey,this.accountService,this.masterPasswordService,this.cryptoService,this.apiService,this.tokenService,this.appIdService,this.platformUtilsService,this.messagingService,this.logService,this.stateService,this.twoFactorService,this.userDecryptionOptionsService,this.environmentService,this.keyConnectorService,this.billingAccountProfileStateService,this.kdfConfigService);case u.a.AuthRequest:return new oe(null==t?void 0:t.authRequest,this.accountService,this.masterPasswordService,this.cryptoService,this.apiService,this.tokenService,this.appIdService,this.platformUtilsService,this.messagingService,this.logService,this.stateService,this.twoFactorService,this.userDecryptionOptionsService,this.deviceTrustService,this.billingAccountProfileStateService,this.kdfConfigService);case u.a.WebAuthn:return new Ue(null==t?void 0:t.webAuthn,this.accountService,this.masterPasswordService,this.cryptoService,this.apiService,this.tokenService,this.appIdService,this.platformUtilsService,this.messagingService,this.logService,this.stateService,this.twoFactorService,this.userDecryptionOptionsService,this.billingAccountProfileStateService,this.kdfConfigService)}})))}}var Oe=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ke=new Z.fX(Z.UC,"decryptionOptions",{deserializer:e=>b.fromJSON(e),clearOn:["logout"]});class Pe{constructor(e){this.stateProvider=e,this.userDecryptionOptionsState=this.stateProvider.getActive(ke),this.userDecryptionOptions$=this.userDecryptionOptionsState.state$,this.hasMasterPassword$=this.userDecryptionOptions$.pipe((0,q.U)((e=>{var t;return null!==(t=null==e?void 0:e.hasMasterPassword)&&void 0!==t&&t})))}userDecryptionOptionsById$(e){return this.stateProvider.getUser(e,ke).state$}setUserDecryptionOptions(e){return Oe(this,void 0,void 0,(function*(){yield this.userDecryptionOptionsState.update((t=>e))}))}}var qe=i(54019),Ie=i(7985),Me=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Ne=new Z.fX(Z.WV,"acceptAuthRequests",{deserializer:e=>null!=e&&e,clearOn:[]}),Le=new Z.fX(Z.WV,"adminAuthRequest",{deserializer:e=>e,clearOn:[]});class De{constructor(e,t,i,n,s,o){this.appIdService=e,this.accountService=t,this.masterPasswordService=i,this.cryptoService=n,this.apiService=s,this.stateProvider=o,this.authRequestPushNotificationSubject=new qe.x,this.authRequestPushNotification$=this.authRequestPushNotificationSubject.asObservable()}getAcceptAuthRequests(e){return Me(this,void 0,void 0,(function*(){if(null==e)throw new Error("User ID is required");return yield(0,P.z)(this.stateProvider.getUser(e,Ne).state$)}))}setAcceptAuthRequests(e,t){return Me(this,void 0,void 0,(function*(){if(null==t)throw new Error("User ID is required");yield this.stateProvider.setUserState(Ne,e,t)}))}getAdminAuthRequest(e){return Me(this,void 0,void 0,(function*(){if(null==e)throw new Error("User ID is required");const t=yield(0,P.z)(this.stateProvider.getUser(e,Le).state$);return Ie.$.fromJSON(t)}))}setAdminAuthRequest(e,t){return Me(this,void 0,void 0,(function*(){if(null==t)throw new Error("User ID is required");if(null==e)throw new Error("Auth request is required");yield this.stateProvider.setUserState(Le,e.toJSON(),t)}))}clearAdminAuthRequest(e){return Me(this,void 0,void 0,(function*(){if(null==e)throw new Error("User ID is required");yield this.stateProvider.setUserState(Le,null,e)}))}approveOrDenyAuthRequest(e,t){return Me(this,void 0,void 0,(function*(){if(!t.id)throw new Error("Auth request has no id");if(!t.publicKey)throw new Error("Auth request has no public key");const i=E.c.fromB64ToArray(t.publicKey),n=(yield(0,P.z)(this.accountService.activeAccount$)).id,s=yield(0,P.z)(this.masterPasswordService.masterKey$(n)),o=yield(0,P.z)(this.masterPasswordService.masterKeyHash$(n));let r,a;if(s&&o)r=yield this.cryptoService.rsaEncrypt(E.c.fromUtf8ToArray(o),i),a=s.encKey;else{a=(yield this.cryptoService.getUserKey()).key}const l=yield this.cryptoService.rsaEncrypt(a,i),c=new M(l.encryptedString,null==r?void 0:r.encryptedString,yield this.appIdService.getAppId(),e);return yield this.apiService.putAuthRequest(t.id,c)}))}setUserKeyAfterDecryptingSharedUserKey(e,t){return Me(this,void 0,void 0,(function*(){const i=yield this.decryptPubKeyEncryptedUserKey(e.key,t);yield this.cryptoService.setUserKey(i)}))}setKeysAfterDecryptingSharedMasterKeyAndHash(e,t){return Me(this,void 0,void 0,(function*(){const{masterKey:i,masterKeyHash:n}=yield this.decryptPubKeyEncryptedMasterKeyAndHash(e.key,e.masterPasswordHash,t),s=yield this.cryptoService.decryptUserKeyWithMasterKey(i),o=(yield(0,P.z)(this.accountService.activeAccount$)).id;yield this.masterPasswordService.setMasterKey(i,o),yield this.masterPasswordService.setMasterKeyHash(n,o),yield this.cryptoService.setUserKey(s)}))}decryptPubKeyEncryptedUserKey(e,t){return Me(this,void 0,void 0,(function*(){const i=yield this.cryptoService.rsaDecrypt(e,t);return new h.N(i)}))}decryptPubKeyEncryptedMasterKeyAndHash(e,t,i){return Me(this,void 0,void 0,(function*(){const n=yield this.cryptoService.rsaDecrypt(e,i),s=yield this.cryptoService.rsaDecrypt(t,i);return{masterKey:new h.N(n),masterKeyHash:E.c.fromBufferToUtf8(s)}}))}sendAuthRequestPushNotification(e){null!=e.id&&this.authRequestPushNotificationSubject.next(e.id)}}function Ee(e){if(null==e)throw new Error("JWT token not found");const t=e.split(".");if(3!==t.length)throw new Error("JWT must have 3 parts");const i=t[1];let n;try{n=E.c.fromUrlB64ToUtf8(i)}catch(s){throw new Error("Cannot decode the token")}try{return JSON.parse(n)}catch(o){throw new Error("Cannot parse the token's payload into JSON")}}},55602:(e,t,i)=>{"use strict";i.d(t,{s:()=>n});class n{}},98438:(e,t,i)=>{"use strict";i.d(t,{C:()=>n});class n{}},87483:(e,t,i)=>{"use strict";i.d(t,{j:()=>n});class n{}},54538:(e,t,i)=>{"use strict";i.d(t,{k:()=>n});class n{}},46226:(e,t,i)=>{"use strict";i.d(t,{T:()=>n});class n{}},51430:(e,t,i)=>{"use strict";i.d(t,{o:()=>n});class n{}},7203:(e,t,i)=>{"use strict";i.d(t,{E:()=>n});class n{}},52297:(e,t,i)=>{"use strict";i.d(t,{Q:()=>n});class n{}},5351:(e,t,i)=>{"use strict";i.d(t,{T:()=>n});class n{}},1113:(e,t,i)=>{"use strict";i.d(t,{R:()=>s,Y:()=>n});class n{constructor(e,t){this.state$=e,this.set=t}}class s{}},47244:(e,t,i)=>{"use strict";i.d(t,{t:()=>n});class n{}},82558:(e,t,i)=>{"use strict";i.d(t,{u:()=>o,w:()=>s});var n=i(91667);class s extends n.Y{}class o extends s{}},54427:(e,t,i)=>{"use strict";i.d(t,{s:()=>n});class n{}},97360:(e,t,i)=>{"use strict";i.d(t,{M:()=>n});class n{}},58691:(e,t,i)=>{"use strict";i.d(t,{$9:()=>p,$G:()=>c,DL:()=>r,Mn:()=>f,Po:()=>o,RN:()=>g,WN:()=>h,WW:()=>l,eC:()=>m,gW:()=>d,pF:()=>u,tt:()=>a});var n=i(92786),s=i(27646);function o(e){return e.canViewAssignedCollections||e.canViewAllCollections}function r(e){return e.isOwner||e.canManagePolicies||e.canManageSso||e.canManageScim||e.canAccessImportExport||e.canManageDeviceApprovals}function a(e){return e.canManageUsers||e.canManageUsersPassword}function l(e){return e.canManageGroups}function c(e){return e.canAccessReports||e.canAccessEventLogs}function u(e){return e.isOwner}function d(e){return!(!e.enabled&&!e.isOwner)&&(a(e)||l(e)||c(e)||u(e)||r(e)||o(e))}function p(e){return(0,n.U)((t=>t.find((t=>t.id===e))))}function h(e){return(0,n.U)((t=>t.filter((e=>e.canAccessImportExport||e.canCreateNewCollections&&e.flexibleCollections)).sort(s.c.getSortFunction(e,"name"))))}function g(e){return e.isMember}class f{}class m extends f{}},50137:(e,t,i)=>{"use strict";i.d(t,{P:()=>n});class n{}},83924:(e,t,i)=>{"use strict";i.d(t,{W:()=>s,d:()=>n});class n{}class s extends n{}},5959:(e,t,i)=>{"use strict";i.d(t,{H:()=>n});class n{}},31361:(e,t,i)=>{"use strict";i.d(t,{L:()=>n});class n{}},92614:(e,t,i)=>{"use strict";var n,s,o,r,a,l,c,u,d,p;i.d(t,{Dn:()=>o,je:()=>r,Mi:()=>a,lP:()=>l,a3:()=>c,D2:()=>u}),function(e){e[e.Default=0]="Default",e[e.BillingSync=1]="BillingSync",e[e.Scim=2]="Scim"}(n||(n={})),function(e){e[e.CloudBillingSync=1]="CloudBillingSync",e[e.Scim=2]="Scim"}(s||(s={})),function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed",e[e.Revoked=-1]="Revoked"}(o||(o={})),function(e){e[e.Owner=0]="Owner",e[e.Admin=1]="Admin",e[e.User=2]="User",e[e.Manager=3]="Manager",e[e.Custom=4]="Custom"}(r||(r={})),function(e){e[e.TwoFactorAuthentication=0]="TwoFactorAuthentication",e[e.MasterPassword=1]="MasterPassword",e[e.PasswordGenerator=2]="PasswordGenerator",e[e.SingleOrg=3]="SingleOrg",e[e.RequireSso=4]="RequireSso",e[e.PersonalOwnership=5]="PersonalOwnership",e[e.DisableSend=6]="DisableSend",e[e.SendOptions=7]="SendOptions",e[e.ResetPassword=8]="ResetPassword",e[e.MaximumVaultTimeout=9]="MaximumVaultTimeout",e[e.DisablePersonalVaultExport=10]="DisablePersonalVaultExport",e[e.ActivateAutofill=11]="ActivateAutofill"}(a||(a={})),function(e){e[e.Msp=0]="Msp",e[e.Reseller=1]="Reseller"}(l||(l={})),function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed",e[e.Revoked=-1]="Revoked"}(c||(c={})),function(e){e[e.ProviderAdmin=0]="ProviderAdmin",e[e.ServiceUser=1]="ServiceUser"}(u||(u={})),function(e){e[e.Default=0]="Default",e[e.AzureAd=1]="AzureAd",e[e.Okta=2]="Okta",e[e.OneLogin=3]="OneLogin",e[e.JumpCloud=4]="JumpCloud",e[e.GoogleWorkspace=5]="GoogleWorkspace",e[e.Rippling=6]="Rippling"}(d||(d={})),function(e){e[e.Pending=0]="Pending",e[e.Created=1]="Created",e[e.Billable=2]="Billable"}(p||(p={}))},20698:(e,t,i)=>{"use strict";i.d(t,{Q:()=>s});var n=i(58043);class s extends n.c{constructor(e=null){if(super(e),null==e)return this;this.accessEventLogs=this.getResponseProperty("AccessEventLogs"),this.accessImportExport=this.getResponseProperty("AccessImportExport"),this.accessReports=this.getResponseProperty("AccessReports"),this.createNewCollections=this.getResponseProperty("CreateNewCollections"),this.editAnyCollection=this.getResponseProperty("EditAnyCollection"),this.deleteAnyCollection=this.getResponseProperty("DeleteAnyCollection"),this.editAssignedCollections=this.getResponseProperty("EditAssignedCollections"),this.deleteAssignedCollections=this.getResponseProperty("DeleteAssignedCollections"),this.manageCiphers=this.getResponseProperty("ManageCiphers"),this.manageGroups=this.getResponseProperty("ManageGroups"),this.manageSso=this.getResponseProperty("ManageSso"),this.managePolicies=this.getResponseProperty("ManagePolicies"),this.manageUsers=this.getResponseProperty("ManageUsers"),this.manageResetPassword=this.getResponseProperty("ManageResetPassword"),this.manageScim=this.getResponseProperty("ManageScim")}}},63700:(e,t,i)=>{"use strict";i.d(t,{n:()=>n});class n{constructor(e){null!=e&&(this.id=e.id,this.organizationId=e.organizationId,this.type=e.type,this.data=e.data,this.enabled=e.enabled)}}},85623:(e,t,i)=>{"use strict";i.d(t,{v:()=>s});var n=i(40160);class s extends n.Z{constructor(){super(...arguments),this.minComplexity=0,this.minLength=0,this.requireUpper=!1,this.requireLower=!1,this.requireNumbers=!1,this.requireSpecial=!1,this.enforceOnLogin=!1}static fromResponse(e){if(null==e)return null;const t=new s;return t.minComplexity=e.minComplexity,t.minLength=e.minLength,t.requireUpper=e.requireUpper,t.requireLower=e.requireLower,t.requireNumbers=e.requireNumbers,t.requireSpecial=e.requireSpecial,t.enforceOnLogin=e.enforceOnLogin,t}}},27263:(e,t,i)=>{"use strict";i.d(t,{c:()=>s});var n=i(92614);class s{constructor(e){null!=e&&(this.id=e.id,this.name=e.name,this.status=e.status,this.type=e.type,this.enabled=e.enabled,this.usePolicies=e.usePolicies,this.useGroups=e.useGroups,this.useDirectory=e.useDirectory,this.useEvents=e.useEvents,this.useTotp=e.useTotp,this.use2fa=e.use2fa,this.useApi=e.useApi,this.useSso=e.useSso,this.useKeyConnector=e.useKeyConnector,this.useScim=e.useScim,this.useCustomPermissions=e.useCustomPermissions,this.useResetPassword=e.useResetPassword,this.useSecretsManager=e.useSecretsManager,this.usePasswordManager=e.usePasswordManager,this.useActivateAutofillPolicy=e.useActivateAutofillPolicy,this.selfHost=e.selfHost,this.usersGetPremium=e.usersGetPremium,this.seats=e.seats,this.maxCollections=e.maxCollections,this.maxStorageGb=e.maxStorageGb,this.ssoBound=e.ssoBound,this.identifier=e.identifier,this.permissions=e.permissions,this.resetPasswordEnrolled=e.resetPasswordEnrolled,this.userId=e.userId,this.hasPublicAndPrivateKeys=e.hasPublicAndPrivateKeys,this.providerId=e.providerId,this.providerName=e.providerName,this.providerType=e.providerType,this.isProviderUser=e.isProviderUser,this.isMember=e.isMember,this.familySponsorshipFriendlyName=e.familySponsorshipFriendlyName,this.familySponsorshipAvailable=e.familySponsorshipAvailable,this.planProductType=e.planProductType,this.keyConnectorEnabled=e.keyConnectorEnabled,this.keyConnectorUrl=e.keyConnectorUrl,this.familySponsorshipLastSyncDate=e.familySponsorshipLastSyncDate,this.familySponsorshipValidUntil=e.familySponsorshipValidUntil,this.familySponsorshipToDelete=e.familySponsorshipToDelete,this.accessSecretsManager=e.accessSecretsManager,this.limitCollectionCreationDeletion=e.limitCollectionCreationDeletion,this.allowAdminAccessToAllCollectionItems=e.allowAdminAccessToAllCollectionItems,this.flexibleCollections=e.flexibleCollections)}get canAccess(){return!!this.isOwner||this.enabled&&this.status===n.Dn.Confirmed}get isManager(){return this.type===n.je.Manager||this.isAdmin}get isAdmin(){return this.type===n.je.Admin||this.isOwner}get isOwner(){return this.type===n.je.Owner||this.isProviderUser}get canAccessEventLogs(){return(this.isAdmin||this.permissions.accessEventLogs)&&this.useEvents}get canAccessImportExport(){return this.isAdmin||this.permissions.accessImportExport}get canAccessReports(){return this.isAdmin||this.permissions.accessReports}get canCreateNewCollections(){return this.flexibleCollections?!this.limitCollectionCreationDeletion||this.isAdmin||this.permissions.createNewCollections:this.isManager||this.permissions.createNewCollections}canEditAnyCollection(e){return this.flexibleCollections&&e?this.isProviderUser||this.type===n.je.Custom&&this.permissions.editAnyCollection||this.allowAdminAccessToAllCollectionItems&&this.isAdmin:this.isAdmin||this.permissions.editAnyCollection}canEditUnassignedCiphers(){return this.isAdmin||this.permissions.editAnyCollection}canEditAllCiphers(e){return this.flexibleCollections&&e?this.isProviderUser||this.type===n.je.Custom&&this.permissions.editAnyCollection||this.allowAdminAccessToAllCollectionItems&&this.isAdmin:this.isAdmin||this.permissions.editAnyCollection}get canDeleteAnyCollection(){return this.isAdmin||this.permissions.deleteAnyCollection}get canViewAllCollections(){return this.isAdmin||this.permissions.editAnyCollection||this.canDeleteAnyCollection}get canEditAssignedCollections(){return this.isManager||this.permissions.editAssignedCollections}get canDeleteAssignedCollections(){return this.isManager||this.permissions.deleteAssignedCollections}get canViewAssignedCollections(){return this.canDeleteAssignedCollections||this.canEditAssignedCollections}get canManageGroups(){return(this.isAdmin||this.permissions.manageGroups)&&this.useGroups}get canManageSso(){return(this.isAdmin||this.permissions.manageSso)&&this.useSso}get canManageDomainVerification(){return(this.isAdmin||this.permissions.manageSso)&&this.useSso}get canManageScim(){return(this.isAdmin||this.permissions.manageScim)&&this.useScim}get canManagePolicies(){return(this.isAdmin||this.permissions.managePolicies)&&this.usePolicies}get canManageUsers(){return this.isAdmin||this.permissions.manageUsers}get canManageUsersPassword(){return this.isAdmin||this.permissions.manageResetPassword}get canManageDeviceApprovals(){return(this.isAdmin||this.permissions.manageResetPassword)&&this.useSso}get isExemptFromPolicies(){return this.canManagePolicies}get canViewSubscription(){return!!this.canEditSubscription||(this.hasProvider&&this.providerType===n.lP.Msp?this.isProviderUser:this.isOwner)}get canEditSubscription(){return this.hasProvider?this.isProviderUser:this.isOwner}get canEditPaymentMethods(){return this.canEditSubscription}get canViewBillingHistory(){return this.canEditSubscription}get hasProvider(){return null!=this.providerId||null!=this.providerName}get hasReseller(){return this.hasProvider&&this.providerType===n.lP.Reseller}get canAccessSecretsManager(){return this.useSecretsManager&&this.accessSecretsManager}get isFreeOrg(){return!this.useTotp}get canManageSponsorships(){return this.familySponsorshipAvailable||null!==this.familySponsorshipFriendlyName}static fromJSON(e){return null==e?null:Object.assign(new s,e,{familySponsorshipLastSyncDate:new Date(e.familySponsorshipLastSyncDate),familySponsorshipValidUntil:new Date(e.familySponsorshipValidUntil)})}}},90692:(e,t,i)=>{"use strict";i.d(t,{G:()=>o});var n=i(40160),s=i(63700);class o extends n.Z{constructor(e){super(),null!=e&&(this.id=e.id,this.organizationId=e.organizationId,this.type=e.type,this.data=e.data,this.enabled=e.enabled)}static fromResponse(e){return new o(new s.n(e))}static fromListResponse(e){var t,i;return null!==(i=null===(t=e.data)||void 0===t?void 0:t.map((e=>o.fromResponse(e))))&&void 0!==i?i:void 0}}},36076:(e,t,i)=>{"use strict";i.d(t,{a:()=>n});class n{}},44882:(e,t,i)=>{"use strict";i.d(t,{u:()=>s});var n=i(98405);class s extends n.C{constructor(e,t){super(e,t)}}},3289:(e,t,i)=>{"use strict";i.d(t,{d:()=>n});class n{constructor(e,t,i,n){this.id=e,this.readOnly=t,this.hidePasswords=i,this.manage=n}}},41489:(e,t,i)=>{"use strict";i.d(t,{j:()=>s});var n=i(58043);class s extends n.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.type=this.getResponseProperty("Type"),this.data=this.getResponseProperty("Data"),this.enabled=this.getResponseProperty("Enabled")}}},88652:(e,t,i)=>{"use strict";i.d(t,{Y:()=>s});var n=i(58043);class s extends n.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.readOnly=this.getResponseProperty("ReadOnly"),this.hidePasswords=this.getResponseProperty("HidePasswords"),this.manage=this.getResponseProperty("Manage")}}},37408:(e,t,i)=>{"use strict";i.d(t,{X:()=>n});class n{}},47724:(e,t,i)=>{"use strict";function n(e,t){if(null==e&&null==t)return!0;if(null==e||null==t)return!1;const i=new Set([...Object.keys(e),...Object.keys(t)]);for(const n of i)if(e[n]!==t[n])return!1;return!0}i.d(t,{BR:()=>s,_5:()=>o,wZ:()=>n});class s{}class o extends s{}},29491:(e,t,i)=>{"use strict";i.d(t,{r:()=>n});class n{}},2184:(e,t,i)=>{"use strict";i.d(t,{e:()=>n});class n{}},44647:(e,t,i)=>{"use strict";i.d(t,{o:()=>n});class n{}},51651:(e,t,i)=>{"use strict";i.d(t,{U:()=>n});class n{}},4423:(e,t,i)=>{"use strict";i.d(t,{c:()=>n});class n{}},19326:(e,t,i)=>{"use strict";i.d(t,{m:()=>n});class n{}},85420:(e,t,i)=>{"use strict";i.d(t,{d:()=>n});class n{}},1008:(e,t,i)=>{"use strict";i.d(t,{J:()=>n});class n{}},42842:(e,t,i)=>{"use strict";i.d(t,{R:()=>s,j:()=>n});class n{}class s extends n{}},77685:(e,t,i)=>{"use strict";i.d(t,{U:()=>n});class n{}},1153:(e,t,i)=>{"use strict";i.d(t,{F:()=>n});class n{}},77097:(e,t,i)=>{"use strict";i.d(t,{B:()=>n});class n{}},14921:(e,t,i)=>{"use strict";i.d(t,{S:()=>n});class n{}},42304:(e,t,i)=>{"use strict";i.d(t,{i:()=>n});class n{}},77442:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});class n{}},21452:(e,t,i)=>{"use strict";i.d(t,{V:()=>n});class n{}},67855:(e,t,i)=>{"use strict";var n;i.d(t,{y:()=>n}),function(e){e[e.LoggedOut=0]="LoggedOut",e[e.Locked=1]="Locked",e[e.Unlocked=2]="Unlocked"}(n||(n={}))},38002:(e,t,i)=>{"use strict";var n;i.d(t,{a:()=>n}),function(e){e[e.Password=0]="Password",e[e.Sso=1]="Sso",e[e.UserApiKey=2]="UserApiKey",e[e.AuthRequest=3]="AuthRequest",e[e.WebAuthn=4]="WebAuthn"}(n||(n={}))},48103:(e,t,i)=>{"use strict";var n;i.d(t,{L:()=>n}),function(e){e[e.Authenticator=0]="Authenticator",e[e.Email=1]="Email",e[e.Duo=2]="Duo",e[e.Yubikey=3]="Yubikey",e[e.U2f=4]="U2f",e[e.Remember=5]="Remember",e[e.OrganizationDuo=6]="OrganizationDuo",e[e.WebAuthn=7]="WebAuthn"}(n||(n={}))},70138:(e,t,i)=>{"use strict";var n;i.d(t,{R:()=>n}),function(e){e[e.MasterPassword=0]="MasterPassword",e[e.OTP=1]="OTP",e[e.PIN=2]="PIN",e[e.Biometrics=3]="Biometrics"}(n||(n={}))},7985:(e,t,i)=>{"use strict";i.d(t,{$:()=>s});var n=i(27646);class s{constructor(e){e&&Object.assign(this,e)}toJSON(){return{id:this.id,privateKey:n.c.fromBufferToByteString(this.privateKey)}}static fromJSON(e){if(null==e)return null;let t=null;return e.privateKey&&(t=n.c.fromByteStringToArray(e.privateKey)),new s({id:e.id,privateKey:t})}}},36788:(e,t,i)=>{"use strict";var n;i.d(t,{w:()=>n}),function(e){e[e.None=0]="None",e[e.AdminForcePasswordReset=1]="AdminForcePasswordReset",e[e.WeakMasterPassword=2]="WeakMasterPassword",e[e.TdeUserWithoutPasswordHasPasswordResetPermission=3]="TdeUserWithoutPasswordHasPasswordResetPermission"}(n||(n={}))},88160:(e,t,i)=>{"use strict";i.d(t,{H:()=>o,S:()=>s});var n=i(21032);class s{constructor(e){this.kdfType=n.G3.PBKDF2_SHA256,this.iterations=null!=e?e:n.qv.defaultValue}validateKdfConfig(){if(!n.qv.inRange(this.iterations))throw new Error(`PBKDF2 iterations must be between ${n.qv.min} and ${n.qv.max}`)}static fromJSON(e){return new s(e.iterations)}}class o{constructor(e,t,i){this.kdfType=n.G3.Argon2id,this.iterations=null!=e?e:n.lh.defaultValue,this.memory=null!=t?t:n._l.defaultValue,this.parallelism=null!=i?i:n.Oi.defaultValue}validateKdfConfig(){if(!n.lh.inRange(this.iterations))throw new Error(`Argon2 iterations must be between ${n.lh.min} and ${n.lh.max}`);if(!n._l.inRange(this.memory))throw new Error(`Argon2 memory must be between ${n._l.min}mb and ${n._l.max}mb`);if(!n.Oi.inRange(this.parallelism))throw new Error(`Argon2 parallelism must be between ${n.Oi.min} and ${n.Oi.max}.`)}static fromJSON(e){return new o(e.iterations,e.memory,e.parallelism)}}},65193:(e,t,i)=>{"use strict";i.d(t,{x:()=>n});class n{constructor(e,t){this.type=t.getDevice(),this.name=t.getDeviceString(),this.identifier=e,this.pushToken=null}static fromJSON(e){return Object.assign(Object.create(n.prototype),e)}}},71916:(e,t,i)=>{"use strict";i.d(t,{_:()=>n});class n{constructor(e=null,t=null,i=!1){this.provider=e,this.token=t,this.remember=i}}},15110:(e,t,i)=>{"use strict";i.d(t,{g:()=>n});class n{constructor(e,t){this.twoFactor=e,this.device=null!=t?t:null}alterIdentityTokenHeaders(e){}setTwoFactor(e){this.twoFactor=e}setAuthRequestAccessCode(e){this.authRequest=e}toIdentityToken(e){const t={scope:"api offline_access",client_id:e};return this.device&&(t.deviceType=this.device.type,t.deviceIdentifier=this.device.identifier,t.deviceName=this.device.name),this.authRequest&&(t.authRequest=this.authRequest),this.twoFactor&&this.twoFactor.token&&null!=this.twoFactor.provider&&(t.twoFactorToken=this.twoFactor.token,t.twoFactorProvider=this.twoFactor.provider,t.twoFactorRemember=this.twoFactor.remember?"1":"0"),t}}},38889:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var n=i(65193),s=i(71916),o=i(15110);class r extends o.g{constructor(e,t,i,n){super(i,n),this.clientId=e,this.clientSecret=t,this.twoFactor=i}toIdentityToken(){const e=super.toIdentityToken(this.clientId);return e.scope=this.clientId.startsWith("organization")?"api.organization":"api",e.grant_type="client_credentials",e.client_secret=this.clientSecret,e}static fromJSON(e){return Object.assign(Object.create(r.prototype),e,{device:e.device?n.x.fromJSON(e.device):void 0,twoFactor:e.twoFactor?Object.assign(new s._,e.twoFactor):void 0})}}},91667:(e,t,i)=>{"use strict";i.d(t,{Y:()=>n});class n{}},15800:(e,t,i)=>{"use strict";i.d(t,{U:()=>s});var n=i(91667);class s extends n.Y{}},55793:(e,t,i)=>{"use strict";i.d(t,{b:()=>s});var n=i(58043);class s extends n.c{constructor(e){super(e),this.siteKey=this.getResponseProperty("HCaptcha_SiteKey")}}},88674:(e,t,i)=>{"use strict";i.d(t,{O:()=>u});var n=i(58043),s=i(10296);class o extends n.c{constructor(e){super(e),this.keyConnectorUrl=this.getResponseProperty("KeyConnectorUrl")}}var r=i(70427);class a extends n.c{constructor(e){super(e),this.hasAdminApproval=this.getResponseProperty("HasAdminApproval"),this.hasLoginApprovingDevice=this.getResponseProperty("HasLoginApprovingDevice"),this.hasManageResetPasswordPermission=this.getResponseProperty("HasManageResetPasswordPermission"),e.EncryptedPrivateKey&&(this.encryptedPrivateKey=new r._(this.getResponseProperty("EncryptedPrivateKey"))),e.EncryptedUserKey&&(this.encryptedUserKey=new r._(this.getResponseProperty("EncryptedUserKey")))}}class l extends n.c{constructor(e){super(e),e.EncryptedPrivateKey&&(this.encryptedPrivateKey=new r._(this.getResponseProperty("EncryptedPrivateKey"))),e.EncryptedUserKey&&(this.encryptedUserKey=new r._(this.getResponseProperty("EncryptedUserKey")))}}class c extends n.c{constructor(e){super(e),this.hasMasterPassword=this.getResponseProperty("HasMasterPassword"),e.TrustedDeviceOption&&(this.trustedDeviceOption=new a(this.getResponseProperty("TrustedDeviceOption"))),e.KeyConnectorOption&&(this.keyConnectorOption=new o(this.getResponseProperty("KeyConnectorOption"))),e.WebAuthnPrfOption&&(this.webAuthnPrfOption=new l(this.getResponseProperty("WebAuthnPrfOption")))}}class u extends n.c{constructor(e){super(e),this.accessToken=e.access_token,this.expiresIn=e.expires_in,this.refreshToken=e.refresh_token,this.tokenType=e.token_type,this.resetMasterPassword=this.getResponseProperty("ResetMasterPassword"),this.privateKey=this.getResponseProperty("PrivateKey"),this.key=this.getResponseProperty("Key"),this.twoFactorToken=this.getResponseProperty("TwoFactorToken"),this.kdf=this.getResponseProperty("Kdf"),this.kdfIterations=this.getResponseProperty("KdfIterations"),this.kdfMemory=this.getResponseProperty("KdfMemory"),this.kdfParallelism=this.getResponseProperty("KdfParallelism"),this.forcePasswordReset=this.getResponseProperty("ForcePasswordReset"),this.apiUseKeyConnector=this.getResponseProperty("ApiUseKeyConnector"),this.keyConnectorUrl=this.getResponseProperty("KeyConnectorUrl"),this.masterPasswordPolicy=new s.Q(this.getResponseProperty("MasterPasswordPolicy")),e.UserDecryptionOptions&&(this.userDecryptionOptions=new c(this.getResponseProperty("UserDecryptionOptions")))}}},4502:(e,t,i)=>{"use strict";i.d(t,{b:()=>o});var n=i(58043),s=i(10296);class o extends n.c{constructor(e){super(e),this.captchaToken=this.getResponseProperty("CaptchaBypassToken"),this.twoFactorProviders=this.getResponseProperty("TwoFactorProviders"),this.twoFactorProviders2=this.getResponseProperty("TwoFactorProviders2"),this.masterPasswordPolicy=new s.Q(this.getResponseProperty("MasterPasswordPolicy")),this.ssoEmail2faSessionToken=this.getResponseProperty("SsoEmail2faSessionToken"),this.email=this.getResponseProperty("Email")}}},10296:(e,t,i)=>{"use strict";i.d(t,{Q:()=>s});var n=i(58043);class s extends n.c{constructor(e){super(e),this.minComplexity=this.getResponseProperty("MinComplexity"),this.minLength=this.getResponseProperty("MinLength"),this.requireUpper=this.getResponseProperty("RequireUpper"),this.requireLower=this.getResponseProperty("RequireLower"),this.requireNumbers=this.getResponseProperty("RequireNumbers"),this.requireSpecial=this.getResponseProperty("RequireSpecial"),this.enforceOnLogin=this.getResponseProperty("EnforceOnLogin")}}},70908:(e,t,i)=>{"use strict";i.d(t,{ap:()=>a,pQ:()=>o});var n=i(58043),s=i(27646);class o extends n.c{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled");const t=this.getResponseProperty("Keys");this.keys=null==t?null:t.map((e=>new r(e)))}}class r extends n.c{constructor(e){super(e),this.name=this.getResponseProperty("Name"),this.id=this.getResponseProperty("Id"),this.migrated=this.getResponseProperty("Migrated")}}class a extends n.c{constructor(e){super(e),this.attestation=this.getResponseProperty("attestation"),this.authenticatorSelection=this.getResponseProperty("authenticatorSelection"),this.challenge=s.c.fromUrlB64ToArray(this.getResponseProperty("challenge")),this.excludeCredentials=this.getResponseProperty("excludeCredentials").map((e=>(e.id=s.c.fromUrlB64ToArray(e.id).buffer,e))),this.extensions=this.getResponseProperty("extensions"),this.pubKeyCredParams=this.getResponseProperty("pubKeyCredParams"),this.rp=this.getResponseProperty("rp"),this.timeout=this.getResponseProperty("timeout");const t=this.getResponseProperty("user");t.id=s.c.fromUrlB64ToArray(t.id),this.user=t}}},49831:(e,t,i)=>{"use strict";i.d(t,{s:()=>n});class n{constructor(e,t){this.options=e,this.token=t}}},66990:(e,t,i)=>{"use strict";i.d(t,{Sz:()=>p,Vz:()=>c});var n=i(92786),s=i(99042),o=i(27646),r=i(36957),a=i(48103),l=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const c={[a.L.Authenticator]:{type:a.L.Authenticator,name:null,description:null,priority:1,sort:1,premium:!1},[a.L.Yubikey]:{type:a.L.Yubikey,name:null,description:null,priority:3,sort:2,premium:!0},[a.L.Duo]:{type:a.L.Duo,name:"Duo",description:null,priority:2,sort:3,premium:!0},[a.L.OrganizationDuo]:{type:a.L.OrganizationDuo,name:"Duo (Organization)",description:null,priority:10,sort:4,premium:!1},[a.L.Email]:{type:a.L.Email,name:null,description:null,priority:0,sort:6,premium:!1},[a.L.WebAuthn]:{type:a.L.WebAuthn,name:null,description:null,priority:4,sort:5,premium:!1}},u=r.vh.record(r.K4,"providers",{deserializer:e=>e}),d=new r.vh(r.K4,"selected",{deserializer:e=>e});class p{constructor(e,t,i){this.i18nService=e,this.platformUtilsService=t,this.globalStateProvider=i,this.providersState=this.globalStateProvider.get(u),this.selectedState=this.globalStateProvider.get(d),this.providers$=this.providersState.state$.pipe((0,n.U)((e=>o.c.recordToMap(e)))),this.selected$=this.selectedState.state$}init(){c[a.L.Email].name=this.i18nService.t("emailTitle"),c[a.L.Email].description=this.i18nService.t("emailDesc"),c[a.L.Authenticator].name=this.i18nService.t("authenticatorAppTitle"),c[a.L.Authenticator].description=this.i18nService.t("authenticatorAppDesc"),c[a.L.Duo].description=this.i18nService.t("duoDesc"),c[a.L.OrganizationDuo].name="Duo ("+this.i18nService.t("organization")+")",c[a.L.OrganizationDuo].description=this.i18nService.t("duoOrganizationDesc"),c[a.L.WebAuthn].name=this.i18nService.t("webAuthnTitle"),c[a.L.WebAuthn].description=this.i18nService.t("webAuthnDesc"),c[a.L.Yubikey].name=this.i18nService.t("yubiKeyTitle"),c[a.L.Yubikey].description=this.i18nService.t("yubiKeyDesc")}getSupportedProviders(e){return l(this,void 0,void 0,(function*(){const t=yield(0,s.z)(this.providers$),i=[];return null==t||(t.has(a.L.OrganizationDuo)&&this.platformUtilsService.supportsDuo()&&i.push(c[a.L.OrganizationDuo]),t.has(a.L.Authenticator)&&i.push(c[a.L.Authenticator]),t.has(a.L.Yubikey)&&i.push(c[a.L.Yubikey]),t.has(a.L.Duo)&&this.platformUtilsService.supportsDuo()&&i.push(c[a.L.Duo]),t.has(a.L.WebAuthn)&&this.platformUtilsService.supportsWebAuthn(e)&&i.push(c[a.L.WebAuthn]),t.has(a.L.Email)&&i.push(c[a.L.Email])),i}))}getDefaultProvider(e){return l(this,void 0,void 0,(function*(){const t=yield(0,s.z)(this.providers$),i=yield(0,s.z)(this.selected$);if(null==t)return null;if(null!=i&&t.has(i))return i;let n=null,o=-1;return t.forEach(((t,i)=>{const s=c[i];if(null!=s&&s.priority>o){if(i===a.L.WebAuthn&&!e)return;n=i,o=s.priority}})),n}))}setSelectedProvider(e){return l(this,void 0,void 0,(function*(){yield this.selectedState.update((()=>e))}))}clearSelectedProvider(){return l(this,void 0,void 0,(function*(){yield this.selectedState.update((()=>null))}))}setProviders(e){return l(this,void 0,void 0,(function*(){yield this.providersState.update((()=>e.twoFactorProviders2))}))}clearProviders(){return l(this,void 0,void 0,(function*(){yield this.providersState.update((()=>null))}))}getProviders(){return(0,s.z)(this.providers$)}}},10064:(e,t,i)=>{"use strict";i.d(t,{J:()=>o});var n=i(27646);class s{constructor(e){this.id=e.id,this.rawId=n.c.fromBufferToUrlB64(e.rawId),this.type=e.type,this.extensions={}}}class o extends s{constructor(e){if(super(e),!(e.response instanceof AuthenticatorAssertionResponse))throw new Error("Invalid authenticator response");this.response={authenticatorData:n.c.fromBufferToUrlB64(e.response.authenticatorData),signature:n.c.fromBufferToUrlB64(e.response.signature),clientDataJSON:n.c.fromBufferToUrlB64(e.response.clientDataJSON),userHandle:n.c.fromBufferToUrlB64(e.response.userHandle)}}static fromJSON(e){return Object.assign(Object.create(o.prototype),e)}}},16284:(e,t,i)=>{"use strict";i.d(t,{D:()=>r});var n=i(58043),s=i(27646);class o extends n.c{constructor(e){var t;super(e),this.allowCredentials=null===(t=this.getResponseProperty("allowCredentials"))||void 0===t?void 0:t.map((e=>Object.assign(Object.assign({},e),{id:s.c.fromUrlB64ToArray(e.id).buffer}))),this.challenge=s.c.fromUrlB64ToArray(this.getResponseProperty("challenge")),this.extensions=this.getResponseProperty("extensions"),this.rpId=this.getResponseProperty("rpId"),this.timeout=this.getResponseProperty("timeout"),this.userVerification=this.getResponseProperty("userVerification")}}class r extends n.c{constructor(e){super(e),this.options=new o(this.getResponseProperty("options")),this.token=this.getResponseProperty("token")}}},30933:(e,t,i)=>{"use strict";i.d(t,{B:()=>h,z:()=>p});var n=i(92786),s=i(66469),o=i(27646),r=i(36957),a=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const l=new r.vh(r.An,"showFavicons",{deserializer:e=>null==e||e}),c=new r.vh(r.An,"neverDomains",{deserializer:e=>null!=e?e:null}),u=new r.fX(r.An,"equivalentDomains",{deserializer:e=>null!=e?e:null,clearOn:["logout"]}),d=new r.fX(r.An,"defaultUriMatchStrategy",{deserializer:e=>null!=e?e:s.s.Domain,clearOn:[]});class p{}class h{constructor(e){this.stateProvider=e,this.showFaviconsState=this.stateProvider.getGlobal(l),this.showFavicons$=this.showFaviconsState.state$.pipe((0,n.U)((e=>null==e||e))),this.neverDomainsState=this.stateProvider.getGlobal(c),this.neverDomains$=this.neverDomainsState.state$.pipe((0,n.U)((e=>null!=e?e:null))),this.equivalentDomainsState=this.stateProvider.getActive(u),this.equivalentDomains$=this.equivalentDomainsState.state$.pipe((0,n.U)((e=>null!=e?e:null))),this.defaultUriMatchStrategyState=this.stateProvider.getActive(d),this.defaultUriMatchStrategy$=this.defaultUriMatchStrategyState.state$.pipe((0,n.U)((e=>null!=e?e:s.s.Domain)))}setShowFavicons(e){return a(this,void 0,void 0,(function*(){yield this.showFaviconsState.update((()=>e))}))}setNeverDomains(e){return a(this,void 0,void 0,(function*(){yield this.neverDomainsState.update((()=>e))}))}setEquivalentDomains(e){return a(this,void 0,void 0,(function*(){yield this.equivalentDomainsState.update((()=>e))}))}setDefaultUriMatchStrategy(e){return a(this,void 0,void 0,(function*(){yield this.defaultUriMatchStrategyState.update((()=>e))}))}getUrlEquivalentDomains(e){return this.equivalentDomains$.pipe((0,n.U)((t=>{const i=o.c.getDomain(e);if(null==i||null==t)return new Set;const n=t.filter((e=>e.includes(i))).flat();return new Set(n)})))}}},384:(e,t,i)=>{"use strict";i.d(t,{M:()=>n});class n{}},6677:(e,t,i)=>{"use strict";i.d(t,{l:()=>n});class n{}},83376:(e,t,i)=>{"use strict";i.d(t,{c:()=>n});class n{}},28004:(e,t,i)=>{"use strict";i.d(t,{I:()=>n});class n{}},69485:(e,t,i)=>{"use strict";var n,s,o,r,a;i.d(t,{Lt:()=>n,qz:()=>s,k9:()=>o}),function(e){e[e.Card=0]="Card",e[e.BankAccount=1]="BankAccount",e[e.PayPal=2]="PayPal",e[e.BitPay=3]="BitPay",e[e.Credit=4]="Credit",e[e.WireTransfer=5]="WireTransfer",e[e.Check=8]="Check"}(n||(n={})),function(e){e[e.FamiliesForEnterprise=0]="FamiliesForEnterprise"}(s||(s={})),function(e){e[e.Free=0]="Free",e[e.FamiliesAnnually2019=1]="FamiliesAnnually2019",e[e.TeamsMonthly2019=2]="TeamsMonthly2019",e[e.TeamsAnnually2019=3]="TeamsAnnually2019",e[e.EnterpriseMonthly2019=4]="EnterpriseMonthly2019",e[e.EnterpriseAnnually2019=5]="EnterpriseAnnually2019",e[e.Custom=6]="Custom",e[e.FamiliesAnnually=7]="FamiliesAnnually",e[e.TeamsMonthly2020=8]="TeamsMonthly2020",e[e.TeamsAnnually2020=9]="TeamsAnnually2020",e[e.EnterpriseMonthly2020=10]="EnterpriseMonthly2020",e[e.EnterpriseAnnually2020=11]="EnterpriseAnnually2020",e[e.TeamsMonthly2023=12]="TeamsMonthly2023",e[e.TeamsAnnually2023=13]="TeamsAnnually2023",e[e.EnterpriseMonthly2023=14]="EnterpriseMonthly2023",e[e.EnterpriseAnnually2023=15]="EnterpriseAnnually2023",e[e.TeamsStarter2023=16]="TeamsStarter2023",e[e.TeamsMonthly=17]="TeamsMonthly",e[e.TeamsAnnually=18]="TeamsAnnually",e[e.EnterpriseMonthly=19]="EnterpriseMonthly",e[e.EnterpriseAnnually=20]="EnterpriseAnnually",e[e.TeamsStarter=21]="TeamsStarter"}(o||(o={})),function(e){e[e.Charge=0]="Charge",e[e.Credit=1]="Credit",e[e.PromotionalCredit=2]="PromotionalCredit",e[e.ReferralCredit=3]="ReferralCredit",e[e.Refund=4]="Refund"}(r||(r={})),function(e){e[e.PasswordManager=0]="PasswordManager",e[e.SecretsManager=1]="SecretsManager"}(a||(a={}))},16173:(e,t,i)=>{"use strict";i.d(t,{i:()=>s});var n=i(9571);class s extends n.a{}},95608:(e,t,i)=>{"use strict";i.d(t,{t:()=>s});var n=i(16173);class s extends n.i{}},9571:(e,t,i)=>{"use strict";i.d(t,{a:()=>n});class n{}},59281:(e,t,i)=>{"use strict";var n;i.d(t,{T:()=>n,h:()=>o}),function(e){e.BrowserFilelessImport="browser-fileless-import",e.ItemShare="item-share",e.FlexibleCollectionsV1="flexible-collections-v-1",e.VaultOnboarding="vault-onboarding",e.GeneratorToolsModernization="generator-tools-modernization",e.KeyRotationImprovements="key-rotation-improvements",e.FlexibleCollectionsMigration="flexible-collections-migration",e.ShowPaymentMethodWarningBanners="show-payment-method-warning-banners",e.EnableConsolidatedBilling="enable-consolidated-billing",e.AC1795_UpdatedSubscriptionStatusSection="AC-1795_updated-subscription-status-section",e.UnassignedItemsBanner="unassigned-items-banner",e.EnableDeleteProvider="AC-1218-delete-provider",e.ExtensionRefresh="extension-refresh"}(n||(n={}));const s=!1,o={[n.BrowserFilelessImport]:s,[n.ItemShare]:s,[n.FlexibleCollectionsV1]:s,[n.VaultOnboarding]:s,[n.GeneratorToolsModernization]:s,[n.KeyRotationImprovements]:s,[n.FlexibleCollectionsMigration]:s,[n.ShowPaymentMethodWarningBanners]:s,[n.EnableConsolidatedBilling]:s,[n.AC1795_UpdatedSubscriptionStatusSection]:s,[n.UnassignedItemsBanner]:s,[n.EnableDeleteProvider]:s,[n.ExtensionRefresh]:s}},256:(e,t,i)=>{"use strict";var n;i.d(t,{W:()=>n}),function(e){e[e.Continue=100]="Continue",e[e.SwitchingProtocols=101]="SwitchingProtocols",e[e.Processing=102]="Processing",e[e.Ok=200]="Ok",e[e.Created=201]="Created",e[e.Accepted=202]="Accepted",e[e.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",e[e.NoContent=204]="NoContent",e[e.ResetContent=205]="ResetContent",e[e.PartialContent=206]="PartialContent",e[e.MultiStatus=207]="MultiStatus",e[e.AlreadyReported=208]="AlreadyReported",e[e.ImUsed=226]="ImUsed",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.Found=302]="Found",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.LengthRequired=411]="LengthRequired",e[e.PreconditionFailed=412]="PreconditionFailed",e[e.PayloadTooLarge=413]="PayloadTooLarge",e[e.UriTooLong=414]="UriTooLong",e[e.UnsupportedMediaType=415]="UnsupportedMediaType",e[e.RangeNotSatisfiable=416]="RangeNotSatisfiable",e[e.ExpectationFailed=417]="ExpectationFailed",e[e.IAmATeapot=418]="IAmATeapot",e[e.MisdirectedRequest=421]="MisdirectedRequest",e[e.UnprocessableEntity=422]="UnprocessableEntity",e[e.Locked=423]="Locked",e[e.FailedDependency=424]="FailedDependency",e[e.UpgradeRequired=426]="UpgradeRequired",e[e.PreconditionRequired=428]="PreconditionRequired",e[e.TooManyRequests=429]="TooManyRequests",e[e.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",e[e.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout",e[e.HttpVersionNotSupported=505]="HttpVersionNotSupported",e[e.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",e[e.InsufficientStorage=507]="InsufficientStorage",e[e.LoopDetected=508]="LoopDetected",e[e.NotExtended=510]="NotExtended",e[e.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired"}(n||(n={}))},51303:(e,t,i)=>{"use strict";var n,s;i.d(t,{Bh:()=>n,Yi:()=>s,gJ:()=>o,tw:()=>r,WE:()=>d.W,k$:()=>c,kv:()=>u}),function(e){e.Web="web",e.Browser="browser",e.Desktop="desktop",e.Cli="cli"}(n||(n={})),function(e){e[e.Android=0]="Android",e[e.iOS=1]="iOS",e[e.ChromeExtension=2]="ChromeExtension",e[e.FirefoxExtension=3]="FirefoxExtension",e[e.OperaExtension=4]="OperaExtension",e[e.EdgeExtension=5]="EdgeExtension",e[e.WindowsDesktop=6]="WindowsDesktop",e[e.MacOsDesktop=7]="MacOsDesktop",e[e.LinuxDesktop=8]="LinuxDesktop",e[e.ChromeBrowser=9]="ChromeBrowser",e[e.FirefoxBrowser=10]="FirefoxBrowser",e[e.OperaBrowser=11]="OperaBrowser",e[e.EdgeBrowser=12]="EdgeBrowser",e[e.IEBrowser=13]="IEBrowser",e[e.UnknownBrowser=14]="UnknownBrowser",e[e.AndroidAmazon=15]="AndroidAmazon",e[e.UWP=16]="UWP",e[e.SafariBrowser=17]="SafariBrowser",e[e.VivaldiBrowser=18]="VivaldiBrowser",e[e.VivaldiExtension=19]="VivaldiExtension",e[e.SafariExtension=20]="SafariExtension",e[e.SDK=21]="SDK",e[e.Server=22]="Server",e[e.WindowsCLI=23]="WindowsCLI",e[e.MacOsCLI=24]="MacOsCLI",e[e.LinuxCLI=25]="LinuxCLI"}(s||(s={}));new Set([s.Android,s.iOS,s.AndroidAmazon]),new Set([s.WindowsDesktop,s.MacOsDesktop,s.LinuxDesktop,s.UWP,s.WindowsCLI,s.MacOsCLI,s.LinuxCLI]);var o,r;!function(e){e[e.SCIM=1]="SCIM",e[e.DomainVerification=2]="DomainVerification"}(o||(o={})),function(e){e[e.User_LoggedIn=1e3]="User_LoggedIn",e[e.User_ChangedPassword=1001]="User_ChangedPassword",e[e.User_Updated2fa=1002]="User_Updated2fa",e[e.User_Disabled2fa=1003]="User_Disabled2fa",e[e.User_Recovered2fa=1004]="User_Recovered2fa",e[e.User_FailedLogIn=1005]="User_FailedLogIn",e[e.User_FailedLogIn2fa=1006]="User_FailedLogIn2fa",e[e.User_ClientExportedVault=1007]="User_ClientExportedVault",e[e.User_UpdatedTempPassword=1008]="User_UpdatedTempPassword",e[e.User_MigratedKeyToKeyConnector=1009]="User_MigratedKeyToKeyConnector",e[e.User_RequestedDeviceApproval=1010]="User_RequestedDeviceApproval",e[e.Cipher_Created=1100]="Cipher_Created",e[e.Cipher_Updated=1101]="Cipher_Updated",e[e.Cipher_Deleted=1102]="Cipher_Deleted",e[e.Cipher_AttachmentCreated=1103]="Cipher_AttachmentCreated",e[e.Cipher_AttachmentDeleted=1104]="Cipher_AttachmentDeleted",e[e.Cipher_Shared=1105]="Cipher_Shared",e[e.Cipher_UpdatedCollections=1106]="Cipher_UpdatedCollections",e[e.Cipher_ClientViewed=1107]="Cipher_ClientViewed",e[e.Cipher_ClientToggledPasswordVisible=1108]="Cipher_ClientToggledPasswordVisible",e[e.Cipher_ClientToggledHiddenFieldVisible=1109]="Cipher_ClientToggledHiddenFieldVisible",e[e.Cipher_ClientToggledCardCodeVisible=1110]="Cipher_ClientToggledCardCodeVisible",e[e.Cipher_ClientCopiedPassword=1111]="Cipher_ClientCopiedPassword",e[e.Cipher_ClientCopiedHiddenField=1112]="Cipher_ClientCopiedHiddenField",e[e.Cipher_ClientCopiedCardCode=1113]="Cipher_ClientCopiedCardCode",e[e.Cipher_ClientAutofilled=1114]="Cipher_ClientAutofilled",e[e.Cipher_SoftDeleted=1115]="Cipher_SoftDeleted",e[e.Cipher_Restored=1116]="Cipher_Restored",e[e.Cipher_ClientToggledCardNumberVisible=1117]="Cipher_ClientToggledCardNumberVisible",e[e.Cipher_ClientToggledTOTPSeedVisible=1118]="Cipher_ClientToggledTOTPSeedVisible",e[e.Collection_Created=1300]="Collection_Created",e[e.Collection_Updated=1301]="Collection_Updated",e[e.Collection_Deleted=1302]="Collection_Deleted",e[e.Group_Created=1400]="Group_Created",e[e.Group_Updated=1401]="Group_Updated",e[e.Group_Deleted=1402]="Group_Deleted",e[e.OrganizationUser_Invited=1500]="OrganizationUser_Invited",e[e.OrganizationUser_Confirmed=1501]="OrganizationUser_Confirmed",e[e.OrganizationUser_Updated=1502]="OrganizationUser_Updated",e[e.OrganizationUser_Removed=1503]="OrganizationUser_Removed",e[e.OrganizationUser_UpdatedGroups=1504]="OrganizationUser_UpdatedGroups",e[e.OrganizationUser_UnlinkedSso=1505]="OrganizationUser_UnlinkedSso",e[e.OrganizationUser_ResetPassword_Enroll=1506]="OrganizationUser_ResetPassword_Enroll",e[e.OrganizationUser_ResetPassword_Withdraw=1507]="OrganizationUser_ResetPassword_Withdraw",e[e.OrganizationUser_AdminResetPassword=1508]="OrganizationUser_AdminResetPassword",e[e.OrganizationUser_ResetSsoLink=1509]="OrganizationUser_ResetSsoLink",e[e.OrganizationUser_FirstSsoLogin=1510]="OrganizationUser_FirstSsoLogin",e[e.OrganizationUser_Revoked=1511]="OrganizationUser_Revoked",e[e.OrganizationUser_Restored=1512]="OrganizationUser_Restored",e[e.OrganizationUser_ApprovedAuthRequest=1513]="OrganizationUser_ApprovedAuthRequest",e[e.OrganizationUser_RejectedAuthRequest=1514]="OrganizationUser_RejectedAuthRequest",e[e.Organization_Updated=1600]="Organization_Updated",e[e.Organization_PurgedVault=1601]="Organization_PurgedVault",e[e.Organization_ClientExportedVault=1602]="Organization_ClientExportedVault",e[e.Organization_VaultAccessed=1603]="Organization_VaultAccessed",e[e.Organization_EnabledSso=1604]="Organization_EnabledSso",e[e.Organization_DisabledSso=1605]="Organization_DisabledSso",e[e.Organization_EnabledKeyConnector=1606]="Organization_EnabledKeyConnector",e[e.Organization_DisabledKeyConnector=1607]="Organization_DisabledKeyConnector",e[e.Organization_SponsorshipsSynced=1608]="Organization_SponsorshipsSynced",e[e.Organization_CollectionManagementUpdated=1609]="Organization_CollectionManagementUpdated",e[e.Policy_Updated=1700]="Policy_Updated",e[e.ProviderUser_Invited=1800]="ProviderUser_Invited",e[e.ProviderUser_Confirmed=1801]="ProviderUser_Confirmed",e[e.ProviderUser_Updated=1802]="ProviderUser_Updated",e[e.ProviderUser_Removed=1803]="ProviderUser_Removed",e[e.ProviderOrganization_Created=1900]="ProviderOrganization_Created",e[e.ProviderOrganization_Added=1901]="ProviderOrganization_Added",e[e.ProviderOrganization_Removed=1902]="ProviderOrganization_Removed",e[e.ProviderOrganization_VaultAccessed=1903]="ProviderOrganization_VaultAccessed",e[e.OrganizationDomain_Added=2e3]="OrganizationDomain_Added",e[e.OrganizationDomain_Removed=2001]="OrganizationDomain_Removed",e[e.OrganizationDomain_Verified=2002]="OrganizationDomain_Verified",e[e.OrganizationDomain_NotVerified=2003]="OrganizationDomain_NotVerified",e[e.Secret_Retrieved=2100]="Secret_Retrieved"}(r||(r={}));var a,l,c,u,d=i(256);!function(e){e.Integration="integration",e.SDK="sdk"}(a||(a={})),function(e){e[e.One=1]="One",e[e.Latest=1]="Latest"}(l||(l={})),function(e){e[e.SyncCipherUpdate=0]="SyncCipherUpdate",e[e.SyncCipherCreate=1]="SyncCipherCreate",e[e.SyncLoginDelete=2]="SyncLoginDelete",e[e.SyncFolderDelete=3]="SyncFolderDelete",e[e.SyncCiphers=4]="SyncCiphers",e[e.SyncVault=5]="SyncVault",e[e.SyncOrgKeys=6]="SyncOrgKeys",e[e.SyncFolderCreate=7]="SyncFolderCreate",e[e.SyncFolderUpdate=8]="SyncFolderUpdate",e[e.SyncCipherDelete=9]="SyncCipherDelete",e[e.SyncSettings=10]="SyncSettings",e[e.LogOut=11]="LogOut",e[e.SyncSendCreate=12]="SyncSendCreate",e[e.SyncSendUpdate=13]="SyncSendUpdate",e[e.SyncSendDelete=14]="SyncSendDelete",e[e.AuthRequest=15]="AuthRequest",e[e.AuthRequestResponse=16]="AuthRequestResponse",e[e.SyncOrganizations=17]="SyncOrganizations"}(c||(c={})),function(e){e[e.Free=0]="Free",e[e.Families=1]="Families",e[e.Teams=2]="Teams",e[e.Enterprise=3]="Enterprise",e[e.TeamsStarter=4]="TeamsStarter"}(u||(u={}))},27059:(e,t,i)=>{"use strict";var n;i.d(t,{B:()=>n}),function(e){e.Lock="lock",e.LogOut="logOut"}(n||(n={}))},66469:(e,t,i)=>{"use strict";i.d(t,{s:()=>n});const n={Domain:0,Host:1,StartsWith:2,Exact:3,RegularExpression:4,Never:5}},61875:(e,t,i)=>{"use strict";i.d(t,{Rm:()=>N,lC:()=>F,L5:()=>Y});var n=i(70427),s=i(15727),o=i(57387);function r(e){return null==e?null:"string"==typeof e?e:null==e?void 0:e.encryptedString}class a{static template(){const e=new a;return e.cardholderName="John Doe",e.brand="visa",e.number="4242424242424242",e.expMonth="04",e.expYear="2023",e.code="123",e}static toView(e,t=new o._){return t.cardholderName=e.cardholderName,t.brand=e.brand,t.number=e.number,t.expMonth=e.expMonth,t.expYear=e.expYear,t.code=e.code,t}static toDomain(e,t=new s.Z){return t.cardholderName=null!=e.cardholderName?new n._(e.cardholderName):null,t.brand=null!=e.brand?new n._(e.brand):null,t.number=null!=e.number?new n._(e.number):null,t.expMonth=null!=e.expMonth?new n._(e.expMonth):null,t.expYear=null!=e.expYear?new n._(e.expYear):null,t.code=null!=e.code?new n._(e.code):null,t}constructor(e){null!=e&&(this.cardholderName=r(e.cardholderName),this.brand=r(e.brand),this.number=r(e.number),this.expMonth=r(e.expMonth),this.expYear=r(e.expYear),this.code=r(e.code))}}var l=i(72285),c=i(31182),u=i(19572),d=i(53061),p=i(89474),h=i(52870),g=i(11612);class f{static template(){const e=new f;return e.name="Field name",e.value="Some value",e.type=p.fS.Text,e}static toView(e,t=new g.k){return t.type=e.type,t.value=e.value,t.name=e.name,t.linkedId=e.linkedId,t}static toDomain(e,t=new h.g){return t.type=e.type,t.value=null!=e.value?new n._(e.value):null,t.name=null!=e.name?new n._(e.name):null,t.linkedId=e.linkedId,t}constructor(e){null!=e&&(this.name=r(e.name),this.value=r(e.value),this.type=e.type,this.linkedId=e.linkedId)}}var m=i(34754),v=i(15091);class y{static template(){const e=new y;return e.title="Mr",e.firstName="John",e.middleName="William",e.lastName="Doe",e.address1="123 Any St",e.address2="Apt #123",e.address3=null,e.city="New York",e.state="NY",e.postalCode="10001",e.country="US",e.company="Acme Inc.",e.email="john@company.com",e.phone="5555551234",e.ssn="000-123-4567",e.username="jdoe",e.passportNumber="US-123456789",e.licenseNumber="D123-12-123-12333",e}static toView(e,t=new v.t){return t.title=e.title,t.firstName=e.firstName,t.middleName=e.middleName,t.lastName=e.lastName,t.address1=e.address1,t.address2=e.address2,t.address3=e.address3,t.city=e.city,t.state=e.state,t.postalCode=e.postalCode,t.country=e.country,t.company=e.company,t.email=e.email,t.phone=e.phone,t.ssn=e.ssn,t.username=e.username,t.passportNumber=e.passportNumber,t.licenseNumber=e.licenseNumber,t}static toDomain(e,t=new m.i){return t.title=null!=e.title?new n._(e.title):null,t.firstName=null!=e.firstName?new n._(e.firstName):null,t.middleName=null!=e.middleName?new n._(e.middleName):null,t.lastName=null!=e.lastName?new n._(e.lastName):null,t.address1=null!=e.address1?new n._(e.address1):null,t.address2=null!=e.address2?new n._(e.address2):null,t.address3=null!=e.address3?new n._(e.address3):null,t.city=null!=e.city?new n._(e.city):null,t.state=null!=e.state?new n._(e.state):null,t.postalCode=null!=e.postalCode?new n._(e.postalCode):null,t.country=null!=e.country?new n._(e.country):null,t.company=null!=e.company?new n._(e.company):null,t.email=null!=e.email?new n._(e.email):null,t.phone=null!=e.phone?new n._(e.phone):null,t.ssn=null!=e.ssn?new n._(e.ssn):null,t.username=null!=e.username?new n._(e.username):null,t.passportNumber=null!=e.passportNumber?new n._(e.passportNumber):null,t.licenseNumber=null!=e.licenseNumber?new n._(e.licenseNumber):null,t}constructor(e){null!=e&&(this.title=r(e.title),this.firstName=r(e.firstName),this.middleName=r(e.middleName),this.lastName=r(e.lastName),this.address1=r(e.address1),this.address2=r(e.address2),this.address3=r(e.address3),this.city=r(e.city),this.state=r(e.state),this.postalCode=r(e.postalCode),this.country=r(e.country),this.company=r(e.company),this.email=r(e.email),this.phone=r(e.phone),this.ssn=r(e.ssn),this.username=r(e.username),this.passportNumber=r(e.passportNumber),this.licenseNumber=r(e.licenseNumber))}}var w=i(82702),b=i(60712),U=i(6137),_=i(90189);class A{static template(){const e=new A;return e.credentialId="keyId",e.keyType="keyType",e.keyAlgorithm="keyAlgorithm",e.keyCurve="keyCurve",e.keyValue="keyValue",e.rpId="rpId",e.userHandle="userHandle",e.userName="userName",e.counter="counter",e.rpName="rpName",e.userDisplayName="userDisplayName",e.discoverable="false",e.creationDate=null,e}static toView(e,t=new _.X){return t.credentialId=e.credentialId,t.keyType=e.keyType,t.keyAlgorithm=e.keyAlgorithm,t.keyCurve=e.keyCurve,t.keyValue=e.keyValue,t.rpId=e.rpId,t.userHandle=e.userHandle,t.userName=e.userName,t.counter=parseInt(e.counter),t.rpName=e.rpName,t.userDisplayName=e.userDisplayName,t.discoverable="true"===e.discoverable,t.creationDate=new Date(e.creationDate),t}static toDomain(e,t=new U.m){return t.credentialId=null!=e.credentialId?new n._(e.credentialId):null,t.keyType=null!=e.keyType?new n._(e.keyType):null,t.keyAlgorithm=null!=e.keyAlgorithm?new n._(e.keyAlgorithm):null,t.keyCurve=null!=e.keyCurve?new n._(e.keyCurve):null,t.keyValue=null!=e.keyValue?new n._(e.keyValue):null,t.rpId=null!=e.rpId?new n._(e.rpId):null,t.userHandle=null!=e.userHandle?new n._(e.userHandle):null,t.userName=null!=e.userName?new n._(e.userName):null,t.counter=null!=e.counter?new n._(e.counter):null,t.rpName=null!=e.rpName?new n._(e.rpName):null,t.userDisplayName=null!=e.userDisplayName?new n._(e.userDisplayName):null,t.discoverable=null!=e.discoverable?new n._(e.discoverable):null,t.creationDate=e.creationDate,t}constructor(e){null!=e&&(this.credentialId=r(e.credentialId),this.keyType=r(e.keyType),this.keyAlgorithm=r(e.keyAlgorithm),this.keyCurve=r(e.keyCurve),this.keyValue=r(e.keyValue),this.rpId=r(e.rpId),this.userHandle=r(e.userHandle),this.userName=r(e.userName),this.counter=r(String(e.counter)),this.rpName=r(e.rpName),this.userDisplayName=r(e.userDisplayName),this.discoverable=r(String(e.discoverable)),this.creationDate=e.creationDate)}}var Z=i(20364),x=i(95896);class S{static template(){const e=new S;return e.uri="https://google.com",e.match=null,e}static toView(e,t=new x.E){return t.uri=e.uri,t.match=e.match,t}static toDomain(e,t=new Z.c){return t.uri=null!=e.uri?new n._(e.uri):null,t.uriChecksum=null!=e.uriChecksum?new n._(e.uriChecksum):null,t.match=e.match,t}constructor(e){var t;this.match=null,null!=e&&(this.uri=r(e.uri),"uriChecksum"in e&&(this.uriChecksum=null===(t=e.uriChecksum)||void 0===t?void 0:t.encryptedString),this.match=e.match)}}class T{static template(){const e=new T;return e.uris=[],e.username="jdoe",e.password="myp@ssword123",e.totp="JBSWY3DPEHPK3PXP",e.fido2Credentials=[A.template()],e}static toView(e,t=new b.q){return null!=e.uris&&(t.uris=e.uris.map((e=>S.toView(e)))),t.username=e.username,t.password=e.password,t.totp=e.totp,null!=e.fido2Credentials&&(t.fido2Credentials=e.fido2Credentials.map((e=>A.toView(e)))),t}static toDomain(e,t=new w.m){return null!=e.uris&&(t.uris=e.uris.map((e=>S.toDomain(e)))),t.username=null!=e.username?new n._(e.username):null,t.password=null!=e.password?new n._(e.password):null,t.totp=null!=e.totp?new n._(e.totp):null,t}constructor(e){this.fido2Credentials=[],null!=e&&(null!=e.uris&&(this.uris=e.uris.map((e=>new S(e)))),null!=e.fido2Credentials&&(this.fido2Credentials=e.fido2Credentials.map((e=>new A(e)))),this.username=r(e.username),this.password=r(e.password),this.totp=r(e.totp))}}var C=i(19051),O=i(42937);class k{static template(){const e=new k;return e.password=null,e.lastUsedDate=null,e}static toView(e,t=new O.i){return t.password=e.password,t.lastUsedDate=e.lastUsedDate,t}static toDomain(e,t=new C.r){return t.password=null!=e.password?new n._(e.password):null,t.lastUsedDate=e.lastUsedDate,t}constructor(e){this.lastUsedDate=null,null!=e&&(this.password=r(e.password),this.lastUsedDate=e.lastUsedDate)}}var P=i(99896),q=i(54976);class I{static template(){const e=new I;return e.type=p.xs.Generic,e}static toView(e,t=new q.z){return t.type=e.type,t}static toDomain(e,t=new P.k){return t.type=e.type,t}constructor(e){null!=e&&(this.type=e.type)}}class M{constructor(){this.passwordHistory=null,this.revisionDate=null,this.creationDate=null,this.deletedDate=null}static template(){const e=new M;return e.organizationId=null,e.collectionIds=null,e.folderId=null,e.type=c.O.Login,e.name="Item name",e.notes="Some notes about this item.",e.favorite=!1,e.fields=[],e.login=null,e.secureNote=null,e.card=null,e.identity=null,e.reprompt=l.N.None,e.passwordHistory=[],e.creationDate=null,e.revisionDate=null,e.deletedDate=null,e}static toView(e,t=new d.$){var i,n,s;if(t.type=e.type,t.folderId=e.folderId,null==t.organizationId&&(t.organizationId=e.organizationId),t.collectionIds||e.collectionIds){const s=new Set((null!==(i=t.collectionIds)&&void 0!==i?i:[]).concat(null!==(n=e.collectionIds)&&void 0!==n?n:[]));t.collectionIds=Array.from(s.values())}switch(t.name=e.name,t.notes=e.notes,t.favorite=e.favorite,t.reprompt=null!==(s=e.reprompt)&&void 0!==s?s:l.N.None,null!=e.fields&&(t.fields=e.fields.map((e=>f.toView(e)))),e.type){case c.O.Login:t.login=T.toView(e.login);break;case c.O.SecureNote:t.secureNote=I.toView(e.secureNote);break;case c.O.Card:t.card=a.toView(e.card);break;case c.O.Identity:t.identity=y.toView(e.identity)}return null!=e.passwordHistory&&(t.passwordHistory=e.passwordHistory.map((e=>k.toView(e)))),t.creationDate=e.creationDate,t.revisionDate=e.revisionDate,t.deletedDate=e.deletedDate,t}static toDomain(e,t=new u.t){var i;switch(t.type=e.type,t.folderId=e.folderId,null==t.organizationId&&(t.organizationId=e.organizationId),t.name=null!=e.name?new n._(e.name):null,t.notes=null!=e.notes?new n._(e.notes):null,t.favorite=e.favorite,t.reprompt=null!==(i=e.reprompt)&&void 0!==i?i:l.N.None,t.key=null!=e.key?new n._(e.key):null,null!=e.fields&&(t.fields=e.fields.map((e=>f.toDomain(e)))),e.type){case c.O.Login:t.login=T.toDomain(e.login);break;case c.O.SecureNote:t.secureNote=I.toDomain(e.secureNote);break;case c.O.Card:t.card=a.toDomain(e.card);break;case c.O.Identity:t.identity=y.toDomain(e.identity)}return null!=e.passwordHistory&&(t.passwordHistory=e.passwordHistory.map((e=>k.toDomain(e)))),t.creationDate=e.creationDate,t.revisionDate=e.revisionDate,t.deletedDate=e.deletedDate,t}build(e){var t;switch(this.organizationId=e.organizationId,this.folderId=e.folderId,this.type=e.type,this.reprompt=e.reprompt,this.name=r(e.name),this.notes=r(e.notes),"key"in e&&(this.key=null===(t=e.key)||void 0===t?void 0:t.encryptedString),this.favorite=e.favorite,null!=e.fields&&(this.fields=e.fields.map((e=>new f(e)))),e.type){case c.O.Login:this.login=new T(e.login);break;case c.O.SecureNote:this.secureNote=new I(e.secureNote);break;case c.O.Card:this.card=new a(e.card);break;case c.O.Identity:this.identity=new y(e.identity)}null!=e.passwordHistory&&(this.passwordHistory=e.passwordHistory.map((e=>new k(e)))),this.creationDate=e.creationDate,this.revisionDate=e.revisionDate,this.deletedDate=e.deletedDate}}class N extends M{build(e){this.id=e.id,super.build(e),this.collectionIds=e.collectionIds}}var L=i(54193),D=i(23666);class E{static template(){const e=new E;return e.organizationId="00000000-0000-0000-0000-000000000000",e.name="Collection name",e.externalId=null,e}static toView(e,t=new D.n){return t.name=e.name,t.externalId=e.externalId,null==t.organizationId&&(t.organizationId=e.organizationId),t}static toDomain(e,t=new L.F){return t.name=null!=e.name?new n._(e.name):null,t.externalId=e.externalId,null==t.organizationId&&(t.organizationId=e.organizationId),t}build(e){this.organizationId=e.organizationId,this.name=r(e.name),this.externalId=e.externalId}}class F extends E{static toView(e,t=new D.n){return t.id=e.id,super.toView(e,t)}static toDomain(e,t=new L.F){return t.id=e.id,super.toDomain(e,t)}build(e){this.id=e.id,super.build(e)}}var R=i(10256),J=i(90364);class z{static template(){const e=new z;return e.name="Folder name",e}static toView(e,t=new J.a){return t.name=e.name,t}static toDomain(e,t=new R.g){return t.name=null!=e.name?new n._(e.name):null,t}build(e){this.name=r(e.name)}}class Y extends z{static toView(e,t=new J.a){return t.id=e.id,super.toView(e,t)}static toDomain(e,t=new R.g){return t.id=e.id,super.toDomain(e,t)}build(e){this.id=e.id,super.build(e)}}},98405:(e,t,i)=>{"use strict";i.d(t,{C:()=>n});class n{constructor(e,t){this.publicKey=e,this.encryptedPrivateKey=t}}},58043:(e,t,i)=>{"use strict";i.d(t,{c:()=>n});class n{constructor(e){this.response=e}getResponseProperty(e,t=null,i=!1){if(null==e||""===e)throw new Error("propertyName must not be null/empty.");if(null==t&&null!=this.response&&(t=this.response),null==t)return null;if(!i&&void 0===t[e]){let i=null;i=e.charAt(0)===e.charAt(0).toUpperCase()?e.charAt(0).toLowerCase():e.charAt(0).toUpperCase(),e.length>1&&(i+=e.slice(1)),void 0===t[e=i]&&(e=e.toLowerCase()),void 0===t[e]&&(e=e.toUpperCase())}return t[e]}}},25679:(e,t,i)=>{"use strict";i.d(t,{i:()=>o});var n=i(27646),s=i(58043);class o extends s.c{constructor(e,t,i){var s,o;super(e);let r=null;if(null!=e){const t=this.getResponseProperty("ErrorModel");r=t&&i?t:e}429===t?this.message="Rate limit exceeded. Try again later.":r&&(this.message=this.getResponseProperty("Message",r),this.validationErrors=this.getResponseProperty("ValidationErrors",r),this.captchaSiteKey=null===(o=null===(s=this.validationErrors)||void 0===s?void 0:s.HCaptcha_SiteKey)||void 0===o?void 0:o[0],this.captchaRequired=!n.c.isNullOrWhitespace(this.captchaSiteKey)),this.statusCode=t}getSingleMessage(){if(null==this.validationErrors)return this.message;for(const e in this.validationErrors)if(this.validationErrors.hasOwnProperty(e)&&this.validationErrors[e].length)return this.validationErrors[e][0];return this.message}getAllMessages(){const e=[];if(null==this.validationErrors)return e;for(const t in this.validationErrors)this.validationErrors.hasOwnProperty(t)&&this.validationErrors[t].forEach((i=>{let n="";if(t.indexOf("[")>-1&&t.indexOf("]")>-1){const e=t.lastIndexOf(".");n=t.substr(0,e>-1?e:t.length)+": "}e.push(n+i)}));return e}}},42844:(e,t,i)=>{"use strict";i.d(t,{L:()=>s});var n=i(58043);class s extends n.c{constructor(e,t){super(e);const i=this.getResponseProperty("Data");this.data=null==i?[]:i.map((e=>new t(e))),this.continuationToken=this.getResponseProperty("ContinuationToken")}}},13973:(e,t,i)=>{"use strict";i.d(t,{s:()=>n});class n{}},7323:(e,t,i)=>{"use strict";i.d(t,{A:()=>n});class n{}},65254:(e,t,i)=>{"use strict";i.d(t,{E:()=>n});class n{}},79865:(e,t,i)=>{"use strict";i.d(t,{O:()=>n});class n{}},76528:(e,t,i)=>{"use strict";i.d(t,{$:()=>n});class n{}},85540:(e,t,i)=>{"use strict";i.d(t,{U:()=>n});class n{}},56934:(e,t,i)=>{"use strict";var n;i.d(t,{L:()=>s,y:()=>n}),function(e){e.US="US",e.EU="EU",e.SelfHosted="Self-hosted"}(n||(n={}));class s{}},53481:(e,t,i)=>{"use strict";i.d(t,{_:()=>n});class n{}},78627:(e,t,i)=>{"use strict";i.d(t,{D:()=>s});class n{}class s extends n{}},66459:(e,t,i)=>{"use strict";i.d(t,{$:()=>n});class n{}},34961:(e,t,i)=>{"use strict";i.d(t,{o:()=>n.B});var n=i(70734)},99721:(e,t,i)=>{"use strict";i.d(t,{P:()=>n});class n{}},58172:(e,t,i)=>{"use strict";i.d(t,{b:()=>n});class n{}},14494:(e,t,i)=>{"use strict";i.d(t,{R:()=>n});class n{}},37017:(e,t,i)=>{"use strict";i.d(t,{d:()=>m,f:()=>v});var n=i(92786),s=i(33031),o=i(99042),r=i(70427),a=i(36957);const l=new a.fX(a.pR,"biometricUnlockEnabled",{deserializer:e=>e,clearOn:[]}),c=new a.fX(a.pR,"requirePasswordOnStart",{deserializer:e=>e,clearOn:[]}),u=new a.fX(a.pR,"clientKeyHalf",{deserializer:e=>e,clearOn:["logout"]}),d=new a.fX(a.pR,"dismissedBiometricRequirePasswordOnStartCallout",{deserializer:e=>e,clearOn:[]}),p=a.vh.record(a.pR,"promptCancelled",{deserializer:e=>e}),h=new a.fX(a.pR,"promptAutomatically",{deserializer:e=>e,clearOn:[]}),g=new a.vh(a.pR,"fingerprintValidated",{deserializer:e=>e});var f=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class m{}class v{constructor(e){this.stateProvider=e,this.biometricUnlockEnabledState=this.stateProvider.getActive(l),this.biometricUnlockEnabled$=this.biometricUnlockEnabledState.state$.pipe((0,n.U)(Boolean)),this.requirePasswordOnStartState=this.stateProvider.getActive(c),this.requirePasswordOnStart$=this.requirePasswordOnStartState.state$.pipe((0,n.U)((e=>!!e))),this.encryptedClientKeyHalfState=this.stateProvider.getActive(u),this.encryptedClientKeyHalf$=this.encryptedClientKeyHalfState.state$.pipe((0,n.U)(y)),this.dismissedRequirePasswordOnStartCalloutState=this.stateProvider.getActive(d),this.dismissedRequirePasswordOnStartCallout$=this.dismissedRequirePasswordOnStartCalloutState.state$.pipe((0,n.U)(Boolean)),this.promptCancelledState=this.stateProvider.getGlobal(p),this.promptCancelled$=(0,s.a)([this.stateProvider.activeUserId$,this.promptCancelledState.state$]).pipe((0,n.U)((([e,t])=>{var i;return null!==(i=null==t?void 0:t[e])&&void 0!==i&&i}))),this.promptAutomaticallyState=this.stateProvider.getActive(h),this.promptAutomatically$=this.promptAutomaticallyState.state$.pipe((0,n.U)(Boolean)),this.fingerprintValidatedState=this.stateProvider.getGlobal(g),this.fingerprintValidated$=this.fingerprintValidatedState.state$.pipe((0,n.U)(Boolean))}setBiometricUnlockEnabled(e){return f(this,void 0,void 0,(function*(){yield this.biometricUnlockEnabledState.update((()=>e))}))}getBiometricUnlockEnabled(e){return f(this,void 0,void 0,(function*(){return yield(0,o.z)(this.stateProvider.getUser(e,l).state$.pipe((0,n.U)(Boolean)))}))}setRequirePasswordOnStart(e){return f(this,void 0,void 0,(function*(){let t;yield this.requirePasswordOnStartState.update(((i,[n])=>(t=n,e)),{combineLatestWith:this.requirePasswordOnStartState.combinedState$}),e||(yield this.removeEncryptedClientKeyHalf(t))}))}setEncryptedClientKeyHalf(e,t){var i;return f(this,void 0,void 0,(function*(){const n=null!==(i=null==e?void 0:e.encryptedString)&&void 0!==i?i:null;t?yield this.stateProvider.getUser(t,u).update((()=>n)):yield this.encryptedClientKeyHalfState.update((()=>n))}))}removeEncryptedClientKeyHalf(e){return f(this,void 0,void 0,(function*(){yield this.stateProvider.getUser(e,u).update((()=>null))}))}getRequirePasswordOnStart(e){return f(this,void 0,void 0,(function*(){return!!(yield(0,o.z)(this.stateProvider.getUser(e,c).state$))}))}getEncryptedClientKeyHalf(e){return f(this,void 0,void 0,(function*(){return yield(0,o.z)(this.stateProvider.getUser(e,u).state$.pipe((0,n.U)(y)))}))}logout(e){return f(this,void 0,void 0,(function*(){yield this.stateProvider.getUser(e,u).update((()=>null)),yield this.resetUserPromptCancelled(e)}))}setDismissedRequirePasswordOnStartCallout(){return f(this,void 0,void 0,(function*(){yield this.dismissedRequirePasswordOnStartCalloutState.update((()=>!0))}))}resetUserPromptCancelled(e){return f(this,void 0,void 0,(function*(){yield this.stateProvider.getGlobal(p).update(((t,i)=>(delete t[null!=e?e:i],t)),{combineLatestWith:this.stateProvider.activeUserId$,shouldUpdate:(t,i)=>null!=(null==t?void 0:t[null!=e?e:i])})}))}setUserPromptCancelled(){return f(this,void 0,void 0,(function*(){yield this.promptCancelledState.update(((e,t)=>(null!=e||(e={}),e[t]=!0,e)),{combineLatestWith:this.stateProvider.activeUserId$,shouldUpdate:(e,t)=>{if(null==t)throw new Error("Cannot update biometric prompt cancelled state without an active user");return!0}})}))}resetAllPromptCancelled(){return f(this,void 0,void 0,(function*(){yield this.promptCancelledState.update((()=>null))}))}setPromptAutomatically(e){return f(this,void 0,void 0,(function*(){yield this.promptAutomaticallyState.update((()=>e))}))}setFingerprintValidated(e){return f(this,void 0,void 0,(function*(){yield this.fingerprintValidatedState.update((()=>e))}))}}function y(e){return null==e?null:new r._(e)}},32715:(e,t,i)=>{"use strict";var n;i.d(t,{F:()=>n,T:()=>s}),function(e){e[e.AesCbc256_B64=0]="AesCbc256_B64",e[e.AesCbc128_HmacSha256_B64=1]="AesCbc128_HmacSha256_B64",e[e.AesCbc256_HmacSha256_B64=2]="AesCbc256_HmacSha256_B64",e[e.Rsa2048_OaepSha256_B64=3]="Rsa2048_OaepSha256_B64",e[e.Rsa2048_OaepSha1_B64=4]="Rsa2048_OaepSha1_B64",e[e.Rsa2048_OaepSha256_HmacSha256_B64=5]="Rsa2048_OaepSha256_HmacSha256_B64",e[e.Rsa2048_OaepSha1_HmacSha256_B64=6]="Rsa2048_OaepSha1_HmacSha256_B64"}(n||(n={}));const s={[n.AesCbc256_B64]:2,[n.AesCbc128_HmacSha256_B64]:3,[n.AesCbc256_HmacSha256_B64]:3,[n.Rsa2048_OaepSha256_B64]:1,[n.Rsa2048_OaepSha1_B64]:1,[n.Rsa2048_OaepSha256_HmacSha256_B64]:2,[n.Rsa2048_OaepSha1_HmacSha256_B64]:2}},88967:(e,t,i)=>{"use strict";var n;i.d(t,{F:()=>n}),function(e){e[e.Direct=0]="Direct",e[e.Azure=1]="Azure"}(n||(n={}))},27447:(e,t,i)=>{"use strict";var n;i.d(t,{R:()=>n}),function(e){e[e.ServerAuthorization=1]="ServerAuthorization",e[e.LocalAuthorization=2]="LocalAuthorization"}(n||(n={}))},83658:(e,t,i)=>{"use strict";var n;i.d(t,{C:()=>n}),function(e){e.Local="local",e.Memory="memory",e.Session="session"}(n||(n={}))},44879:(e,t,i)=>{"use strict";i.d(t,{Ac:()=>c.A,CR:()=>r.C,Fs:()=>n.F,Fz:()=>s.F,G3:()=>a.G3,Oi:()=>a.Oi,RR:()=>o.R,T6:()=>n.T,_l:()=>a._l,al:()=>a.al,f8:()=>u.f,l1:()=>l.l,lh:()=>a.lh,qv:()=>a.qv});var n=i(32715),s=i(88967),o=i(27447),r=i(83658),a=i(21032),l=i(34452),c=(i(8899),i(11508)),u=i(75067)},21032:(e,t,i)=>{"use strict";i.d(t,{G3:()=>n,Oi:()=>a,_l:()=>r,al:()=>u,lh:()=>l,qv:()=>c});var n,s=i(88160),o=i(79914);!function(e){e[e.PBKDF2_SHA256=0]="PBKDF2_SHA256",e[e.Argon2id=1]="Argon2id"}(n||(n={}));const r=new o.n(16,1024,64),a=new o.n(1,16,4),l=new o.n(2,10,3),c=(n.PBKDF2_SHA256,new o.n(6e5,2e6,6e5)),u=new s.S(c.defaultValue)},34452:(e,t,i)=>{"use strict";var n;i.d(t,{l:()=>n}),function(e){e.Auto="auto",e.Biometric="biometric",e.Pin="pin"}(n||(n={}))},8899:(e,t,i)=>{"use strict";var n;i.d(t,{h:()=>n}),function(e){e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(n||(n={}))},11508:(e,t,i)=>{"use strict";var n;i.d(t,{A:()=>n}),function(e){e.Both="both",e.Disk="disk",e.Memory="memory"}(n||(n={}))},75067:(e,t,i)=>{"use strict";var n;i.d(t,{f:()=>n}),function(e){e.System="system",e.Light="light",e.Dark="dark",e.Nord="nord",e.SolarizedDark="solarizedDark"}(n||(n={}))},70734:(e,t,i)=>{"use strict";i.d(t,{B:()=>s});class n{constructor(e){this.innerMessageSenders=e}send(e,t={}){for(const i of this.innerMessageSenders)i.send(e,t)}}class s{static combine(...e){return new n(e)}}s.EMPTY=new n([])},16494:(e,t,i)=>{"use strict";function n(e){return"string"==typeof e?JSON.parse(e):e}function s(e){const t=n({showPasswordless:!0,enableCipherKeyEncryption:!1});return null==t[e]||!!t[e]}function o(e){return!1}i.d(t,{Sp:()=>s,UE:()=>o})},79914:(e,t,i)=>{"use strict";i.d(t,{n:()=>n});class n{constructor(e,t,i){if(this.min=e,this.max=t,this.defaultValue=i,e>t)throw new Error(`${e} is greater than ${t}.`);if(!1===this.inRange(i))throw new Error("Default value is not in range.")}inRange(e){return e>=this.min&&e<=this.max}}},1661:(e,t,i)=>{"use strict";i.d(t,{f:()=>o});var n=i(27646);const s=["https://","http://","ssh://","ftp://","sftp://","irc://","vnc://","rdp://","ms-rd:","chrome://","iosapp://","androidapp://"];class o{static canLaunch(e){if(n.c.isNullOrWhitespace(e))return!1;for(let t=0;t<s.length;t++)if(0===e.indexOf(s[t]))return!0;return!1}}},27646:(e,t,i)=>{"use strict";i.d(t,{c:()=>u});var n=i(14375),s=i(7312),o=i(92716),r=i(30359),a=i(22535),l=i(71624);const c="undefined"==typeof self?i(69573):null;class u{static init(){u.inited||(u.inited=!0,u.isNode=void 0!==l&&null!=l.release&&"node"===l.release.name,u.isBrowser="undefined"!=typeof window,u.isMobileBrowser=u.isBrowser&&this.isMobile(window),u.isAppleMobileBrowser=u.isBrowser&&this.isAppleMobile(window),u.isNode?u.global=i.g:u.isBrowser?u.global=window:u.global=self)}static fromB64ToArray(e){if(null==e)return null;if(u.isNode)return new Uint8Array(Buffer.from(e,"base64"));{const t=u.global.atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i}}static fromUrlB64ToArray(e){return u.fromB64ToArray(u.fromUrlB64ToB64(e))}static fromHexToArray(e){if(u.isNode)return new Uint8Array(Buffer.from(e,"hex"));{const t=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)t[i/2]=parseInt(e.substr(i,2),16);return t}}static fromUtf8ToArray(e){if(u.isNode)return new Uint8Array(Buffer.from(e,"utf8"));{const t=unescape(encodeURIComponent(e)),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i}}static fromByteStringToArray(e){if(null==e)return null;const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}static fromBufferToB64(e){if(null==e)return null;if(u.isNode)return Buffer.from(e).toString("base64");{let t="";const i=new Uint8Array(e);for(let e=0;e<i.byteLength;e++)t+=String.fromCharCode(i[e]);return u.global.btoa(t)}}static fromBufferToUrlB64(e){return u.fromB64toUrlB64(u.fromBufferToB64(e))}static fromB64toUrlB64(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static fromBufferToUtf8(e){return s.lW.from(e).toString("utf8")}static fromBufferToByteString(e){return String.fromCharCode.apply(null,new Uint8Array(e))}static fromBufferToHex(e){if(u.isNode)return Buffer.from(e).toString("hex");{const t=new Uint8Array(e);return Array.prototype.map.call(t,(e=>("00"+e.toString(16)).slice(-2))).join("")}}static hexStringToArrayBuffer(e){if(e.length%2!=0)throw"HexString has to be an even length";const t=new ArrayBuffer(e.length/2),i=new Uint8Array(t);for(let n=0;n<i.length;n++){const t=e.substr(2*n,2),s=parseInt(t,16);i[n]=s}return t}static fromUrlB64ToB64(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Illegal base64url string!")}return t}static fromUrlB64ToUtf8(e){return u.fromB64ToUtf8(u.fromUrlB64ToB64(e))}static fromUtf8ToB64(e){return u.isNode?Buffer.from(e,"utf8").toString("base64"):decodeURIComponent(escape(u.global.btoa(e)))}static fromUtf8ToUrlB64(e){return u.fromBufferToUrlB64(u.fromUtf8ToArray(e))}static fromB64ToUtf8(e){return u.isNode?Buffer.from(e,"base64").toString("utf8"):decodeURIComponent(escape(u.global.atob(e)))}static newGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}static isGuid(e){return RegExp(u.guidRegex,"i").test(e)}static getHostname(e){if(u.isNullOrWhitespace(e))return null;if((e=e.trim()).startsWith("data:"))return null;if(e.startsWith("about:"))return null;if(e.startsWith("file:"))return null;if(e.indexOf("!")>0)return null;try{const t=(0,a.Fo)(e,{validHosts:this.validHosts});if(null!=t)return t}catch(t){return null}return null}static getHost(e){const t=u.getUrl(e);try{return null!=t&&""!==t.host?t.host:null}catch(i){return null}}static getDomain(e){if(u.isNullOrWhitespace(e))return null;if((e=e.trim()).startsWith("data:"))return null;if(e.startsWith("about:"))return null;try{const t=(0,a.Qc)(e,{validHosts:this.validHosts,allowPrivateDomains:!0});if(null!=t&&null!=t.hostname)return"localhost"===t.hostname||t.isIp?t.hostname:null!=t.domain?t.domain:null}catch(t){return null}return null}static getQueryParams(e){const t=u.getUrl(e);if(null==t||null==t.search||""===t.search)return null;const i=new Map;return("?"===t.search[0]?t.search.substr(1):t.search).split("&").forEach((e=>{const t=e.split("=");t.length<1||i.set(decodeURIComponent(t[0]).toLowerCase(),null==t[1]?"":decodeURIComponent(t[1]))})),i}static getSortFunction(e,t){return(i,n)=>null==i[t]&&null!=n[t]?-1:null!=i[t]&&null==n[t]?1:null==i[t]&&null==n[t]?0:e.collator?e.collator.compare(i[t],n[t]):i[t].localeCompare(n[t])}static isNullOrWhitespace(e){return null==e||"string"!=typeof e||""===e.trim()}static isNullOrEmpty(e){return null==e||"string"!=typeof e||""==e}static isPromise(e){return null!=e&&"function"==typeof e.then&&"function"==typeof e.catch}static nameOf(e){return e}static assign(e,t){return Object.assign(e,t)}static iterateEnum(e){return Object.keys(e).filter((e=>Number.isNaN(+e))).map((t=>e[t]))}static getUrl(e){return this.isNullOrWhitespace(e)?null:(e=e.trim(),u.getUrlObject(e))}static camelToPascalCase(e){return e.charAt(0).toUpperCase()+e.slice(1)}static pickTextColorBasedOnBgColor(e,t=186,i=!1){const n="#"===e.charAt(0)?e.substring(1,7):e;return.299*parseInt(n.substring(0,2),16)+.587*parseInt(n.substring(2,4),16)+.114*parseInt(n.substring(4,6),16)>t?i?"black":"black !important":i?"white":"white !important"}static stringToColor(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);let i="#";for(let n=0;n<3;n++){i+=("00"+(t>>8*n&255).toString(16)).substr(-2)}return i}static getContainerService(){if(null==this.global.bitwardenContainerService)throw new Error("global bitwardenContainerService not initialized.");return this.global.bitwardenContainerService}static validateHexColor(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)}static mapToRecord(e){return null==e?null:e instanceof Map?Object.fromEntries(e):e}static recordToMap(e){if(null==e)return null;if(e instanceof Map)return e;const t=Object.entries(e);return 0===t.length?new Map:isNaN(Number(t[0][0]))?new Map(t):new Map(t.map((e=>[Number(e[0]),e[1]])))}static merge(e,t){return Object.assign(e,t)}static encodeRFC3986URIComponent(e){return encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))}static normalizePath(e){return n.normalize(decodeURIComponent(e)).replace(/^(\.\.(\/|\\|$))+/,"")}static isMobile(e){let t=!1;var i;return i=e.navigator.userAgent||e.navigator.vendor||e.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4)))&&(t=!0),t||null!=e.navigator.userAgent.match(/iPad/i)}static delay(e){return new Promise((t=>setTimeout(t,e)))}static asyncToObservable(e){return(0,o.of)(void 0).pipe((0,r.w)((()=>e())))}static daysRemaining(e){const t=e.getTime()-Date.now();return Math.max(0,Math.floor(t/864e5))}static isAppleMobile(e){return null!=e.navigator.userAgent.match(/iPhone/i)||null!=e.navigator.userAgent.match(/iPad/i)}static getUrlObject(e){const t=e.indexOf("://")>-1;if(!t&&e.indexOf(".")>-1)e="http://"+e;else if(!t)return null;try{return null!=c?new c.URL(e):new URL(e)}catch(i){}return null}}u.inited=!1,u.isNode=!1,u.isBrowser=!0,u.isMobileBrowser=!1,u.isAppleMobileBrowser=!1,u.global=null,u.regexpEmojiPresentation=/(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])/g,u.validHosts=["localhost"],u.originalMinimumPasswordLength=8,u.minimumPasswordLength=12,u.DomainMatchBlacklist=new Map([["google.com",new Set(["script.google.com"])]]),u.guidRegex=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,u.init()},90428:(e,t,i)=>{"use strict";i.d(t,{V:()=>n});const n=["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","amigo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","coastline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dish","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","euphemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","giddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungrily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasses","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastrami","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","recycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","tingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unusable","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]},487:(e,t,i)=>{"use strict";i.d(t,{H6:()=>u,dn:()=>c,jK:()=>a,mR:()=>d});var n=i(27646),s=i(70427),o=i(55637);class r{toJSON(){return{encrypted:this.encrypted,decrypted:this.decrypted instanceof ArrayBuffer?n.c.fromBufferToByteString(this.decrypted):this.decrypted}}static fromJSON(e,t,i){if(null==e)return null;const n=new r;return null!=(null==e?void 0:e.encrypted)&&(n.encrypted=i?i(e.encrypted):e.encrypted),null!=(null==e?void 0:e.decrypted)&&(n.decrypted=t?t(e.decrypted):e.decrypted),n}}class a{constructor(){this.passwordGenerationHistory=new r}static fromJSON(e){return null==e?null:Object.assign(new a,e)}}class l{constructor(){this.cryptoSymmetricKey=new r}toJSON(){return n.c.merge(this,{publicKey:this.publicKey?n.c.fromBufferToByteString(this.publicKey):void 0})}static fromJSON(e){return null==e?null:Object.assign(new l,e,{cryptoSymmetricKey:r.fromJSON(null==e?void 0:e.cryptoSymmetricKey,o.N.fromJSON),publicKey:n.c.fromByteStringToArray(null==e?void 0:e.publicKey)})}static initRecordEncryptionPairsFromJSON(e){return r.fromJSON(e,(t=>{if(null==e)return null;const i={};for(const e in t)i[e]=o.N.fromJSON(t[e]);return i}))}}class c{static fromJSON(e){return null==e?null:Object.assign(new c,e)}}class u{constructor(){this.vaultTimeoutAction="lock",this.pinProtected=new r}static fromJSON(e){return null==e?null:Object.assign(new u,e,{pinProtected:r.fromJSON(null==e?void 0:e.pinProtected,s._.fromJSON)})}}class d{constructor(e){this.data=new a,this.keys=new l,this.profile=new c,this.settings=new u,Object.assign(this,{data:Object.assign(Object.assign({},new a),null==e?void 0:e.data),keys:Object.assign(Object.assign({},new l),null==e?void 0:e.keys),profile:Object.assign(Object.assign({},new c),null==e?void 0:e.profile),settings:Object.assign(Object.assign({},new u),null==e?void 0:e.settings)})}static fromJSON(e){return null==e?null:Object.assign(new d({}),e,{keys:l.fromJSON(null==e?void 0:e.keys),data:a.fromJSON(null==e?void 0:e.data),profile:c.fromJSON(null==e?void 0:e.profile),settings:u.fromJSON(null==e?void 0:e.settings)})}}},40160:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var n=i(70427),s=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class o{buildDomainModel(e,t,i,s=[]){for(const o in i){if(!i.hasOwnProperty(o))continue;const r=t[i[o]||o];s.indexOf(o)>-1?e[o]=r||null:e[o]=r?new n._(r):null}}buildDataModel(e,t,i,n=[]){for(const s in i){if(!i.hasOwnProperty(s))continue;const o=e[i[s]||s];n.indexOf(s)>-1?t[s]=null!=o?o:null:t[s]=null!=o?o.encryptedString:null}}decryptObj(e,t,i,n=null){return s(this,void 0,void 0,(function*(){const s=[],o=this;for(const r in t)t.hasOwnProperty(r)&&function(r){const a=Promise.resolve().then((()=>{const e=t[r]||r;return o[e]?o[e].decrypt(i,n):null})).then((t=>{e[r]=t}));s.push(a)}(r);return yield Promise.all(s),e}))}}},65901:(e,t,i)=>{"use strict";i.d(t,{j:()=>r});var n=i(27646),s=i(44879),o=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class r{constructor(e){this.buffer=e,this.encryptionType=null,this.dataBytes=null,this.ivBytes=null,this.macBytes=null;const t=e,i=t[0];switch(i){case s.Fs.AesCbc128_HmacSha256_B64:case s.Fs.AesCbc256_HmacSha256_B64:{const e=50;t.length<e&&this.throwDecryptionError(),this.ivBytes=t.slice(1,17),this.macBytes=t.slice(17,49),this.dataBytes=t.slice(49);break}case s.Fs.AesCbc256_B64:{const e=18;t.length<e&&this.throwDecryptionError(),this.ivBytes=t.slice(1,17),this.dataBytes=t.slice(17);break}default:this.throwDecryptionError()}this.encryptionType=i}throwDecryptionError(){throw new Error("Error parsing encrypted ArrayBuffer: data is corrupted or has an invalid format.")}static fromResponse(e){return o(this,void 0,void 0,(function*(){const t=yield e.arrayBuffer();if(null==t)throw new Error("Cannot create EncArrayBuffer from Response - Response is empty");return new r(new Uint8Array(t))}))}static fromB64(e){const t=n.c.fromB64ToArray(e);return new r(t)}}},70427:(e,t,i)=>{"use strict";i.d(t,{_:()=>r});var n=i(44879),s=i(27646),o=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class r{constructor(e,t,i,n){null!=t?this.initFromData(e,t,i,n):this.initFromEncryptedString(e)}get ivBytes(){return null==this.iv?null:s.c.fromB64ToArray(this.iv)}get macBytes(){return null==this.mac?null:s.c.fromB64ToArray(this.mac)}get dataBytes(){return null==this.data?null:s.c.fromB64ToArray(this.data)}toJSON(){return this.encryptedString}static fromJSON(e){return null==e?null:new r(e)}initFromData(e,t,i,n){this.encryptedString=null!=i?e+"."+i+"|"+t:e+"."+t,null!=n&&(this.encryptedString=this.encryptedString+"|"+n),this.encryptionType=e,this.data=t,this.iv=i,this.mac=n}initFromEncryptedString(e){if(this.encryptedString=e,!this.encryptedString)return;const{encType:t,encPieces:i}=r.parseEncryptedString(this.encryptedString);if(this.encryptionType=t,i.length===n.T6[t])switch(t){case n.Fs.AesCbc128_HmacSha256_B64:case n.Fs.AesCbc256_HmacSha256_B64:this.iv=i[0],this.data=i[1],this.mac=i[2];break;case n.Fs.AesCbc256_B64:this.iv=i[0],this.data=i[1];break;case n.Fs.Rsa2048_OaepSha256_B64:case n.Fs.Rsa2048_OaepSha1_B64:this.data=i[0];break;default:return}}static parseEncryptedString(e){const t=e.split(".");let i,s=null;if(2===t.length)try{i=parseInt(t[0],null),s=t[1].split("|")}catch(o){return}else s=e.split("|"),i=3===s.length?n.Fs.AesCbc128_HmacSha256_B64:n.Fs.AesCbc256_B64;return{encType:i,encPieces:s}}static isSerializedEncString(e){const{encType:t,encPieces:i}=this.parseEncryptedString(e);return n.T6[t]===i.length}decrypt(e,t=null){return o(this,void 0,void 0,(function*(){if(null!=this.decryptedValue)return this.decryptedValue;try{if(null==t&&(t=yield this.getKeyForDecryption(e)),null==t)throw new Error("No key to decrypt EncString with orgId "+e);const i=s.c.getContainerService().getEncryptService();this.decryptedValue=yield i.decryptToUtf8(this,t)}catch(i){this.decryptedValue="[error: cannot decrypt]"}return this.decryptedValue}))}getKeyForDecryption(e){return o(this,void 0,void 0,(function*(){const t=s.c.getContainerService().getCryptoService();return null!=e?yield t.getOrgKey(e):yield t.getUserKeyWithLegacySupport()}))}}},55637:(e,t,i)=>{"use strict";i.d(t,{N:()=>o});var n=i(27646),s=i(44879);class o{constructor(e,t){if(null==e)throw new Error("Must provide key");if(null==t)if(32===e.byteLength)t=s.Fs.AesCbc256_B64;else{if(64!==e.byteLength)throw new Error("Unable to determine encType.");t=s.Fs.AesCbc256_HmacSha256_B64}if(this.key=e,this.encType=t,t===s.Fs.AesCbc256_B64&&32===e.byteLength)this.encKey=e,this.macKey=null;else if(t===s.Fs.AesCbc128_HmacSha256_B64&&32===e.byteLength)this.encKey=e.slice(0,16),this.macKey=e.slice(16,32);else{if(t!==s.Fs.AesCbc256_HmacSha256_B64||64!==e.byteLength)throw new Error("Unsupported encType/key length.");this.encKey=e.slice(0,32),this.macKey=e.slice(32,64)}null!=this.key&&(this.keyB64=n.c.fromBufferToB64(this.key)),null!=this.encKey&&(this.encKeyB64=n.c.fromBufferToB64(this.encKey)),null!=this.macKey&&(this.macKeyB64=n.c.fromBufferToB64(this.macKey))}toJSON(){return{keyB64:this.keyB64}}static fromString(e){if(null==e)return null;const t=n.c.fromB64ToArray(e);return new o(t)}static fromJSON(e){return o.fromString(null==e?void 0:e.keyB64)}}},12481:(e,t,i)=>{"use strict";i.d(t,{d:()=>s});var n=i(8899);class s{constructor(e,t=null){this.isDev=e,this.filter=t,this.timersMap=new Map}debug(e,...t){this.isDev&&this.write(n.h.Debug,e,...t)}info(e,...t){this.write(n.h.Info,e,...t)}warning(e,...t){this.write(n.h.Warning,e,...t)}error(e,...t){this.write(n.h.Error,e,...t)}write(e,t,...i){if(null==this.filter||!this.filter(e))switch(e){case n.h.Debug:case n.h.Info:console.log(t,...i);break;case n.h.Warning:console.warn(t,...i);break;case n.h.Error:console.error(t,...i)}}}},82570:(e,t,i)=>{"use strict";var n;i.d(t,{n:()=>n}),function(e){e[e.Cipher=0]="Cipher",e[e.CipherView=1]="CipherView"}(n||(n={}))},20023:(e,t,i)=>{"use strict";function n(e){return t=>null==t?null:t.map((t=>e(t)))}function s(e){return t=>{if(null==t)return null;const i={};return Object.entries(t).forEach((([t,n])=>{i[t]=e(n)})),i}}i.d(t,{I:()=>n,X:()=>s})},36957:(e,t,i)=>{"use strict";i.d(t,{fK:()=>h.fK,Wi:()=>h.Wi,WV:()=>h.WV,su:()=>h.su,SA:()=>h.SA,jK:()=>h.jK,vA:()=>c,Gz:()=>h.Gz,ag:()=>h.ag,pR:()=>h.pR,KD:()=>h.KD,hY:()=>h.hY,E8:()=>h.E8,SD:()=>h.SD,oc:()=>h.oc,lJ:()=>h.lJ,$8:()=>h.$8,d:()=>h.d,An:()=>h.An,dT:()=>n,DC:()=>o,O0:()=>h.O0,fk:()=>h.fk,ql:()=>h.ql,fo:()=>h.fo,ud:()=>h.ud,tW:()=>h.tW,MC:()=>a,l1:()=>h.l1,YP:()=>h.YP,vh:()=>u.v,IK:()=>h.IK,Jp:()=>h.Jp,C7:()=>h.C7,GB:()=>h.GB,Dk:()=>h.Dk,yL:()=>h.yL,km:()=>h.km,NP:()=>h.DC,Dw:()=>h.Dw,qj:()=>h.qj,Lg:()=>h.Lg,Nz:()=>h.Nz,jC:()=>l,q4:()=>p.q,X9:()=>r,vV:()=>h.vV,wQ:()=>h.wQ,ix:()=>h.ix,jc:()=>h.jc,Vj:()=>h.Vj,K4:()=>h.K4,Qi:()=>h.Qi,UC:()=>h.UC,fX:()=>d.f,NQ:()=>h.NQ,Ub:()=>h.Ub,w6:()=>h.w6,z3:()=>h.z3});class n{constructor(e,t,i){this.stateDefinition=e,this.uniqueDerivationName=t,this.options=i}static from(e,t){return s(e)?new n(e[0].stateDefinition,e[1],t):new n(e.stateDefinition,e.key,t)}static fromWithUserId(e,t){return s(e)?new n(e[0].stateDefinition,e[1],t):new n(e.stateDefinition,e.key,t)}get derive(){return this.options.derive}deserialize(e){return this.options.deserializer(e)}get cleanupDelayMs(){var e;return this.options.cleanupDelayMs<0?0:null!==(e=this.options.cleanupDelayMs)&&void 0!==e?e:1e3}get clearOnCleanup(){var e;return null===(e=this.options.clearOnCleanup)||void 0===e||e}buildCacheKey(){return`derived_${this.stateDefinition.name}_${this.uniqueDerivationName}`}get storageKey(){return`derived_${this.stateDefinition.name}_${this.uniqueDerivationName}`}}function s(e){return Array.isArray(e)}class o{}class r{}class a{}class l{}class c{}var u=i(16722),d=i(96672),p=i(15851),h=i(30832)},16722:(e,t,i)=>{"use strict";i.d(t,{p:()=>o,v:()=>s});var n=i(20023);class s{constructor(e,t,i){if(this.stateDefinition=e,this.key=t,this.options=i,null==i.deserializer)throw new Error(`'deserializer' is a required property on key ${this.errorKeyName}`);if(i.cleanupDelayMs<=0)throw new Error(`'cleanupDelayMs' must be greater than 0. Value of ${i.cleanupDelayMs} passed to key ${this.errorKeyName} `)}get deserializer(){return this.options.deserializer}get cleanupDelayMs(){var e;return this.options.cleanupDelayMs<0?0:null!==(e=this.options.cleanupDelayMs)&&void 0!==e?e:1e3}static array(e,t,i){return new s(e,t,Object.assign(Object.assign({},i),{deserializer:(0,n.I)((e=>i.deserializer(e)))}))}static record(e,t,i){return new s(e,t,Object.assign(Object.assign({},i),{deserializer:(0,n.X)((e=>i.deserializer(e)))}))}get fullName(){return`${this.stateDefinition.name}_${this.key}`}get errorKeyName(){return`${this.stateDefinition.name} > ${this.key}`}}function o(e){return`global_${e.stateDefinition.name}_${e.key}`}},96349:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});class n{constructor(e,t,i){this.name=e,this.defaultStorageLocation=t,this.storageLocationOverrides=null!=i?i:{}}}},30832:(e,t,i)=>{"use strict";i.d(t,{$8:()=>L,An:()=>T,C7:()=>h,DC:()=>r,Dk:()=>s,Dw:()=>m,E8:()=>ee,GB:()=>p,Gz:()=>S,IK:()=>v,Jp:()=>y,K4:()=>g,KD:()=>W,Lg:()=>B,NQ:()=>j,Nz:()=>b,O0:()=>D,Qi:()=>k,SA:()=>O,SD:()=>Q,Tp:()=>I,UC:()=>x,Ub:()=>V,Vj:()=>R,WV:()=>w,Wi:()=>P,YP:()=>u,ag:()=>l,d:()=>Z,fK:()=>d,fk:()=>E,fo:()=>G,hY:()=>X,ix:()=>_,jK:()=>f,jc:()=>A,km:()=>o,l1:()=>c,lJ:()=>N,oc:()=>M,pR:()=>q,qj:()=>K,ql:()=>Y,su:()=>C,tW:()=>z,ud:()=>J,vV:()=>F,w6:()=>H,wQ:()=>U,yL:()=>a,z3:()=>$});var n=i(96349);const s=new n.Z("organizations","disk"),o=new n.Z("policies","disk"),r=new n.Z("providers","disk"),a=new n.Z("organizationManagementPreferences","disk",{web:"disk-local"}),l=new n.Z("billing","disk"),c=new n.Z("kdfConfig","disk"),u=new n.Z("keyConnector","disk"),d=(new n.Z("account","memory"),new n.Z("account","disk")),p=new n.Z("masterPassword","memory"),h=new n.Z("masterPassword","disk"),g=new n.Z("twoFactor","memory"),f=new n.Z("avatar","disk",{web:"disk-local"}),m=new n.Z("router","disk"),v=new n.Z("loginEmail","disk",{web:"disk-local"}),y=new n.Z("loginStrategy","memory"),w=new n.Z("authRequestLocal","disk",{web:"disk-local"}),b=new n.Z("ssoLogin","disk"),U=new n.Z("token","disk"),_=new n.Z("tokenDiskLocal","disk",{web:"disk-local"}),A=new n.Z("token","memory"),Z=new n.Z("deviceTrust","disk",{web:"disk-local"}),x=new n.Z("userDecryptionOptions","disk"),S=new n.Z("badgeSettings","disk"),T=(new n.Z("userNotificationSettings","disk"),new n.Z("domainSettings","disk")),C=new n.Z("autofillSettings","disk"),O=new n.Z("autofillSettingsLocal","disk",{web:"disk-local"}),k=(new n.Z("newWebLayoutBanner","disk",{web:"disk-local"}),new n.Z("unassignedItemsBanner","disk",{web:"disk-local"})),P=new n.Z("applicationId","disk",{web:"disk-local"}),q=new n.Z("biometricSettings","disk"),I=new n.Z("clearEvent","disk"),M=new n.Z("config","disk",{web:"disk-local"}),N=new n.Z("crypto","disk"),L=new n.Z("crypto","memory"),D=(new n.Z("desktopSettings","disk"),new n.Z("environment","disk")),E=new n.Z("environment","memory"),F=new n.Z("theming","disk",{web:"disk-local"}),R=new n.Z("translation","disk"),J=(new n.Z("smOnboarding","disk",{web:"disk-local"}),new n.Z("generator","disk")),z=new n.Z("generator","memory"),Y=(new n.Z("sendBrowser","memory"),new n.Z("eventCollection","disk")),K=new n.Z("encryptedSend","disk",{web:"memory"}),B=new n.Z("decryptedSend","memory",{browser:"memory-large-object"}),Q=new n.Z("collection","disk",{web:"memory"}),G=new n.Z("folder","disk",{web:"memory"}),j=new n.Z("vaultFilter","disk",{web:"disk-local"}),V=new n.Z("vaultOnboarding","disk",{web:"disk-local"}),$=new n.Z("vaultSettings","disk",{web:"disk-local"}),H=(new n.Z("vaultBrowser","memory",{browser:"memory-large-object"}),new n.Z("vaultSearch","memory",{browser:"memory-large-object"})),W=new n.Z("ciphers","disk",{web:"memory"}),X=new n.Z("ciphersLocal","disk",{web:"disk-local"}),ee=new n.Z("ciphersMemory","memory",{browser:"memory-large-object"})},87218:(e,t,i)=>{"use strict";i.d(t,{GA:()=>r,MJ:()=>l,qT:()=>a});var n=i(16722),s=i(30832),o=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const r=n.v.array(s.Tp,"lock",{deserializer:e=>e}),a=n.v.array(s.Tp,"logout",{deserializer:e=>e});class l{constructor(e,t){this.storageServiceProvider=t,this.stateEventStateMap={lock:e.get(r),logout:e.get(a)}}registerEvents(e){return o(this,void 0,void 0,(function*(){for(const t of e.clearOn){const i=this.stateEventStateMap[t],[n]=this.storageServiceProvider.get(e.stateDefinition.defaultStorageLocation,e.stateDefinition.storageLocationOverrides),s={state:e.stateDefinition.name,key:e.key,location:n};yield i.update((e=>(null!=e||(e=[]),e.push(s),e)),{shouldUpdate:e=>null==e||-1===e.findIndex((e=>e.state===s.state&&e.key===s.key&&e.location===s.location))})}}))}}},15851:(e,t,i)=>{"use strict";i.d(t,{q:()=>l});var n=i(99042),s=i(96349),o=i(87218),r=i(96672),a=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class l{constructor(e,t){this.storageServiceProvider=t,this.stateEventMap={lock:e.get(o.GA),logout:e.get(o.qT)}}handleEvent(e,t){return a(this,void 0,void 0,(function*(){let i=yield(0,n.z)(this.stateEventMap[e].state$);null!=i||(i=[]);const s=[];for(const e of i)try{const[,i]=this.storageServiceProvider.get(e.location,{}),n=this.storageKeyFor(t,e);null!=(yield i.get(n))&&(yield i.remove(n))}catch(o){let t="Unknown Error";"object"==typeof o&&"message"in o&&"string"==typeof o.message&&(t=o.message),s.push(`${t} in ${e.state} > ${e.key} located ${e.location}`)}if(s.length>0)throw new Error(`One or more errors occurred while handling event '${e}' for user ${t}.\n${s.join("\n")}`)}))}storageKeyFor(e,t){return new r.f(new s.Z(t.state,t.location),t.key,{deserializer:e=>e,clearOn:[]}).buildKey(e)}}},96672:(e,t,i)=>{"use strict";i.d(t,{f:()=>l,u:()=>a});var n,s=i(27646),o=i(20023);const r=Symbol("UserKeyDefinition");function a(e){return r in e&&!0===e[r]}class l{constructor(e,t,i){if(this.stateDefinition=e,this.key=t,this.options=i,this[n]=!0,null==i.deserializer)throw new Error(`'deserializer' is a required property on key ${this.errorKeyName}`);if(i.cleanupDelayMs<=0)throw new Error(`'cleanupDelayMs' must be greater than 0. Value of ${i.cleanupDelayMs} passed to key ${this.errorKeyName} `);this.clearOn=Array.from(new Set(i.clearOn))}get deserializer(){return this.options.deserializer}get cleanupDelayMs(){var e;return this.options.cleanupDelayMs<0?0:null!==(e=this.options.cleanupDelayMs)&&void 0!==e?e:1e3}static fromBaseKeyDefinition(e){return new l(e.stateDefinition,e.key,Object.assign(Object.assign({},e.options),{clearOn:[]}))}static array(e,t,i){return new l(e,t,Object.assign(Object.assign({},i),{deserializer:(0,o.I)((e=>i.deserializer(e)))}))}static record(e,t,i){return new l(e,t,Object.assign(Object.assign({},i),{deserializer:(0,o.X)((e=>i.deserializer(e)))}))}get fullName(){return`${this.stateDefinition.name}_${this.key}`}buildKey(e){if(!s.c.isGuid(e))throw new Error(`You cannot build a user key without a valid UserId, building for key ${this.fullName}`);return`user_${e}_${this.stateDefinition.name}_${this.key}`}get errorKeyName(){return`${this.stateDefinition.name} > ${this.key}`}}n=r},89770:(e,t,i)=>{"use strict";i.d(t,{Q:()=>c,v:()=>a});var n=i(92786),s=i(44879),o=i(36957),r=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class a{}const l=new o.vh(o.vV,"selection",{deserializer:e=>e});class c{constructor(e,t=s.f8.System){this.globalStateProvider=e,this.defaultTheme=t,this.selectedThemeState=this.globalStateProvider.get(l),this.selectedTheme$=this.selectedThemeState.state$.pipe((0,n.U)((e=>null!=e?e:this.defaultTheme)))}setSelectedTheme(e){return r(this,void 0,void 0,(function*(){yield this.selectedThemeState.update((()=>e),{shouldUpdate:t=>t!==e})}))}}},64524:(e,t,i)=>{"use strict";var n=i(36957);class s{constructor(e,t,i){this.credential=e,this.category=t,this.generationDate="number"==typeof i?new Date(i):i}static fromJSON(e){return new s(e.credential,e.category,e.generationDate)}toJSON(){return{credential:this.credential,category:this.category,generationDate:this.generationDate.valueOf()}}}class o{constructor(e,t){this.disclosed=e,this.excluded=t}static allSecret(){const e=Object.freeze([]),t=Object.freeze([]);return new o(e,t)}disclose(e){const t=[...this.disclosed,e];return new o(Object.freeze(t),this.excluded)}exclude(e){const t=[...this.excluded,e];return new o(this.disclosed,Object.freeze(t))}classify(e){const t=JSON.parse(JSON.stringify(e));for(const n of this.excluded)delete t[n];const i={};for(const n of this.disclosed)i[n]=t[n],delete t[n];return{disclosed:i,secret:t}}declassify(e,t){const i={};for(const s of this.disclosed)i[s]=e[s];const n=Object.assign(i,t);for(const s of this.excluded)delete n[s];return n}}class r{constructor(e,t,i,n,s,o){this.stateDefinition=e,this.key=t,this.classifier=i,this.options=n,this.deconstruct=s,this.reconstruct=o}toEncryptedStateKey(){return new n.fX(this.stateDefinition,this.key,{cleanupDelayMs:this.options.cleanupDelayMs,deserializer:e=>e,clearOn:this.options.clearOn})}static value(e,t,i,n){return new r(e,t,i,n,(e=>[[null,e]]),(([[,e]])=>e))}static array(e,t,i,n){return new r(e,t,i,n,(e=>e.map(((e,t)=>[t,e]))),(e=>e.map((([,e])=>e))))}static record(e,t,i,n){return new r(e,t,i,n,(e=>Object.entries(e)),(e=>Object.fromEntries(e)))}}new n.fX(n.tW,"generatorSettings",{deserializer:e=>e,clearOn:["lock","logout"]}),new n.fX(n.ud,"passwordGeneratorSettings",{deserializer:e=>e,clearOn:[]}),new n.fX(n.ud,"passphraseGeneratorSettings",{deserializer:e=>e,clearOn:[]}),new n.fX(n.ud,"effUsernameGeneratorSettings",{deserializer:e=>e,clearOn:[]}),new n.fX(n.ud,"catchallGeneratorSettings",{deserializer:e=>e,clearOn:[]}),new n.fX(n.ud,"subaddressGeneratorSettings",{deserializer:e=>e,clearOn:[]}),new n.fX(n.ud,"addyIoForwarder",{deserializer:e=>e,clearOn:[]}),new n.fX(n.ud,"duckDuckGoForwarder",{deserializer:e=>e,clearOn:[]}),new n.fX(n.ud,"fastmailForwarder",{deserializer:e=>e,clearOn:[]}),new n.fX(n.ud,"firefoxRelayForwarder",{deserializer:e=>e,clearOn:[]}),new n.fX(n.ud,"forwardEmailForwarder",{deserializer:e=>e,clearOn:[]}),new n.fX(n.ud,"simpleLoginForwarder",{deserializer:e=>e,clearOn:[]}),r.array(n.ud,"localGeneratorHistory",o.allSecret(),{deserializer:s.fromJSON,clearOn:["logout"]})},39553:(e,t,i)=>{"use strict";i.d(t,{ZU:()=>h,f9:()=>v,UW:()=>o});var n=i(70673);Object.freeze({length:14,minLength:n.z.length.min,ambiguous:!0,uppercase:!0,lowercase:!0,number:!0,minNumber:1,special:!1,minSpecial:0});var s=i(92614);i(64524);Object.freeze({minLength:0,useUppercase:!1,useLowercase:!1,useNumbers:!1,numberCount:0,useSpecial:!1,specialCount:0});class o{}var r=i(40160);class a extends r.Z{constructor(){super(...arguments),this.defaultType="",this.minLength=0,this.useUppercase=!1,this.useLowercase=!1,this.useNumbers=!1,this.numberCount=0,this.useSpecial=!1,this.specialCount=0,this.minNumberWords=0,this.capitalize=!1,this.includeNumber=!1}inEffect(){return""!==this.defaultType||this.minLength>0||this.numberCount>0||this.specialCount>0||this.useUppercase||this.useLowercase||this.useNumbers||this.useSpecial||this.minNumberWords>0||this.capitalize||this.includeNumber}clone(){const e=new a;return Object.assign(e,this),e}}var l=i(90428),c=i(70427);const u=Object.freeze({numWords:3,wordSeparator:"-",capitalize:!1,includeNumber:!1});const d=function(){const e=Object.freeze({min:3,max:20});return Object.freeze({numWords:e})}();class p{constructor(e){var t,i;this.policy=structuredClone(e),this.numWords=(t=e.minNumberWords,i=d.numWords,{min:Math.max(i.min,t),max:Math.max(i.max,t)})}get policyInEffect(){return[this.policy.capitalize,this.policy.includeNumber,this.policy.minNumberWords>d.numWords.min].includes(!0)}applyPolicy(e){const t=this.policy.capitalize||e.capitalize||!1,i=this.policy.includeNumber||e.includeNumber||!1,n=function(e,t){const{min:i,max:n}=t,s=Math.min(null!=e?e:t.min,n);return Math.max(s,i)}(e.numWords,this.numWords);return Object.assign(Object.assign({},e),{numWords:n,capitalize:t,includeNumber:i})}sanitize(e){var t,i;const n=""===e.wordSeparator?"":null!==(i=null===(t=e.wordSeparator)||void 0===t?void 0:t[0])&&void 0!==i?i:u.wordSeparator;return Object.assign(Object.assign({},e),{wordSeparator:n})}}class h{constructor(e,t){this.password=e,this.date=t}}var g=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const f={length:14,minLength:5,ambiguous:!1,number:!0,minNumber:1,uppercase:!0,minUppercase:0,lowercase:!0,minLowercase:0,special:!1,minSpecial:0,type:"password",numWords:3,wordSeparator:"-",capitalize:!1,includeNumber:!1},m=new a;class v{constructor(e,t,i){this.cryptoService=e,this.policyService=t,this.stateService=i}generatePassword(e){var t;return g(this,void 0,void 0,(function*(){if("passphrase"===(null!==(t=e.type)&&void 0!==t?t:f.type))return this.generatePassphrase(Object.assign(Object.assign({},f),e));const i=new n.u(m).sanitize(Object.assign(Object.assign({},f),e)),s=[];if(i.lowercase&&i.minLowercase>0)for(let e=0;e<i.minLowercase;e++)s.push("l");if(i.uppercase&&i.minUppercase>0)for(let e=0;e<i.minUppercase;e++)s.push("u");if(i.number&&i.minNumber>0)for(let e=0;e<i.minNumber;e++)s.push("n");if(i.special&&i.minSpecial>0)for(let e=0;e<i.minSpecial;e++)s.push("s");for(;s.length<i.length;)s.push("a");yield this.shuffleArray(s);let o="",r="abcdefghijkmnopqrstuvwxyz";i.ambiguous&&(r+="l"),i.lowercase&&(o+=r);let a="ABCDEFGHJKLMNPQRSTUVWXYZ";i.ambiguous&&(a+="IO"),i.uppercase&&(o+=a);let l="23456789";i.ambiguous&&(l+="01"),i.number&&(o+=l);const c="!@#$%^&*";i.special&&(o+=c);let u="";for(let e=0;e<i.length;e++){let t;switch(s[e]){case"l":t=r;break;case"u":t=a;break;case"n":t=l;break;case"s":t=c;break;case"a":t=o}const i=yield this.cryptoService.randomNumber(0,t.length-1);u+=t.charAt(i)}return u}))}generatePassphrase(e){return g(this,void 0,void 0,(function*(){const t=new p(m).sanitize(Object.assign(Object.assign({},f),e));(null==t.numWords||t.numWords<=2)&&(t.numWords=f.numWords),null==t.capitalize&&(t.capitalize=!1),null==t.includeNumber&&(t.includeNumber=!1);const i=l.V.length-1,n=new Array(t.numWords);for(let e=0;e<t.numWords;e++){const s=yield this.cryptoService.randomNumber(0,i);t.capitalize?n[e]=this.capitalize(l.V[s]):n[e]=l.V[s]}return t.includeNumber&&(yield this.appendRandomNumberToRandomWord(n)),n.join(t.wordSeparator)}))}getOptions(){return g(this,void 0,void 0,(function*(){let e=yield this.stateService.getPasswordGenerationOptions();e=null==e?Object.assign({},f):Object.assign({},f,e),yield this.stateService.setPasswordGenerationOptions(e);const t=yield this.enforcePasswordGeneratorPoliciesOnOptions(e);return e=t[0],[e,t[1]]}))}enforcePasswordGeneratorPoliciesOnOptions(e){return g(this,void 0,void 0,(function*(){let t=yield this.getPasswordGeneratorPolicyOptions();t=null!=t?t:new a,"password"!==t.defaultType&&"passphrase"!==t.defaultType||(e.type=t.defaultType);const i="password"==e.type?new n.u(t):new p(t),s=i.applyPolicy(e),o=i.sanitize(s);return[Object.assign(e,o),t]}))}getPasswordGeneratorPolicyOptions(){var e;return g(this,void 0,void 0,(function*(){const t=yield null===(e=this.policyService)||void 0===e?void 0:e.getAll(s.Mi.PasswordGenerator);let i=null;return null==t||0===t.length||t.forEach((e=>{e.enabled&&null!=e.data&&(null==i&&(i=new a),null!=e.data.defaultType&&"password"!==i.defaultType&&(i.defaultType=e.data.defaultType),null!=e.data.minLength&&e.data.minLength>i.minLength&&(i.minLength=e.data.minLength),e.data.useUpper&&(i.useUppercase=!0),e.data.useLower&&(i.useLowercase=!0),e.data.useNumbers&&(i.useNumbers=!0),null!=e.data.minNumbers&&e.data.minNumbers>i.numberCount&&(i.numberCount=e.data.minNumbers),e.data.useSpecial&&(i.useSpecial=!0),null!=e.data.minSpecial&&e.data.minSpecial>i.specialCount&&(i.specialCount=e.data.minSpecial),null!=e.data.minNumberWords&&e.data.minNumberWords>i.minNumberWords&&(i.minNumberWords=e.data.minNumberWords),e.data.capitalize&&(i.capitalize=!0),e.data.includeNumber&&(i.includeNumber=!0))})),i}))}saveOptions(e){return g(this,void 0,void 0,(function*(){yield this.stateService.setPasswordGenerationOptions(e)}))}getHistory(){return g(this,void 0,void 0,(function*(){if(!(yield this.cryptoService.hasUserKey()))return new Array;if(null==(yield this.stateService.getDecryptedPasswordGenerationHistory())){const e=yield this.stateService.getEncryptedPasswordGenerationHistory(),t=yield this.decryptHistory(e);yield this.stateService.setDecryptedPasswordGenerationHistory(t)}const e=yield this.stateService.getDecryptedPasswordGenerationHistory();return null!=e?e:new Array}))}addHistory(e){return g(this,void 0,void 0,(function*(){if(!(yield this.cryptoService.hasUserKey()))return;const t=yield this.getHistory();if(this.matchesPrevious(e,t))return;t.unshift(new h(e,Date.now())),t.length>100&&t.pop();const i=yield this.encryptHistory(t);return yield this.stateService.setDecryptedPasswordGenerationHistory(t),yield this.stateService.setEncryptedPasswordGenerationHistory(i)}))}clear(e){return g(this,void 0,void 0,(function*(){yield this.stateService.setEncryptedPasswordGenerationHistory(null,{userId:e}),yield this.stateService.setDecryptedPasswordGenerationHistory(null,{userId:e})}))}capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}appendRandomNumberToRandomWord(e){return g(this,void 0,void 0,(function*(){if(null==e||e.length<=0)return;const t=yield this.cryptoService.randomNumber(0,e.length-1),i=yield this.cryptoService.randomNumber(0,9);e[t]=e[t]+i}))}encryptHistory(e){return g(this,void 0,void 0,(function*(){if(null==e||0===e.length)return Promise.resolve([]);const t=e.map((e=>g(this,void 0,void 0,(function*(){const t=yield this.cryptoService.encrypt(e.password);return new h(t.encryptedString,e.date)}))));return yield Promise.all(t)}))}decryptHistory(e){return g(this,void 0,void 0,(function*(){if(null==e||0===e.length)return Promise.resolve([]);const t=e.map((e=>g(this,void 0,void 0,(function*(){const t=yield this.cryptoService.decryptToUtf8(new c._(e.password));return new h(t,e.date)}))));return yield Promise.all(t)}))}matchesPrevious(e,t){return null!=t&&0!==t.length&&t[t.length-1].password===e}shuffleArray(e){return g(this,void 0,void 0,(function*(){for(let t=e.length-1;t>0;t--){const i=yield this.cryptoService.randomNumber(0,t);[e[t],e[i]]=[e[i],e[t]]}}))}}},70673:(e,t,i)=>{"use strict";i.d(t,{u:()=>s,z:()=>n});const n=function(){const e=Object.freeze({min:5,max:128}),t=Object.freeze({min:0,max:9}),i=Object.freeze({min:0,max:9});return Object.freeze({length:e,minDigits:t,minSpecialCharacters:i})}();class s{constructor(e){function t(e,t){return{min:Math.max(t.min,e),max:Math.max(t.max,e)}}this.policy=structuredClone(e),this.minDigits=t(e.numberCount,n.minDigits),this.minSpecialCharacters=t(e.specialCount,n.minSpecialCharacters);const i=this.minDigits.min+this.minSpecialCharacters.min,s=e.minLength>0?e.minLength:n.length.min,o=Math.max(s,i,n.length.min);this.length={min:o,max:Math.max(n.length.max,o)}}get policyInEffect(){return[this.policy.useUppercase,this.policy.useLowercase,this.policy.useNumbers,this.policy.useSpecial,this.policy.minLength>n.length.min,this.policy.numberCount>n.minDigits.min,this.policy.specialCount>n.minSpecialCharacters.min].includes(!0)}applyPolicy(e){function t(e,t){const{min:i,max:n}=t,s=Math.min(e||0,n);return Math.max(s,i)}const i=this.policy.useUppercase||e.uppercase||!1,n=this.policy.useLowercase||e.lowercase||!1,s=this.policy.useNumbers||e.number||e.minNumber>0,o=this.policy.useSpecial||e.special||e.minSpecial>0,r=t(e.length,this.length),a=t(e.minNumber,this.minDigits),l=t(e.minSpecial,this.minSpecialCharacters);return Object.assign(Object.assign({},e),{length:r,uppercase:i,lowercase:n,number:s,minNumber:a,special:o,minSpecial:l})}sanitize(e){var t;function i(e,t){const i=null!=e?e:t>0;return[i,i?t||1:0]}const[n,s]=i(e.lowercase,e.minLowercase),[o,r]=i(e.uppercase,e.minUppercase),[a,l]=i(e.number,e.minNumber),[c,u]=i(e.special,e.minSpecial),d=s+r+l+u,p=Math.max(d,this.length.min),h=Math.max(null!==(t=e.length)&&void 0!==t?t:p,p);return Object.assign(Object.assign({},e),{length:h,minLength:p,lowercase:n,minLowercase:s,uppercase:o,minUppercase:r,number:a,minNumber:l,special:c,minSpecial:u})}}},8257:(e,t,i)=>{"use strict";i.d(t,{N$:()=>x,vo:()=>n});i(92614),i(64524);Object.freeze({wordCapitalize:!1,wordIncludeNumber:!1,website:null});Object.freeze({catchallType:"random",catchallDomain:"",website:null});Object.freeze({subaddressType:"random",subaddressEmail:"",website:null});class n{}var s=i(90428),o=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class r{generate(e,t){var i,n,s;return o(this,void 0,void 0,(function*(){if(null==t.apiKey||""===t.apiKey)throw"Invalid addy.io API token.";if(null==(null===(i=t.anonaddy)||void 0===i?void 0:i.domain)||""===t.anonaddy.domain)throw"Invalid addy.io domain.";if(null==(null===(n=t.anonaddy)||void 0===n?void 0:n.baseUrl)||""===t.anonaddy.baseUrl)throw"Invalid addy.io url.";const o={redirect:"manual",cache:"no-store",method:"POST",headers:new Headers({Authorization:"Bearer "+t.apiKey,"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"})},r=t.anonaddy.baseUrl+"/api/v1/aliases";o.body=JSON.stringify({domain:t.anonaddy.domain,description:(null!=t.website?"Website: "+t.website+". ":"")+"Generated by Bitwarden."});const a=new Request(r,o),l=yield e.nativeFetch(a);if(200===l.status||201===l.status){const e=yield l.json();return null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.email}if(401===l.status)throw"Invalid addy.io API token.";if(null!=(null==l?void 0:l.statusText))throw"addy.io error:\n"+l.statusText;throw"Unknown addy.io error occurred."}))}}var a=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class l{generate(e,t){return a(this,void 0,void 0,(function*(){if(null==t.apiKey||""===t.apiKey)throw"Invalid DuckDuckGo API token.";const i={redirect:"manual",cache:"no-store",method:"POST",headers:new Headers({Authorization:"Bearer "+t.apiKey,"Content-Type":"application/json"})},n=new Request("https://quack.duckduckgo.com/api/email/addresses",i),s=yield e.nativeFetch(n);if(200===s.status||201===s.status){const e=yield s.json();if(e.address)return`${e.address}@duck.com`}else if(401===s.status)throw"Invalid DuckDuckGo API token.";throw"Unknown DuckDuckGo error occurred."}))}}var c=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class u{generate(e,t){var i,n,s,o,r,a,l,u,d,p,h;return c(this,void 0,void 0,(function*(){if(null==t.apiKey||""===t.apiKey)throw"Invalid Fastmail API token.";const c=yield this.getAccountId(e,t);if(null==c||""===c)throw"Unable to obtain Fastmail masked email account ID.";const g={redirect:"manual",cache:"no-store",method:"POST",headers:new Headers({Authorization:"Bearer "+t.apiKey,"Content-Type":"application/json"})};g.body=JSON.stringify({using:["https://www.fastmail.com/dev/maskedemail","urn:ietf:params:jmap:core"],methodCalls:[["MaskedEmail/set",{accountId:c,create:{"new-masked-email":{state:"enabled",description:"",forDomain:t.website,emailPrefix:t.fastmail.prefix}}},"0"]]});const f=new Request("https://api.fastmail.com/jmap/api/",g),m=yield e.nativeFetch(f);if(200===m.status){const e=yield m.json();if(null!=e.methodResponses&&e.methodResponses.length>0&&e.methodResponses[0].length>0)if("MaskedEmail/set"===e.methodResponses[0][0]){if(null!=(null===(n=null===(i=e.methodResponses[0][1])||void 0===i?void 0:i.created)||void 0===n?void 0:n["new-masked-email"]))return null===(r=null===(o=null===(s=e.methodResponses[0][1])||void 0===s?void 0:s.created)||void 0===o?void 0:o["new-masked-email"])||void 0===r?void 0:r.email;if(null!=(null===(l=null===(a=e.methodResponses[0][1])||void 0===a?void 0:a.notCreated)||void 0===l?void 0:l["new-masked-email"]))throw"Fastmail error: "+(null===(p=null===(d=null===(u=e.methodResponses[0][1])||void 0===u?void 0:u.notCreated)||void 0===d?void 0:d["new-masked-email"])||void 0===p?void 0:p.description)}else if("error"===e.methodResponses[0][0])throw"Fastmail error: "+(null===(h=e.methodResponses[0][1])||void 0===h?void 0:h.description)}if(401===m.status||403===m.status)throw"Invalid Fastmail API token.";throw"Unknown Fastmail error occurred."}))}getAccountId(e,t){return c(this,void 0,void 0,(function*(){const i={cache:"no-store",method:"GET",headers:new Headers({Authorization:"Bearer "+t.apiKey})},n=new Request("https://api.fastmail.com/.well-known/jmap",i),s=yield e.nativeFetch(n);if(200===s.status){const e=yield s.json();if(null!=e.primaryAccounts)return e.primaryAccounts["https://www.fastmail.com/dev/maskedemail"]}return null}))}}var d=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class p{generate(e,t){return d(this,void 0,void 0,(function*(){if(null==t.apiKey||""===t.apiKey)throw"Invalid Firefox Relay API token.";const i={redirect:"manual",cache:"no-store",method:"POST",headers:new Headers({Authorization:"Token "+t.apiKey,"Content-Type":"application/json"})};i.body=JSON.stringify({enabled:!0,generated_for:t.website,description:(null!=t.website?t.website+" - ":"")+"Generated by Bitwarden."});const n=new Request("https://relay.firefox.com/api/v1/relayaddresses/",i),s=yield e.nativeFetch(n);if(200===s.status||201===s.status){const e=yield s.json();return null==e?void 0:e.full_address}if(401===s.status)throw"Invalid Firefox Relay API token.";throw"Unknown Firefox Relay error occurred."}))}}class h{constructor(){this.fastmail=new g,this.anonaddy=new f,this.forwardemail=new m,this.simplelogin=new v}}class g{}class f{}class m{}class v{}var y=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class w{generate(e,t){return y(this,void 0,void 0,(function*(){if(null==t.apiKey||""===t.apiKey)throw"Invalid SimpleLogin API key.";const i={redirect:"manual",cache:"no-store",method:"POST",headers:new Headers({Authentication:t.apiKey,"Content-Type":"application/json"})};let n=t.simplelogin.baseUrl+"/api/alias/random/new";null!=t.website&&(n+="?hostname="+t.website),i.body=JSON.stringify({note:(null!=t.website?"Website: "+t.website+". ":"")+"Generated by Bitwarden."});const s=new Request(n,i),o=yield e.nativeFetch(s);if(200===o.status||201===o.status){return(yield o.json()).alias}if(401===o.status)throw"Invalid SimpleLogin API key.";const r=yield o.json();if(null!=(null==r?void 0:r.error))throw"SimpleLogin error:"+r.error;throw"Unknown SimpleLogin error occurred."}))}}var b=i(27646),U=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class _{generate(e,t){var i,n;return U(this,void 0,void 0,(function*(){if(null==t.apiKey||""===t.apiKey)throw"Invalid Forward Email API key.";if(null==(null===(i=t.forwardemail)||void 0===i?void 0:i.domain)||""===t.forwardemail.domain)throw"Invalid Forward Email domain.";const s={redirect:"manual",cache:"no-store",method:"POST",headers:new Headers({Authorization:"Basic "+b.c.fromUtf8ToB64(t.apiKey+":"),"Content-Type":"application/json"})},o=`https://api.forwardemail.net/v1/domains/${t.forwardemail.domain}/aliases`;s.body=JSON.stringify({labels:t.website,description:(null!=t.website?"Website: "+t.website+". ":"")+"Generated by Bitwarden."});const r=new Request(o,s),a=yield e.nativeFetch(r);if(200===a.status||201===a.status){const e=yield a.json();return(null==e?void 0:e.name)+"@"+((null===(n=null==e?void 0:e.domain)||void 0===n?void 0:n.name)||t.forwardemail.domain)}if(401===a.status)throw"Invalid Forward Email API key.";const l=yield a.json();if(null!=(null==l?void 0:l.message))throw"Forward Email error:\n"+l.message;if(null!=(null==l?void 0:l.error))throw"Forward Email error:\n"+l.error;throw"Unknown Forward Email error occurred."}))}}var A=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Z={type:"word",website:null,wordCapitalize:!0,wordIncludeNumber:!0,subaddressType:"random",catchallType:"random",forwardedService:"",forwardedAnonAddyDomain:"anonaddy.me",forwardedAnonAddyBaseUrl:"https://app.addy.io",forwardedForwardEmailDomain:"hideaddress.net",forwardedSimpleLoginBaseUrl:"https://app.simplelogin.io"};class x{constructor(e,t,i){this.cryptoService=e,this.stateService=t,this.apiService=i}generateUsername(e){return"catchall"===e.type?this.generateCatchall(e):"subaddress"===e.type?this.generateSubaddress(e):"forwarded"===e.type?this.generateForwarded(e):this.generateWord(e)}generateWord(e){return A(this,void 0,void 0,(function*(){const t=Object.assign({},Z,e);null==t.wordCapitalize&&(t.wordCapitalize=!0),null==t.wordIncludeNumber&&(t.wordIncludeNumber=!0);const i=yield this.cryptoService.randomNumber(0,s.V.length-1);let n=s.V[i];if(t.wordCapitalize&&(n=n.charAt(0).toUpperCase()+n.slice(1)),t.wordIncludeNumber){const e=yield this.cryptoService.randomNumber(1,9999);n+=this.zeroPad(e.toString(),4)}return n}))}generateSubaddress(e){return A(this,void 0,void 0,(function*(){const t=Object.assign({},Z,e),i=t.subaddressEmail;if(null==i||i.length<3)return t.subaddressEmail;const n=i.indexOf("@");if(n<1||n>=i.length-1)return i;null==t.subaddressType&&(t.subaddressType="random");const s=i.substr(0,n),o=i.substr(n+1,i.length);let r="";return"random"===t.subaddressType?r=yield this.randomString(8):"website-name"===t.subaddressType&&(r=t.website),s+"+"+r+"@"+o}))}generateCatchall(e){return A(this,void 0,void 0,(function*(){const t=Object.assign({},Z,e);if(null==t.catchallDomain||""===t.catchallDomain)return null;null==t.catchallType&&(t.catchallType="random");let i="";return"random"===t.catchallType?i=yield this.randomString(8):"website-name"===t.catchallType&&(i=t.website),i+"@"+t.catchallDomain}))}generateForwarded(e){return A(this,void 0,void 0,(function*(){const t=Object.assign({},Z,e);if(null==t.forwardedService)return null;let i=null;const n=new h;return n.website=t.website,"simplelogin"===t.forwardedService?(i=new w,n.apiKey=t.forwardedSimpleLoginApiKey,n.simplelogin.baseUrl=t.forwardedSimpleLoginBaseUrl):"anonaddy"===t.forwardedService?(i=new r,n.apiKey=t.forwardedAnonAddyApiToken,n.anonaddy.domain=t.forwardedAnonAddyDomain,n.anonaddy.baseUrl=t.forwardedAnonAddyBaseUrl):"firefoxrelay"===t.forwardedService?(i=new p,n.apiKey=t.forwardedFirefoxApiToken):"fastmail"===t.forwardedService?(i=new u,n.apiKey=t.forwardedFastmailApiToken):"duckduckgo"===t.forwardedService?(i=new l,n.apiKey=t.forwardedDuckDuckGoToken):"forwardemail"===t.forwardedService&&(i=new _,n.apiKey=t.forwardedForwardEmailApiToken,n.forwardemail.domain=t.forwardedForwardEmailDomain),null==i?null:i.generate(this.apiService,n)}))}getOptions(){return A(this,void 0,void 0,(function*(){let e=yield this.stateService.getUsernameGenerationOptions();return e=null==e?Object.assign({},Z):Object.assign({},Z,e),yield this.stateService.setUsernameGenerationOptions(e),e}))}saveOptions(e){return A(this,void 0,void 0,(function*(){yield this.stateService.setUsernameGenerationOptions(e)}))}randomString(e){return A(this,void 0,void 0,(function*(){let t="";const i="abcdefghijklmnopqrstuvwxyz1234567890";for(let n=0;n<e;n++){const e=yield this.cryptoService.randomNumber(0,35);t+=i.charAt(e)}return t}))}zeroPad(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e}}},51453:(e,t,i)=>{"use strict";i.d(t,{N:()=>o,A:()=>n});class n{}var s=i(3653);class o{getPasswordStrength(e,t=null,i=null){if(null==e||0===e.length)return null;const n=["bitwarden","bit","warden",...null!=i?i:[],...this.emailToUserInputs(t)],o=Array.from(new Set(n));return s(e,o)}emailToUserInputs(e){if(null==e||0===e.length)return[];const t=e.indexOf("@");return t<0?[]:e.substring(0,t).trim().toLowerCase().split(/[^A-Za-z0-9]/)}}},41399:(e,t,i)=>{"use strict";var n;i.d(t,{n:()=>n}),function(e){e[e.Text=0]="Text",e[e.File=1]="File"}(n||(n={}))},94312:(e,t,i)=>{"use strict";i.d(t,{f:()=>a});var n=i(40160),s=i(70427),o=i(56788),r=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class a extends n.Z{constructor(e){super(),null!=e&&(this.size=e.size,this.buildDomainModel(this,e,{id:null,sizeName:null,fileName:null},["id","sizeName"]))}decrypt(e){return r(this,void 0,void 0,(function*(){return yield this.decryptObj(new o.h(this),{fileName:null},null,e)}))}static fromJSON(e){return null==e?null:Object.assign(new a,e,{fileName:s._.fromJSON(e.fileName)})}}},22850:(e,t,i)=>{"use strict";i.d(t,{y:()=>r});var n=i(40160),s=i(70427),o=i(67395);class r extends n.Z{constructor(e){super(),null!=e&&(this.hidden=e.hidden,this.buildDomainModel(this,e,{text:null},[]))}decrypt(e){return this.decryptObj(new o.z(this),{text:null},null,e)}static fromJSON(e){return null==e?null:Object.assign(new r,e,{text:s._.fromJSON(e.text)})}}},69255:(e,t,i)=>{"use strict";i.d(t,{v:()=>d});var n=i(27646),s=i(40160),o=i(70427),r=i(41399),a=i(36320),l=i(94312),c=i(22850),u=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class d extends s.Z{constructor(e){if(super(),null!=e)switch(this.buildDomainModel(this,e,{id:null,accessId:null,name:null,notes:null,key:null},["id","accessId"]),this.type=e.type,this.maxAccessCount=e.maxAccessCount,this.accessCount=e.accessCount,this.password=e.password,this.disabled=e.disabled,this.revisionDate=null!=e.revisionDate?new Date(e.revisionDate):null,this.deletionDate=null!=e.deletionDate?new Date(e.deletionDate):null,this.expirationDate=null!=e.expirationDate?new Date(e.expirationDate):null,this.hideEmail=e.hideEmail,this.type){case r.n.Text:this.text=new c.y(e.text);break;case r.n.File:this.file=new l.f(e.file)}}decrypt(){return u(this,void 0,void 0,(function*(){const e=new a.i(this),t=n.c.getContainerService().getCryptoService();try{e.key=yield t.decryptToBytes(this.key,null),e.cryptoKey=yield t.makeSendKey(e.key)}catch(i){}switch(yield this.decryptObj(e,{name:null,notes:null},null,e.cryptoKey),this.type){case r.n.File:e.file=yield this.file.decrypt(e.cryptoKey);break;case r.n.Text:e.text=yield this.text.decrypt(e.cryptoKey)}return e}))}static fromJSON(e){if(null==e)return null;const t=null==e.revisionDate?null:new Date(e.revisionDate),i=null==e.expirationDate?null:new Date(e.expirationDate),n=null==e.deletionDate?null:new Date(e.deletionDate);return Object.assign(new d,e,{key:o._.fromJSON(e.key),name:o._.fromJSON(e.name),notes:o._.fromJSON(e.notes),text:c.y.fromJSON(e.text),file:l.f.fromJSON(e.file),revisionDate:t,expirationDate:i,deletionDate:n})}}},56788:(e,t,i)=>{"use strict";i.d(t,{h:()=>n});class n{constructor(e){this.id=null,this.size=null,this.sizeName=null,this.fileName=null,e&&(this.id=e.id,this.size=e.size,this.sizeName=e.sizeName)}get fileSize(){try{if(null!=this.size)return parseInt(this.size,null)}catch(e){}return 0}static fromJSON(e){return null==e?null:Object.assign(new n,e)}}},67395:(e,t,i)=>{"use strict";i.d(t,{z:()=>n});class n{constructor(e){this.text=null,e&&(this.hidden=e.hidden)}get maskedText(){return null!=this.text?"••••••••":null}static fromJSON(e){return null==e?null:Object.assign(new n,e)}}},36320:(e,t,i)=>{"use strict";i.d(t,{i:()=>a});var n=i(27646),s=i(55637),o=i(56788),r=i(67395);class a{constructor(e){this.id=null,this.accessId=null,this.name=null,this.notes=null,this.type=null,this.text=new r.z,this.file=new o.h,this.maxAccessCount=null,this.accessCount=0,this.revisionDate=null,this.deletionDate=null,this.expirationDate=null,this.password=null,this.disabled=!1,this.hideEmail=!1,e&&(this.id=e.id,this.accessId=e.accessId,this.type=e.type,this.maxAccessCount=e.maxAccessCount,this.accessCount=e.accessCount,this.revisionDate=e.revisionDate,this.deletionDate=e.deletionDate,this.expirationDate=e.expirationDate,this.disabled=e.disabled,this.password=e.password,this.hideEmail=e.hideEmail)}get urlB64Key(){return n.c.fromBufferToUrlB64(this.key)}get maxAccessCountReached(){return null!=this.maxAccessCount&&this.accessCount>=this.maxAccessCount}get expired(){return null!=this.expirationDate&&this.expirationDate<=new Date}get pendingDelete(){return this.deletionDate<=new Date}toJSON(){return n.c.merge(Object.assign({},this),{key:n.c.fromBufferToB64(this.key)})}static fromJSON(e){return null==e?null:Object.assign(new a,e,{key:n.c.fromB64ToArray(e.key),cryptoKey:s.N.fromJSON(e.cryptoKey),text:r.z.fromJSON(e.text),file:o.h.fromJSON(e.file),revisionDate:null==e.revisionDate?null:new Date(e.revisionDate),deletionDate:null==e.deletionDate?null:new Date(e.deletionDate),expirationDate:null==e.expirationDate?null:new Date(e.expirationDate)})}}},67381:(e,t,i)=>{"use strict";i.d(t,{g:()=>n});const n=1e5},88701:(e,t,i)=>{"use strict";i.d(t,{e:()=>n});class n{}},92649:(e,t,i)=>{"use strict";i.d(t,{N:()=>n,v:()=>s});class n{}class s extends n{}},92236:(e,t,i)=>{"use strict";i.d(t,{u:()=>n});class n{}},31754:(e,t,i)=>{"use strict";i.d(t,{a:()=>n});class n{}},22492:(e,t,i)=>{"use strict";i.d(t,{s:()=>n});class n{}},23031:(e,t,i)=>{"use strict";i.d(t,{G:()=>s,s:()=>n});class n{}class s extends n{}},4871:(e,t,i)=>{"use strict";i.d(t,{_:()=>n});class n{}},8067:(e,t,i)=>{"use strict";i.d(t,{w:()=>n});class n{}},72285:(e,t,i)=>{"use strict";var n;i.d(t,{N:()=>n}),function(e){e[e.None=0]="None",e[e.Password=1]="Password"}(n||(n={}))},31182:(e,t,i)=>{"use strict";var n;i.d(t,{O:()=>n}),function(e){e[e.Login=1]="Login",e[e.SecureNote=2]="SecureNote",e[e.Card=3]="Card",e[e.Identity=4]="Identity"}(n||(n={}))},67496:(e,t,i)=>{"use strict";var n;i.d(t,{f:()=>n}),function(e){e[e.Text=0]="Text",e[e.Hidden=1]="Hidden",e[e.Boolean=2]="Boolean",e[e.Linked=3]="Linked"}(n||(n={}))},89474:(e,t,i)=>{"use strict";i.d(t,{LC:()=>o.LC,Ou:()=>n.O,Wp:()=>o.Wp,fS:()=>s.f,qA:()=>o.qA,xs:()=>r.x});i(72285);var n=i(31182),s=i(67496),o=i(98808),r=i(63503)},98808:(e,t,i)=>{"use strict";var n,s,o;i.d(t,{LC:()=>o,Wp:()=>s,qA:()=>n}),function(e){e[e.Username=100]="Username",e[e.Password=101]="Password"}(n||(n={})),function(e){e[e.CardholderName=300]="CardholderName",e[e.ExpMonth=301]="ExpMonth",e[e.ExpYear=302]="ExpYear",e[e.Code=303]="Code",e[e.Brand=304]="Brand",e[e.Number=305]="Number"}(s||(s={})),function(e){e[e.Title=400]="Title",e[e.MiddleName=401]="MiddleName",e[e.Address1=402]="Address1",e[e.Address2=403]="Address2",e[e.Address3=404]="Address3",e[e.City=405]="City",e[e.State=406]="State",e[e.PostalCode=407]="PostalCode",e[e.Country=408]="Country",e[e.Company=409]="Company",e[e.Email=410]="Email",e[e.Phone=411]="Phone",e[e.Ssn=412]="Ssn",e[e.Username=413]="Username",e[e.PassportNumber=414]="PassportNumber",e[e.LicenseNumber=415]="LicenseNumber",e[e.FirstName=416]="FirstName",e[e.LastName=417]="LastName",e[e.FullName=418]="FullName"}(o||(o={}))},63503:(e,t,i)=>{"use strict";var n;i.d(t,{x:()=>n}),function(e){e[e.Generic=0]="Generic"}(n||(n={}))},28805:(e,t,i)=>{"use strict";i.d(t,{B:()=>s});class n{constructor(e,t){this.propertyKey=e,this._i18nKey=t}get i18nKey(){var e;return null!==(e=this._i18nKey)&&void 0!==e?e:this.propertyKey}}function s(e,t){return(i,s)=>{null==i.linkedFieldOptions&&(i.linkedFieldOptions=new Map),i.linkedFieldOptions.set(e,new n(s,t))}}},20601:(e,t,i)=>{"use strict";i.d(t,{E:()=>s});var n=i(58043);class s extends n.c{constructor(e=null){super(e),null!=e&&(this.cardholderName=this.getResponseProperty("CardholderName"),this.brand=this.getResponseProperty("Brand"),this.number=this.getResponseProperty("Number"),this.expMonth=this.getResponseProperty("ExpMonth"),this.expYear=this.getResponseProperty("ExpYear"),this.code=this.getResponseProperty("Code"))}}},57361:(e,t,i)=>{"use strict";i.d(t,{J:()=>s});var n=i(58043);class s extends n.c{constructor(e=null){super(e),null!=e&&(this.credentialId=this.getResponseProperty("CredentialId"),this.keyType=this.getResponseProperty("KeyType"),this.keyAlgorithm=this.getResponseProperty("KeyAlgorithm"),this.keyCurve=this.getResponseProperty("KeyCurve"),this.keyValue=this.getResponseProperty("keyValue"),this.rpId=this.getResponseProperty("RpId"),this.userHandle=this.getResponseProperty("UserHandle"),this.userName=this.getResponseProperty("UserName"),this.counter=this.getResponseProperty("Counter"),this.rpName=this.getResponseProperty("RpName"),this.userDisplayName=this.getResponseProperty("UserDisplayName"),this.discoverable=this.getResponseProperty("Discoverable"),this.creationDate=this.getResponseProperty("CreationDate"))}}},56393:(e,t,i)=>{"use strict";i.d(t,{P:()=>s});var n=i(58043);class s extends n.c{constructor(e=null){super(e),null!=e&&(this.type=this.getResponseProperty("Type"),this.name=this.getResponseProperty("Name"),this.value=this.getResponseProperty("Value"),this.linkedId=this.getResponseProperty("linkedId"))}}},6801:(e,t,i)=>{"use strict";i.d(t,{x:()=>s});var n=i(58043);class s extends n.c{constructor(e=null){super(e),null!=e&&(this.title=this.getResponseProperty("Title"),this.firstName=this.getResponseProperty("FirstName"),this.middleName=this.getResponseProperty("MiddleName"),this.lastName=this.getResponseProperty("LastName"),this.address1=this.getResponseProperty("Address1"),this.address2=this.getResponseProperty("Address2"),this.address3=this.getResponseProperty("Address3"),this.city=this.getResponseProperty("City"),this.state=this.getResponseProperty("State"),this.postalCode=this.getResponseProperty("PostalCode"),this.country=this.getResponseProperty("Country"),this.company=this.getResponseProperty("Company"),this.email=this.getResponseProperty("Email"),this.phone=this.getResponseProperty("Phone"),this.ssn=this.getResponseProperty("SSN"),this.username=this.getResponseProperty("Username"),this.passportNumber=this.getResponseProperty("PassportNumber"),this.licenseNumber=this.getResponseProperty("LicenseNumber"))}}},49066:(e,t,i)=>{"use strict";i.d(t,{l:()=>s});var n=i(58043);class s extends n.c{constructor(e=null){if(super(e),this.match=null,null==e)return;this.uri=this.getResponseProperty("Uri"),this.uriChecksum=this.getResponseProperty("UriChecksum");const t=this.getResponseProperty("Match");this.match=null!=t?t:null}}},39108:(e,t,i)=>{"use strict";i.d(t,{I:()=>r});var n=i(58043),s=i(57361),o=i(49066);class r extends n.c{constructor(e=null){if(super(e),null==e)return;this.username=this.getResponseProperty("Username"),this.password=this.getResponseProperty("Password"),this.passwordRevisionDate=this.getResponseProperty("PasswordRevisionDate"),this.totp=this.getResponseProperty("Totp"),this.autofillOnPageLoad=this.getResponseProperty("AutofillOnPageLoad");const t=this.getResponseProperty("Uris");null!=t&&(this.uris=t.map((e=>new o.l(e))));const i=this.getResponseProperty("Fido2Credentials");null!=i&&(this.fido2Credentials=i.map((e=>new s.J(e))))}}},2806:(e,t,i)=>{"use strict";i.d(t,{t:()=>s});var n=i(58043);class s extends n.c{constructor(e=null){super(e),null!=e&&(this.type=this.getResponseProperty("Type"))}}},85166:(e,t,i)=>{"use strict";i.d(t,{T:()=>n});class n{constructor(e){null!=e&&(this.id=e.id,this.url=e.url,this.fileName=e.fileName,this.key=e.key,this.size=e.size,this.sizeName=e.sizeName)}}},28598:(e,t,i)=>{"use strict";i.d(t,{w:()=>n});class n{constructor(e){null!=e&&(this.cardholderName=e.cardholderName,this.brand=e.brand,this.number=e.number,this.expMonth=e.expMonth,this.expYear=e.expYear,this.code=e.code)}}},61265:(e,t,i)=>{"use strict";i.d(t,{O:()=>d});var n=i(31182),s=i(85166),o=i(28598),r=i(25212),a=i(30912),l=i(90091),c=i(10482),u=i(666);class d{constructor(e,t){if(null!=e){switch(this.id=e.id,this.organizationId=e.organizationId,this.folderId=e.folderId,this.edit=e.edit,this.viewPassword=e.viewPassword,this.organizationUseTotp=e.organizationUseTotp,this.favorite=e.favorite,this.revisionDate=e.revisionDate,this.type=e.type,this.name=e.name,this.notes=e.notes,this.collectionIds=null!=t?t:e.collectionIds,this.creationDate=e.creationDate,this.deletedDate=e.deletedDate,this.reprompt=e.reprompt,this.key=e.key,this.type){case n.O.Login:this.login=new l.V(e.login);break;case n.O.SecureNote:this.secureNote=new u.a(e.secureNote);break;case n.O.Card:this.card=new o.w(e.card);break;case n.O.Identity:this.identity=new a.h(e.identity)}null!=e.fields&&(this.fields=e.fields.map((e=>new r.t(e)))),null!=e.attachments&&(this.attachments=e.attachments.map((e=>new s.T(e)))),null!=e.passwordHistory&&(this.passwordHistory=e.passwordHistory.map((e=>new c.t(e))))}}static fromJSON(e){return Object.assign(new d,e)}}},68134:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var n=i(81687);class s{constructor(e){this.id=e.id,this.organizationId=e.organizationId,this.name=e.name,this.externalId=e.externalId,this.readOnly=e.readOnly,this.manage=e.manage,this.hidePasswords=e.hidePasswords}static fromJSON(e){return Object.assign(new s(new n.TO({})),e)}}},38610:(e,t,i)=>{"use strict";i.d(t,{Y:()=>n});class n{constructor(e){null!=e&&(this.credentialId=e.credentialId,this.keyType=e.keyType,this.keyAlgorithm=e.keyAlgorithm,this.keyCurve=e.keyCurve,this.keyValue=e.keyValue,this.rpId=e.rpId,this.userHandle=e.userHandle,this.userName=e.userName,this.counter=e.counter,this.rpName=e.rpName,this.userDisplayName=e.userDisplayName,this.discoverable=e.discoverable,this.creationDate=e.creationDate)}}},25212:(e,t,i)=>{"use strict";i.d(t,{t:()=>n});class n{constructor(e){null!=e&&(this.type=e.type,this.name=e.name,this.value=e.value,this.linkedId=e.linkedId)}}},30912:(e,t,i)=>{"use strict";i.d(t,{h:()=>n});class n{constructor(e){null!=e&&(this.title=e.title,this.firstName=e.firstName,this.middleName=e.middleName,this.lastName=e.lastName,this.address1=e.address1,this.address2=e.address2,this.address3=e.address3,this.city=e.city,this.state=e.state,this.postalCode=e.postalCode,this.country=e.country,this.company=e.company,this.email=e.email,this.phone=e.phone,this.ssn=e.ssn,this.username=e.username,this.passportNumber=e.passportNumber,this.licenseNumber=e.licenseNumber)}}},67565:(e,t,i)=>{"use strict";i.d(t,{h:()=>n});class n{constructor(e){this.match=null,null!=e&&(this.uri=e.uri,this.uriChecksum=e.uriChecksum,this.match=e.match)}}},90091:(e,t,i)=>{"use strict";i.d(t,{V:()=>o});var n=i(38610),s=i(67565);class o{constructor(e){var t;null!=e&&(this.username=e.username,this.password=e.password,this.passwordRevisionDate=e.passwordRevisionDate,this.totp=e.totp,this.autofillOnPageLoad=e.autofillOnPageLoad,e.uris&&(this.uris=e.uris.map((e=>new s.h(e)))),e.fido2Credentials&&(this.fido2Credentials=null===(t=e.fido2Credentials)||void 0===t?void 0:t.map((e=>new n.Y(e)))))}}},10482:(e,t,i)=>{"use strict";i.d(t,{t:()=>n});class n{constructor(e){null!=e&&(this.password=e.password,this.lastUsedDate=e.lastUsedDate)}}},666:(e,t,i)=>{"use strict";i.d(t,{a:()=>n});class n{constructor(e){null!=e&&(this.type=e.type)}}},19553:(e,t,i)=>{"use strict";i.d(t,{P:()=>u});var n=i(27646),s=i(40160),o=i(70427),r=i(55637),a=i(85166),l=i(67175),c=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class u extends s.Z{constructor(e){super(),null!=e&&(this.size=e.size,this.buildDomainModel(this,e,{id:null,url:null,sizeName:null,fileName:null,key:null},["id","url","sizeName"]))}decrypt(e,t){return c(this,void 0,void 0,(function*(){const i=yield this.decryptObj(new l.w(this),{fileName:null},e,t);return null!=this.key&&(i.key=yield this.decryptAttachmentKey(e,t)),i}))}decryptAttachmentKey(e,t){return c(this,void 0,void 0,(function*(){try{null==t&&(t=yield this.getKeyForDecryption(e));const i=n.c.getContainerService().getEncryptService(),s=yield i.decryptToBytes(this.key,t);return new r.N(s)}catch(i){}}))}getKeyForDecryption(e){return c(this,void 0,void 0,(function*(){const t=n.c.getContainerService().getCryptoService();return null!=e?yield t.getOrgKey(e):yield t.getUserKeyWithLegacySupport()}))}toAttachmentData(){const e=new a.T;return e.size=this.size,this.buildDataModel(this,e,{id:null,url:null,sizeName:null,fileName:null,key:null},["id","url","sizeName"]),e}static fromJSON(e){if(null==e)return null;const t=o._.fromJSON(e.key),i=o._.fromJSON(e.fileName);return Object.assign(new u,e,{key:t,fileName:i})}}},15727:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(40160),s=i(70427),o=i(28598),r=i(57387);class a extends n.Z{constructor(e){super(),null!=e&&this.buildDomainModel(this,e,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},[])}decrypt(e,t){return this.decryptObj(new r._,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},e,t)}toCardData(){const e=new o.w;return this.buildDataModel(this,e,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null}),e}static fromJSON(e){if(null==e)return null;const t=s._.fromJSON(e.cardholderName),i=s._.fromJSON(e.brand),n=s._.fromJSON(e.number),o=s._.fromJSON(e.expMonth),r=s._.fromJSON(e.expYear),l=s._.fromJSON(e.code);return Object.assign(new a,e,{cardholderName:t,brand:i,number:n,expMonth:o,expYear:r,code:l})}}},19572:(e,t,i)=>{"use strict";i.d(t,{t:()=>w});var n=i(27646),s=i(40160),o=i(70427),r=i(55637),a=i(82570),l=i(31182),c=i(61265),u=i(53061),d=i(19553),p=i(15727),h=i(52870),g=i(34754),f=i(82702),m=i(19051),v=i(99896),y=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class w extends s.Z{constructor(e,t=null){if(super(),this.initializerKey=a.n.Cipher,null!=e){switch(this.buildDomainModel(this,e,{id:null,organizationId:null,folderId:null,name:null,notes:null,key:null},["id","organizationId","folderId"]),this.type=e.type,this.favorite=e.favorite,this.organizationUseTotp=e.organizationUseTotp,this.edit=e.edit,null!=e.viewPassword?this.viewPassword=e.viewPassword:this.viewPassword=!0,this.revisionDate=null!=e.revisionDate?new Date(e.revisionDate):null,this.collectionIds=e.collectionIds,this.localData=t,this.creationDate=null!=e.creationDate?new Date(e.creationDate):null,this.deletedDate=null!=e.deletedDate?new Date(e.deletedDate):null,this.reprompt=e.reprompt,this.type){case l.O.Login:this.login=new f.m(e.login);break;case l.O.SecureNote:this.secureNote=new v.k(e.secureNote);break;case l.O.Card:this.card=new p.Z(e.card);break;case l.O.Identity:this.identity=new g.i(e.identity)}null!=e.attachments?this.attachments=e.attachments.map((e=>new d.P(e))):this.attachments=null,null!=e.fields?this.fields=e.fields.map((e=>new h.g(e))):this.fields=null,null!=e.passwordHistory?this.passwordHistory=e.passwordHistory.map((e=>new m.r(e))):this.passwordHistory=null}}decrypt(e){return y(this,void 0,void 0,(function*(){const t=new u.$(this);let i=!0;if(null!=this.key){const t=n.c.getContainerService().getEncryptService();e=new r.N(yield t.decryptToBytes(this.key,e)),i=!1}switch(yield this.decryptObj(t,{name:null,notes:null},this.organizationId,e),this.type){case l.O.Login:t.login=yield this.login.decrypt(this.organizationId,i,e);break;case l.O.SecureNote:t.secureNote=yield this.secureNote.decrypt(this.organizationId,e);break;case l.O.Card:t.card=yield this.card.decrypt(this.organizationId,e);break;case l.O.Identity:t.identity=yield this.identity.decrypt(this.organizationId,e)}if(null!=this.attachments&&this.attachments.length>0){const i=[];yield this.attachments.reduce(((t,n)=>t.then((()=>n.decrypt(this.organizationId,e))).then((e=>{i.push(e)}))),Promise.resolve()),t.attachments=i}if(null!=this.fields&&this.fields.length>0){const i=[];yield this.fields.reduce(((t,n)=>t.then((()=>n.decrypt(this.organizationId,e))).then((e=>{i.push(e)}))),Promise.resolve()),t.fields=i}if(null!=this.passwordHistory&&this.passwordHistory.length>0){const i=[];yield this.passwordHistory.reduce(((t,n)=>t.then((()=>n.decrypt(this.organizationId,e))).then((e=>{i.push(e)}))),Promise.resolve()),t.passwordHistory=i}return t}))}toCipherData(){var e;const t=new c.O;switch(t.id=this.id,t.organizationId=this.organizationId,t.folderId=this.folderId,t.edit=this.edit,t.viewPassword=this.viewPassword,t.organizationUseTotp=this.organizationUseTotp,t.favorite=this.favorite,t.revisionDate=null!=this.revisionDate?this.revisionDate.toISOString():null,t.type=this.type,t.collectionIds=this.collectionIds,t.creationDate=null!=this.creationDate?this.creationDate.toISOString():null,t.deletedDate=null!=this.deletedDate?this.deletedDate.toISOString():null,t.reprompt=this.reprompt,t.key=null===(e=this.key)||void 0===e?void 0:e.encryptedString,this.buildDataModel(this,t,{name:null,notes:null}),t.type){case l.O.Login:t.login=this.login.toLoginData();break;case l.O.SecureNote:t.secureNote=this.secureNote.toSecureNoteData();break;case l.O.Card:t.card=this.card.toCardData();break;case l.O.Identity:t.identity=this.identity.toIdentityData()}return null!=this.fields&&(t.fields=this.fields.map((e=>e.toFieldData()))),null!=this.attachments&&(t.attachments=this.attachments.map((e=>e.toAttachmentData()))),null!=this.passwordHistory&&(t.passwordHistory=this.passwordHistory.map((e=>e.toPasswordHistoryData()))),t}static fromJSON(e){var t,i,n;if(null==e)return null;const s=new w,r=o._.fromJSON(e.name),a=o._.fromJSON(e.notes),c=null==e.revisionDate?null:new Date(e.revisionDate),u=null==e.deletedDate?null:new Date(e.deletedDate),y=null===(t=e.attachments)||void 0===t?void 0:t.map((e=>d.P.fromJSON(e))),b=null===(i=e.fields)||void 0===i?void 0:i.map((e=>h.g.fromJSON(e))),U=null===(n=e.passwordHistory)||void 0===n?void 0:n.map((e=>m.r.fromJSON(e))),_=o._.fromJSON(e.key);switch(Object.assign(s,e,{name:r,notes:a,revisionDate:c,deletedDate:u,attachments:y,fields:b,passwordHistory:U,key:_}),e.type){case l.O.Card:s.card=p.Z.fromJSON(e.card);break;case l.O.Identity:s.identity=g.i.fromJSON(e.identity);break;case l.O.Login:s.login=f.m.fromJSON(e.login);break;case l.O.SecureNote:s.secureNote=v.k.fromJSON(e.secureNote)}return s}}},54193:(e,t,i)=>{"use strict";i.d(t,{F:()=>o});var n=i(40160),s=i(23666);class o extends n.Z{constructor(e){super(),null!=e&&this.buildDomainModel(this,e,{id:null,organizationId:null,name:null,externalId:null,readOnly:null,hidePasswords:null,manage:null},["id","organizationId","externalId","readOnly","hidePasswords","manage"])}decrypt(){return this.decryptObj(new s.n(this),{name:null},this.organizationId)}}},6137:(e,t,i)=>{"use strict";i.d(t,{m:()=>l});var n=i(40160),s=i(70427),o=i(38610),r=i(90189),a=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class l extends n.Z{constructor(e){super(),this.credentialId=null,null!=e&&(this.buildDomainModel(this,e,{credentialId:null,keyType:null,keyAlgorithm:null,keyCurve:null,keyValue:null,rpId:null,userHandle:null,userName:null,counter:null,rpName:null,userDisplayName:null,discoverable:null},[]),this.creationDate=null!=e.creationDate?new Date(e.creationDate):null)}decrypt(e,t){return a(this,void 0,void 0,(function*(){const i=yield this.decryptObj(new r.X,{credentialId:null,keyType:null,keyAlgorithm:null,keyCurve:null,keyValue:null,rpId:null,userHandle:null,userName:null,rpName:null,userDisplayName:null,discoverable:null},e,t),{counter:n}=yield this.decryptObj({counter:""},{counter:null},e,t);i.counter=parseInt(n);const{discoverable:s}=yield this.decryptObj({discoverable:""},{discoverable:null},e,t);return i.discoverable="true"===s,i.creationDate=this.creationDate,i}))}toFido2CredentialData(){const e=new o.Y;return e.creationDate=this.creationDate.toISOString(),this.buildDataModel(this,e,{credentialId:null,keyType:null,keyAlgorithm:null,keyCurve:null,keyValue:null,rpId:null,userHandle:null,userName:null,counter:null,rpName:null,userDisplayName:null,discoverable:null}),e}static fromJSON(e){if(null==e)return null;const t=s._.fromJSON(e.credentialId),i=s._.fromJSON(e.keyType),n=s._.fromJSON(e.keyAlgorithm),o=s._.fromJSON(e.keyCurve),r=s._.fromJSON(e.keyValue),a=s._.fromJSON(e.rpId),c=s._.fromJSON(e.userHandle),u=s._.fromJSON(e.userName),d=s._.fromJSON(e.counter),p=s._.fromJSON(e.rpName),h=s._.fromJSON(e.userDisplayName),g=s._.fromJSON(e.discoverable),f=null!=e.creationDate?new Date(e.creationDate):null;return Object.assign(new l,e,{credentialId:t,keyType:i,keyAlgorithm:n,keyCurve:o,keyValue:r,rpId:a,userHandle:c,userName:u,counter:d,rpName:p,userDisplayName:h,discoverable:g,creationDate:f})}}},52870:(e,t,i)=>{"use strict";i.d(t,{g:()=>a});var n=i(40160),s=i(70427),o=i(25212),r=i(11612);class a extends n.Z{constructor(e){super(),null!=e&&(this.type=e.type,this.linkedId=e.linkedId,this.buildDomainModel(this,e,{name:null,value:null},[]))}decrypt(e,t){return this.decryptObj(new r.k(this),{name:null,value:null},e,t)}toFieldData(){const e=new o.t;return this.buildDataModel(this,e,{name:null,value:null,type:null,linkedId:null},["type","linkedId"]),e}static fromJSON(e){if(null==e)return null;const t=s._.fromJSON(e.name),i=s._.fromJSON(e.value);return Object.assign(new a,e,{name:t,value:i})}}},10256:(e,t,i)=>{"use strict";i.d(t,{g:()=>r});var n=i(40160),s=i(70427),o=i(90364);class r extends n.Z{constructor(e){super(),null!=e&&(this.buildDomainModel(this,e,{id:null,name:null},["id"]),this.revisionDate=null!=e.revisionDate?new Date(e.revisionDate):null)}decrypt(){return this.decryptObj(new o.a(this),{name:null},null)}static fromJSON(e){const t=null==e.revisionDate?null:new Date(e.revisionDate);return Object.assign(new r,e,{name:s._.fromJSON(e.name),revisionDate:t})}}},34754:(e,t,i)=>{"use strict";i.d(t,{i:()=>a});var n=i(40160),s=i(70427),o=i(30912),r=i(15091);class a extends n.Z{constructor(e){super(),null!=e&&this.buildDomainModel(this,e,{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null},[])}decrypt(e,t){return this.decryptObj(new r.t,{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null},e,t)}toIdentityData(){const e=new o.h;return this.buildDataModel(this,e,{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null}),e}static fromJSON(e){if(null==e)return null;const t=s._.fromJSON(e.title),i=s._.fromJSON(e.firstName),n=s._.fromJSON(e.middleName),o=s._.fromJSON(e.lastName),r=s._.fromJSON(e.address1),l=s._.fromJSON(e.address2),c=s._.fromJSON(e.address3),u=s._.fromJSON(e.city),d=s._.fromJSON(e.state),p=s._.fromJSON(e.postalCode),h=s._.fromJSON(e.country),g=s._.fromJSON(e.company),f=s._.fromJSON(e.email),m=s._.fromJSON(e.phone),v=s._.fromJSON(e.ssn),y=s._.fromJSON(e.username),w=s._.fromJSON(e.passportNumber),b=s._.fromJSON(e.licenseNumber);return Object.assign(new a,e,{title:t,firstName:i,middleName:n,lastName:o,address1:r,address2:l,address3:c,city:u,state:d,postalCode:p,country:h,company:g,email:f,phone:m,ssn:v,username:y,passportNumber:w,licenseNumber:b})}}},20364:(e,t,i)=>{"use strict";i.d(t,{c:()=>c});var n=i(27646),s=i(40160),o=i(70427),r=i(67565),a=i(95896),l=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class c extends s.Z{constructor(e){super(),null!=e&&(this.match=e.match,this.buildDomainModel(this,e,{uri:null,uriChecksum:null},[]))}decrypt(e,t){return this.decryptObj(new a.E(this),{uri:null},e,t)}validateChecksum(e,t,i){return l(this,void 0,void 0,(function*(){if(null==this.uriChecksum)return!1;const s=n.c.getContainerService().getEncryptService(),o=yield s.hash(e,"sha256");return(yield this.uriChecksum.decrypt(t,i))===o}))}toLoginUriData(){const e=new r.h;return this.buildDataModel(this,e,{uri:null,uriChecksum:null,match:null},["match"]),e}static fromJSON(e){if(null==e)return null;const t=o._.fromJSON(e.uri),i=o._.fromJSON(e.uriChecksum);return Object.assign(new c,e,{uri:t,uriChecksum:i})}}},82702:(e,t,i)=>{"use strict";i.d(t,{m:()=>u});var n=i(40160),s=i(70427),o=i(90091),r=i(60712),a=i(6137),l=i(20364),c=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class u extends n.Z{constructor(e){super(),null!=e&&(this.passwordRevisionDate=null!=e.passwordRevisionDate?new Date(e.passwordRevisionDate):null,this.autofillOnPageLoad=e.autofillOnPageLoad,this.buildDomainModel(this,e,{username:null,password:null,totp:null},[]),e.uris&&(this.uris=[],e.uris.forEach((e=>{this.uris.push(new l.c(e))}))),e.fido2Credentials&&(this.fido2Credentials=e.fido2Credentials.map((e=>new a.m(e)))))}decrypt(e,t,i){return c(this,void 0,void 0,(function*(){const n=yield this.decryptObj(new r.q(this),{username:null,password:null,totp:null},e,i);if(null!=this.uris){n.uris=[];for(let s=0;s<this.uris.length;s++){const o=yield this.uris[s].decrypt(e,i);(t||(yield this.uris[s].validateChecksum(o.uri,e,i)))&&n.uris.push(o)}}return null!=this.fido2Credentials&&(n.fido2Credentials=yield Promise.all(this.fido2Credentials.map((t=>t.decrypt(e,i))))),n}))}toLoginData(){const e=new o.V;return e.passwordRevisionDate=null!=this.passwordRevisionDate?this.passwordRevisionDate.toISOString():null,e.autofillOnPageLoad=this.autofillOnPageLoad,this.buildDataModel(this,e,{username:null,password:null,totp:null}),null!=this.uris&&this.uris.length>0&&(e.uris=[],this.uris.forEach((t=>{e.uris.push(t.toLoginUriData())}))),null!=this.fido2Credentials&&this.fido2Credentials.length>0&&(e.fido2Credentials=this.fido2Credentials.map((e=>e.toFido2CredentialData()))),e}static fromJSON(e){var t,i,n;if(null==e)return null;const o=s._.fromJSON(e.username),r=s._.fromJSON(e.password),c=s._.fromJSON(e.totp),d=null==e.passwordRevisionDate?null:new Date(e.passwordRevisionDate),p=null===(t=e.uris)||void 0===t?void 0:t.map((e=>l.c.fromJSON(e))),h=null!==(n=null===(i=e.fido2Credentials)||void 0===i?void 0:i.map((e=>a.m.fromJSON(e))))&&void 0!==n?n:[];return Object.assign(new u,e,{username:o,password:r,totp:c,passwordRevisionDate:d,uris:p,fido2Credentials:h})}}},19051:(e,t,i)=>{"use strict";i.d(t,{r:()=>a});var n=i(40160),s=i(70427),o=i(10482),r=i(42937);class a extends n.Z{constructor(e){super(),null!=e&&(this.buildDomainModel(this,e,{password:null}),this.lastUsedDate=new Date(e.lastUsedDate))}decrypt(e,t){return this.decryptObj(new r.i(this),{password:null},e,t)}toPasswordHistoryData(){const e=new o.t;return e.lastUsedDate=this.lastUsedDate.toISOString(),this.buildDataModel(this,e,{password:null}),e}static fromJSON(e){if(null==e)return null;const t=s._.fromJSON(e.password),i=null==e.lastUsedDate?null:new Date(e.lastUsedDate);return Object.assign(new a,e,{password:t,lastUsedDate:i})}}},99896:(e,t,i)=>{"use strict";i.d(t,{k:()=>r});var n=i(40160),s=i(666),o=i(54976);class r extends n.Z{constructor(e){super(),null!=e&&(this.type=e.type)}decrypt(e,t){return Promise.resolve(new o.z(this))}toSecureNoteData(){const e=new s.a;return e.type=this.type,e}static fromJSON(e){return null==e?null:Object.assign(new r,e)}}},94441:(e,t,i)=>{"use strict";i.d(t,{O:()=>n});class n{constructor(e,t,i,n){this.children=[],this.parent=t,this.node=e,i&&(this.node.name=i),n&&(this.node.id=n)}}},97466:(e,t,i)=>{"use strict";i.d(t,{c:()=>n});class n{constructor(e,t){this.ids=null==e?[]:e,this.organizationId=t}}},43898:(e,t,i)=>{"use strict";i.d(t,{L:()=>n});class n{constructor(e){this.collectionIds=null==e?[]:e}}},41412:(e,t,i)=>{"use strict";i.d(t,{K:()=>s});var n=i(29918);class s extends n.a{constructor(e){super(e),this.id=e.id}}},29918:(e,t,i)=>{"use strict";i.d(t,{a:()=>p});var n=i(31182),s=i(20601),o=i(57361),r=i(56393),a=i(6801),l=i(49066),c=i(39108),u=i(2806);class d{}class p{constructor(e){var t,i,p;switch(this.type=e.type,this.folderId=e.folderId,this.organizationId=e.organizationId,this.name=e.name?e.name.encryptedString:null,this.notes=e.notes?e.notes.encryptedString:null,this.favorite=e.favorite,this.lastKnownRevisionDate=e.revisionDate,this.reprompt=e.reprompt,this.key=null===(t=e.key)||void 0===t?void 0:t.encryptedString,this.type){case n.O.Login:this.login=new c.I,this.login.uris=null!==(p=null===(i=e.login.uris)||void 0===i?void 0:i.map((e=>{const t=new l.l;return t.uri=null!=e.uri?e.uri.encryptedString:null,t.match=null!=e.match?e.match:null,t.uriChecksum=null!=e.uriChecksum?e.uriChecksum.encryptedString:null,t})))&&void 0!==p?p:[],this.login.username=e.login.username?e.login.username.encryptedString:null,this.login.password=e.login.password?e.login.password.encryptedString:null,this.login.passwordRevisionDate=null!=e.login.passwordRevisionDate?e.login.passwordRevisionDate.toISOString():null,this.login.totp=e.login.totp?e.login.totp.encryptedString:null,this.login.autofillOnPageLoad=e.login.autofillOnPageLoad,null!=e.login.fido2Credentials&&(this.login.fido2Credentials=e.login.fido2Credentials.map((e=>{const t=new o.J;return t.credentialId=null!=e.credentialId?e.credentialId.encryptedString:null,t.keyType=null!=e.keyType?e.keyType.encryptedString:null,t.keyAlgorithm=null!=e.keyAlgorithm?e.keyAlgorithm.encryptedString:null,t.keyCurve=null!=e.keyCurve?e.keyCurve.encryptedString:null,t.keyValue=null!=e.keyValue?e.keyValue.encryptedString:null,t.rpId=null!=e.rpId?e.rpId.encryptedString:null,t.rpName=null!=e.rpName?e.rpName.encryptedString:null,t.counter=null!=e.counter?e.counter.encryptedString:null,t.userHandle=null!=e.userHandle?e.userHandle.encryptedString:null,t.userName=null!=e.userName?e.userName.encryptedString:null,t.userDisplayName=null!=e.userDisplayName?e.userDisplayName.encryptedString:null,t.discoverable=null!=e.discoverable?e.discoverable.encryptedString:null,t.creationDate=null!=e.creationDate?e.creationDate.toISOString():null,t})));break;case n.O.SecureNote:this.secureNote=new u.t,this.secureNote.type=e.secureNote.type;break;case n.O.Card:this.card=new s.E,this.card.cardholderName=null!=e.card.cardholderName?e.card.cardholderName.encryptedString:null,this.card.brand=null!=e.card.brand?e.card.brand.encryptedString:null,this.card.number=null!=e.card.number?e.card.number.encryptedString:null,this.card.expMonth=null!=e.card.expMonth?e.card.expMonth.encryptedString:null,this.card.expYear=null!=e.card.expYear?e.card.expYear.encryptedString:null,this.card.code=null!=e.card.code?e.card.code.encryptedString:null;break;case n.O.Identity:this.identity=new a.x,this.identity.title=null!=e.identity.title?e.identity.title.encryptedString:null,this.identity.firstName=null!=e.identity.firstName?e.identity.firstName.encryptedString:null,this.identity.middleName=null!=e.identity.middleName?e.identity.middleName.encryptedString:null,this.identity.lastName=null!=e.identity.lastName?e.identity.lastName.encryptedString:null,this.identity.address1=null!=e.identity.address1?e.identity.address1.encryptedString:null,this.identity.address2=null!=e.identity.address2?e.identity.address2.encryptedString:null,this.identity.address3=null!=e.identity.address3?e.identity.address3.encryptedString:null,this.identity.city=null!=e.identity.city?e.identity.city.encryptedString:null,this.identity.state=null!=e.identity.state?e.identity.state.encryptedString:null,this.identity.postalCode=null!=e.identity.postalCode?e.identity.postalCode.encryptedString:null,this.identity.country=null!=e.identity.country?e.identity.country.encryptedString:null,this.identity.company=null!=e.identity.company?e.identity.company.encryptedString:null,this.identity.email=null!=e.identity.email?e.identity.email.encryptedString:null,this.identity.phone=null!=e.identity.phone?e.identity.phone.encryptedString:null,this.identity.ssn=null!=e.identity.ssn?e.identity.ssn.encryptedString:null,this.identity.username=null!=e.identity.username?e.identity.username.encryptedString:null,this.identity.passportNumber=null!=e.identity.passportNumber?e.identity.passportNumber.encryptedString:null,this.identity.licenseNumber=null!=e.identity.licenseNumber?e.identity.licenseNumber.encryptedString:null}null!=e.fields&&(this.fields=e.fields.map((e=>{const t=new r.P;return t.type=e.type,t.name=e.name?e.name.encryptedString:null,t.value=e.value?e.value.encryptedString:null,t.linkedId=e.linkedId,t}))),null!=e.passwordHistory&&(this.passwordHistory=[],e.passwordHistory.forEach((e=>{this.passwordHistory.push({lastUsedDate:e.lastUsedDate,password:e.password?e.password.encryptedString:null})}))),null!=e.attachments&&(this.attachments={},this.attachments2={},e.attachments.forEach((e=>{const t=e.fileName?e.fileName.encryptedString:null;this.attachments[e.id]=t;const i=new d;i.fileName=t,null!=e.key&&(i.key=e.key.encryptedString),this.attachments2[e.id]=i})))}}},43441:(e,t,i)=>{"use strict";i.d(t,{W:()=>n});class n{constructor(e){this.groups=[],this.users=[],null!=e&&(this.name=e.name?e.name.encryptedString:null,this.externalId=e.externalId)}}},79971:(e,t,i)=>{"use strict";i.d(t,{C:()=>s});var n=i(47910);class s extends n.i{constructor(e){super(e),this.id=e.id}}},47910:(e,t,i)=>{"use strict";i.d(t,{i:()=>n});class n{constructor(e){this.name=e.name?e.name.encryptedString:null}}},74854:(e,t,i)=>{"use strict";i.d(t,{j:()=>s});var n=i(58043);class s extends n.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.url=this.getResponseProperty("Url"),this.fileName=this.getResponseProperty("FileName"),this.key=this.getResponseProperty("Key"),this.size=this.getResponseProperty("Size"),this.sizeName=this.getResponseProperty("SizeName")}}},5094:(e,t,i)=>{"use strict";i.d(t,{r:()=>p});var n=i(58043),s=i(72285),o=i(20601),r=i(56393),a=i(6801),l=i(39108),c=i(2806),u=i(74854);class d extends n.c{constructor(e){super(e),this.password=this.getResponseProperty("Password"),this.lastUsedDate=this.getResponseProperty("LastUsedDate")}}class p extends n.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.folderId=this.getResponseProperty("FolderId")||null,this.type=this.getResponseProperty("Type"),this.name=this.getResponseProperty("Name"),this.notes=this.getResponseProperty("Notes"),this.favorite=this.getResponseProperty("Favorite")||!1,this.edit=!!this.getResponseProperty("Edit"),null==this.getResponseProperty("ViewPassword")?this.viewPassword=!0:this.viewPassword=this.getResponseProperty("ViewPassword"),this.organizationUseTotp=this.getResponseProperty("OrganizationUseTotp"),this.revisionDate=this.getResponseProperty("RevisionDate"),this.collectionIds=this.getResponseProperty("CollectionIds"),this.creationDate=this.getResponseProperty("CreationDate"),this.deletedDate=this.getResponseProperty("DeletedDate");const t=this.getResponseProperty("Login");null!=t&&(this.login=new l.I(t));const i=this.getResponseProperty("Card");null!=i&&(this.card=new o.E(i));const n=this.getResponseProperty("Identity");null!=n&&(this.identity=new a.x(n));const p=this.getResponseProperty("SecureNote");null!=p&&(this.secureNote=new c.t(p));const h=this.getResponseProperty("Fields");null!=h&&(this.fields=h.map((e=>new r.P(e))));const g=this.getResponseProperty("Attachments");null!=g&&(this.attachments=g.map((e=>new u.j(e))));const f=this.getResponseProperty("PasswordHistory");null!=f&&(this.passwordHistory=f.map((e=>new d(e)))),this.reprompt=this.getResponseProperty("Reprompt")||s.N.None,this.key=this.getResponseProperty("Key")||null}}},81687:(e,t,i)=>{"use strict";i.d(t,{QY:()=>a,TO:()=>r,sy:()=>o});var n=i(88652),s=i(58043);class o extends s.c{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.name=this.getResponseProperty("Name"),this.externalId=this.getResponseProperty("ExternalId")}}class r extends o{constructor(e){super(e),this.readOnly=this.getResponseProperty("ReadOnly")||!1,this.manage=this.getResponseProperty("Manage")||!1,this.hidePasswords=this.getResponseProperty("HidePasswords")||!1,this.assigned="collectionDetails"==this.getResponseProperty("object")}}class a extends r{constructor(e){super(e),this.groups=[],this.users=[],this.assigned=this.getResponseProperty("Assigned")||!1;const t=this.getResponseProperty("Groups");null!=t&&(this.groups=t.map((e=>new n.Y(e))));const i=this.getResponseProperty("Users");null!=i&&(this.users=i.map((e=>new n.Y(e))))}}},67175:(e,t,i)=>{"use strict";i.d(t,{w:()=>s});var n=i(55637);class s{constructor(e){this.id=null,this.url=null,this.size=null,this.sizeName=null,this.fileName=null,this.key=null,e&&(this.id=e.id,this.url=e.url,this.size=e.size,this.sizeName=e.sizeName)}get fileSize(){try{if(null!=this.size)return parseInt(this.size,null)}catch(e){}return 0}static fromJSON(e){const t=null==e.key?null:n.N.fromJSON(e.key);return Object.assign(new s,e,{key:t})}}},57387:(e,t,i)=>{"use strict";i.d(t,{_:()=>l});var n=i(89474),s=i(28805),o=i(85129),r=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},a=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class l extends o.A{constructor(){super(...arguments),this.cardholderName=null,this.expMonth=null,this.expYear=null,this.code=null,this._brand=null,this._number=null,this._subTitle=null}get maskedCode(){return null!=this.code?"•".repeat(this.code.length):null}get maskedNumber(){return null!=this.number?"•".repeat(this.number.length):null}get brand(){return this._brand}set brand(e){this._brand=e,this._subTitle=null}get number(){return this._number}set number(e){this._number=e,this._subTitle=null}get subTitle(){if(null==this._subTitle&&(this._subTitle=this.brand,null!=this.number&&this.number.length>=4)){null!=this._subTitle&&""!==this._subTitle?this._subTitle+=", ":this._subTitle="";const e=this.number.length>=5&&null!=this.number.match(new RegExp("^3[47]"))?5:4;this._subTitle+="*"+this.number.substr(this.number.length-e)}return this._subTitle}get expiration(){if(!this.expMonth&&!this.expYear)return null;let e=null!=this.expMonth?("0"+this.expMonth).slice(-2):"__";return e+=" / "+(null!=this.expYear?this.formatYear(this.expYear):"____"),e}formatYear(e){return 2===e.length?"20"+e:e}static fromJSON(e){return Object.assign(new l,e)}static getCardBrandByPatterns(e){if(null==e||"string"!=typeof e||""===e.trim())return null;let t=new RegExp("^4");return null!=e.match(t)?"Visa":/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/.test(e)?"Mastercard":(t=new RegExp("^3[47]"),null!=e.match(t)?"Amex":(t=new RegExp("^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)"),null!=e.match(t)?"Discover":(t=new RegExp("^36"),null!=e.match(t)?"Diners Club":(t=new RegExp("^30[0-5]"),null!=e.match(t)?"Diners Club":(t=new RegExp("^35(2[89]|[3-8][0-9])"),null!=e.match(t)?"JCB":(t=new RegExp("^(4026|417500|4508|4844|491(3|7))"),null!=e.match(t)?"Visa":null))))))}}r([(0,s.B)(n.Wp.CardholderName),a("design:type",String)],l.prototype,"cardholderName",void 0),r([(0,s.B)(n.Wp.ExpMonth,"expirationMonth"),a("design:type",String)],l.prototype,"expMonth",void 0),r([(0,s.B)(n.Wp.ExpYear,"expirationYear"),a("design:type",String)],l.prototype,"expYear",void 0),r([(0,s.B)(n.Wp.Code,"securityCode"),a("design:type",String)],l.prototype,"code",void 0),r([(0,s.B)(n.Wp.Brand),a("design:type",String),a("design:paramtypes",[String])],l.prototype,"brand",null),r([(0,s.B)(n.Wp.Number),a("design:type",String),a("design:paramtypes",[String])],l.prototype,"number",null)},53061:(e,t,i)=>{"use strict";i.d(t,{$:()=>h});var n=i(82570),s=i(72285),o=i(31182),r=i(67175),a=i(57387),l=i(11612),c=i(15091),u=i(60712),d=i(42937),p=i(54976);class h{constructor(e){var t;this.initializerKey=n.n.CipherView,this.id=null,this.organizationId=null,this.folderId=null,this.name=null,this.notes=null,this.type=null,this.favorite=!1,this.organizationUseTotp=!1,this.edit=!1,this.viewPassword=!0,this.login=new u.q,this.identity=new c.t,this.card=new a._,this.secureNote=new p.z,this.attachments=null,this.fields=null,this.passwordHistory=null,this.collectionIds=null,this.revisionDate=null,this.creationDate=null,this.deletedDate=null,this.reprompt=s.N.None,e&&(this.id=e.id,this.organizationId=e.organizationId,this.folderId=e.folderId,this.favorite=e.favorite,this.organizationUseTotp=e.organizationUseTotp,this.edit=e.edit,this.viewPassword=e.viewPassword,this.type=e.type,this.localData=e.localData,this.collectionIds=e.collectionIds,this.revisionDate=e.revisionDate,this.creationDate=e.creationDate,this.deletedDate=e.deletedDate,this.reprompt=null!==(t=e.reprompt)&&void 0!==t?t:s.N.None)}get item(){switch(this.type){case o.O.Login:return this.login;case o.O.SecureNote:return this.secureNote;case o.O.Card:return this.card;case o.O.Identity:return this.identity}return null}get subTitle(){var e;return null===(e=this.item)||void 0===e?void 0:e.subTitle}get hasPasswordHistory(){return this.passwordHistory&&this.passwordHistory.length>0}get hasAttachments(){return this.attachments&&this.attachments.length>0}get hasOldAttachments(){if(this.hasAttachments)for(let e=0;e<this.attachments.length;e++)if(null==this.attachments[e].key)return!0;return!1}get hasFields(){return this.fields&&this.fields.length>0}get passwordRevisionDisplayDate(){return this.type!==o.O.Login||null==this.login||null==this.login.password||""===this.login.password?null:this.login.passwordRevisionDate}get isDeleted(){return null!=this.deletedDate}get linkedFieldOptions(){var e;return null===(e=this.item)||void 0===e?void 0:e.linkedFieldOptions}linkedFieldValue(e){var t;const i=null===(t=this.linkedFieldOptions)||void 0===t?void 0:t.get(e);if(null==i)return null;this.item;return this.item[i.propertyKey]}linkedFieldI18nKey(e){var t;return null===(t=this.linkedFieldOptions.get(e))||void 0===t?void 0:t.i18nKey}toJSON(){return this}static fromJSON(e){var t,i,n;if(null==e)return null;const s=new h,g=null==e.revisionDate?null:new Date(e.revisionDate),f=null==e.deletedDate?null:new Date(e.deletedDate),m=null===(t=e.attachments)||void 0===t?void 0:t.map((e=>r.w.fromJSON(e))),v=null===(i=e.fields)||void 0===i?void 0:i.map((e=>l.k.fromJSON(e))),y=null===(n=e.passwordHistory)||void 0===n?void 0:n.map((e=>d.i.fromJSON(e)));switch(Object.assign(s,e,{revisionDate:g,deletedDate:f,attachments:m,fields:v,passwordHistory:y}),e.type){case o.O.Card:s.card=a._.fromJSON(e.card);break;case o.O.Identity:s.identity=c.t.fromJSON(e.identity);break;case o.O.Login:s.login=u.q.fromJSON(e.login);break;case o.O.SecureNote:s.secureNote=p.z.fromJSON(e.secureNote)}return s}}},23666:(e,t,i)=>{"use strict";i.d(t,{k:()=>o,n:()=>r});var n=i(54193),s=i(81687);const o="/";class r{constructor(e){this.id=null,this.organizationId=null,this.name=null,this.externalId=null,this.readOnly=null,this.hidePasswords=null,this.manage=null,this.assigned=null,e&&(this.id=e.id,this.organizationId=e.organizationId,this.externalId=e.externalId,e instanceof n.F&&(this.readOnly=e.readOnly,this.hidePasswords=e.hidePasswords,this.manage=e.manage,this.assigned=!0),e instanceof s.QY&&(this.assigned=e.assigned))}canEditItems(e,t){if(null!=e&&e.id!==this.organizationId)throw new Error("Id of the organization provided does not match the org id of the collection.");return(null==e?void 0:e.flexibleCollections)?(null==e?void 0:e.canEditAllCiphers(t))||this.manage||this.assigned&&!this.readOnly:(null==e?void 0:e.canEditAnyCollection(!1))||(null==e?void 0:e.canEditAssignedCollections)&&this.assigned}canEdit(e,t){if(null!=e&&e.id!==this.organizationId)throw new Error("Id of the organization provided does not match the org id of the collection.");return(null==e?void 0:e.flexibleCollections)?(null==e?void 0:e.canEditAnyCollection(t))||this.manage:(null==e?void 0:e.canEditAnyCollection(t))||(null==e?void 0:e.canEditAssignedCollections)}canDelete(e){if(null!=e&&e.id!==this.organizationId)throw new Error("Id of the organization provided does not match the org id of the collection.");return(null==e?void 0:e.flexibleCollections)?(null==e?void 0:e.canDeleteAnyCollection)||!(null==e?void 0:e.limitCollectionCreationDeletion)&&this.manage:(null==e?void 0:e.canDeleteAnyCollection)||(null==e?void 0:e.canDeleteAssignedCollections)}static fromJSON(e){return Object.assign(new r(new n.F),e)}}},90189:(e,t,i)=>{"use strict";i.d(t,{X:()=>s});var n=i(85129);class s extends n.A{constructor(){super(...arguments),this.creationDate=null}get subTitle(){return this.userDisplayName}static fromJSON(e){const t=null!=e.creationDate?new Date(e.creationDate):null;return Object.assign(new s,e,{creationDate:t})}}},11612:(e,t,i)=>{"use strict";i.d(t,{k:()=>n});class n{constructor(e){this.name=null,this.value=null,this.type=null,this.newField=!1,this.showValue=!1,this.showCount=!1,this.linkedId=null,e&&(this.type=e.type,this.linkedId=e.linkedId)}get maskedValue(){return null!=this.value?"••••••••":null}static fromJSON(e){return Object.assign(new n,e)}}},90364:(e,t,i)=>{"use strict";i.d(t,{a:()=>n});class n{constructor(e){this.id=null,this.name=null,this.revisionDate=null,e&&(this.id=e.id,this.revisionDate=e.revisionDate)}static fromJSON(e){const t=null==e.revisionDate?null:new Date(e.revisionDate);return Object.assign(new n,e,{revisionDate:t})}}},15091:(e,t,i)=>{"use strict";i.d(t,{t:()=>c});var n=i(27646),s=i(89474),o=i(28805),r=i(85129),a=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},l=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class c extends r.A{constructor(){super(),this.title=null,this.middleName=null,this.address1=null,this.address2=null,this.address3=null,this.city=null,this.state=null,this.postalCode=null,this.country=null,this.company=null,this.email=null,this.phone=null,this.ssn=null,this.username=null,this.passportNumber=null,this.licenseNumber=null,this._firstName=null,this._lastName=null,this._subTitle=null}get firstName(){return this._firstName}set firstName(e){this._firstName=e,this._subTitle=null}get lastName(){return this._lastName}set lastName(e){this._lastName=e,this._subTitle=null}get subTitle(){return null!=this._subTitle||null==this.firstName&&null==this.lastName||(this._subTitle="",null!=this.firstName&&(this._subTitle=this.firstName),null!=this.lastName&&(""!==this._subTitle&&(this._subTitle+=" "),this._subTitle+=this.lastName)),this._subTitle}get fullName(){if(null!=this.title||null!=this.firstName||null!=this.middleName||null!=this.lastName){let e="";return null!=this.title&&(e+=this.title+" "),null!=this.firstName&&(e+=this.firstName+" "),null!=this.middleName&&(e+=this.middleName+" "),null!=this.lastName&&(e+=this.lastName),e.trim()}return null}get fullAddress(){let e=this.address1;return n.c.isNullOrWhitespace(this.address2)||(n.c.isNullOrWhitespace(e)||(e+=", "),e+=this.address2),n.c.isNullOrWhitespace(this.address3)||(n.c.isNullOrWhitespace(e)||(e+=", "),e+=this.address3),e}get fullAddressPart2(){if(null==this.city&&null==this.state&&null==this.postalCode)return null;const e=this.city||"-",t=this.state,i=this.postalCode||"-";let s=e;return n.c.isNullOrWhitespace(t)||(s+=", "+t),s+=", "+i,s}static fromJSON(e){return Object.assign(new c,e)}}a([(0,o.B)(s.LC.Title),l("design:type",String)],c.prototype,"title",void 0),a([(0,o.B)(s.LC.MiddleName),l("design:type",String)],c.prototype,"middleName",void 0),a([(0,o.B)(s.LC.Address1),l("design:type",String)],c.prototype,"address1",void 0),a([(0,o.B)(s.LC.Address2),l("design:type",String)],c.prototype,"address2",void 0),a([(0,o.B)(s.LC.Address3),l("design:type",String)],c.prototype,"address3",void 0),a([(0,o.B)(s.LC.City,"cityTown"),l("design:type",String)],c.prototype,"city",void 0),a([(0,o.B)(s.LC.State,"stateProvince"),l("design:type",String)],c.prototype,"state",void 0),a([(0,o.B)(s.LC.PostalCode,"zipPostalCode"),l("design:type",String)],c.prototype,"postalCode",void 0),a([(0,o.B)(s.LC.Country),l("design:type",String)],c.prototype,"country",void 0),a([(0,o.B)(s.LC.Company),l("design:type",String)],c.prototype,"company",void 0),a([(0,o.B)(s.LC.Email),l("design:type",String)],c.prototype,"email",void 0),a([(0,o.B)(s.LC.Phone),l("design:type",String)],c.prototype,"phone",void 0),a([(0,o.B)(s.LC.Ssn),l("design:type",String)],c.prototype,"ssn",void 0),a([(0,o.B)(s.LC.Username),l("design:type",String)],c.prototype,"username",void 0),a([(0,o.B)(s.LC.PassportNumber),l("design:type",String)],c.prototype,"passportNumber",void 0),a([(0,o.B)(s.LC.LicenseNumber),l("design:type",String)],c.prototype,"licenseNumber",void 0),a([(0,o.B)(s.LC.FirstName),l("design:type",String),l("design:paramtypes",[String])],c.prototype,"firstName",null),a([(0,o.B)(s.LC.LastName),l("design:type",String),l("design:paramtypes",[String])],c.prototype,"lastName",null),a([(0,o.B)(s.LC.FullName),l("design:type",String),l("design:paramtypes",[])],c.prototype,"fullName",null)},85129:(e,t,i)=>{"use strict";i.d(t,{A:()=>n});class n{}},95896:(e,t,i)=>{"use strict";i.d(t,{E:()=>r});var n=i(66469),s=i(1661),o=i(27646);class r{constructor(e){this.match=null,this._uri=null,this._domain=null,this._hostname=null,this._host=null,this._canLaunch=null,e&&(this.match=e.match)}get uri(){return this._uri}set uri(e){this._uri=e,this._domain=null,this._canLaunch=null}get domain(){return null==this._domain&&null!=this.uri&&(this._domain=o.c.getDomain(this.uri),""===this._domain&&(this._domain=null)),this._domain}get hostname(){return this.match===n.s.RegularExpression?null:(null==this._hostname&&null!=this.uri&&(this._hostname=o.c.getHostname(this.uri),""===this._hostname&&(this._hostname=null)),this._hostname)}get host(){return this.match===n.s.RegularExpression?null:(null==this._host&&null!=this.uri&&(this._host=o.c.getHost(this.uri),""===this._host&&(this._host=null)),this._host)}get hostnameOrUri(){return null!=this.hostname?this.hostname:this.uri}get hostOrUri(){return null!=this.host?this.host:this.uri}get isWebsite(){return null!=this.uri&&(0===this.uri.indexOf("http://")||0===this.uri.indexOf("https://")||this.uri.indexOf("://")<0&&!o.c.isNullOrWhitespace(o.c.getDomain(this.uri)))}get canLaunch(){return null!=this._canLaunch||(null!=this.uri&&this.match!==n.s.RegularExpression?this._canLaunch=s.f.canLaunch(this.launchUri):this._canLaunch=!1),this._canLaunch}get launchUri(){return this.uri.indexOf("://")<0&&!o.c.isNullOrWhitespace(o.c.getDomain(this.uri))?"http://"+this.uri:this.uri}static fromJSON(e){return Object.assign(new r,e)}matchesUri(e,t,i=null){var s;if(!this.uri||!e)return!1;let r=null!==(s=this.match)&&void 0!==s?s:i;null!=r||(r=n.s.Domain);const a=o.c.getDomain(e),l=t.add(a);switch(r){case n.s.Domain:return this.matchesDomain(e,l);case n.s.Host:{const t=o.c.getHost(e);return null!=t&&t===o.c.getHost(this.uri)}case n.s.Exact:return e===this.uri;case n.s.StartsWith:return e.startsWith(this.uri);case n.s.RegularExpression:try{return new RegExp(this.uri,"i").test(e)}catch(c){return!1}case n.s.Never:return!1}return!1}matchesDomain(e,t){if(null==e||null==this.domain||!t.has(this.domain))return!1;if(o.c.DomainMatchBlacklist.has(this.domain)){const t=o.c.getHost(e);return!o.c.DomainMatchBlacklist.get(this.domain).has(t)}return!0}}},60712:(e,t,i)=>{"use strict";i.d(t,{q:()=>d});var n=i(27646),s=i(89474),o=i(28805),r=i(90189),a=i(85129),l=i(95896),c=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},u=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class d extends a.A{constructor(e){super(),this.username=null,this.password=null,this.passwordRevisionDate=null,this.totp=null,this.uris=[],this.autofillOnPageLoad=null,this.fido2Credentials=null,e&&(this.passwordRevisionDate=e.passwordRevisionDate,this.autofillOnPageLoad=e.autofillOnPageLoad)}get uri(){return this.hasUris?this.uris[0].uri:null}get maskedPassword(){return null!=this.password?"••••••••":null}get subTitle(){return this.username}get canLaunch(){return this.hasUris&&this.uris.some((e=>e.canLaunch))}get hasTotp(){return!n.c.isNullOrWhitespace(this.totp)}get launchUri(){if(this.hasUris){const e=this.uris.find((e=>e.canLaunch));if(null!=e)return e.launchUri}return null}get hasUris(){return null!=this.uris&&this.uris.length>0}get hasFido2Credentials(){return null!=this.fido2Credentials&&this.fido2Credentials.length>0}matchesUri(e,t,i=null){return null!=this.uris&&this.uris.some((n=>n.matchesUri(e,t,i)))}static fromJSON(e){var t;const i=null==e.passwordRevisionDate?null:new Date(e.passwordRevisionDate),n=e.uris.map((e=>l.E.fromJSON(e))),s=null===(t=e.fido2Credentials)||void 0===t?void 0:t.map((e=>r.X.fromJSON(e)));return Object.assign(new d,e,{passwordRevisionDate:i,uris:n,fido2Credentials:s})}}c([(0,o.B)(s.qA.Username),u("design:type",String)],d.prototype,"username",void 0),c([(0,o.B)(s.qA.Password),u("design:type",String)],d.prototype,"password",void 0)},42937:(e,t,i)=>{"use strict";i.d(t,{i:()=>n});class n{constructor(e){this.password=null,this.lastUsedDate=null,e&&(this.lastUsedDate=e.lastUsedDate)}static fromJSON(e){const t=null==e.lastUsedDate?null:new Date(e.lastUsedDate);return Object.assign(new n,e,{lastUsedDate:t})}}},54976:(e,t,i)=>{"use strict";i.d(t,{z:()=>s});var n=i(85129);class s extends n.A{constructor(e){super(),this.type=null,e&&(this.type=e.type)}get subTitle(){return null}static fromJSON(e){return Object.assign(new s,e)}}},39194:(e,t,i)=>{"use strict";i.d(t,{L:()=>s});var n=i(94441);class s{static nestedTraverse(e,t,i,o,r,a){if(i.length<=t)return;const l=t===i.length-1,c=i[t];for(let u=0;u<e.length;u++)if(e[u].node.name===c)return l&&e[u].node.id!==o.id?void e.push(new n.O(o,r,c)):void s.nestedTraverse(e[u].children,t+1,i,o,e[u],a);if(0===e.filter((e=>e.node.name===c)).length){if(l)return void e.push(new n.O(o,r,c));const u=c+a+i[t+1];s.nestedTraverse(e,0,[u,...i.slice(t+2)],o,r,a)}}static getTreeNodeObject(e,t){if(e.node.id===t)return e;for(let i=0;i<e.children.length;i++)if(null!=e.children[i].children){const n=s.getTreeNodeObject(e.children[i],t);if(null!==n)return n}return null}static getTreeNodeObjectFromList(e,t){for(let i=0;i<e.length;i++){if(e[i].node.id===t)return e[i];if(null!=e[i].children){const n=s.getTreeNodeObjectFromList(e[i].children,t);if(null!==n)return n}}return null}}},2012:(e,t,i)=>{"use strict";i.d(t,{G:()=>o});var n=i(36903),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.m]})},98205:(e,t,i)=>{"use strict";i.d(t,{Q:()=>g});var n=i(54019),s=i(59554),o=i(80060),r=i(59459),a=i(68362),l=i(43822),c=i(85762),u=i(11394),d=i(14494),p=i(66459),h=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class g{constructor(e,t,i){this.buttonComponent=e,this.validationService=t,this.logService=i,this.destroy$=new n.x,this._loading$=new s.X(!1),this.disabled=!1,this.loading$=this._loading$.asObservable()}get loading(){return this._loading$.value}set loading(e){this._loading$.next(e),this.buttonComponent.loading=e}onClick(){return h(this,void 0,void 0,(function*(){!this.handler||this.loading||this.disabled||this.buttonComponent.disabled||(this.loading=!0,(0,l.W)(this.handler).pipe((0,o.b)({error:e=>{var t,i;null===(t=this.logService)||void 0===t||t.error(`Async action exception: ${e}`),null===(i=this.validationService)||void 0===i||i.showError(e)}}),(0,r.x)((()=>this.loading=!1)),(0,a.R)(this.destroy$)).subscribe())}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}g.ɵfac=function(e){return new(e||g)(c.Y36(u.x),c.Y36(d.R,8),c.Y36(p.$,8))},g.ɵdir=c.lG2({type:g,selectors:[["","bitAction",""]],hostBindings:function(e,t){1&e&&c.NdJ("click",(function(){return t.onClick()}))},inputs:{handler:["bitAction","handler"]}})},36338:(e,t,i)=>{"use strict";i.d(t,{u:()=>f});var n=i(54019),s=i(59554),o=i(67775),r=i(30359),a=i(79596),l=i(92716),c=i(68362),u=i(43822),d=i(85762),p=i(37513),h=i(14494),g=i(66459);class f{constructor(e,t,i){this.formGroupDirective=e,this.destroy$=new n.x,this._loading$=new s.X(!1),this._disabled$=new s.X(!1),this.allowDisabledFormSubmit=!1,this.loading$=this._loading$.asObservable(),this.disabled$=this._disabled$.asObservable(),e.ngSubmit.pipe((0,o.h)((()=>!this.disabled)),(0,r.w)((()=>{const e=(0,u.W)(this.handler);return this.loading=!0,e.pipe((0,a.K)((e=>(null==i||i.error(`Async submit exception: ${e}`),null==t||t.showError(e),(0,l.of)(void 0)))))})),(0,c.R)(this.destroy$)).subscribe({next:()=>this.loading=!1,complete:()=>this.loading=!1})}ngOnInit(){this.formGroupDirective.statusChanges.pipe((0,c.R)(this.destroy$)).subscribe((e=>{this.allowDisabledFormSubmit?this._disabled$.next(!1):this._disabled$.next("DISABLED"===e)}))}get disabled(){return this._disabled$.value}set disabled(e){this._disabled$.next(e)}get loading(){return this._loading$.value}set loading(e){this.disabled=e,this._loading$.next(e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}f.ɵfac=function(e){return new(e||f)(d.Y36(p.sg),d.Y36(h.R,8),d.Y36(g.$,8))},f.ɵdir=d.lG2({type:f,selectors:[["","formGroup","","bitSubmit",""]],inputs:{handler:["bitSubmit","handler"],allowDisabledFormSubmit:"allowDisabledFormSubmit"}})},46246:(e,t,i)=>{"use strict";i.d(t,{b:()=>c});var n=i(54019),s=i(68362),o=i(85762),r=i(11394),a=i(36338),l=i(98205);class c{constructor(e,t,i){this.destroy$=new n.x,t&&e&&(t.loading$.pipe((0,s.R)(this.destroy$)).subscribe((t=>{"submit"===this.type?e.loading=t:e.disabled=t})),t.disabled$.pipe((0,s.R)(this.destroy$)).subscribe((t=>{!1!==this.disabled&&(e.disabled=t)}))),t&&i&&(i.loading$.pipe((0,s.R)(this.destroy$)).subscribe((e=>{t.disabled=e})),t.disabled$.pipe((0,s.R)(this.destroy$)).subscribe((e=>{i.disabled=e})))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}c.ɵfac=function(e){return new(e||c)(o.Y36(r.x),o.Y36(a.u,8),o.Y36(l.Q,8))},c.ɵdir=o.lG2({type:c,selectors:[["button","bitFormButton",""]],inputs:{type:"type",disabled:"disabled"}})},14970:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var n=i(27646),s=i(85762),o=i(68088),r=i(28508);function a(e,t){if(1&e&&s._UZ(0,"img",1),2&e){const e=s.oxw();s.s9C("title",e.title||e.text),s.Q6J("src",e.src,s.LSH)("ngClass",e.classList)}}const l={xlarge:["tw-h-24","tw-w-24"],large:["tw-h-16","tw-w-16"],default:["tw-h-10","tw-w-10"],small:["tw-h-7","tw-w-7"],xsmall:["tw-h-6","tw-w-6"]};class c{constructor(e){this.sanitizer=e,this.border=!1,this.size="default",this.svgCharCount=2,this.svgFontSize=20,this.svgFontWeight=300,this.svgSize=48}ngOnChanges(){this.generate()}get classList(){var e;return["tw-rounded-full"].concat(null!==(e=l[this.size])&&void 0!==e?e:[]).concat(this.border?["tw-border","tw-border-solid","tw-border-secondary-600"]:[])}generate(){var e,t;let i=null;const s=null!==(t=null===(e=this.text)||void 0===e?void 0:e.toUpperCase())&&void 0!==t?t:"";let o;i=this.getFirstLetters(s,this.svgCharCount),null==i&&(i=this.unicodeSafeSubstring(s,this.svgCharCount)),i.match(n.c.regexpEmojiPresentation)&&(i=i.match(n.c.regexpEmojiPresentation)[0]);let r=this.color;n.c.isNullOrWhitespace(this.color)?n.c.isNullOrWhitespace(this.id)?(r=n.c.stringToColor(s),o=this.createSvgElement(this.svgSize,r)):(r=n.c.stringToColor(this.id.toString()),o=this.createSvgElement(this.svgSize,r)):o=this.createSvgElement(this.svgSize,r);const a=this.createTextElement(i,r);o.appendChild(a);const l=window.document.createElement("div").appendChild(o).outerHTML,c=window.btoa(unescape(encodeURIComponent(l)));this.src=this.sanitizer.bypassSecurityTrustResourceUrl("data:image/svg+xml;base64,"+c)}getFirstLetters(e,t){const i=e.split(" ");if(i.length>1){let e="";for(let n=0;n<t;n++)e+=this.unicodeSafeSubstring(i[n],1);return e}return null}createSvgElement(e,t){const i=window.document.createElement("svg");return i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("pointer-events","none"),i.setAttribute("width",e.toString()),i.setAttribute("height",e.toString()),i.style.backgroundColor=t,i.style.width=e+"px",i.style.height=e+"px",i}createTextElement(e,t){const i=window.document.createElement("text");return i.setAttribute("text-anchor","middle"),i.setAttribute("y","50%"),i.setAttribute("x","50%"),i.setAttribute("dy","0.35em"),i.setAttribute("pointer-events","auto"),i.setAttribute("fill",n.c.pickTextColorBasedOnBgColor(t,135,!0)),i.setAttribute("font-family",'"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"'),i.textContent=e,i.style.fontWeight=this.svgFontWeight.toString(),i.style.fontSize=this.svgFontSize+"px",i}unicodeSafeSubstring(e,t){const i=e.match(/./gu);return null!=i?i.slice(0,t).join(""):""}}c.ɵfac=function(e){return new(e||c)(s.Y36(o.H7))},c.ɵcmp=s.Xpm({type:c,selectors:[["bit-avatar"]],inputs:{border:"border",color:"color",id:"id",text:"text",title:"title",size:"size"},features:[s.TTD],decls:1,vars:1,consts:[[3,"src","title","ngClass",4,"ngIf"],[3,"src","title","ngClass"]],template:function(e,t){1&e&&s.YNc(0,a,1,3,"img",0),2&e&&s.Q6J("ngIf",t.src)},dependencies:[r.mk,r.O5],encapsulation:2})},1874:(e,t,i)=>{"use strict";i.d(t,{b:()=>u});var n=i(85762),s=i(28508),o=i(66385),r=i(49399);function a(e,t){1&e&&(n.TgZ(0,"span",5),n._uU(1,", "),n.qZA())}function l(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n    "),n.TgZ(2,"span",3),n._uU(3),n.qZA(),n._uU(4,"\n    "),n.YNc(5,a,2,0,"span",4),n._uU(6,"\n  "),n.BQk()),2&e){const e=t.$implicit,i=t.last,s=n.oxw();n.xp6(2),n.Q6J("variant",s.variant)("truncate",s.truncate),n.xp6(1),n.hij("\n      ",e,"\n    "),n.xp6(2),n.Q6J("ngIf",!i||s.isFiltered)}}function c(e,t){if(1&e&&(n.TgZ(0,"span",6),n._uU(1),n.ALo(2,"i18n"),n.qZA()),2&e){const e=n.oxw();n.Q6J("variant",e.variant),n.xp6(1),n.hij("\n    ",n.xi3(2,2,"plusNMore",(e.items.length-e.filteredItems.length).toString()),"\n  ")}}class u{constructor(){this.filteredItems=[],this.isFiltered=!1,this.variant="primary",this.items=[],this.truncate=!0}get maxItems(){return this._maxItems}set maxItems(e){this._maxItems=null==e?void 0:Math.max(1,e)}ngOnChanges(){null==this.maxItems||this.items.length<=this.maxItems?this.filteredItems=this.items:this.filteredItems=this.items.slice(0,this.maxItems-1),this.isFiltered=this.items.length>this.filteredItems.length}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=n.Xpm({type:u,selectors:[["bit-badge-list"]],inputs:{variant:"variant",items:"items",truncate:"truncate",maxItems:"maxItems"},features:[n.TTD],decls:7,vars:2,consts:[[1,"tw-inline-flex","tw-flex-wrap","tw-gap-2"],[4,"ngFor","ngForOf"],["bitBadge","",3,"variant",4,"ngIf"],["bitBadge","",3,"variant","truncate"],["class","tw-sr-only",4,"ngIf"],[1,"tw-sr-only"],["bitBadge","",3,"variant"]],template:function(e,t){1&e&&(n.TgZ(0,"div",0),n._uU(1,"\n  "),n.YNc(2,l,7,4,"ng-container",1),n._uU(3,"\n  "),n.YNc(4,c,3,5,"span",2),n._uU(5,"\n"),n.qZA(),n._uU(6,"\n")),2&e&&(n.xp6(2),n.Q6J("ngForOf",t.filteredItems),n.xp6(2),n.Q6J("ngIf",t.isFiltered))},dependencies:[s.sg,s.O5,o.l,r.C],encapsulation:2})},66385:(e,t,i)=>{"use strict";i.d(t,{l:()=>a});var n=i(62348),s=i(85762);const o={primary:["tw-bg-primary-600"],secondary:["tw-bg-text-muted"],success:["tw-bg-success-600"],danger:["tw-bg-danger-600"],warning:["tw-bg-warning-600"],info:["tw-bg-info-600"]},r={primary:["hover:tw-bg-primary-700"],secondary:["hover:tw-bg-secondary-700"],success:["hover:tw-bg-success-700"],danger:["hover:tw-bg-danger-700"],warning:["hover:tw-bg-warning-700"],info:["hover:tw-bg-info-700"]};class a{get classList(){return["tw-inline-block","tw-py-0.5","tw-px-1.5","tw-font-bold","tw-text-center","tw-align-text-top","!tw-text-contrast","tw-rounded","tw-border-none","tw-box-border","tw-whitespace-nowrap","tw-text-xs","hover:tw-no-underline","focus:tw-outline-none","focus:tw-ring","focus:tw-ring-offset-2","focus:tw-ring-primary-700"].concat(o[this.variant]).concat(this.hasHoverEffects?r[this.variant]:[]).concat(this.truncate?["tw-truncate","tw-max-w-40"]:[])}get title(){return this.truncate?this.el.nativeElement.textContent.trim():null}getFocusTarget(){return this.el.nativeElement}constructor(e){var t;this.el=e,this.variant="primary",this.truncate=!0,this.hasHoverEffects=!1,this.hasHoverEffects="SPAN"!=(null===(t=null==e?void 0:e.nativeElement)||void 0===t?void 0:t.nodeName)}}a.ɵfac=function(e){return new(e||a)(s.Y36(s.SBq))},a.ɵdir=s.lG2({type:a,selectors:[["span","bitBadge",""],["a","bitBadge",""],["button","bitBadge",""]],hostVars:3,hostBindings:function(e,t){2&e&&(s.uIk("title",t.title),s.Tol(t.classList))},inputs:{variant:"variant",truncate:"truncate"},features:[s._Bn([{provide:n.l,useExisting:a}])]})},47404:(e,t,i)=>{"use strict";i.d(t,{T:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.ez]})},40041:(e,t,i)=>{"use strict";i.d(t,{S:()=>u});var n=i(85762),s=i(28508),o=i(21656),r=i(49399);function a(e,t){if(1&e&&n._UZ(0,"i",4),2&e){const e=n.oxw();n.Q6J("ngClass",e.icon)}}function l(e,t){if(1&e){const e=n.EpF();n.TgZ(0,"button",5),n.NdJ("click",(function(){n.CHM(e);const t=n.oxw();return n.KtG(t.onClose.emit())})),n.ALo(1,"i18n"),n.ALo(2,"i18n"),n.qZA()}2&e&&n.uIk("title",n.lcZ(1,2,"close"))("aria-label",n.lcZ(2,4,"close"))}const c={premium:"bwi-star",info:"bwi-info-circle",warning:"bwi-exclamation-triangle",danger:"bwi-error"};class u{constructor(){this.bannerType="info",this.useAlertRole=!0,this.showClose=!0,this.onClose=new n.vpe}ngOnInit(){var e;null!==(e=this.icon)&&void 0!==e||(this.icon=c[this.bannerType])}get bannerClass(){switch(this.bannerType){case"danger":return"tw-bg-danger-600";case"info":return"tw-bg-info-600";case"premium":return"tw-bg-success-600";case"warning":return"tw-bg-warning-600"}}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=n.Xpm({type:u,selectors:[["bit-banner"]],inputs:{bannerType:"bannerType",icon:"icon",useAlertRole:"useAlertRole",showClose:"showClose"},outputs:{onClose:"onClose"},ngContentSelectors:["*"],decls:12,vars:5,consts:[[1,"tw-flex","tw-items-center","tw-gap-2","tw-p-2","tw-pl-4","tw-text-contrast","tw-border-transparent","tw-bg-clip-padding","tw-border-solid","tw-border-b","tw-border-0",3,"ngClass"],["class","bwi tw-align-middle tw-text-base","aria-hidden","true",3,"ngClass",4,"ngIf"],[1,"tw-grow","tw-text-base"],["type","button","bitIconButton","bwi-close","buttonType","contrast","size","default",3,"click",4,"ngIf"],["aria-hidden","true",1,"bwi","tw-align-middle","tw-text-base",3,"ngClass"],["type","button","bitIconButton","bwi-close","buttonType","contrast","size","default",3,"click"]],template:function(e,t){1&e&&(n.F$t(),n.TgZ(0,"div",0),n._uU(1,"\n  "),n.YNc(2,a,1,1,"i",1),n._uU(3,"\n  "),n.TgZ(4,"span",2),n._uU(5,"\n    "),n.Hsn(6),n._uU(7,"\n  "),n.qZA(),n._uU(8,"\n  "),n.YNc(9,l,3,6,"button",3),n._uU(10,"\n"),n.qZA(),n._uU(11,"\n")),2&e&&(n.Q6J("ngClass",t.bannerClass),n.uIk("role",t.useAlertRole?"status":null)("aria-live",t.useAlertRole?"polite":null),n.xp6(2),n.Q6J("ngIf",t.icon),n.xp6(7),n.Q6J("ngIf",t.showClose))},dependencies:[s.mk,s.O5,o.Q,r.C],encapsulation:2})},49781:(e,t,i)=>{"use strict";i.d(t,{s:()=>a});var n=i(28508),s=i(41938),o=i(36903),r=i(85762);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=r.oAB({type:a}),a.ɵinj=r.cJS({imports:[n.ez,o.m,s.v]})},93814:(e,t,i)=>{"use strict";i.d(t,{L:()=>a});var n=i(85762),s=i(28508);function o(e,t){if(1&e&&n._UZ(0,"i",1),2&e){const e=n.oxw(2);n.Gre("bwi ",e.icon," !tw-mr-2")}}function r(e,t){if(1&e&&(n._uU(0,"\n  "),n.YNc(1,o,1,3,"i",0),n.Hsn(2),n._uU(3,"\n")),2&e){const e=n.oxw();n.xp6(1),n.Q6J("ngIf",e.icon)}}class a{constructor(){this.route=void 0,this.queryParams={},this.click=new n.vpe}onClick(e){this.click.next(e)}}a.ɵfac=function(e){return new(e||a)},a.ɵcmp=n.Xpm({type:a,selectors:[["bit-breadcrumb"]],viewQuery:function(e,t){if(1&e&&n.Gf(n.Rgc,7),2&e){let e;n.iGM(e=n.CRH())&&(t.content=e.first)}},inputs:{icon:"icon",route:"route",queryParams:"queryParams",queryParamsHandling:"queryParamsHandling"},outputs:{click:"click"},ngContentSelectors:["*"],decls:2,vars:0,consts:[["aria-hidden","true",3,"class",4,"ngIf"],["aria-hidden","true"]],template:function(e,t){1&e&&(n.F$t(),n.YNc(0,r,4,1,"ng-template"),n._uU(1,"\n"))},dependencies:[s.O5],encapsulation:2})},8427:(e,t,i)=>{"use strict";i.d(t,{n:()=>x});var n=i(93814),s=i(85762),o=i(28508),r=i(12492),a=i(21656),l=i(73974),c=i(26194),u=i(44234),d=i(8111);function p(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n    "),s.TgZ(2,"a",3),s._uU(3,"\n      "),s.GkF(4,4),s._uU(5,"\n    "),s.qZA(),s._uU(6,"\n  "),s.BQk()),2&e){const e=s.oxw().$implicit;s.xp6(2),s.Q6J("routerLink",e.route)("queryParams",e.queryParams)("queryParamsHandling",e.queryParamsHandling),s.xp6(2),s.Q6J("ngTemplateOutlet",e.content)}}function h(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n    "),s.TgZ(2,"button",5),s.NdJ("click",(function(t){s.CHM(e);const i=s.oxw().$implicit;return s.KtG(i.onClick(t))})),s._uU(3,"\n      "),s.GkF(4,4),s._uU(5,"\n    "),s.qZA(),s._uU(6,"\n  "),s.BQk()}if(2&e){const e=s.oxw().$implicit;s.xp6(4),s.Q6J("ngTemplateOutlet",e.content)}}function g(e,t){1&e&&s._UZ(0,"i",6)}function f(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n  "),s.YNc(2,p,7,4,"ng-container",1),s._uU(3,"\n  "),s.YNc(4,h,7,1,"ng-container",1),s._uU(5,"\n  "),s.YNc(6,g,1,0,"i",2),s._uU(7,"\n"),s.BQk()),2&e){const e=t.$implicit,i=t.last;s.xp6(2),s.Q6J("ngIf",e.route),s.xp6(2),s.Q6J("ngIf",!e.route),s.xp6(2),s.Q6J("ngIf",!i)}}function m(e,t){1&e&&s._UZ(0,"i",6)}function v(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"a",9),s._uU(3,"\n          "),s.GkF(4,4),s._uU(5,"\n        "),s.qZA(),s._uU(6,"\n      "),s.BQk()),2&e){const e=s.oxw().$implicit;s.xp6(2),s.Q6J("routerLink",e.route)("queryParams",e.queryParams)("queryParamsHandling",e.queryParamsHandling),s.xp6(2),s.Q6J("ngTemplateOutlet",e.content)}}function y(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n        "),s.TgZ(2,"button",10),s.NdJ("click",(function(t){s.CHM(e);const i=s.oxw().$implicit;return s.KtG(i.onClick(t))})),s._uU(3,"\n          "),s.GkF(4,4),s._uU(5,"\n        "),s.qZA(),s._uU(6,"\n      "),s.BQk()}if(2&e){const e=s.oxw().$implicit;s.xp6(4),s.Q6J("ngTemplateOutlet",e.content)}}function w(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n      "),s.YNc(2,v,7,4,"ng-container",1),s._uU(3,"\n      "),s.YNc(4,y,7,1,"ng-container",1),s._uU(5,"\n    "),s.BQk()),2&e){const e=t.$implicit;s.xp6(2),s.Q6J("ngIf",e.route),s.xp6(2),s.Q6J("ngIf",!e.route)}}function b(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n      "),s.TgZ(2,"a",3),s._uU(3,"\n        "),s.GkF(4,4),s._uU(5,"\n      "),s.qZA(),s._uU(6,"\n    "),s.BQk()),2&e){const e=s.oxw().$implicit;s.xp6(2),s.Q6J("routerLink",e.route)("queryParams",e.queryParams)("queryParamsHandling",e.queryParamsHandling),s.xp6(2),s.Q6J("ngTemplateOutlet",e.content)}}function U(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n      "),s.TgZ(2,"button",5),s.NdJ("click",(function(t){s.CHM(e);const i=s.oxw().$implicit;return s.KtG(i.onClick(t))})),s._uU(3,"\n        "),s.GkF(4,4),s._uU(5,"\n      "),s.qZA(),s._uU(6,"\n    "),s.BQk()}if(2&e){const e=s.oxw().$implicit;s.xp6(4),s.Q6J("ngTemplateOutlet",e.content)}}function _(e,t){1&e&&s._UZ(0,"i",6)}function A(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n    "),s.YNc(2,b,7,4,"ng-container",1),s._uU(3,"\n    "),s.YNc(4,U,7,1,"ng-container",1),s._uU(5,"\n    "),s.YNc(6,_,1,0,"i",2),s._uU(7,"\n  "),s.BQk()),2&e){const e=t.$implicit,i=t.last;s.xp6(2),s.Q6J("ngIf",e.route),s.xp6(2),s.Q6J("ngIf",!e.route),s.xp6(2),s.Q6J("ngIf",!i)}}function Z(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n  "),s.YNc(2,m,1,0,"i",2),s._uU(3,"\n\n  "),s._UZ(4,"button",7),s._uU(5,"\n\n  "),s.TgZ(6,"bit-menu",null,8),s._uU(8,"\n    "),s.YNc(9,w,6,2,"ng-container",0),s._uU(10,"\n  "),s.qZA(),s._uU(11,"\n  "),s._UZ(12,"i",6),s._uU(13,"\n\n  "),s.YNc(14,A,8,3,"ng-container",0),s._uU(15,"\n"),s.BQk()),2&e){const e=s.MAs(7),t=s.oxw();s.xp6(2),s.Q6J("ngIf",t.beforeOverflow.length>0),s.xp6(2),s.Q6J("bitMenuTriggerFor",e),s.xp6(5),s.Q6J("ngForOf",t.overflow),s.xp6(5),s.Q6J("ngForOf",t.afterOverflow)}}class x{constructor(){this.show=3,this.breadcrumbs=[]}set breadcrumbList(e){this.breadcrumbs=e.toArray()}get beforeOverflow(){return this.hasOverflow?this.breadcrumbs.slice(0,this.show-1):this.breadcrumbs}get overflow(){return this.breadcrumbs.slice(this.show-1,-1)}get afterOverflow(){return this.breadcrumbs.slice(-1)}get hasOverflow(){return this.breadcrumbs.length>this.show}}x.ɵfac=function(e){return new(e||x)},x.ɵcmp=s.Xpm({type:x,selectors:[["bit-breadcrumbs"]],contentQueries:function(e,t,i){if(1&e&&s.Suo(i,n.L,4),2&e){let e;s.iGM(e=s.CRH())&&(t.breadcrumbList=e)}},inputs:{show:"show"},decls:4,vars:2,consts:[[4,"ngFor","ngForOf"],[4,"ngIf"],["class","bwi bwi-angle-right tw-mx-1.5 tw-text-main",4,"ngIf"],["bitLink","","linkType","primary",1,"tw-my-2","tw-inline-block",3,"routerLink","queryParams","queryParamsHandling"],[3,"ngTemplateOutlet"],["type","button","bitLink","","linkType","primary",1,"tw-my-2","tw-inline-block",3,"click"],[1,"bwi","bwi-angle-right","tw-mx-1.5","tw-text-main"],["type","button","bitIconButton","bwi-ellipsis-h","size","small","aria-haspopup","",3,"bitMenuTriggerFor"],["overflowMenu",""],["bitMenuItem","","linkType","primary",3,"routerLink","queryParams","queryParamsHandling"],["type","button","bitMenuItem","","linkType","primary",3,"click"]],template:function(e,t){1&e&&(s.YNc(0,f,8,3,"ng-container",0),s._uU(1,"\n\n"),s.YNc(2,Z,16,4,"ng-container",1),s._uU(3,"\n")),2&e&&(s.Q6J("ngForOf",t.beforeOverflow),s.xp6(2),s.Q6J("ngIf",t.hasOverflow))},dependencies:[o.sg,o.O5,o.tP,r.r,r._,a.Q,l.M,c.t,u.e,d.rH],encapsulation:2})},40857:(e,t,i)=>{"use strict";i.d(t,{J:()=>c});var n=i(28508),s=i(8111),o=i(41938),r=i(19244),a=i(59692),l=i(85762);class c{}c.ɵfac=function(e){return new(e||c)},c.ɵmod=l.oAB({type:c}),c.ɵinj=l.cJS({imports:[n.ez,r.L,o.v,a.$,s.Bz]})},81974:(e,t,i)=>{"use strict";i.d(t,{r:()=>u});var n=i(39617),s=i(11394),o=i(85762),r=i(28508);const a=function(e){return{"tw-invisible":e}},l=["focus-visible:tw-ring","focus-visible:tw-ring-offset-2","focus-visible:tw-ring-primary-700","focus-visible:tw-z-10"],c={primary:["tw-border-primary-600","tw-bg-primary-600","!tw-text-contrast","hover:tw-bg-primary-700","hover:tw-border-primary-700","disabled:tw-bg-primary-600/60","disabled:tw-border-primary-600/60","disabled:!tw-text-contrast/60","disabled:tw-bg-clip-padding","disabled:tw-cursor-not-allowed",...l],secondary:["tw-bg-transparent","tw-border-text-muted","!tw-text-muted","hover:tw-bg-text-muted","hover:tw-border-text-muted","hover:!tw-text-contrast","disabled:tw-bg-transparent","disabled:tw-border-text-muted/60","disabled:!tw-text-muted/60","disabled:tw-cursor-not-allowed",...l],danger:["tw-bg-transparent","tw-border-danger-600","!tw-text-danger","hover:tw-bg-danger-600","hover:tw-border-danger-600","hover:!tw-text-contrast","disabled:tw-bg-transparent","disabled:tw-border-danger-600/60","disabled:!tw-text-danger/60","disabled:tw-cursor-not-allowed",...l],unstyled:[]};class u{constructor(){this._block=!1,this.loading=!1,this.disabled=!1}get classList(){var e;return["tw-font-semibold","tw-py-1.5","tw-px-3","tw-rounded","tw-transition","tw-border","tw-border-solid","tw-text-center","hover:tw-no-underline","focus:tw-outline-none"].concat(this.block?["tw-w-full","tw-block"]:["tw-inline-block"]).concat(c[null!==(e=this.buttonType)&&void 0!==e?e:"secondary"])}get disabledAttr(){return!(!(null!=this.disabled&&!1!==this.disabled)&&!this.loading)||null}get block(){return this._block}set block(e){this._block=(0,n.Ig)(e)}setButtonType(e){this.buttonType=e}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=o.Xpm({type:u,selectors:[["button","bitButton",""],["a","bitButton",""]],hostVars:3,hostBindings:function(e,t){2&e&&(o.uIk("disabled",t.disabledAttr),o.Tol(t.classList))},inputs:{buttonType:"buttonType",block:"block",loading:"loading",disabled:"disabled"},features:[o._Bn([{provide:s.x,useExisting:u}])],attrs:["bitButton",""],ngContentSelectors:["*"],decls:13,vars:6,consts:[[1,"tw-relative"],[3,"ngClass"],[1,"tw-absolute","tw-inset-0","tw-flex","tw-items-center","tw-justify-center",3,"ngClass"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin"]],template:function(e,t){1&e&&(o.F$t(),o.TgZ(0,"span",0),o._uU(1,"\n  "),o.TgZ(2,"span",1),o._uU(3,"\n    "),o.Hsn(4),o._uU(5,"\n  "),o.qZA(),o._uU(6,"\n  "),o.TgZ(7,"span",2),o._uU(8,"\n    "),o._UZ(9,"i",3),o._uU(10,"\n  "),o.qZA(),o._uU(11,"\n"),o.qZA(),o._uU(12,"\n")),2&e&&(o.xp6(2),o.Q6J("ngClass",o.VKq(2,a,t.loading)),o.xp6(5),o.Q6J("ngClass",o.VKq(4,a,!t.loading)))},dependencies:[r.mk],encapsulation:2})},40925:(e,t,i)=>{"use strict";i.d(t,{h:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.ez]})},24083:(e,t,i)=>{"use strict";i.d(t,{O:()=>d});var n=i(85762),s=i(78627),o=i(28508);function r(e,t){if(1&e&&n._UZ(0,"i",4),2&e){const e=n.oxw(2);n.Gre("bwi ",e.icon,"")}}function a(e,t){if(1&e&&(n.TgZ(0,"header",2),n._uU(1,"\n    "),n.YNc(2,r,1,3,"i",3),n._uU(3),n.qZA()),2&e){const e=n.oxw();n.s9C("id",e.titleId),n.Q6J("ngClass",e.headerClass),n.xp6(2),n.Q6J("ngIf",e.icon),n.xp6(1),n.hij("\n    ",e.title,"\n  ")}}const l={success:"bwi-check",info:"bwi-info-circle",warning:"bwi-exclamation-triangle",danger:"bwi-error"},c={warning:"warning",danger:"error"};let u=0;class d{constructor(e){this.i18nService=e,this.type="info",this.useAlertRole=!1,this.titleId="bit-callout-title-"+u++}ngOnInit(){var e;null!==(e=this.icon)&&void 0!==e||(this.icon=l[this.type]),null==this.title&&null!=c[this.type]&&(this.title=this.i18nService.t(c[this.type]))}get calloutClass(){switch(this.type){case"danger":return"tw-border-l-danger-600";case"info":return"tw-border-l-info-600";case"success":return"tw-border-l-success-600";case"warning":return"tw-border-l-warning-600"}}get headerClass(){switch(this.type){case"danger":return"!tw-text-danger";case"info":return"!tw-text-info";case"success":return"!tw-text-success";case"warning":return"!tw-text-warning"}}}d.ɵfac=function(e){return new(e||d)(n.Y36(s.D))},d.ɵcmp=n.Xpm({type:d,selectors:[["bit-callout"]],inputs:{type:"type",icon:"icon",title:"title",useAlertRole:"useAlertRole"},ngContentSelectors:["*"],decls:7,vars:3,consts:[[1,"tw-mb-4","tw-box-border","tw-rounded","tw-border","tw-border-l-8","tw-border-solid","tw-border-secondary-300","tw-bg-background-alt","tw-px-5","tw-py-3","tw-leading-5","tw-text-main",3,"ngClass"],["class","tw-mb-2 tw-mt-0 tw-text-base tw-font-bold tw-uppercase",3,"id","ngClass",4,"ngIf"],[1,"tw-mb-2","tw-mt-0","tw-text-base","tw-font-bold","tw-uppercase",3,"id","ngClass"],["aria-hidden","true",3,"class",4,"ngIf"],["aria-hidden","true"]],template:function(e,t){1&e&&(n.F$t(),n.TgZ(0,"aside",0),n._uU(1,"\n  "),n.YNc(2,a,4,4,"header",1),n._uU(3,"\n  "),n.Hsn(4),n._uU(5,"\n"),n.qZA(),n._uU(6,"\n")),2&e&&(n.Q6J("ngClass",t.calloutClass),n.uIk("aria-labelledby",t.titleId),n.xp6(2),n.Q6J("ngIf",t.title))},dependencies:[o.mk,o.O5],encapsulation:2})},7266:(e,t,i)=>{"use strict";i.d(t,{d:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.ez]})},7172:(e,t,i)=>{"use strict";i.d(t,{b:()=>r});var n=i(37513),s=i(11601),o=i(85762);class r{constructor(e){this.ngControl=e,this.inputClasses=["tw-appearance-none","tw-outline-none","tw-relative","tw-transition","tw-cursor-pointer","tw-inline-block","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-600","tw-h-3.5","tw-w-3.5","tw-mr-1.5","tw-bottom-[-1px]","tw-flex-none","before:tw-content-['']","before:tw-block","before:tw-absolute","before:tw-inset-0","hover:tw-border-2","[&>label]:tw-border-2","focus-visible:tw-ring-2","focus-visible:tw-ring-offset-2","focus-visible:tw-ring-primary-700","disabled:tw-cursor-auto","disabled:tw-border","disabled:tw-bg-secondary-100","checked:tw-bg-primary-600","checked:tw-border-primary-600","checked:hover:tw-bg-primary-700","checked:hover:tw-border-primary-700","[&>label:hover]:checked:tw-bg-primary-700","[&>label:hover]:checked:tw-border-primary-700","checked:before:tw-bg-text-contrast","checked:before:tw-mask-position-[center]","checked:before:tw-mask-repeat-[no-repeat]","checked:disabled:tw-border-secondary-100","checked:disabled:tw-bg-secondary-100","checked:disabled:before:tw-bg-text-muted","[&:not(:indeterminate)]:checked:before:tw-mask-image-[var(--mask-image)]","indeterminate:before:tw-mask-image-[var(--indeterminate-mask-image)]","indeterminate:tw-bg-primary-600","indeterminate:tw-border-primary-600","indeterminate:hover:tw-bg-primary-700","indeterminate:hover:tw-border-primary-700","[&>label:hover]:indeterminate:tw-bg-primary-700","[&>label:hover]:indeterminate:tw-border-primary-700","indeterminate:before:tw-bg-text-contrast","indeterminate:before:tw-mask-position-[center]","indeterminate:before:tw-mask-repeat-[no-repeat]","indeterminate:before:tw-mask-image-[var(--indeterminate-mask-image)]","indeterminate:disabled:tw-border-secondary-100","indeterminate:disabled:tw-bg-secondary-100","indeterminate:disabled:before:tw-bg-text-muted"],this.maskImage='url(\'data:image/svg+xml,%3Csvg class="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="8" height="8" viewBox="0 0 10 10"%3E%3Cpath d="M0.5 6.2L2.9 8.6L9.5 1.4" fill="none" stroke="white" stroke-width="2"%3E%3C/path%3E%3C/svg%3E\')',this.indeterminateImage='url(\'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="none" viewBox="0 0 13 13"%3E%3Cpath stroke="%23fff" stroke-width="2" d="M2.5 6.5h8"/%3E%3C/svg%3E%0A\')'}get disabled(){var e,t,i;return null!==(i=null!==(e=this._disabled)&&void 0!==e?e:null===(t=this.ngControl)||void 0===t?void 0:t.disabled)&&void 0!==i&&i}set disabled(e){this._disabled=null!=e&&!1!==e}get required(){var e,t,i,s;return null!==(s=null!==(e=this._required)&&void 0!==e?e:null===(i=null===(t=this.ngControl)||void 0===t?void 0:t.control)||void 0===i?void 0:i.hasValidator(n.kI.requiredTrue))&&void 0!==s&&s}set required(e){this._required=null!=e&&!1!==e}get hasError(){var e,t;return"INVALID"===(null===(e=this.ngControl)||void 0===e?void 0:e.status)&&(null===(t=this.ngControl)||void 0===t?void 0:t.touched)}get error(){const e=Object.keys(this.ngControl.errors)[0];return[e,this.ngControl.errors[e]]}}r.ɵfac=function(e){return new(e||r)(o.Y36(n.a5,10))},r.ɵcmp=o.Xpm({type:r,selectors:[["input","type","checkbox","bitCheckbox",""]],hostVars:7,hostBindings:function(e,t){2&e&&(o.Ikx("disabled",t.disabled),o.Tol(t.inputClasses),o.Udp("--mask-image",t.maskImage)("--indeterminate-mask-image",t.indeterminateImage))},inputs:{disabled:"disabled",required:"required"},features:[o._Bn([{provide:s.y,useExisting:r}])],attrs:["type","checkbox","bitCheckbox",""],decls:0,vars:0,template:function(e,t){},encapsulation:2})},72444:(e,t,i)=>{"use strict";i.d(t,{n:()=>a});var n=i(28508),s=i(13506),o=i(36903),r=i(85762);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=r.oAB({type:a}),a.ɵinj=r.cJS({imports:[o.m,n.ez,s.s]})},21989:(e,t,i)=>{"use strict";i.d(t,{L:()=>c});var n,s=i(27646),o=i(85762),r=i(28508);function a(e,t){if(1&e&&(o.TgZ(0,"span",2),o._uU(1),o.qZA()),2&e){const e=o.oxw().index;o.xp6(1),o.Oqu(e+1)}}function l(e,t){if(1&e&&(o.TgZ(0,"span")(1,"span"),o._uU(2),o.qZA(),o.YNc(3,a,2,1,"span",1),o.qZA()),2&e){const e=t.$implicit,i=o.oxw();o.Tol(i.getCharacterClass(e)),o.xp6(2),o.Oqu(e),o.xp6(1),o.Q6J("ngIf",i.showCount)}}!function(e){e[e.Letter=0]="Letter",e[e.Emoji=1]="Emoji",e[e.Special=2]="Special",e[e.Number=3]="Number"}(n||(n={}));class c{constructor(){this.password=null,this.showCount=!1,this.characterStyles={[n.Emoji]:[],[n.Letter]:["tw-text-main"],[n.Special]:["tw-text-danger"],[n.Number]:["tw-text-primary-600"]}}get classList(){return["tw-min-w-0","tw-whitespace-pre-wrap","tw-break-all"]}get passwordArray(){return Array.from(this.password)}getCharacterClass(e){const t=this.getCharacterType(e),i=this.characterStyles[t];return this.showCount?i.concat(["tw-inline-flex","tw-flex-col","tw-items-center","tw-w-7","tw-py-1","odd:tw-bg-secondary-100","even:tw-bg-background"]):i}getCharacterType(e){if(e.match(s.c.regexpEmojiPresentation))return n.Emoji;if(e.match(/\d/))return n.Number;return["&","<",">"," "].includes(e)||e.match(/[^\w ]/)?n.Special:n.Letter}}c.ɵfac=function(e){return new(e||c)},c.ɵcmp=o.Xpm({type:c,selectors:[["bit-color-password"]],hostVars:2,hostBindings:function(e,t){2&e&&o.Tol(t.classList)},inputs:{password:"password",showCount:"showCount"},decls:1,vars:1,consts:[[3,"class",4,"ngFor","ngForOf"],["class","tw-whitespace-nowrap tw-text-xs tw-leading-5 tw-text-main",4,"ngIf"],[1,"tw-whitespace-nowrap","tw-text-xs","tw-leading-5","tw-text-main"]],template:function(e,t){1&e&&o.YNc(0,l,4,4,"span",0),2&e&&o.Q6J("ngForOf",t.passwordArray)},dependencies:[r.sg,r.O5],encapsulation:2})},81168:(e,t,i)=>{"use strict";i.d(t,{e:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵcmp=s.Xpm({type:o,selectors:[["bit-container"]],standalone:!0,features:[s.jDz],ngContentSelectors:["*"],decls:5,vars:0,consts:[[1,"tw-max-w-4xl"]],template:function(e,t){1&e&&(s.F$t(),s.TgZ(0,"div",0),s._uU(1,"\n  "),s.Hsn(2),s._uU(3,"\n"),s.qZA(),s._uU(4,"\n"))},dependencies:[n.ez],encapsulation:2})},81716:(e,t,i)=>{"use strict";i.d(t,{J:()=>s});var n=i(88444);const s=(0,n.X$)("fadeIn",[(0,n.eR)(":enter",[(0,n.oB)({opacity:0,transform:"translateY(-50px)"}),(0,n.ru)([(0,n.jt)("0.15s linear",(0,n.oB)({opacity:1})),(0,n.jt)("0.3s ease-out",(0,n.oB)({transform:"none"}))])])])},29445:(e,t,i)=>{"use strict";i.d(t,{S:()=>p});var n=i(28783),s=i(37513),o=i(2012),r=i(40925),a=i(41938),l=i(36903),c=i(33229),u=i(73369),d=i(85762);class p{}p.ɵfac=function(e){return new(e||p)},p.ɵmod=d.oAB({type:p}),p.ɵinj=d.cJS({providers:[u.x],imports:[l.m,o.G,r.h,n.Su,a.v,s.UX,c.Z,n.Su]})},73369:(e,t,i)=>{"use strict";i.d(t,{x:()=>T});var n=i(28783),s=i(8111),o=i(54019),r=i(67775),a=i(30359),l=i(68362),c=i(99042),u=i(67855),d=i(37513),p=i(85762),h=i(78627),g=i(28508),f=i(46246),m=i(36338),v=i(81974),y=i(70094),w=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function b(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",7),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.dialogRef.close(!1))})),p._uU(1),p.qZA()}if(2&e){const e=p.oxw();p.xp6(1),p.hij("\n        ",e.cancelButtonText,"\n      ")}}const U={primary:"bwi-business",success:"bwi-star",info:"bwi-info-circle",warning:"bwi-exclamation-triangle",danger:"bwi-error"},_={primary:"tw-text-primary-600",success:"tw-text-success",info:"tw-text-info",warning:"tw-text-warning",danger:"tw-text-danger"};class A{get iconClasses(){var e;return[null!==(e=this.simpleDialogOpts.icon)&&void 0!==e?e:U[this.simpleDialogOpts.type],_[this.simpleDialogOpts.type]]}constructor(e,t,i){this.dialogRef=e,this.i18nService=t,this.simpleDialogOpts=i,this.formGroup=new d.cw({}),this.showCancelButton=null!==this.simpleDialogOpts.cancelButtonText,this.accept=()=>w(this,void 0,void 0,(function*(){this.simpleDialogOpts.acceptAction&&(yield this.simpleDialogOpts.acceptAction()),this.dialogRef.close(!0)})),this.localizeText()}localizeText(){this.title=this.translate(this.simpleDialogOpts.title),this.content=this.translate(this.simpleDialogOpts.content),this.acceptButtonText=this.translate(this.simpleDialogOpts.acceptButtonText,"yes"),this.showCancelButton&&(this.cancelButtonText=this.translate(this.simpleDialogOpts.cancelButtonText,void 0!==this.simpleDialogOpts.acceptButtonText?"cancel":"no"))}translate(e,t){var i;return"object"==typeof e?this.i18nService.t(e.key,...null!==(i=e.placeholders)&&void 0!==i?i:[]):null!=e?e:this.i18nService.t(t)}}A.ɵfac=function(e){return new(e||A)(p.Y36(n.zj),p.Y36(h.D),p.Y36(n.Kt))},A.ɵcmp=p.Xpm({type:A,selectors:[["ng-component"]],decls:22,vars:8,consts:[[3,"formGroup","bitSubmit"],["bitDialogIcon","","aria-hidden","true",1,"bwi","tw-text-3xl"],["bitDialogTitle",""],["bitDialogContent",""],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"click",4,"ngIf"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"click"]],template:function(e,t){1&e&&(p.TgZ(0,"form",0),p._uU(1,"\n  "),p.TgZ(2,"bit-simple-dialog"),p._uU(3,"\n    "),p._UZ(4,"i",1),p._uU(5,"\n\n    "),p.TgZ(6,"span",2),p._uU(7),p.qZA(),p._uU(8,"\n\n    "),p.TgZ(9,"div",3),p._uU(10),p.qZA(),p._uU(11,"\n\n    "),p.ynx(12,4),p._uU(13,"\n      "),p.TgZ(14,"button",5),p._uU(15),p.qZA(),p._uU(16,"\n\n      "),p.YNc(17,b,2,1,"button",6),p._uU(18,"\n    "),p.BQk(),p._uU(19,"\n  "),p.qZA(),p._uU(20,"\n"),p.qZA(),p._uU(21,"\n")),2&e&&(p.Q6J("formGroup",t.formGroup)("bitSubmit",t.accept),p.xp6(4),p.Tol(t.iconClasses),p.xp6(3),p.Oqu(t.title),p.xp6(3),p.Oqu(t.content),p.xp6(5),p.hij("\n        ",t.acceptButtonText,"\n      "),p.xp6(2),p.Q6J("ngIf",t.showCancelButton))},dependencies:[g.O5,f.b,m.u,v.r,d._Y,d.JL,d.sg,y.r,y.a],encapsulation:2});var Z=i(87996),x=i(2184),S=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class T extends n.Vq{constructor(e,t,i,n,c,d,p,h,g){super(e,t,i,n,c,d),this.i18nService=g,this._destroy$=new o.x,this.backDropClasses=["tw-fixed","tw-bg-black","tw-bg-opacity-30","tw-inset-0"],p&&h&&p.events.pipe((0,r.h)((e=>e instanceof s.m2)),(0,a.w)((()=>h.getAuthStatus())),(0,r.h)((e=>e!==u.y.Unlocked)),(0,l.R)(this._destroy$)).subscribe((()=>this.closeAll()))}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete(),super.ngOnDestroy()}open(e,t){return t=Object.assign({backdropClass:this.backDropClasses},t),super.open(e,t)}openSimpleDialog(e){return S(this,void 0,void 0,(function*(){const t=this.openSimpleDialogRef(e);return(0,c.z)(t.closed)}))}openSimpleDialogRef(e){return this.open(A,{data:e,disableClose:e.disableClose})}translate(e,t){var i;return null==e&&null==t?null:null==e?this.i18nService.t(t):"object"==typeof e?this.i18nService.t(e.key,...null!==(i=e.placeholders)&&void 0!==i?i:[]):e}}T.ɵfac=function(e){return new(e||T)(p.LFG(Z.aV),p.LFG(p.zs3),p.LFG(n.WX,8),p.LFG(n.Vq,12),p.LFG(Z.Xj),p.LFG(n.YA),p.LFG(s.F0,8),p.LFG(x.e,8),p.LFG(h.D))},T.ɵprov=p.Yz7({token:T,factory:T.ɵfac})},29465:(e,t,i)=>{"use strict";i.d(t,{a:()=>m});var n=i(39617),s=i(81716),o=i(85762),r=i(28508),a=i(21656),l=i(28315),c=i(18362),u=i(46545),d=i(49399);function p(e,t){if(1&e&&(o.TgZ(0,"span",9),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.hij("\n        ",e.subtitle,"\n      ")}}function h(e,t){1&e&&(o.TgZ(0,"div",10),o._uU(1,"\n      "),o._UZ(2,"i",11),o._uU(3,"\n    "),o.qZA())}const g=[[["","bitDialogTitle",""]],[["","bitDialogContent",""]],[["","bitDialogFooter",""]]],f=function(e,t,i){return{"tw-p-4":e,"tw-overflow-y-auto":t,"tw-invisible tw-overflow-y-hidden":i}};class m{constructor(){this.dialogSize="default",this._disablePadding=!1,this.loading=!1}set disablePadding(e){this._disablePadding=(0,n.Ig)(e)}get disablePadding(){return this._disablePadding}get classes(){return["tw-flex","tw-flex-col","tw-max-h-screen","tw-w-screen","tw-p-4"].concat(this.width)}get width(){switch(this.dialogSize){case"small":return"tw-max-w-sm";case"large":return"tw-max-w-3xl";default:return"tw-max-w-xl"}}}m.ɵfac=function(e){return new(e||m)},m.ɵcmp=o.Xpm({type:m,selectors:[["bit-dialog"]],hostVars:2,hostBindings:function(e,t){2&e&&o.Tol(t.classes)},inputs:{dialogSize:"dialogSize",title:"title",subtitle:"subtitle",disablePadding:"disablePadding",loading:"loading"},ngContentSelectors:["[bitDialogTitle]","[bitDialogContent]","[bitDialogFooter]"],decls:32,vars:16,consts:[[1,"tw-flex","tw-w-full","tw-flex-col","tw-self-center","tw-overflow-hidden","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background","tw-text-main",3,"ngClass"],[1,"tw-flex","tw-justify-between","tw-items-center","tw-gap-4","tw-border-0","tw-border-b","tw-border-solid","tw-border-secondary-300","tw-p-4"],["bitDialogTitleContainer","","bitTypography","h3","noMargin","",1,"tw-mb-0","tw-truncate"],["class","tw-text-muted tw-font-normal tw-text-sm",4,"ngIf"],["type","button","bitIconButton","bwi-close","buttonType","main","size","default","bitDialogClose",""],[1,"tw-relative","tw-flex","tw-flex-col","tw-overflow-hidden"],["class","tw-absolute tw-flex tw-h-full tw-w-full tw-items-center tw-justify-center",4,"ngIf"],[1,"tw-pb-8",3,"ngClass"],[1,"tw-flex","tw-flex-row","tw-items-center","tw-gap-2","tw-border-0","tw-border-t","tw-border-solid","tw-border-secondary-300","tw-bg-background-alt","tw-p-4"],[1,"tw-text-muted","tw-font-normal","tw-text-sm"],[1,"tw-absolute","tw-flex","tw-h-full","tw-w-full","tw-items-center","tw-justify-center"],[1,"bwi","bwi-spinner","bwi-spin","bwi-3x"]],template:function(e,t){1&e&&(o.F$t(g),o.TgZ(0,"section",0),o._uU(1,"\n  "),o.TgZ(2,"header",1),o._uU(3,"\n    "),o.TgZ(4,"h1",2),o._uU(5),o.YNc(6,p,2,1,"span",3),o._uU(7,"\n      "),o.Hsn(8),o._uU(9,"\n    "),o.qZA(),o._uU(10,"\n    "),o._UZ(11,"button",4),o.ALo(12,"i18n"),o.ALo(13,"i18n"),o._uU(14,"\n  "),o.qZA(),o._uU(15,"\n\n  "),o.TgZ(16,"div",5),o._uU(17,"\n    "),o.YNc(18,h,4,0,"div",6),o._uU(19,"\n    "),o.TgZ(20,"div",7),o._uU(21,"\n      "),o.Hsn(22,1),o._uU(23,"\n    "),o.qZA(),o._uU(24,"\n  "),o.qZA(),o._uU(25,"\n\n  "),o.TgZ(26,"footer",8),o._uU(27,"\n    "),o.Hsn(28,2),o._uU(29,"\n  "),o.qZA(),o._uU(30,"\n"),o.qZA(),o._uU(31,"\n")),2&e&&(o.Q6J("ngClass",t.width)("@fadeIn",void 0),o.xp6(5),o.hij("\n      ",t.title,"\n      "),o.xp6(1),o.Q6J("ngIf",t.subtitle),o.xp6(5),o.uIk("title",o.lcZ(12,8,"close"))("aria-label",o.lcZ(13,10,"close")),o.xp6(7),o.Q6J("ngIf",t.loading),o.xp6(2),o.Q6J("ngClass",o.kEZ(12,f,!t.disablePadding,!t.loading,t.loading)))},dependencies:[r.mk,r.O5,a.Q,l.t,c.f,u.g,d.C],encapsulation:2,data:{animation:[s.J]}})},18362:(e,t,i)=>{"use strict";i.d(t,{f:()=>o});var n=i(85762),s=i(28783);class o{constructor(e){this.dialogRef=e}get disableClose(){var e;return!!(null===(e=this.dialogRef)||void 0===e?void 0:e.disableClose)||null}close(){this.disableClose||this.dialogRef.close(this.dialogResult)}}o.ɵfac=function(e){return new(e||o)(n.Y36(s.zj,8))},o.ɵdir=n.lG2({type:o,selectors:[["","bitDialogClose",""]],hostVars:1,hostBindings:function(e,t){1&e&&n.NdJ("click",(function(){return t.close()})),2&e&&n.uIk("disabled",t.disableClose)},inputs:{dialogResult:["bitDialogClose","dialogResult"]}})},46545:(e,t,i)=>{"use strict";i.d(t,{g:()=>r});var n=i(85762),s=i(28783);let o=0;class r{constructor(e){this.dialogRef=e,this.id="bit-dialog-title-"+o++,this.simple=!1}ngOnInit(){this.dialogRef&&Promise.resolve().then((()=>{const e=this.dialogRef.containerInstance;e&&0===e._ariaLabelledByQueue.length&&e._ariaLabelledByQueue.push(this.id)}))}}r.ɵfac=function(e){return new(e||r)(n.Y36(s.zj,8))},r.ɵdir=n.lG2({type:r,selectors:[["","bitDialogTitleContainer",""]],hostVars:1,hostBindings:function(e,t){2&e&&n.Ikx("id",t.id)},inputs:{simple:"simple"}})},70094:(e,t,i)=>{"use strict";i.d(t,{a:()=>u,r:()=>d});var n=i(81716),s=i(85762),o=i(28508),r=i(46545);function a(e,t){1&e&&(s.ynx(0),s._uU(1,"\n      "),s.Hsn(2,3),s._uU(3,"\n    "),s.BQk())}function l(e,t){1&e&&(s._uU(0,"\n      "),s._UZ(1,"i",7),s._uU(2,"\n    "))}const c=[[["","bitDialogTitle",""]],[["","bitDialogContent",""]],[["","bitDialogFooter",""]],[["","bitDialogIcon",""]]];class u{}u.ɵfac=function(e){return new(e||u)},u.ɵdir=s.lG2({type:u,selectors:[["","bitDialogIcon",""]]});class d{get hasIcon(){return null!=this.icon}}d.ɵfac=function(e){return new(e||d)},d.ɵcmp=s.Xpm({type:d,selectors:[["bit-simple-dialog"]],contentQueries:function(e,t,i){if(1&e&&s.Suo(i,u,5),2&e){let e;s.iGM(e=s.CRH())&&(t.icon=e.first)}},ngContentSelectors:["[bitDialogTitle]","[bitDialogContent]","[bitDialogFooter]","[bitDialogIcon]"],decls:26,vars:3,consts:[[1,"tw-my-4","tw-flex","tw-max-h-screen","tw-w-96","tw-max-w-90vw","tw-flex-col","tw-overflow-hidden","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-text-contrast","tw-text-main"],[1,"tw-flex","tw-flex-col","tw-items-center","tw-gap-2","tw-px-4","tw-pt-4","tw-text-center"],[4,"ngIf","ngIfElse"],["elseBlock",""],["bitDialogTitleContainer","",1,"tw-mb-0","tw-text-base","tw-font-semibold"],[1,"tw-overflow-y-auto","tw-px-4","tw-pb-4","tw-pt-2","tw-text-center","tw-text-base"],[1,"tw-flex","tw-flex-row","tw-gap-2","tw-border-0","tw-border-t","tw-border-solid","tw-border-secondary-300","tw-p-4"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle","tw-text-3xl","tw-text-warning"]],template:function(e,t){if(1&e&&(s.F$t(c),s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s.YNc(4,a,4,0,"ng-container",2),s._uU(5,"\n    "),s.YNc(6,l,3,0,"ng-template",null,3,s.W1O),s._uU(8,"\n    "),s.TgZ(9,"h1",4),s._uU(10,"\n      "),s.Hsn(11),s._uU(12,"\n    "),s.qZA(),s._uU(13,"\n  "),s.qZA(),s._uU(14,"\n  "),s.TgZ(15,"div",5),s._uU(16,"\n    "),s.Hsn(17,1),s._uU(18,"\n  "),s.qZA(),s._uU(19,"\n  "),s.TgZ(20,"div",6),s._uU(21,"\n    "),s.Hsn(22,2),s._uU(23,"\n  "),s.qZA(),s._uU(24,"\n"),s.qZA(),s._uU(25,"\n")),2&e){const e=s.MAs(7);s.Q6J("@fadeIn",void 0),s.xp6(4),s.Q6J("ngIf",t.hasIcon)("ngIfElse",e)}},dependencies:[o.O5,r.g],encapsulation:2,data:{animation:[n.J]}})},11601:(e,t,i)=>{"use strict";i.d(t,{y:()=>n});class n{}},75734:(e,t,i)=>{"use strict";i.d(t,{A:()=>h});var n=i(39617),s=i(11601),o=i(85762),r=i(78627),a=i(28508),l=i(49399);function c(e,t){1&e&&(o.TgZ(0,"span",3),o._uU(1),o.ALo(2,"i18n"),o.qZA()),2&e&&(o.xp6(1),o.hij(" (",o.lcZ(2,1,"required"),")"))}function u(e,t){1&e&&o.Hsn(0,2,["*ngIf","!hasError"])}function d(e,t){if(1&e&&(o.TgZ(0,"div",4),o._uU(1,"\n  "),o._UZ(2,"i",5),o._uU(3),o.qZA()),2&e){const e=o.oxw();o.xp6(3),o.hij(" ",e.displayError,"\n")}}const p=["*",[["bit-label"]],[["bit-hint"]]];class h{get inline(){return this._inline}set inline(e){this._inline=(0,n.Ig)(e)}set disableMargin(e){this._disableMargin=(0,n.Ig)(e)}get disableMargin(){return this._disableMargin}get classes(){return[].concat(this.inline?["tw-inline-block","tw-mr-4"]:["tw-block"]).concat(this.disableMargin?[]:["tw-mb-6"])}constructor(e){this.i18nService=e,this._inline=!1,this._disableMargin=!1}get labelClasses(){return["tw-transition","tw-select-none","tw-mb-0","tw-inline-flex","tw-items-baseline"].concat(this.formControl.disabled?"tw-cursor-auto":"tw-cursor-pointer")}get labelContentClasses(){return["tw-inline-flex","tw-flex-col","tw-font-semibold"].concat(this.formControl.disabled?"tw-text-muted":"tw-text-main")}get required(){return this.formControl.required}get hasError(){return this.formControl.hasError}get error(){return this.formControl.error}get displayError(){var e,t;return"required"===this.error[0]?this.i18nService.t("inputRequired"):(null===(e=this.error[1])||void 0===e?void 0:e.message)?null===(t=this.error[1])||void 0===t?void 0:t.message:this.error}}h.ɵfac=function(e){return new(e||h)(o.Y36(r.D))},h.ɵcmp=o.Xpm({type:h,selectors:[["bit-form-control"]],contentQueries:function(e,t,i){if(1&e&&o.Suo(i,s.y,5),2&e){let e;o.iGM(e=o.CRH())&&(t.formControl=e.first)}},hostVars:2,hostBindings:function(e,t){2&e&&o.Tol(t.classes)},inputs:{label:"label",inline:"inline",disableMargin:"disableMargin"},ngContentSelectors:["*","bit-label","bit-hint"],decls:19,vars:7,consts:[["class","tw-text-xs tw-font-normal",4,"ngIf"],[4,"ngIf"],["class","tw-mt-1 tw-text-danger",4,"ngIf"],[1,"tw-text-xs","tw-font-normal"],[1,"tw-mt-1","tw-text-danger"],[1,"bwi","bwi-error"]],template:function(e,t){1&e&&(o.F$t(p),o.TgZ(0,"label"),o._uU(1,"\n  "),o.Hsn(2),o._uU(3,"\n  "),o.TgZ(4,"span"),o._uU(5,"\n    "),o.TgZ(6,"span"),o._uU(7,"\n      "),o.Hsn(8,1),o._uU(9,"\n      "),o.YNc(10,c,3,3,"span",0),o._uU(11,"\n    "),o.qZA(),o._uU(12,"\n    "),o.YNc(13,u,1,0,"ng-content",1),o._uU(14,"\n  "),o.qZA(),o._uU(15,"\n"),o.qZA(),o._uU(16,"\n"),o.YNc(17,d,4,1,"div",2),o._uU(18,"\n")),2&e&&(o.Tol(t.labelClasses),o.xp6(4),o.Tol(t.labelContentClasses),o.xp6(6),o.Q6J("ngIf",t.required),o.xp6(3),o.Q6J("ngIf",!t.hasError),o.xp6(4),o.Q6J("ngIf",t.hasError))},dependencies:[a.O5,l.C],encapsulation:2})},13506:(e,t,i)=>{"use strict";i.d(t,{s:()=>o});var n=i(36903),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.m]})},44358:(e,t,i)=>{"use strict";i.d(t,{M:()=>o});var n=i(85762);let s=0;class o{constructor(){this.id="bit-hint-"+s++}}o.ɵfac=function(e){return new(e||o)},o.ɵdir=n.lG2({type:o,selectors:[["bit-hint"]],hostAttrs:[1,"tw-text-muted","tw-font-normal","tw-inline-block","tw-mt-1"],hostVars:1,hostBindings:function(e,t){2&e&&n.Ikx("id",t.id)}})},36179:(e,t,i)=>{"use strict";i.d(t,{u:()=>s});var n=i(85762);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵdir=n.lG2({type:s,selectors:[["bit-label"]]})},23182:(e,t,i)=>{"use strict";i.d(t,{v:()=>n});class n{}},24637:(e,t,i)=>{"use strict";i.d(t,{d:()=>b});var n=i(39617),s=i(44358),o=i(85762),r=i(78627);let a=0;class l{constructor(e){this.i18nService=e,this.id="bit-error-"+a++}get displayError(){var e,t,i,n,s,o,r;switch(this.error[0]){case"required":return this.i18nService.t("inputRequired");case"email":return this.i18nService.t("inputEmail");case"minlength":return this.i18nService.t("inputMinLength",null===(e=this.error[1])||void 0===e?void 0:e.requiredLength);case"maxlength":return this.i18nService.t("inputMaxLength",null===(t=this.error[1])||void 0===t?void 0:t.requiredLength);case"min":return this.i18nService.t("inputMinValue",null===(i=this.error[1])||void 0===i?void 0:i.min);case"max":return this.i18nService.t("inputMaxValue",null===(n=this.error[1])||void 0===n?void 0:n.max);case"forbiddenCharacters":return this.i18nService.t("inputForbiddenCharacters",null===(s=this.error[1])||void 0===s?void 0:s.characters.join(", "));case"multipleEmails":return this.i18nService.t("multipleInputEmails");case"trim":return this.i18nService.t("inputTrimValidator");default:return(null===(o=this.error[1])||void 0===o?void 0:o.message)?null===(r=this.error[1])||void 0===r?void 0:r.message:this.error}}}l.ɵfac=function(e){return new(e||l)(o.Y36(r.D))},l.ɵcmp=o.Xpm({type:l,selectors:[["bit-error"]],hostAttrs:["aria-live","assertive",1,"tw-block","tw-mt-1","tw-text-danger"],hostVars:1,hostBindings:function(e,t){2&e&&o.Ikx("id",t.id)},inputs:{error:"error"},decls:2,vars:1,consts:[[1,"bwi","bwi-error"]],template:function(e,t){1&e&&(o._UZ(0,"i",0),o._uU(1)),2&e&&(o.xp6(1),o.hij(" ",t.displayError,""))},encapsulation:2});var c=i(23182),u=i(57139),d=i(1e4),p=i(28508),h=i(49399);function g(e,t){1&e&&(o.TgZ(0,"span",7),o._uU(1),o.ALo(2,"i18n"),o.qZA()),2&e&&(o.xp6(1),o.hij(" (",o.lcZ(2,1,"required"),")"))}function f(e,t){1&e&&(o.TgZ(0,"div",2),o._uU(1,"\n    "),o.Hsn(2,2),o._uU(3,"\n  "),o.qZA())}function m(e,t){1&e&&(o.TgZ(0,"div",2),o._uU(1,"\n    "),o.Hsn(2,3),o._uU(3,"\n  "),o.qZA())}function v(e,t){1&e&&o.Hsn(0,4,["*ngSwitchCase","false"])}function y(e,t){if(1&e&&o._UZ(0,"bit-error",8),2&e){const e=o.oxw();o.Q6J("error",e.input.error)}}const w=[[["bit-label"]],"*",[["","bitPrefix",""]],[["","bitSuffix",""]],[["bit-hint"]]];class b{constructor(){this._disableMargin=!1}set disableMargin(e){this._disableMargin=(0,n.Ig)(e)}get disableMargin(){return this._disableMargin}get classList(){return["tw-block"].concat(this.disableMargin?[]:["tw-mb-6"])}ngAfterContentChecked(){this.error?this.input.ariaDescribedBy=this.error.id:this.hint?this.input.ariaDescribedBy=this.hint.id:this.input.ariaDescribedBy=void 0}}b.ɵfac=function(e){return new(e||b)},b.ɵcmp=o.Xpm({type:b,selectors:[["bit-form-field"]],contentQueries:function(e,t,i){if(1&e&&(o.Suo(i,c.v,5),o.Suo(i,s.M,5),o.Suo(i,u.xO,4),o.Suo(i,d.e,4)),2&e){let e;o.iGM(e=o.CRH())&&(t.input=e.first),o.iGM(e=o.CRH())&&(t.hint=e.first),o.iGM(e=o.CRH())&&(t.prefixChildren=e),o.iGM(e=o.CRH())&&(t.suffixChildren=e)}},viewQuery:function(e,t){if(1&e&&o.Gf(l,5),2&e){let e;o.iGM(e=o.CRH())&&(t.error=e.first)}},hostVars:2,hostBindings:function(e,t){2&e&&o.Tol(t.classList)},inputs:{disableMargin:"disableMargin"},ngContentSelectors:["bit-label","*","[bitPrefix]","[bitSuffix]","bit-hint"],decls:23,vars:7,consts:[[1,"tw-mb-1","tw-block","tw-font-semibold","tw-text-main"],["class","tw-text-xs tw-font-normal",4,"ngIf"],[1,"tw-flex"],["class","tw-flex",4,"ngIf"],[3,"ngSwitch"],[4,"ngSwitchCase"],[3,"error",4,"ngSwitchCase"],[1,"tw-text-xs","tw-font-normal"],[3,"error"]],template:function(e,t){1&e&&(o.F$t(w),o.TgZ(0,"label",0),o._uU(1,"\n  "),o.Hsn(2),o._uU(3,"\n  "),o.YNc(4,g,3,3,"span",1),o._uU(5,"\n"),o.qZA(),o._uU(6,"\n"),o.TgZ(7,"div",2),o._uU(8,"\n  "),o.YNc(9,f,4,0,"div",3),o._uU(10,"\n  "),o.Hsn(11,1),o._uU(12,"\n  "),o.YNc(13,m,4,0,"div",3),o._uU(14,"\n"),o.qZA(),o._uU(15,"\n"),o.ynx(16,4),o._uU(17,"\n  "),o.YNc(18,v,1,0,"ng-content",5),o._uU(19,"\n  "),o.YNc(20,y,1,1,"bit-error",6),o._uU(21,"\n"),o.BQk(),o._uU(22,"\n")),2&e&&(o.uIk("for",t.input.labelForId),o.xp6(4),o.Q6J("ngIf",t.input.required),o.xp6(5),o.Q6J("ngIf",t.prefixChildren.length),o.xp6(4),o.Q6J("ngIf",t.suffixChildren.length),o.xp6(3),o.Q6J("ngSwitch",t.input.hasError),o.xp6(2),o.Q6J("ngSwitchCase",!1),o.xp6(2),o.Q6J("ngSwitchCase",!0))},dependencies:[p.O5,p.RF,p.n9,l,h.C],encapsulation:2})},49106:(e,t,i)=>{"use strict";i.d(t,{k:()=>l});var n=i(13506),s=i(83758),o=i(39639),r=i(36903),a=i(85762);class l{}l.ɵfac=function(e){return new(e||l)},l.ɵmod=a.oAB({type:l}),l.ɵinj=a.cJS({imports:[r.m,n.s,s.g,o.q,n.s]})},54666:(e,t,i)=>{"use strict";i.d(t,{w:()=>a});var n=i(85762),s=i(21656),o=i(24637),r=i(78627);class a{onClick(){var e;this.toggled=!this.toggled,this.toggledChange.emit(this.toggled),this.update(),null===(e=this.formField.input)||void 0===e||e.focus()}constructor(e,t,i){this.button=e,this.formField=t,this.i18nService=i,this.toggled=!1,this.toggledChange=new n.vpe,this.title=this.i18nService.t("toggleVisibility"),this.label=this.i18nService.t("toggleVisibility")}get icon(){return this.toggled?"bwi-eye-slash":"bwi-eye"}ngOnChanges(){this.update()}ngAfterContentInit(){this.toggled="password"!==this.formField.input.type,this.button.icon=this.icon}update(){var e;this.button.icon=this.icon,null!=(null===(e=this.formField.input)||void 0===e?void 0:e.type)&&(this.formField.input.type=this.toggled?"text":"password",this.formField.input.spellcheck=!this.toggled&&void 0)}}a.ɵfac=function(e){return new(e||a)(n.Y36(s.Q,1),n.Y36(o.d),n.Y36(r.D))},a.ɵdir=n.lG2({type:a,selectors:[["","bitPasswordInputToggle",""]],hostVars:3,hostBindings:function(e,t){1&e&&n.NdJ("click",(function(){return t.onClick()})),2&e&&n.uIk("aria-pressed",t.toggled)("title",t.title)("aria-label",t.label)},inputs:{toggled:"toggled"},outputs:{toggledChange:"toggledChange"},features:[n.TTD]})},57139:(e,t,i)=>{"use strict";i.d(t,{Qj:()=>a,hV:()=>r,wq:()=>o,xO:()=>l});var n=i(85762),s=i(11394);const o=["tw-bg-background-alt","tw-border","tw-border-solid","tw-border-secondary-600","tw-text-muted","tw-rounded-none"],r=["hover:tw-bg-text-muted","hover:tw-text-contrast","disabled:tw-opacity-100","disabled:tw-bg-secondary-100","disabled:hover:tw-bg-secondary-100","disabled:hover:tw-text-muted","focus-visible:tw-ring-primary-700","focus-visible:tw-border-primary-700","focus-visible:tw-ring-1","focus-visible:tw-ring-inset","focus-visible:tw-ring-primary-700","focus-visible:tw-z-10"],a=["tw-block","tw-px-3","tw-py-1.5"];class l{constructor(e){this.buttonComponent=e}get classList(){return o.concat(["tw-border-r-0","first:tw-rounded-l","focus-visible:tw-border-r","focus-visible:tw-mr-[-1px]"]).concat(null!=this.buttonComponent?r:a)}ngOnInit(){var e;null===(e=this.buttonComponent)||void 0===e||e.setButtonType("unstyled")}}l.ɵfac=function(e){return new(e||l)(n.Y36(s.x,8))},l.ɵdir=n.lG2({type:l,selectors:[["","bitPrefix",""]],hostVars:2,hostBindings:function(e,t){2&e&&n.Tol(t.classList)},inputs:{classList:"classList"}})},1e4:(e,t,i)=>{"use strict";i.d(t,{e:()=>r});var n=i(57139),s=i(85762),o=i(11394);class r{constructor(e){this.buttonComponent=e}get classList(){return n.wq.concat(["tw-border-l-0","last:tw-rounded-r","focus-visible:tw-border-l","focus-visible:tw-ml-[-1px]"]).concat(null!=this.buttonComponent?n.hV:n.Qj)}ngOnInit(){var e;null===(e=this.buttonComponent)||void 0===e||e.setButtonType("unstyled")}}r.ɵfac=function(e){return new(e||r)(s.Y36(o.x,8))},r.ɵdir=s.lG2({type:r,selectors:[["","bitSuffix",""]],hostVars:2,hostBindings:function(e,t){2&e&&s.Tol(t.classList)},inputs:{classList:"classList"}})},21656:(e,t,i)=>{"use strict";i.d(t,{Q:()=>p});var n=i(11394),s=i(62348),o=i(85762),r=i(28508);const a=function(e){return{"tw-invisible":e}},l=function(e){return{"bwi-lg":e}},c=["tw-relative","before:tw-content-['']","before:tw-block","before:tw-absolute","before:-tw-inset-[3px]","before:tw-rounded-md","before:tw-transition","before:tw-ring","before:tw-ring-transparent","focus-visible:tw-z-10"],u={contrast:["tw-bg-transparent","!tw-text-contrast","tw-border-transparent","hover:tw-bg-transparent-hover","hover:tw-border-text-contrast","focus-visible:before:tw-ring-text-contrast","disabled:tw-opacity-60","disabled:hover:tw-border-transparent","disabled:hover:tw-bg-transparent",...c],main:["tw-bg-transparent","!tw-text-main","tw-border-transparent","hover:tw-bg-transparent-hover","hover:tw-border-text-main","focus-visible:before:tw-ring-text-main","disabled:tw-opacity-60","disabled:hover:tw-border-transparent","disabled:hover:tw-bg-transparent",...c],muted:["tw-bg-transparent","!tw-text-muted","tw-border-transparent","hover:tw-bg-transparent-hover","hover:tw-border-primary-700","focus-visible:before:tw-ring-primary-700","disabled:tw-opacity-60","disabled:hover:tw-border-transparent","disabled:hover:tw-bg-transparent",...c],primary:["tw-bg-primary-600","!tw-text-contrast","tw-border-primary-600","hover:tw-bg-primary-700","hover:tw-border-primary-700","focus-visible:before:tw-ring-primary-700","disabled:tw-opacity-60","disabled:hover:tw-border-primary-600","disabled:hover:tw-bg-primary-600",...c],secondary:["tw-bg-transparent","!tw-text-muted","tw-border-text-muted","hover:!tw-text-contrast","hover:tw-bg-text-muted","focus-visible:before:tw-ring-primary-700","disabled:tw-opacity-60","disabled:hover:tw-border-text-muted","disabled:hover:tw-bg-transparent","disabled:hover:!tw-text-muted","disabled:hover:tw-border-text-muted",...c],danger:["tw-bg-transparent","!tw-text-danger","tw-border-danger-600","hover:!tw-text-contrast","hover:tw-bg-danger-600","focus-visible:before:tw-ring-primary-700","disabled:tw-opacity-60","disabled:hover:tw-border-danger-600","disabled:hover:tw-bg-transparent","disabled:hover:!tw-text-danger","disabled:hover:tw-border-danger-600",...c],light:["tw-bg-transparent","!tw-text-alt2","tw-border-transparent","hover:tw-bg-transparent-hover","hover:tw-border-text-alt2","focus-visible:before:tw-ring-text-alt2","disabled:hover:tw-border-transparent","disabled:hover:tw-bg-transparent",...c],unstyled:[]},d={default:["tw-px-2.5","tw-py-1.5"],small:["tw-leading-none","tw-text-base","tw-p-1"]};class p{get classList(){var e;return["tw-font-semibold","tw-border","tw-border-solid","tw-rounded","tw-transition","hover:tw-no-underline","focus:tw-outline-none"].concat(u[null!==(e=this.buttonType)&&void 0!==e?e:"main"]).concat(d[this.size])}get iconClass(){return[this.icon,"!tw-m-0"]}get disabledAttr(){return!(!(null!=this.disabled&&!1!==this.disabled)&&!this.loading)||null}setButtonType(e){this.buttonType=e}getFocusTarget(){return this.elementRef.nativeElement}constructor(e){this.elementRef=e,this.size="default",this.loading=!1,this.disabled=!1}}p.ɵfac=function(e){return new(e||p)(o.Y36(o.SBq))},p.ɵcmp=o.Xpm({type:p,selectors:[["button","bitIconButton","",5,"button","bitButton",""]],hostVars:3,hostBindings:function(e,t){2&e&&(o.uIk("disabled",t.disabledAttr),o.Tol(t.classList))},inputs:{icon:["bitIconButton","icon"],buttonType:"buttonType",size:"size",loading:"loading",disabled:"disabled"},features:[o._Bn([{provide:n.x,useExisting:p},{provide:s.l,useExisting:p}])],attrs:["bitIconButton",""],decls:13,vars:10,consts:[[1,"tw-relative"],[3,"ngClass"],["aria-hidden","true",1,"bwi",3,"ngClass"],[1,"tw-absolute","tw-inset-0","tw-flex","tw-items-center","tw-justify-center",3,"ngClass"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"ngClass"]],template:function(e,t){1&e&&(o.TgZ(0,"span",0),o._uU(1,"\n  "),o.TgZ(2,"span",1),o._uU(3,"\n    "),o._UZ(4,"i",2),o._uU(5,"\n  "),o.qZA(),o._uU(6,"\n  "),o.TgZ(7,"span",3),o._uU(8,"\n    "),o._UZ(9,"i",4),o._uU(10,"\n  "),o.qZA(),o._uU(11,"\n"),o.qZA(),o._uU(12,"\n")),2&e&&(o.xp6(2),o.Q6J("ngClass",o.VKq(4,a,t.loading)),o.xp6(2),o.Q6J("ngClass",t.iconClass),o.xp6(3),o.Q6J("ngClass",o.VKq(6,a,!t.loading)),o.xp6(2),o.Q6J("ngClass",o.VKq(8,l,"default"===t.size)))},dependencies:[r.mk],encapsulation:2})},41938:(e,t,i)=>{"use strict";i.d(t,{v:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.ez]})},22221:(e,t,i)=>{"use strict";i.d(t,{G:()=>r});var n=i(66997),s=i(85762),o=i(68088);class r{set icon(e){if(!(0,n.yb)(e))return void(this.innerHtml="");const t=e.svg;this.innerHtml=this.domSanitizer.bypassSecurityTrustHtml(t)}constructor(e){this.domSanitizer=e}}r.ɵfac=function(e){return new(e||r)(s.Y36(o.H7))},r.ɵcmp=s.Xpm({type:r,selectors:[["bit-icon"]],hostVars:1,hostBindings:function(e,t){2&e&&s.Ikx("innerHtml",t.innerHtml,s.oJD)},inputs:{icon:"icon"},decls:0,vars:0,template:function(e,t){},encapsulation:2})},5261:(e,t,i)=>{"use strict";i.d(t,{Q:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.ez]})},66997:(e,t,i)=>{"use strict";i.d(t,{W4:()=>r,yb:()=>s});class n{constructor(e){this.svg=e}}function s(e){return e instanceof n}class o extends Error{constructor(){super("Dynamic content in icons is not allowed due to risk of user-injected XSS.")}}function r(e,...t){if(t.length>0)throw new o;return new n(e[0])}},83505:(e,t,i)=>{"use strict";i.d(t,{o:()=>n});const n=i(66997).W4`
<svg width="120" height="120" fill="none" xmlns="http://www.w3.org/2000/svg">
  <g opacity=".49">
    <path class="tw-fill-secondary-300" fill-rule="evenodd" clip-rule="evenodd" d="M40.36 73.256a30.004 30.004 0 0 0 10.346 1.826c16.282 0 29.482-12.912 29.482-28.84 0-.384-.008-.766-.023-1.145h28.726v39.57H40.36v-11.41Z" />
    <path class="tw-stroke-secondary-600" d="M21.546 46.241c0 15.929 13.2 28.841 29.482 28.841S80.51 62.17 80.51 46.241c0-15.928-13.2-28.841-29.482-28.841S21.546 30.313 21.546 46.241Z" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
    <path class="tw-fill-secondary-600" d="M35.36 70.595a1.2 1.2 0 0 0-2.4 0h2.4Zm77.475-30.356a2.343 2.343 0 0 1 2.365 2.33h2.4c0-2.593-2.107-4.73-4.765-4.73v2.4Zm2.365 2.33v46.047h2.4V42.57h-2.4Zm0 46.047c0 1.293-1.058 2.33-2.365 2.33v2.4c2.59 0 4.765-2.069 4.765-4.73h-2.4Zm-2.365 2.33h-75.11v2.4h75.11v-2.4Zm-75.11 0a2.343 2.343 0 0 1-2.365-2.33h-2.4c0 2.594 2.107 4.73 4.766 4.73v-2.4Zm-2.365-2.33v-18.02h-2.4v18.02h2.4Zm44.508-48.377h32.967v-2.4H79.868v2.4Z" />
    <path class="tw-stroke-secondary-600" d="M79.907 45.287h29.114v39.57H40.487V73.051" stroke-width="2" stroke-linejoin="round" />
    <path class="tw-stroke-secondary-600" d="M57.356 102.56h35.849" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
    <path class="tw-stroke-secondary-600" d="M68.954 92.147v10.413m11.599-10.413v10.413" stroke-width="4" stroke-linejoin="round" />
    <path class="tw-stroke-secondary-600" d="m27.44 64.945-4.51 4.51L5.72 86.663a3 3 0 0 0 0 4.243l1.238 1.238a3 3 0 0 0 4.243 0L28.41 74.936l4.51-4.51" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
    <path class="tw-stroke-secondary-600" d="M101.293 53.154H85.178m16.115 6.043H90.214m-5.036 0h-7.553m23.668 6.043h-7.05m-5.54 0h-15.61m28.2 6.042H85.178m-5.538 0h-8.562m30.215 6.043H78.632m-5.539 0H60m-5.54 0h-8.057" stroke-width="2" stroke-linecap="round" />
    <path class="tw-stroke-secondary-600" d="M29.164 33.01h41.529a2.4 2.4 0 0 1 2.4 2.4v6.28a2.4 2.4 0 0 1-2.4 2.4h-41.53a2.4 2.4 0 0 1-2.4-2.4v-6.28a2.4 2.4 0 0 1 2.4-2.4Z" stroke-width="4" />
    <path class="tw-stroke-secondary-600" d="M22.735 54.16h34.361a2.4 2.4 0 0 1 2.4 2.4v6.28a2.4 2.4 0 0 1-2.4 2.4H28.778m50.358-11.08h-6.161a2.4 2.4 0 0 0-2.4 2.4v6.414a2.266 2.266 0 0 0 2.266 2.265" stroke-width="4" stroke-linecap="round" />
  </g>
</svg>
`},62357:(e,t,i)=>{"use strict";i.d(t,{U:()=>a});var n=i(2097),s=i(27646),o=i(85762),r=i(62348);class a{set appAutofocus(e){this.autofocus=""===e||!0===e}constructor(e,t,i){this.el=e,this.ngZone=t,this.focusableElement=i}ngOnInit(){!s.c.isMobileBrowser&&this.autofocus&&(this.ngZone.isStable?this.focus():this.ngZone.onStable.pipe((0,n.q)(1)).subscribe(this.focus.bind(this)))}focus(){this.focusableElement?this.focusableElement.getFocusTarget().focus():this.el.nativeElement.focus()}}a.ɵfac=function(e){return new(e||a)(o.Y36(o.SBq),o.Y36(o.R0b),o.Y36(r.l,8))},a.ɵdir=o.lG2({type:a,selectors:[["","appAutofocus",""],["","bitAutofocus",""]],inputs:{appAutofocus:"appAutofocus"}})},11512:(e,t,i)=>{"use strict";i.d(t,{G:()=>a});var n=i(37513),s=i(23182),o=i(85762);let r=0;class a{get classList(){return["tw-block","tw-w-full","tw-px-3","tw-py-1.5","tw-bg-background-alt","tw-border","tw-border-solid",this.hasError?"tw-border-danger-600":"tw-border-secondary-600","tw-text-main","tw-placeholder-text-muted","tw-rounded-none","first:tw-rounded-l","last:tw-rounded-r","focus:tw-outline-none","focus:tw-border-primary-700","focus:tw-ring-1","focus:tw-ring-inset","focus:tw-ring-primary-700","focus:tw-z-10","disabled:tw-bg-secondary-100","[&:is(input,textarea):read-only]:tw-bg-secondary-100"].filter((e=>""!=e))}get ariaInvalid(){return!!this.hasError||void 0}get required(){var e,t,i,s;return null!==(s=null!==(e=this._required)&&void 0!==e?e:null===(i=null===(t=this.ngControl)||void 0===t?void 0:t.control)||void 0===i?void 0:i.hasValidator(n.kI.required))&&void 0!==s&&s}set required(e){this._required=null!=e&&!1!==e}get labelForId(){return this.id}onInput(){var e,t;null===(t=null===(e=this.ngControl)||void 0===e?void 0:e.control)||void 0===t||t.markAsUntouched()}get hasError(){var e,t,i,n,s,o;return this.showErrorsWhenDisabled?("INVALID"===(null===(e=this.ngControl)||void 0===e?void 0:e.status)||"DISABLED"===(null===(t=this.ngControl)||void 0===t?void 0:t.status))&&(null===(i=this.ngControl)||void 0===i?void 0:i.touched)&&null!=(null===(n=this.ngControl)||void 0===n?void 0:n.errors):"INVALID"===(null===(s=this.ngControl)||void 0===s?void 0:s.status)&&(null===(o=this.ngControl)||void 0===o?void 0:o.touched)}get error(){const e=Object.keys(this.ngControl.errors)[0];return[e,this.ngControl.errors[e]]}constructor(e,t,i){this.ngControl=e,this.ngZone=t,this.elementRef=i,this.id="bit-input-"+r++,this.hasPrefix=!1,this.hasSuffix=!1,this.showErrorsWhenDisabled=!1}focus(){this.ngZone.runOutsideAngular((()=>{const e=this.elementRef.nativeElement.value.length;this.elementRef.nativeElement.setSelectionRange(e,e),this.elementRef.nativeElement.focus()}))}}a.ɵfac=function(e){return new(e||a)(o.Y36(n.a5,10),o.Y36(o.R0b),o.Y36(o.SBq))},a.ɵdir=o.lG2({type:a,selectors:[["input","bitInput",""],["select","bitInput",""],["textarea","bitInput",""]],hostVars:8,hostBindings:function(e,t){1&e&&o.NdJ("input",(function(){return t.onInput()})),2&e&&(o.Ikx("id",t.id)("required",t.required),o.uIk("aria-describedby",t.ariaDescribedBy)("aria-invalid",t.ariaInvalid)("type",t.type)("spellcheck",t.spellcheck),o.Tol(t.classList))},inputs:{classList:"classList",id:"id",type:"type",spellcheck:"spellcheck",required:"required",hasPrefix:"hasPrefix",hasSuffix:"hasSuffix",showErrorsWhenDisabled:"showErrorsWhenDisabled"},features:[o._Bn([{provide:s.v,useExisting:a}])]})},83758:(e,t,i)=>{"use strict";i.d(t,{g:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.ez]})},33760:(e,t,i)=>{"use strict";i.d(t,{$:()=>h});var n=i(8111),s=i(19244),o=i(36903),r=i(85762),a=i(28508),l=i(49399),c=i(12492);const u=[[["","slot","sidebar"]],"*"],d=function(){return[]},p=function(){return{"--color-text-alt2":"var(--color-text-main)","--color-background-alt3":"var(--color-secondary-100)","--color-background-alt4":"var(--color-secondary-300)"}};class h{constructor(){this.mainContentId="main-content",this.variant="primary"}focusMainContent(){var e;null===(e=document.getElementById(this.mainContentId))||void 0===e||e.focus()}}h.ɵfac=function(e){return new(e||h)},h.ɵcmp=r.Xpm({type:h,selectors:[["bit-layout"]],inputs:{variant:"variant"},standalone:!0,features:[r.jDz],ngContentSelectors:["[slot=sidebar]","*"],decls:23,vars:9,consts:[[1,"tw-fixed","tw-z-50","tw-w-full","tw-flex","tw-justify-center","tw-opacity-0","focus-within:tw-opacity-100","tw-pointer-events-none","focus-within:tw-pointer-events-auto"],[1,"tw-bg-background-alt3","tw-rounded-md","tw-rounded-t-none","tw-py-2","tw-text-alt2"],["bitLink","","linkType","light",1,"tw-mx-6","focus-visible:before:!tw-ring-0",3,"fragment","routerLink","click"],[1,"tw-flex","tw-w-full"],[1,"tw-sticky","tw-inset-y-0","tw-h-screen","tw-w-60","tw-overflow-auto","tw-bg-background-alt3",3,"ngStyle"],["tabindex","-1",1,"tw-overflow-auto","tw-min-w-0","tw-flex-1","tw-bg-background","tw-p-6",3,"id"]],template:function(e,t){1&e&&(r.F$t(u),r.TgZ(0,"div",0),r._uU(1,"\n  "),r.TgZ(2,"nav",1),r._uU(3,"\n    "),r.TgZ(4,"a",2),r.NdJ("click",(function(){return t.focusMainContent()})),r._uU(5),r.ALo(6,"i18n"),r.qZA(),r._uU(7,"\n  "),r.qZA(),r._uU(8,"\n"),r.qZA(),r._uU(9,"\n"),r.TgZ(10,"div",3),r._uU(11,"\n  "),r.TgZ(12,"aside",4),r._uU(13,"\n    "),r.Hsn(14),r._uU(15,"\n  "),r.qZA(),r._uU(16,"\n  "),r.TgZ(17,"main",5),r._uU(18,"\n    "),r.Hsn(19,1),r._uU(20,"\n  "),r.qZA(),r._uU(21,"\n"),r.qZA(),r._uU(22,"\n")),2&e&&(r.xp6(4),r.Q6J("fragment",t.mainContentId)("routerLink",r.DdM(7,d)),r.xp6(1),r.Oqu(r.lcZ(6,5,"skipToContent")),r.xp6(7),r.Q6J("ngStyle","secondary"===t.variant&&r.DdM(8,p)),r.xp6(5),r.Q6J("id",t.mainContentId))},dependencies:[o.m,a.PC,l.C,s.L,c.r,n.Bz,n.rH],encapsulation:2})},12492:(e,t,i)=>{"use strict";i.d(t,{_:()=>l,r:()=>a});var n=i(85762);const s={primary:["!tw-text-primary-600","hover:!tw-text-primary-600","focus-visible:before:tw-ring-primary-700","disabled:!tw-text-primary-600/60"],secondary:["!tw-text-main","hover:!tw-text-main","focus-visible:before:tw-ring-primary-700","disabled:!tw-text-muted/60"],contrast:["!tw-text-contrast","hover:!tw-text-contrast","focus-visible:before:tw-ring-text-contrast","disabled:!tw-text-contrast/60"],light:["!tw-text-alt2","hover:!tw-text-alt2","focus-visible:before:tw-ring-text-alt2","disabled:!tw-text-alt2/60"]},o=["tw-text-unset","tw-leading-none","tw-p-0","tw-font-semibold","tw-bg-transparent","tw-border-0","tw-border-none","tw-rounded","tw-transition","hover:tw-underline","hover:tw-decoration-1","disabled:tw-no-underline","disabled:tw-cursor-not-allowed","focus-visible:tw-outline-none","focus-visible:tw-underline","focus-visible:tw-decoration-1","tw-relative","before:tw-content-['']","before:tw-block","before:tw-absolute","before:-tw-inset-x-[0.1em]","before:tw-rounded-md","before:tw-transition","focus-visible:before:tw-ring-2","focus-visible:tw-z-10"];class r{constructor(){this.linkType="primary"}}r.ɵfac=function(e){return new(e||r)},r.ɵdir=n.lG2({type:r,inputs:{linkType:"linkType"}});class a extends r{get classList(){var e;return["before:-tw-inset-y-[0.125rem]"].concat(o).concat(null!==(e=s[this.linkType])&&void 0!==e?e:[])}}a.ɵfac=function(){let e;return function(t){return(e||(e=n.n5z(a)))(t||a)}}(),a.ɵdir=n.lG2({type:a,selectors:[["a","bitLink",""]],hostVars:2,hostBindings:function(e,t){2&e&&n.Tol(t.classList)},features:[n.qOj]});class l extends r{get classList(){var e;return["before:-tw-inset-y-[0.25rem]"].concat(o).concat(null!==(e=s[this.linkType])&&void 0!==e?e:[])}}l.ɵfac=function(){let e;return function(t){return(e||(e=n.n5z(l)))(t||l)}}(),l.ɵdir=n.lG2({type:l,selectors:[["button","bitLink",""]],hostVars:2,hostBindings:function(e,t){2&e&&n.Tol(t.classList)},features:[n.qOj]})},19244:(e,t,i)=>{"use strict";i.d(t,{L:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.ez]})},91849:(e,t,i)=>{"use strict";i.d(t,{n:()=>s});var n=i(85762);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵcmp=n.Xpm({type:s,selectors:[["bit-menu-divider"]],decls:2,vars:0,consts:[["role","separator","aria-hidden","true",1,"tw-my-2","tw-border-0","tw-border-t","tw-border-solid","tw-border-t-secondary-600"]],template:function(e,t){1&e&&(n._UZ(0,"div",0),n._uU(1,"\n"))},encapsulation:2})},44234:(e,t,i)=>{"use strict";i.d(t,{e:()=>s});var n=i(85762);class s{constructor(e){this.elementRef=e,this.classList=["tw-block","tw-py-1","tw-px-4","!tw-text-main","!tw-no-underline","tw-cursor-pointer","tw-border-none","tw-bg-background","tw-text-left","hover:tw-bg-secondary-100","focus-visible:tw-bg-secondary-100","focus-visible:tw-z-50","focus-visible:tw-outline-none","focus-visible:tw-ring","focus-visible:tw-ring-offset-2","focus-visible:tw-ring-primary-700","active:!tw-ring-0","active:!tw-ring-offset-0"],this.role="menuitem",this.tabIndex="-1"}focus(){this.elementRef.nativeElement.focus()}}s.ɵfac=function(e){return new(e||s)(n.Y36(n.SBq))},s.ɵdir=n.lG2({type:s,selectors:[["","bitMenuItem",""]],hostVars:4,hostBindings:function(e,t){2&e&&(n.Ikx("tabIndex",t.tabIndex),n.uIk("role",t.role),n.Tol(t.classList))}})},26194:(e,t,i)=>{"use strict";i.d(t,{t:()=>l});var n=i(83134),s=i(67775),o=i(85139),r=i(85762),a=i(87996);class l{get hasPopup(){var e;return(null===(e=this.menu)||void 0===e?void 0:e.ariaRole)||"menu"}constructor(e,t,i){this.elementRef=e,this.viewContainerRef=t,this.overlay=i,this.isOpen=!1,this.role="button",this.defaultMenuConfig={panelClass:"bit-menu-panel",hasBackdrop:!0,backdropClass:"cdk-overlay-transparent-backdrop",scrollStrategy:this.overlay.scrollStrategies.reposition(),positionStrategy:this.overlay.position().flexibleConnectedTo(this.elementRef).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}]).withLockedPosition(!0).withFlexibleDimensions(!1).withPush(!0)}}toggleMenu(){this.isOpen?this.destroyMenu():this.openMenu()}ngOnDestroy(){this.disposeAll()}openMenu(){if(null==this.menu)throw new Error("Cannot find bit-menu element");this.isOpen=!0,this.overlayRef=this.overlay.create(this.defaultMenuConfig);const e=new n.UE(this.menu.templateRef,this.viewContainerRef);this.overlayRef.attach(e),this.closedEventsSub=this.getClosedEvents().subscribe((e=>{["Tab","Escape"].includes(null==e?void 0:e.key)&&this.elementRef.nativeElement.focus(),this.destroyMenu()})),this.menu.keyManager&&(this.menu.keyManager.setFirstItemActive(),this.keyDownEventsSub=this.overlayRef.keydownEvents().subscribe((e=>this.menu.keyManager.onKeydown(e))))}destroyMenu(){null!=this.overlayRef&&this.isOpen&&(this.isOpen=!1,this.disposeAll())}getClosedEvents(){const e=this.overlayRef.detachments(),t=this.overlayRef.keydownEvents().pipe((0,s.h)((e=>("menu"===this.menu.ariaRole?["Escape","Tab"]:["Escape"]).includes(e.key)))),i=this.overlayRef.backdropClick(),n=this.menu.closed;return e.pipe((0,o.b)(t,i,n))}disposeAll(){var e,t,i;null===(e=this.closedEventsSub)||void 0===e||e.unsubscribe(),null===(t=this.overlayRef)||void 0===t||t.dispose(),null===(i=this.keyDownEventsSub)||void 0===i||i.unsubscribe()}}l.ɵfac=function(e){return new(e||l)(r.Y36(r.SBq),r.Y36(r.s_b),r.Y36(a.aV))},l.ɵdir=r.lG2({type:l,selectors:[["","bitMenuTriggerFor",""]],hostVars:3,hostBindings:function(e,t){1&e&&r.NdJ("click",(function(){return t.toggleMenu()})),2&e&&r.uIk("aria-expanded",t.isOpen)("aria-haspopup",t.hasPopup)("role",t.role)},inputs:{menu:["bitMenuTriggerFor","menu"]}})},73974:(e,t,i)=>{"use strict";i.d(t,{M:()=>a});var n=i(66267),s=i(85762),o=i(44234);function r(e,t){if(1&e){const e=s.EpF();s._uU(0,"\n  "),s.TgZ(1,"div",0),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.closed.emit())})),s._uU(2,"\n    "),s.Hsn(3),s._uU(4,"\n  "),s.qZA(),s._uU(5,"\n")}if(2&e){const e=s.oxw();s.xp6(1),s.Q6J("cdkTrapFocusAutoCapture","dialog"===e.ariaRole),s.uIk("role",e.ariaRole)("aria-label",e.ariaLabel)}}class a{constructor(){this.closed=new s.vpe,this.ariaRole="menu"}ngAfterContentInit(){"menu"===this.ariaRole&&(this.keyManager=new n.Em(this.menuItems).withWrap())}}a.ɵfac=function(e){return new(e||a)},a.ɵcmp=s.Xpm({type:a,selectors:[["bit-menu"]],contentQueries:function(e,t,i){if(1&e&&s.Suo(i,o.e,5),2&e){let e;s.iGM(e=s.CRH())&&(t.menuItems=e)}},viewQuery:function(e,t){if(1&e&&s.Gf(s.Rgc,5),2&e){let e;s.iGM(e=s.CRH())&&(t.templateRef=e.first)}},inputs:{ariaRole:"ariaRole",ariaLabel:"ariaLabel"},outputs:{closed:"closed"},exportAs:["menuComponent"],ngContentSelectors:["*"],decls:2,vars:0,consts:[["cdkTrapFocus","",1,"tw-flex","tw-shrink-0","tw-flex-col","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-600","tw-bg-background","tw-bg-clip-padding","tw-py-2","tw-overflow-y-auto",3,"cdkTrapFocusAutoCapture","click"]],template:function(e,t){1&e&&(s.F$t(),s.YNc(0,r,6,3,"ng-template"),s._uU(1,"\n"))},dependencies:[n.mK],encapsulation:2})},59692:(e,t,i)=>{"use strict";i.d(t,{$:()=>a});var n=i(66267),s=i(87996),o=i(28508),r=i(85762);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=r.oAB({type:a}),a.ɵinj=r.cJS({imports:[n.rt,o.ez,s.U8]})},6378:(e,t,i)=>{"use strict";i.d(t,{O:()=>w});var n=i(25400),s=i(85762),o=i(37513),r=i(41085),a=i(23182),l=i(78627),c=i(28508),u=i(66385),d=i(49399);function p(e,t){if(1&e&&(s._uU(0,"\n    "),s._UZ(1,"i",4),s._uU(2,"\n  ")),2&e){const e=s.oxw();s.xp6(1),s.Q6J("title",e.loadingText)}}function h(e,t){if(1&e&&s._UZ(0,"i",8),2&e){const e=s.oxw().item;s.Gre("tw-mr-1 bwi bwi-fw ",e.icon,"")}}function g(e,t){if(1&e){const e=s.EpF();s._uU(0,"\n    "),s.TgZ(1,"button",5),s.NdJ("click",(function(){const t=s.CHM(e),i=t.item,n=t.clear;return s.KtG(n(i))})),s._uU(2,"\n      "),s.YNc(3,h,1,3,"i",6),s._uU(4),s._UZ(5,"i",7),s._uU(6,"\n    "),s.qZA(),s._uU(7,"\n  ")}if(2&e){const e=t.item,i=s.oxw();s.xp6(1),s.Q6J("disabled",i.disabled),s.xp6(2),s.Q6J("ngIf",null!=e.icon),s.xp6(1),s.hij("\n      ",e.labelName,"\n      ")}}function f(e,t){1&e&&s._UZ(0,"i",14)}function m(e,t){if(1&e&&s._UZ(0,"i",8),2&e){const e=s.oxw().item;s.Gre("bwi bwi-fw ",e.icon,"")}}function v(e,t){if(1&e&&(s._uU(0,"\n    "),s.TgZ(1,"div",9),s._uU(2,"\n      "),s.TgZ(3,"div",10),s._uU(4,"\n        "),s.YNc(5,f,1,0,"i",11),s._uU(6,"\n      "),s.qZA(),s._uU(7,"\n      "),s.TgZ(8,"div",12),s._uU(9,"\n        "),s.YNc(10,m,1,3,"i",6),s._uU(11,"\n      "),s.qZA(),s._uU(12,"\n      "),s.TgZ(13,"div",13),s._uU(14),s.qZA(),s._uU(15,"\n    "),s.qZA(),s._uU(16,"\n  ")),2&e){const e=t.item,i=s.oxw();s.xp6(5),s.Q6J("ngIf",i.isSelected(e)),s.xp6(5),s.Q6J("ngIf",null!=e.icon),s.xp6(4),s.hij("\n        ",e.listName,"\n      ")}}let y=0;class w{constructor(e,t){this.i18nService=e,this.ngControl=t,this.removeSelectedItems=!1,this.loading=!1,this.disabled=!1,this.searchInputId="search-input-"+y++,this.onItemsConfirmed=new s.vpe,this.keyDown=e=>!(!this.select.isOpen&&"Enter"===e.key&&!(0,n.Vb)(e))&&(!(this.select.isOpen&&"Escape"===e.key&&!(0,n.Vb)(e))||(this.selectedItems=[],this.select.close(),e.stopPropagation(),!1)),this.id="bit-multi-select-"+y++,null!=t&&(t.valueAccessor=this)}ngOnInit(){var e;this.placeholder=null!==(e=this.placeholder)&&void 0!==e?e:this.i18nService.t("multiSelectPlaceholder"),this.loadingText=this.i18nService.t("multiSelectLoading")}isSelected(e){var t;return null!=(null===(t=this.selectedItems)||void 0===t?void 0:t.find((t=>t.id===e.id)))}onDropdownClosed(){if(null!=this.selectedItems&&0!=this.selectedItems.length&&(this.onItemsConfirmed.emit(this.selectedItems),this.removeSelectedItems)){let e=this.baseItems;this.selectedItems.forEach((t=>{e=e.filter((e=>t.id!==e.id))})),this.selectedItems=null,this.baseItems=e}}writeValue(e){this.selectedItems=e}registerOnChange(e){this.notifyOnChange=e}registerOnTouched(e){this.notifyOnTouched=e}setDisabledState(e){this.disabled=e}onChange(e){this.notifyOnChange&&this.notifyOnChange(e)}onBlur(){this.notifyOnTouched&&this.notifyOnTouched()}get ariaDescribedBy(){return this._ariaDescribedBy}set ariaDescribedBy(e){var t;this._ariaDescribedBy=e,null===(t=this.select)||void 0===t||t.searchInput.nativeElement.setAttribute("aria-describedby",e)}get labelForId(){return this.searchInputId}get required(){var e,t,i,n;return null!==(n=null!==(e=this._required)&&void 0!==e?e:null===(i=null===(t=this.ngControl)||void 0===t?void 0:t.control)||void 0===i?void 0:i.hasValidator(o.kI.required))&&void 0!==n&&n}set required(e){this._required=null!=e&&!1!==e}get hasError(){var e,t;return"INVALID"===(null===(e=this.ngControl)||void 0===e?void 0:e.status)&&(null===(t=this.ngControl)||void 0===t?void 0:t.touched)}get error(){var e,t;const i=Object.keys(null===(e=this.ngControl)||void 0===e?void 0:e.errors)[0];return[i,null===(t=this.ngControl)||void 0===t?void 0:t.errors[i]]}}w.ɵfac=function(e){return new(e||w)(s.Y36(l.D),s.Y36(o.a5,10))},w.ɵcmp=s.Xpm({type:w,selectors:[["bit-multi-select"]],viewQuery:function(e,t){if(1&e&&s.Gf(r.w9,5),2&e){let e;s.iGM(e=s.CRH())&&(t.select=e.first)}},hostVars:3,hostBindings:function(e,t){2&e&&(s.Ikx("id",t.id),s.uIk("aria-describedby",t.ariaDescribedBy)("required",t.required))},inputs:{baseItems:"baseItems",removeSelectedItems:"removeSelectedItems",placeholder:"placeholder",loading:"loading",disabled:"disabled",id:"id",required:"required"},outputs:{onItemsConfirmed:"onItemsConfirmed"},features:[s._Bn([{provide:a.v,useExisting:w}])],decls:11,vars:17,consts:[["bindLabel","listName","groupBy","parentGrouping","appendTo","body",3,"items","ngModel","placeholder","loading","loadingText","notFoundText","clearAllText","multiple","closeOnSelect","disabled","clearSearchOnAdd","labelForId","keyDownFn","ngModelChange","blur","close"],["ng-loadingspinner-tmp",""],["ng-label-tmp",""],["ng-option-tmp",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-mr-1",3,"title"],["type","button","bitBadge","","variant","primary",1,"tw-mr-1","disabled:tw-border-0",3,"disabled","click"],["aria-hidden","true",3,"class",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-close","bwi-sm","tw-ml-1"],["aria-hidden","true"],[1,"tw-flex"],[1,"tw-w-7","tw-flex-none"],["class","bwi bwi-fw bwi-check","aria-hidden","true",4,"ngIf"],[1,"tw-mr-2","tw-flex-initial"],[1,"tw-flex-1"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-check"]],template:function(e,t){1&e&&(s.TgZ(0,"ng-select",0),s.NdJ("ngModelChange",(function(e){return t.selectedItems=e}))("ngModelChange",(function(e){return t.onChange(e)}))("blur",(function(){return t.onBlur()}))("close",(function(){return t.onDropdownClosed()})),s.ALo(1,"i18n"),s.ALo(2,"i18n"),s._uU(3,"\n  "),s.YNc(4,p,3,1,"ng-template",1),s._uU(5,"\n  "),s.YNc(6,g,8,3,"ng-template",2),s._uU(7,"\n  "),s.YNc(8,v,17,3,"ng-template",3),s._uU(9,"\n"),s.qZA(),s._uU(10,"\n")),2&e&&(s.s9C("notFoundText",s.lcZ(1,13,"multiSelectNotFound")),s.s9C("clearAllText",s.lcZ(2,15,"multiSelectClearAll")),s.Q6J("items",t.baseItems)("ngModel",t.selectedItems)("placeholder",t.placeholder)("loading",t.loading)("loadingText",t.loadingText)("multiple",!0)("closeOnSelect",!1)("disabled",t.disabled)("clearSearchOnAdd",!0)("labelForId",t.labelForId)("keyDownFn",t.keyDown))},dependencies:[c.O5,o.JJ,o.On,r.w9,r.ir,r.mR,r.dk,u.l,d.C],encapsulation:2})},39639:(e,t,i)=>{"use strict";i.d(t,{q:()=>c});var n=i(28508),s=i(37513),o=i(41085),r=i(47404),a=i(36903),l=i(85762);class c{}c.ɵfac=function(e){return new(e||c)},c.ɵmod=l.oAB({type:c}),c.ɵinj=l.cJS({imports:[n.ez,s.u5,o.A0,r.T,a.m]})},96863:(e,t,i)=>{"use strict";i.d(t,{M:()=>s});var n=i(85762);class s{constructor(){this.routerLinkActiveOptions={paths:"subset",queryParams:"ignored",fragment:"ignored",matrixParams:"ignored"},this.variant="default",this.treeDepth=0,this.hideActiveStyles=!1,this.mainContentClicked=new n.vpe}}s.ɵfac=function(e){return new(e||s)},s.ɵdir=n.lG2({type:s,inputs:{text:"text",ariaLabel:"ariaLabel",icon:"icon",route:"route",relativeTo:"relativeTo",routerLinkActiveOptions:"routerLinkActiveOptions",variant:"variant",treeDepth:"treeDepth",hideActiveStyles:"hideActiveStyles"},outputs:{mainContentClicked:"mainContentClicked"}})},11169:(e,t,i)=>{"use strict";i.d(t,{W:()=>h});var n=i(85762),s=i(96863);const o=function(e,t){return[e,t]};function r(e,t){if(1&e){const e=n.EpF();n._uU(0,"\n    "),n.TgZ(1,"button",6),n.NdJ("click",(function(t){n.CHM(e);const i=n.oxw();return n.KtG(i.toggle(t))})),n.ALo(2,"i18n"),n.ALo(3,"i18n"),n.qZA(),n._uU(4,"\n  ")}if(2&e){const e=n.oxw();n.xp6(1),n.Q6J("bitIconButton",e.open?"bwi-angle-up":"tree"===e.variant?"bwi-angle-right":"bwi-angle-down")("buttonType","light")("title",n.lcZ(2,6,"toggleCollapse")),n.uIk("aria-expanded",e.open.toString())("aria-controls",e.contentId)("aria-label",n.WLB(10,o,n.lcZ(3,8,"toggleCollapse"),e.text).join(" "))}}function a(e,t){1&e&&n.GkF(0)}function l(e,t){if(1&e&&(n.ynx(0,7),n._uU(1,"\n    "),n.YNc(2,a,1,0,"ng-container",8),n._uU(3,"\n  "),n.BQk()),2&e){n.oxw();const e=n.MAs(4);n.xp6(2),n.Q6J("ngTemplateOutlet",e)}}function c(e,t){1&e&&n.GkF(0)}function u(e,t){if(1&e&&(n.ynx(0),n._uU(1,"\n      "),n.YNc(2,c,1,0,"ng-container",8),n._uU(3,"\n    "),n.BQk()),2&e){n.oxw();const e=n.MAs(4);n.xp6(2),n.Q6J("ngTemplateOutlet",e)}}function d(e,t){if(1&e&&(n.TgZ(0,"div",9),n.ALo(1,"i18n"),n._uU(2,"\n  "),n.Hsn(3,1),n._uU(4,"\n"),n.qZA()),2&e){const e=n.oxw();n.uIk("id",e.contentId)("aria-label",n.WLB(4,o,e.text,n.lcZ(1,2,"submenu")).join(" "))}}const p=[[["","slot","end"]],"*"];class h extends s.M{get parentHideActiveStyles(){return this.hideActiveStyles||this.open}constructor(e){super(),this.parentNavGroup=e,this.contentId=Math.random().toString(36).substring(2),this.open=!1,this.openChange=new n.vpe}setOpen(e){var t;this.open=e,this.openChange.emit(this.open),this.open&&(null===(t=this.parentNavGroup)||void 0===t||t.setOpen(this.open))}toggle(e){null==e||e.stopPropagation(),this.setOpen(!this.open)}initNestedStyles(){"tree"===this.variant&&[...this.nestedNavComponents].forEach((e=>{e.treeDepth+=1}))}ngAfterContentInit(){this.initNestedStyles()}}h.ɵfac=function(e){return new(e||h)(n.Y36(h,12))},h.ɵcmp=n.Xpm({type:h,selectors:[["bit-nav-group"]],contentQueries:function(e,t,i){if(1&e&&n.Suo(i,s.M,5),2&e){let e;n.iGM(e=n.CRH())&&(t.nestedNavComponents=e)}},inputs:{open:"open"},outputs:{openChange:"openChange"},features:[n._Bn([{provide:s.M,useExisting:h}]),n.qOj],ngContentSelectors:["[slot=end]","*"],decls:20,vars:12,consts:[[3,"text","icon","route","relativeTo","routerLinkActiveOptions","variant","treeDepth","ariaLabel","hideActiveStyles","mainContentClicked"],["button",""],["slot","start",4,"ngIf"],["slot","end"],[4,"ngIf"],["role","group",4,"ngIf"],["type","button","size","small","aria-haspopup","true",1,"tw-ml-auto",3,"bitIconButton","buttonType","title","click"],["slot","start"],[4,"ngTemplateOutlet"],["role","group"]],template:function(e,t){1&e&&(n.F$t(p),n._uU(0,"\n"),n.TgZ(1,"bit-nav-item",0),n.NdJ("mainContentClicked",(function(){return t.toggle()}))("mainContentClicked",(function(){return t.mainContentClicked.emit()})),n._uU(2,"\n  "),n.YNc(3,r,5,13,"ng-template",null,1,n.W1O),n._uU(5,"\n\n  "),n._uU(6,"\n  "),n.YNc(7,l,4,1,"ng-container",2),n._uU(8,"\n  "),n.ynx(9,3),n._uU(10,"\n    "),n.Hsn(11),n._uU(12,"\n    "),n.YNc(13,u,4,1,"ng-container",4),n._uU(14,"\n  "),n.BQk(),n._uU(15,"\n"),n.qZA(),n._uU(16,"\n\n"),n._uU(17,"\n"),n.YNc(18,d,5,7,"div",5),n._uU(19,"\n")),2&e&&(n.xp6(1),n.Q6J("text",t.text)("icon",t.icon)("route",t.route)("relativeTo",t.relativeTo)("routerLinkActiveOptions",t.routerLinkActiveOptions)("variant",t.variant)("treeDepth",t.treeDepth)("ariaLabel",t.ariaLabel)("hideActiveStyles",t.parentHideActiveStyles),n.xp6(6),n.Q6J("ngIf","tree"===t.variant),n.xp6(6),n.Q6J("ngIf","tree"!==t.variant),n.xp6(5),n.Q6J("ngIf",t.open))},encapsulation:2})},59880:(e,t,i)=>{"use strict";i.d(t,{H:()=>A});var n=i(59554),s=i(92786),o=i(96863),r=i(85762),a=i(11169),l=i(28508),c=i(21656),u=i(8111);const d=function(e){return{"tw-w-0":e}};function p(e,t){if(1&e&&(r.TgZ(0,"div",10),r._uU(1,"\n      "),r._UZ(2,"button",11),r._uU(3,"\n    "),r.qZA()),2&e){const e=r.oxw();r.Q6J("ngClass",r.VKq(2,d,"tree"!==e.variant)),r.xp6(2),r.Q6J("bitIconButton","bwi-angle-down")}}function h(e,t){1&e&&r.GkF(0)}function g(e,t){if(1&e&&(r._uU(0,"\n      "),r._UZ(1,"i"),r.TgZ(2,"span",12),r._uU(3),r.qZA(),r._uU(4,"\n    ")),2&e){const e=r.oxw();r.xp6(1),r.Gre("bwi bwi-fw tw-text-alt2 tw-mx-1 ",e.icon,""),r.xp6(1),r.Q6J("title",e.text)("ngClass",e.showActiveStyles?"tw-font-bold":"tw-font-semibold"),r.xp6(1),r.Oqu(e.text)}}function f(e,t){1&e&&r.GkF(0)}function m(e,t){if(1&e){const e=r.EpF();r._uU(0,"\n      "),r._uU(1,"\n      "),r._uU(2,"\n      "),r.TgZ(3,"a",13),r.NdJ("isActiveChange",(function(t){r.CHM(e);const i=r.oxw();return r.KtG(i.setIsActive(t))}))("click",(function(){r.CHM(e);const t=r.oxw();return r.KtG(t.mainContentClicked.emit())})),r._uU(4,"\n        "),r.YNc(5,f,1,0,"ng-container",14),r._uU(6,"\n      "),r.qZA(),r._uU(7,"\n    ")}if(2&e){const e=r.oxw(),t=r.MAs(18);r.xp6(3),r.Q6J("routerLink",e.route)("relativeTo",e.relativeTo)("routerLinkActiveOptions",e.routerLinkActiveOptions)("ariaCurrentWhenActive","page"),r.uIk("aria-label",e.ariaLabel||e.text),r.xp6(2),r.Q6J("ngTemplateOutlet",t)}}function v(e,t){1&e&&r.GkF(0)}function y(e,t){if(1&e){const e=r.EpF();r._uU(0,"\n      "),r._uU(1,"\n      "),r.TgZ(2,"button",15),r.NdJ("click",(function(){r.CHM(e);const t=r.oxw();return r.KtG(t.mainContentClicked.emit())})),r._uU(3,"\n        "),r.YNc(4,v,1,0,"ng-container",14),r._uU(5,"\n      "),r.qZA(),r._uU(6,"\n    ")}if(2&e){r.oxw();const e=r.MAs(18);r.xp6(4),r.Q6J("ngTemplateOutlet",e)}}const w=[[["","slot","start"]],[["","slot","end"]]],b=function(e,t){return[e,t]},U=function(e){return{"padding-left":e}},_=function(e){return[e]};class A extends o.M{setIsActive(e){this._isActive=e,this._isActive&&this.parentNavGroup&&this.parentNavGroup.setOpen(!0)}get showActiveStyles(){return this._isActive&&!this.hideActiveStyles}onFocusIn(e){this.focusVisibleWithin$.next(e.matches(".fvw:focus-visible"))}onFocusOut(){this.focusVisibleWithin$.next(!1)}constructor(e){super(),this.parentNavGroup=e,this._isActive=!1,this.focusVisibleWithin$=new n.X(!1),this.fvwStyles$=this.focusVisibleWithin$.pipe((0,s.U)((e=>e?"tw-z-10 tw-rounded tw-outline-none tw-ring tw-ring-inset tw-ring-text-alt2":"")))}}A.ɵfac=function(e){return new(e||A)(r.Y36(a.W,8))},A.ɵcmp=r.Xpm({type:A,selectors:[["bit-nav-item"]],hostBindings:function(e,t){1&e&&r.NdJ("focusin",(function(e){return t.onFocusIn(e.target)}))("focusout",(function(){return t.onFocusOut()}))},features:[r._Bn([{provide:o.M,useExisting:A}]),r.qOj],ngContentSelectors:["[slot=start]","[slot=end]"],decls:35,vars:16,consts:[[1,"tw-relative",3,"ngClass"],[1,"tw-relative","tw-flex","tw-items-center","tw-pr-4",3,"ngStyle","ngClass"],[1,"[&>*:focus-visible::before]:!tw-ring-text-alt2","[&>*:hover]:!tw-border-text-alt2","[&>*]:!tw-text-alt2"],["slotStart",""],[3,"ngClass",4,"ngIf"],[4,"ngIf","ngIfThen","ngIfElse"],["anchorAndButtonContent",""],["isAnchor",""],["isButton",""],[1,"tw-flex","tw-gap-1","[&>*:focus-visible::before]:!tw-ring-text-alt2","[&>*:hover]:!tw-border-text-alt2","[&>*]:tw-text-alt2"],[3,"ngClass"],["type","button","size","small","aria-hidden","true",1,"tw-invisible",3,"bitIconButton"],[3,"title","ngClass"],["routerLinkActive","",1,"fvw","tw-w-full","tw-truncate","tw-border-none","tw-bg-transparent","tw-p-0","tw-text-start","!tw-text-alt2","hover:tw-text-alt2","hover:tw-no-underline","focus:tw-outline-none","[&>:not(.bwi)]:hover:tw-underline",3,"routerLink","relativeTo","routerLinkActiveOptions","ariaCurrentWhenActive","isActiveChange","click"],[4,"ngTemplateOutlet"],["type","button",1,"fvw","tw-w-full","tw-truncate","tw-border-none","tw-bg-transparent","tw-p-0","tw-text-start","!tw-text-alt2","hover:tw-text-alt2","hover:tw-no-underline","focus:tw-outline-none","[&>:not(.bwi)]:hover:tw-underline",3,"click"]],template:function(e,t){if(1&e&&(r.F$t(w),r.TgZ(0,"div",0),r.ALo(1,"async"),r._uU(2,"\n  "),r.TgZ(3,"div",1),r._uU(4,"\n    "),r.TgZ(5,"div",2,3),r._uU(7,"\n      "),r.Hsn(8),r._uU(9,"\n    "),r.qZA(),r._uU(10,"\n    "),r._uU(11,"\n    "),r.YNc(12,p,4,4,"div",4),r._uU(13,"\n\n    "),r.YNc(14,h,1,0,"ng-container",5),r._uU(15,"\n\n    "),r._uU(16,"\n    "),r.YNc(17,g,5,6,"ng-template",null,6,r.W1O),r._uU(19,"\n\n    "),r._uU(20,"\n    "),r.YNc(21,m,8,6,"ng-template",null,7,r.W1O),r._uU(23,"\n\n    "),r._uU(24,"\n    "),r.YNc(25,y,7,1,"ng-template",null,8,r.W1O),r._uU(27,"\n\n    "),r.TgZ(28,"div",9),r._uU(29,"\n      "),r.Hsn(30,1),r._uU(31,"\n    "),r.qZA(),r._uU(32,"\n  "),r.qZA(),r._uU(33,"\n"),r.qZA(),r._uU(34,"\n")),2&e){const e=r.MAs(6),i=r.MAs(22),n=r.MAs(26);r.Q6J("ngClass",r.WLB(9,b,t.showActiveStyles?"tw-bg-background-alt4":"tw-bg-background-alt3 hover:tw-bg-primary-300/60",r.lcZ(1,7,t.fvwStyles$))),r.xp6(3),r.Q6J("ngStyle",r.VKq(12,U,("tree"===t.variant?2.5:1)+1.5*t.treeDepth+"rem"))("ngClass",r.VKq(14,_,"tree"===t.variant?"tw-py-1":"tw-py-2")),r.xp6(9),r.Q6J("ngIf",0===e.childElementCount),r.xp6(2),r.Q6J("ngIf",t.route)("ngIfThen",i)("ngIfElse",n)}},dependencies:[l.mk,l.O5,l.tP,l.PC,c.Q,u.rH,u.Od,l.Ov],encapsulation:2})},38261:(e,t,i)=>{"use strict";i.d(t,{A:()=>h});var n=i(87996),s=i(28508),o=i(8111),r=i(41938),a=i(36903),l=i(11169),c=i(59880),u=i(85762),d=i(21656),p=i(49399);class h{}h.ɵfac=function(e){return new(e||h)},h.ɵmod=u.oAB({type:h}),h.ɵinj=u.cJS({imports:[s.ez,a.m,r.v,n.U8,o.Bz]}),u.B6R(l.W,[s.O5,s.tP,d.Q,c.H],[p.C])},63339:(e,t,i)=>{"use strict";i.d(t,{M:()=>a});var n=i(83505),s=i(85762),o=i(22221);const r=[[["","slot","title"]],[["","slot","description"]],[["","slot","button"]]];class a{constructor(){this.icon=n.o}}a.ɵfac=function(e){return new(e||a)},a.ɵcmp=s.Xpm({type:a,selectors:[["bit-no-items"]],inputs:{icon:"icon"},ngContentSelectors:["[slot=title]","[slot=description]","[slot=button]"],decls:23,vars:1,consts:[[1,"tw-mx-auto","tw-flex","tw-flex-col","tw-items-center","tw-justify-center","tw-pt-6","tw-text-center"],[1,"tw-max-w-sm"],["aria-hidden","true",3,"icon"],[1,"tw-font-semibold"],[1,"tw-space-x-2"]],template:function(e,t){1&e&&(s.F$t(r),s.TgZ(0,"div",0),s._uU(1,"\n  "),s.TgZ(2,"div",1),s._uU(3,"\n    "),s._UZ(4,"bit-icon",2),s._uU(5,"\n    "),s.TgZ(6,"h3",3),s._uU(7,"\n      "),s.Hsn(8),s._uU(9,"\n    "),s.qZA(),s._uU(10,"\n    "),s.TgZ(11,"p"),s._uU(12,"\n      "),s.Hsn(13,1),s._uU(14,"\n    "),s.qZA(),s._uU(15,"\n  "),s.qZA(),s._uU(16,"\n  "),s.TgZ(17,"div",4),s._uU(18,"\n    "),s.Hsn(19,2),s._uU(20,"\n  "),s.qZA(),s._uU(21,"\n"),s.qZA(),s._uU(22,"\n")),2&e&&(s.xp6(4),s.Q6J("icon",t.icon))},dependencies:[o.G],encapsulation:2})},98002:(e,t,i)=>{"use strict";i.d(t,{t:()=>r});var n=i(28508),s=i(5261),o=i(85762);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵmod=o.oAB({type:r}),r.ɵinj=o.cJS({imports:[n.ez,s.Q]})},51676:(e,t,i)=>{"use strict";i.d(t,{q:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.ez]})},21500:(e,t,i)=>{"use strict";i.d(t,{_:()=>p});var n=i(85762),s=i(66079),o=i(75734),r=i(37513),a=i(11601);let l=0;class c{constructor(e){this.ngControl=e,this.id="bit-radio-input-"+l++,this.inputClasses=["tw-appearance-none","tw-outline-none","tw-relative","tw-transition","tw-cursor-pointer","tw-inline-block","tw-rounded-full","tw-border","tw-border-solid","tw-border-secondary-600","tw-w-3.5","tw-h-3.5","tw-mr-1.5","tw-bottom-[-1px]","tw-flex-none","hover:tw-border-2","[&>label:hover]:tw-border-2","before:tw-content-['']","before:tw-transition","before:tw-block","before:tw-absolute","before:tw-rounded-full","before:tw-inset-[2px]","focus-visible:tw-ring-2","focus-visible:tw-ring-offset-2","focus-visible:tw-ring-primary-700","disabled:tw-cursor-auto","disabled:tw-border","disabled:tw-bg-secondary-100","checked:tw-bg-text-contrast","checked:tw-border-primary-600","checked:hover:tw-border","checked:hover:tw-border-primary-700","checked:hover:before:tw-bg-primary-700","[&>label:hover]:checked:tw-bg-primary-700","[&>label:hover]:checked:tw-border-primary-700","checked:before:tw-bg-primary-600","checked:disabled:tw-border-secondary-100","checked:disabled:tw-bg-secondary-100","checked:disabled:before:tw-bg-text-muted"]}get disabled(){var e,t,i;return null!==(i=null!==(e=this._disabled)&&void 0!==e?e:null===(t=this.ngControl)||void 0===t?void 0:t.disabled)&&void 0!==i&&i}set disabled(e){this._disabled=null!=e&&!1!==e}get required(){var e,t,i,n;return null!==(n=null!==(e=this._required)&&void 0!==e?e:null===(i=null===(t=this.ngControl)||void 0===t?void 0:t.control)||void 0===i?void 0:i.hasValidator(r.kI.requiredTrue))&&void 0!==n&&n}set required(e){this._required=null!=e&&!1!==e}get hasError(){var e,t;return"INVALID"===(null===(e=this.ngControl)||void 0===e?void 0:e.status)&&(null===(t=this.ngControl)||void 0===t?void 0:t.touched)}get error(){const e=Object.keys(this.ngControl.errors)[0];return[e,this.ngControl.errors[e]]}}c.ɵfac=function(e){return new(e||c)(n.Y36(r.a5,10))},c.ɵcmp=n.Xpm({type:c,selectors:[["input","type","radio","bitRadio",""]],hostVars:4,hostBindings:function(e,t){2&e&&(n.Ikx("disabled",t.disabled),n.uIk("id",t.id),n.Tol(t.inputClasses))},inputs:{id:"id",disabled:"disabled",required:"required"},features:[n._Bn([{provide:a.y,useExisting:c}])],attrs:["type","radio","bitRadio",""],decls:0,vars:0,template:function(e,t){},encapsulation:2});const u=[[["bit-label"]],[["bit-hint"]]];let d=0;class p{get classList(){return[this.block?"tw-block":"tw-inline-block","tw-mb-2"]}constructor(e){this.groupComponent=e,this.id="bit-radio-button-"+d++,this.disabled=!1}get inputId(){return`${this.id}-input`}get name(){return this.groupComponent.name}get selected(){return this.groupComponent.selected===this.value}get groupDisabled(){return this.groupComponent.disabled}get block(){return this.groupComponent.block}onInputChange(){this.groupComponent.onInputChange(this.value)}onBlur(){this.groupComponent.onBlur()}}p.ɵfac=function(e){return new(e||p)(n.Y36(s.w))},p.ɵcmp=n.Xpm({type:p,selectors:[["bit-radio-button"]],hostVars:3,hostBindings:function(e,t){2&e&&(n.uIk("id",t.id),n.Tol(t.classList))},inputs:{id:"id",value:"value",disabled:"disabled"},ngContentSelectors:["bit-label","bit-hint"],decls:9,vars:5,consts:[["disableMargin","",3,"inline"],["type","radio","bitRadio","",3,"id","disabled","value","checked","change","blur"]],template:function(e,t){1&e&&(n.F$t(u),n.TgZ(0,"bit-form-control",0),n._uU(1,"\n  "),n.TgZ(2,"input",1),n.NdJ("change",(function(){return t.onInputChange()}))("blur",(function(){return t.onBlur()})),n.qZA(),n._uU(3,"\n\n  "),n.Hsn(4,0,["ngProjectAs","bit-label",5,["bit-label"]]),n._uU(5,"\n  "),n.Hsn(6,1,["ngProjectAs","bit-hint",5,["bit-hint"]]),n._uU(7,"\n"),n.qZA(),n._uU(8,"\n")),2&e&&(n.Q6J("inline",!t.block),n.xp6(2),n.Q6J("id",t.inputId)("disabled",t.groupDisabled||t.disabled)("value",t.value)("checked",t.selected))},dependencies:[o.A,c],encapsulation:2})},20953:(e,t,i)=>{"use strict";i.d(t,{c:()=>a});var n=i(28508),s=i(13506),o=i(36903),r=i(85762);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=r.oAB({type:a}),a.ɵinj=r.cJS({imports:[n.ez,o.m,s.s,s.s]})},66079:(e,t,i)=>{"use strict";i.d(t,{w:()=>m});var n=i(37513),s=i(36179),o=i(85762),r=i(28508),a=i(49399);function l(e,t){1&e&&(o.TgZ(0,"span",5),o._uU(1),o.ALo(2,"i18n"),o.qZA()),2&e&&(o.xp6(1),o.hij(" (",o.lcZ(2,1,"required"),")"))}function c(e,t){1&e&&o.GkF(0)}function u(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n  "),o.TgZ(2,"fieldset"),o._uU(3,"\n    "),o.TgZ(4,"legend",2),o._uU(5,"\n      "),o.Hsn(6),o._uU(7,"\n      "),o.YNc(8,l,3,3,"span",3),o._uU(9,"\n    "),o.qZA(),o._uU(10,"\n    "),o.YNc(11,c,1,0,"ng-container",4),o._uU(12,"\n  "),o.qZA(),o._uU(13,"\n"),o.BQk()),2&e){const e=o.oxw(),t=o.MAs(5);o.xp6(8),o.Q6J("ngIf",e.required),o.xp6(3),o.Q6J("ngTemplateOutlet",t)}}function d(e,t){1&e&&o.GkF(0)}function p(e,t){if(1&e&&(o.ynx(0),o._uU(1,"\n  "),o.YNc(2,d,1,0,"ng-container",4),o._uU(3,"\n"),o.BQk()),2&e){o.oxw();const e=o.MAs(5);o.xp6(2),o.Q6J("ngTemplateOutlet",e)}}function h(e,t){1&e&&(o._uU(0,"\n  "),o.TgZ(1,"div"),o._uU(2,"\n    "),o.Hsn(3,1),o._uU(4,"\n  "),o.qZA(),o._uU(5,"\n  "),o.Hsn(6,2,["ngProjectAs","bit-hint",5,["bit-hint"]]),o._uU(7,"\n"))}const g=[[["bit-label"]],"*",[["bit-hint"]]];let f=0;class m{get name(){var e,t,i;return null!==(e=this._name)&&void 0!==e?e:null===(i=null===(t=this.ngControl)||void 0===t?void 0:t.name)||void 0===i?void 0:i.toString()}set name(e){this._name=e}constructor(e){this.ngControl=e,this.disabled=!1,this.block=!1,this.role="radiogroup",this.id="bit-radio-group-"+f++,this.classList=["tw-block","tw-mb-4"],null!=e&&(e.valueAccessor=this)}get required(){var e,t,i;return null!==(i=null===(t=null===(e=this.ngControl)||void 0===e?void 0:e.control)||void 0===t?void 0:t.hasValidator(n.kI.required))&&void 0!==i&&i}writeValue(e){this.selected=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e}onInputChange(e){this.selected=e,this.onChange(this.selected)}onBlur(){this.onTouched()}}m.ɵfac=function(e){return new(e||m)(o.Y36(n.a5,10))},m.ɵcmp=o.Xpm({type:m,selectors:[["bit-radio-group"]],contentQueries:function(e,t,i){if(1&e&&o.Suo(i,s.u,5),2&e){let e;o.iGM(e=o.CRH())&&(t.label=e.first)}},hostVars:4,hostBindings:function(e,t){2&e&&(o.uIk("role",t.role)("id",t.id),o.Tol(t.classList))},inputs:{name:"name",block:"block",id:"id"},ngContentSelectors:["bit-label","*","bit-hint"],decls:7,vars:2,consts:[[4,"ngIf"],["content",""],[1,"tw-mb-1","tw-block","tw-text-base","tw-font-semibold","tw-text-main"],["class","tw-text-xs tw-font-normal",4,"ngIf"],[4,"ngTemplateOutlet"],[1,"tw-text-xs","tw-font-normal"]],template:function(e,t){1&e&&(o.F$t(g),o.YNc(0,u,14,2,"ng-container",0),o._uU(1,"\n\n"),o.YNc(2,p,4,1,"ng-container",0),o._uU(3,"\n\n"),o.YNc(4,h,8,0,"ng-template",null,1,o.W1O),o._uU(6,"\n")),2&e&&(o.Q6J("ngIf",t.label),o.xp6(2),o.Q6J("ngIf",!t.label))},dependencies:[r.O5,r.tP,a.C],encapsulation:2})},94239:(e,t,i)=>{"use strict";i.d(t,{g:()=>u});var n=i(37513),s=i(62348),o=i(85762),r=i(11512),a=i(49399);const l=["input"];let c=0;class u{constructor(){this.id="search-id-"+c++}getFocusTarget(){return this.input.nativeElement}onChange(e){null!=this.notifyOnChange&&this.notifyOnChange(e)}onTouch(){null!=this.notifyOnTouch&&this.notifyOnTouch()}registerOnChange(e){this.notifyOnChange=e}registerOnTouched(e){this.notifyOnTouch=e}writeValue(e){this.searchText=e}setDisabledState(e){this.disabled=e}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=o.Xpm({type:u,selectors:[["bit-search"]],viewQuery:function(e,t){if(1&e&&o.Gf(l,5),2&e){let e;o.iGM(e=o.CRH())&&(t.input=e.first)}},inputs:{disabled:"disabled",placeholder:"placeholder"},features:[o._Bn([{provide:n.JU,multi:!0,useExisting:u},{provide:s.l,useExisting:u}])],decls:16,vars:11,consts:[[1,"tw-sr-only",3,"for"],[1,"tw-relative","tw-flex","tw-items-center"],["aria-hidden","true",1,"tw-absolute","tw-left-2","tw-z-20","!tw-mb-0","tw-cursor-text",3,"for"],[1,"bwi","bwi-search","bwi-fw","tw-text-muted"],["bitInput","","type","search",1,"tw-rounded-l","tw-pl-9",3,"id","placeholder","ngModel","disabled","ngModelChange","blur"],["input",""]],template:function(e,t){if(1&e&&(o.TgZ(0,"label",0),o._uU(1),o.ALo(2,"i18n"),o.qZA(),o._uU(3,"\n"),o.TgZ(4,"div",1),o._uU(5,"\n  "),o.TgZ(6,"label",2),o._uU(7,"\n    "),o._UZ(8,"i",3),o._uU(9,"\n  "),o.qZA(),o._uU(10,"\n  "),o.TgZ(11,"input",4,5),o.NdJ("ngModelChange",(function(e){return t.onChange(e)}))("blur",(function(){return t.onTouch()})),o.ALo(13,"i18n"),o.qZA(),o._uU(14,"\n"),o.qZA(),o._uU(15,"\n")),2&e){let e;o.Q6J("for",t.id),o.xp6(1),o.Oqu(o.lcZ(2,7,"search")),o.xp6(5),o.Q6J("for",t.id),o.xp6(5),o.Q6J("id",t.id)("placeholder",null!==(e=t.placeholder)&&void 0!==e?e:o.lcZ(13,9,"search"))("ngModel",t.searchText)("disabled",t.disabled)}},dependencies:[r.G,n.Fj,n.JJ,n.On,a.C],encapsulation:2})},27420:(e,t,i)=>{"use strict";i.d(t,{t:()=>a});var n=i(37513),s=i(83758),o=i(36903),r=i(85762);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=r.oAB({type:a}),a.ɵinj=r.cJS({imports:[o.m,s.g,n.u5]})},84575:(e,t,i)=>{"use strict";i.d(t,{e:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵcmp=s.Xpm({type:o,selectors:[["bit-section"]],standalone:!0,features:[s.jDz],ngContentSelectors:["*"],decls:6,vars:0,consts:[[1,"tw-mb-6","md:tw-mb-12"]],template:function(e,t){1&e&&(s.F$t(),s._uU(0,"\n    "),s.TgZ(1,"section",0),s._uU(2,"\n      "),s.Hsn(3),s._uU(4,"\n    "),s.qZA(),s._uU(5,"\n  "))},dependencies:[n.ez],encapsulation:2})},30469:(e,t,i)=>{"use strict";i.d(t,{x:()=>r});var n=i(39617),s=i(85762);function o(e,t){1&e&&s.Hsn(0)}class r{constructor(){this.value=void 0,this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=(0,n.Ig)(e)}}r.ɵfac=function(e){return new(e||r)},r.ɵcmp=s.Xpm({type:r,selectors:[["bit-option"]],inputs:{icon:"icon",value:"value",label:"label",disabled:"disabled"},ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(s.F$t(),s.YNc(0,o,1,0,"ng-template"))},encapsulation:2})},28975:(e,t,i)=>{"use strict";i.d(t,{H:()=>h});var n=i(37513),s=i(41085),o=i(23182),r=i(30469),a=i(85762),l=i(78627),c=i(28508);function u(e,t){if(1&e&&a._UZ(0,"i",6),2&e){const e=a.oxw().item;a.Gre("bwi bwi-fw ",e.icon,"")}}function d(e,t){if(1&e&&(a._uU(0,"\n    "),a.TgZ(1,"div",2),a._uU(2,"\n      "),a.TgZ(3,"div",3),a._uU(4,"\n        "),a.YNc(5,u,1,3,"i",4),a._uU(6,"\n      "),a.qZA(),a._uU(7,"\n      "),a.TgZ(8,"div",5),a._uU(9),a.qZA(),a._uU(10,"\n    "),a.qZA(),a._uU(11,"\n  ")),2&e){const e=t.item;a.xp6(5),a.Q6J("ngIf",null!=e.icon),a.xp6(4),a.hij("\n        ",e.label,"\n      ")}}let p=0;class h{constructor(e,t){this.i18nService=e,this.ngControl=t,this.items=[],this.placeholder=this.i18nService.t("selectPlaceholder"),this.searchInputId="bit-select-search-input-"+p++,this.classes=["tw-block","tw-w-full"],this.id="bit-multi-select-"+p++,null!=t&&(t.valueAccessor=this)}set options(e){this.items=e.toArray(),this.selectedOption=this.findSelectedOption(this.items,this.selectedValue)}get disabled(){var e,t,i;return null!==(i=null!==(e=this._disabled)&&void 0!==e?e:null===(t=this.ngControl)||void 0===t?void 0:t.disabled)&&void 0!==i&&i}set disabled(e){this._disabled=null!=e&&!1!==e}writeValue(e){this.selectedValue=e,this.selectedOption=this.findSelectedOption(this.items,this.selectedValue)}registerOnChange(e){this.notifyOnChange=e}registerOnTouched(e){this.notifyOnTouched=e}setDisabledState(e){this.disabled=e}onChange(e){this.notifyOnChange&&this.notifyOnChange(null==e?void 0:e.value)}onBlur(){this.notifyOnTouched&&this.notifyOnTouched()}get ariaDescribedBy(){return this._ariaDescribedBy}set ariaDescribedBy(e){var t;this._ariaDescribedBy=e,null===(t=this.select)||void 0===t||t.searchInput.nativeElement.setAttribute("aria-describedby",e)}get labelForId(){return this.searchInputId}get required(){var e,t,i,s;return null!==(s=null!==(e=this._required)&&void 0!==e?e:null===(i=null===(t=this.ngControl)||void 0===t?void 0:t.control)||void 0===i?void 0:i.hasValidator(n.kI.required))&&void 0!==s&&s}set required(e){this._required=null!=e&&!1!==e}get hasError(){var e,t;return"INVALID"===(null===(e=this.ngControl)||void 0===e?void 0:e.status)&&(null===(t=this.ngControl)||void 0===t?void 0:t.touched)}get error(){var e,t;const i=Object.keys(null===(e=this.ngControl)||void 0===e?void 0:e.errors)[0];return[i,null===(t=this.ngControl)||void 0===t?void 0:t.errors[i]]}findSelectedOption(e,t){return e.find((e=>e.value===t))}}h.ɵfac=function(e){return new(e||h)(a.Y36(l.D),a.Y36(n.a5,10))},h.ɵcmp=a.Xpm({type:h,selectors:[["bit-select"]],contentQueries:function(e,t,i){if(1&e&&a.Suo(i,r.x,4),2&e){let e;a.iGM(e=a.CRH())&&(t.options=e)}},viewQuery:function(e,t){if(1&e&&a.Gf(s.w9,5),2&e){let e;a.iGM(e=a.CRH())&&(t.select=e.first)}},hostVars:6,hostBindings:function(e,t){2&e&&(a.Ikx("disabled",t.disabled)("id",t.id),a.uIk("aria-describedby",t.ariaDescribedBy)("required",t.required),a.Tol(t.classes))},inputs:{items:"items",placeholder:"placeholder",disabled:"disabled",id:"id",required:"required"},features:[a._Bn([{provide:o.v,useExisting:h}])],decls:5,vars:6,consts:[["appendTo","body",3,"ngModel","disabled","placeholder","items","labelForId","clearable","ngModelChange","blur"],["ng-option-tmp",""],[1,"tw-flex"],[1,"tw-mr-2","tw-flex-initial"],["aria-hidden","true",3,"class",4,"ngIf"],[1,"tw-flex-1"],["aria-hidden","true"]],template:function(e,t){1&e&&(a.TgZ(0,"ng-select",0),a.NdJ("ngModelChange",(function(e){return t.selectedOption=e}))("ngModelChange",(function(e){return t.onChange(e)}))("blur",(function(){return t.onBlur()})),a._uU(1,"\n  "),a.YNc(2,d,12,2,"ng-template",1),a._uU(3,"\n"),a.qZA(),a._uU(4,"\n")),2&e&&a.Q6J("ngModel",t.selectedOption)("disabled",t.disabled)("placeholder",t.placeholder)("items",t.items)("labelForId",t.labelForId)("clearable",!1)},dependencies:[c.O5,s.w9,s.ir,n.JJ,n.On],encapsulation:2})},31393:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var n=i(28508),s=i(37513),o=i(41085),r=i(85762);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=r.oAB({type:a}),a.ɵinj=r.cJS({imports:[n.ez,o.A0,s.u5]})},11394:(e,t,i)=>{"use strict";i.d(t,{x:()=>n});class n{}},62348:(e,t,i)=>{"use strict";i.d(t,{l:()=>n});class n{}},49399:(e,t,i)=>{"use strict";i.d(t,{C:()=>o});var n=i(85762),s=i(78627);class o{constructor(e){this.i18nService=e}transform(e,t,i,n){return this.i18nService.t(e,t,i,n)}}o.ɵfac=function(e){return new(e||o)(n.Y36(s.D,16))},o.ɵpipe=n.Yjl({name:"i18n",type:o,pure:!0})},36903:(e,t,i)=>{"use strict";i.d(t,{m:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.ez,n.ez]})},50941:(e,t,i)=>{"use strict";i.d(t,{Y:()=>s});var n=i(85762);class s{get classList(){return["tw-p-3"]}}s.ɵfac=function(e){return new(e||s)},s.ɵdir=n.lG2({type:s,selectors:[["th","bitCell",""],["td","bitCell",""]],hostVars:2,hostBindings:function(e,t){2&e&&n.Tol(t.classList)}})},26361:(e,t,i)=>{"use strict";i.d(t,{v:()=>s});var n=i(85762);class s{constructor(){this.alignContent="middle"}get alignmentClass(){switch(this.alignContent){case"top":return"tw-align-top";case"middle":return"tw-align-middle";case"bottom":return"tw-align-bottom";default:return"tw-align-baseline"}}get classList(){return["tw-border-0","tw-border-b","tw-border-secondary-300","tw-border-solid","hover:tw-bg-background-alt","last:tw-border-0",this.alignmentClass]}}s.ɵfac=function(e){return new(e||s)},s.ɵdir=n.lG2({type:s,selectors:[["tr","bitRow",""]],hostVars:2,hostBindings:function(e,t){2&e&&n.Tol(t.classList)},inputs:{alignContent:"alignContent"}})},2138:(e,t,i)=>{"use strict";i.d(t,{G:()=>l});var n=i(39617),s=i(39518),o=i(59554),r=i(33031),a=i(92786);class l extends s.o2{constructor(){super(),this._filter=new o.X(""),this._renderData=new o.X([]),this._renderChangesSubscription=null,this._data=new o.X([]),this._sort=new o.X({direction:"asc"})}get data(){return this._data.value}set data(e){e=Array.isArray(e)?e:[],this._data.next(e),this._renderChangesSubscription||this.filterData(e)}set sort(e){this._sort.next(e)}get sort(){return this._sort.value}get filter(){return this._filter.value}set filter(e){this._filter.next(e),this._renderChangesSubscription||this.filterData(this.data)}connect(){return this._renderChangesSubscription||this.updateChangeSubscription(),this._renderData}disconnect(){var e;null===(e=this._renderChangesSubscription)||void 0===e||e.unsubscribe(),this._renderChangesSubscription=null}updateChangeSubscription(){var e;const t=(0,r.a)([this._data,this._filter]).pipe((0,a.U)((([e])=>this.filterData(e)))),i=(0,r.a)([t,this._sort]).pipe((0,a.U)((([e,t])=>this.orderData(e,t))));null===(e=this._renderChangesSubscription)||void 0===e||e.unsubscribe(),this._renderChangesSubscription=i.subscribe((e=>this._renderData.next(e)))}filterData(e){return this.filteredData=null==this.filter||""===this.filter?e:e.filter((e=>this.filterPredicate(e,this.filter))),this.filteredData}orderData(e,t){return t?this.sortData(e,t):e}sortingDataAccessor(e,t){const i=e[t];if((0,n.t6)(i)){const e=Number(i);return e<Number.MAX_SAFE_INTEGER?e:i}return i}sortData(e,t){const i=t.column,n="asc"===t.direction?1:-1;return i?e.sort(((e,s)=>{if(t.fn)return t.fn(e,s)*n;let o=this.sortingDataAccessor(e,i),r=this.sortingDataAccessor(s,i);const a=typeof o,l=typeof r;if(a!==l&&("number"===a&&(o+=""),"number"===l&&(r+="")),"string"==typeof o&&"string"==typeof r)return o.localeCompare(r)*n;let c=0;return null!=o&&null!=r?o>r?c=1:o<r&&(c=-1):null!=o?c=1:null!=r&&(c=-1),c*n})):e}filterPredicate(e,t){const i=Object.keys(e).reduce(((t,i)=>t+e[i]+"◬"),"").toLowerCase(),n=t.trim().toLowerCase();return-1!=i.indexOf(n)}}},54735:(e,t,i)=>{"use strict";i.d(t,{a:()=>u,f:()=>c});var n=i(39518),s=i(85762),o=i(28508);function r(e,t){1&e&&s.GkF(0)}const a=[[["","header",""]]],l=function(e){return{$implicit:e}};class c{constructor(e){this.template=e}}c.ɵfac=function(e){return new(e||c)(s.Y36(s.Rgc))},c.ɵdir=s.lG2({type:c,selectors:[["ng-template","body",""]]});class u{constructor(){this.layout="auto",this._initialized=!1}get tableClass(){return["tw-w-full","tw-leading-normal","tw-text-main","tw-border-collapse","tw-text-start","auto"===this.layout?"tw-table-auto":"tw-table-fixed"]}ngAfterContentChecked(){if(!this._initialized&&(0,n.Z9)(this.dataSource)){this._initialized=!0;const e=this.dataSource.connect();this.rows=e}}ngOnDestroy(){(0,n.Z9)(this.dataSource)&&this.dataSource.disconnect()}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=s.Xpm({type:u,selectors:[["bit-table"]],contentQueries:function(e,t,i){if(1&e&&s.Suo(i,c,5),2&e){let e;s.iGM(e=s.CRH())&&(t.templateVariable=e.first)}},inputs:{dataSource:"dataSource",layout:"layout"},ngContentSelectors:["[header]"],decls:13,vars:5,consts:[[3,"ngClass"],[1,"tw-border-0","tw-border-b-2","tw-border-solid","tw-border-secondary-300","tw-font-bold","tw-text-muted"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(s.F$t(a),s.TgZ(0,"table",0),s._uU(1,"\n  "),s.TgZ(2,"thead",1),s._uU(3,"\n    "),s.Hsn(4),s._uU(5,"\n  "),s.qZA(),s._uU(6,"\n  "),s.TgZ(7,"tbody"),s._uU(8,"\n    "),s.YNc(9,r,1,0,"ng-container",2),s._uU(10,"\n  "),s.qZA(),s._uU(11,"\n"),s.qZA(),s._uU(12,"\n")),2&e&&(s.Q6J("ngClass",t.tableClass),s.xp6(9),s.Q6J("ngTemplateOutlet",t.templateVariable.template)("ngTemplateOutletContext",s.VKq(3,l,t.rows)))},dependencies:[o.mk,o.tP],encapsulation:2})},13936:(e,t,i)=>{"use strict";i.d(t,{U:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.ez]})},59047:(e,t,i)=>{"use strict";i.d(t,{Q:()=>s});var n=i(85762);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵcmp=n.Xpm({type:s,selectors:[["bit-tab-header"]],hostAttrs:[1,"tw-h-16","tw-pl-4","tw-bg-background-alt","tw-flex","tw-items-end","tw-border-0","tw-border-b","tw-border-solid","tw-border-secondary-300"],ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(n.F$t(),n.Hsn(0))},encapsulation:2})},52850:(e,t,i)=>{"use strict";i.d(t,{M:()=>s});var n=i(85762);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵdir=n.lG2({type:s,selectors:[["","bitTabListContainer",""]],hostAttrs:[1,"tw-inline-flex","tw-flex-wrap","tw-leading-5"]})},97327:(e,t,i)=>{"use strict";i.d(t,{B:()=>s});var n=i(85762);class s{get disabledAttr(){return this.disabled||null}constructor(e){this.elementRef=e}focus(){this.elementRef.nativeElement.focus()}click(){this.elementRef.nativeElement.click()}get classList(){return this.baseClassList.concat(this.active?this.activeClassList:[]).concat(this.disabled?this.disabledClassList:[]).concat(this.textColorClassList)}get textColorClassList(){return this.disabled?["!tw-text-muted","hover:!tw-text-muted"]:this.active?["!tw-text-primary-600","hover:!tw-text-primary-700"]:["!tw-text-main","hover:!tw-text-main"]}get baseClassList(){return["tw-block","tw-relative","tw-py-2","tw-px-4","tw-font-semibold","tw-transition","tw-rounded-t","tw-border-0","tw-border-x","tw-border-t-4","tw-border-transparent","tw-border-solid","tw-bg-transparent","hover:tw-underline","focus-visible:tw-z-10","focus-visible:tw-outline-none","focus-visible:tw-ring-2","focus-visible:tw-ring-primary-700"]}get disabledClassList(){return["!tw-bg-secondary-100","!tw-no-underline","tw-cursor-not-allowed"]}get activeClassList(){return["tw--mb-px","tw-border-x-secondary-300","tw-border-t-primary-600","tw-border-b","tw-border-b-background","!tw-bg-background","hover:tw-border-t-primary-700","focus-visible:tw-border-t-primary-700","focus-visible:!tw-text-primary-700"]}}s.ɵfac=function(e){return new(e||s)(n.Y36(n.SBq))},s.ɵdir=n.lG2({type:s,selectors:[["","bitTabListItem",""]],hostVars:3,hostBindings:function(e,t){2&e&&(n.uIk("disabled",t.disabledAttr),n.Tol(t.classList))},inputs:{active:"active",disabled:"disabled"}})},17731:(e,t,i)=>{"use strict";i.d(t,{Q:()=>_});var n=i(66267),s=i(39617),o=i(85762),r=i(54019),a=i(68362),l=i(97327),c=i(26536),u=i(28508),d=i(52850),p=i(59047),h=i(83134);function g(e,t){}class f{constructor(){this.preserveContent=!1}get hidden(){return!this.active||null}get active(){return this._active}set active(e){this._active=e,this._active&&(this._firstRender=!0)}get tabContent(){return this.active||this.preserveContent&&this._firstRender?this.content:null}}function m(e,t){if(1&e&&(o._uU(0,"\n          "),o.GkF(1,5),o._uU(2,"\n        ")),2&e){const e=o.oxw(2).$implicit;o.xp6(1),o.Q6J("ngTemplateOutlet",e.templateLabel.templateRef)}}function v(e,t){if(1&e&&o._uU(0),2&e){const e=o.oxw(2).$implicit;o.Oqu(e.textLabel)}}function y(e,t){if(1&e&&(o._uU(0,"\n        "),o.YNc(1,m,3,1,"ng-template",7),o._uU(2,"\n\n        "),o.YNc(3,v,1,1,"ng-template",null,8,o.W1O),o._uU(5,"\n      ")),2&e){const e=o.MAs(4),t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngIf",t.templateLabel)("ngIfElse",e)}}function w(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",4),o.NdJ("click",(function(){const t=o.CHM(e).index,i=o.oxw();return o.KtG(i.selectTab(t))})),o._uU(1,"\n      "),o.GkF(2,5),o._uU(3,"\n\n      "),o.YNc(4,y,6,2,"ng-template",null,6,o.W1O),o._uU(6,"\n    "),o.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=o.MAs(5),s=o.oxw();o.Q6J("id",s.getTabLabelId(i))("active",e.isActive)("disabled",e.disabled),o.uIk("aria-selected",s.selectedIndex===i)("tabindex",s.selectedIndex===i?0:-1),o.xp6(2),o.Q6J("ngTemplateOutlet",n)}}function b(e,t){if(1&e&&(o.TgZ(0,"bit-tab-body",9),o._uU(1,"\n  "),o.qZA()),2&e){const e=t.$implicit,i=t.index,n=o.oxw();o.Q6J("id",n.getTabContentId(i))("active",e.isActive)("content",e.content)("preserveContent",n.preserveContent),o.uIk("tabindex",e.contentTabIndex)("labeledby",n.getTabLabelId(i))}}f.ɵfac=function(e){return new(e||f)},f.ɵcmp=o.Xpm({type:f,selectors:[["bit-tab-body"]],hostVars:1,hostBindings:function(e,t){2&e&&o.uIk("hidden",t.hidden)},inputs:{content:"content",preserveContent:"preserveContent",active:"active"},decls:2,vars:1,consts:[[3,"cdkPortalOutlet"]],template:function(e,t){1&e&&(o.YNc(0,g,0,0,"ng-template",0),o._uU(1,"\n")),2&e&&o.Q6J("cdkPortalOutlet",t.tabContent)},dependencies:[h.Pl],encapsulation:2});let U=0;class _{get selectedIndex(){return this._selectedIndex}set selectedIndex(e){this._indexToSelect=(0,s.su)(e,null)}constructor(){this.destroy$=new r.x,this._indexToSelect=0,this.label="",this.preserveContent=!1,this._selectedIndex=null,this.selectedIndexChange=new o.vpe,this.selectedTabChange=new o.vpe,this._groupId=U++}getTabContentId(e){return`bit-tab-content-${this._groupId}-${e}`}getTabLabelId(e){return`bit-tab-label-${this._groupId}-${e}`}selectTab(e){this.selectedIndex=e}ngAfterContentChecked(){const e=this._indexToSelect=this._clampTabIndex(this._indexToSelect);if(this._selectedIndex!=e){const t=null==this._selectedIndex;t||this.selectedTabChange.emit({index:e,tab:this.tabs.toArray()[e]}),Promise.resolve().then((()=>{this.tabs.forEach(((t,i)=>t.isActive=i===e)),t||this.selectedIndexChange.emit(e)})),this._selectedIndex=e,this.keyManager&&this.keyManager.setActiveItem(e)}}ngAfterViewInit(){this.keyManager=new n.Em(this.tabLabels).withHorizontalOrientation("ltr").withWrap().withHomeAndEnd()}ngAfterContentInit(){this.tabs.changes.pipe((0,a.R)(this.destroy$)).subscribe((()=>{const e=this._clampTabIndex(this._indexToSelect);if(e===this._selectedIndex){const t=this.tabs.toArray();let i;for(let e=0;e<t.length;e++)if(t[e].isActive){this._indexToSelect=this._selectedIndex=e,i=t[e];break}!i&&t[e]&&(t[e].isActive=!0,this.selectedTabChange.emit({index:e,tab:t[e]}))}}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}_clampTabIndex(e){return Math.min(this.tabs.length-1,Math.max(e||0,0))}}_.ɵfac=function(e){return new(e||_)},_.ɵcmp=o.Xpm({type:_,selectors:[["bit-tab-group"]],contentQueries:function(e,t,i){if(1&e&&o.Suo(i,c.i,4),2&e){let e;o.iGM(e=o.CRH())&&(t.tabs=e)}},viewQuery:function(e,t){if(1&e&&o.Gf(l.B,5),2&e){let e;o.iGM(e=o.CRH())&&(t.tabLabels=e)}},inputs:{label:"label",preserveContent:"preserveContent",selectedIndex:"selectedIndex"},outputs:{selectedIndexChange:"selectedIndexChange",selectedTabChange:"selectedTabChange"},decls:13,vars:3,consts:[["bitTabListContainer","","role","tablist",3,"keydown"],["bitTabListItem","","type","button","role","tab",3,"id","active","disabled","click",4,"ngFor","ngForOf"],[1,"tw-px-4","tw-pt-5"],["role","tabpanel",3,"id","active","content","preserveContent",4,"ngFor","ngForOf"],["bitTabListItem","","type","button","role","tab",3,"id","active","disabled","click"],[3,"ngTemplateOutlet"],["content",""],[3,"ngIf","ngIfElse"],["tabTextLabel",""],["role","tabpanel",3,"id","active","content","preserveContent"]],template:function(e,t){1&e&&(o.TgZ(0,"bit-tab-header"),o._uU(1,"\n  "),o.TgZ(2,"div",0),o.NdJ("keydown",(function(e){return t.keyManager.onKeydown(e)})),o._uU(3,"\n    "),o.YNc(4,w,7,6,"button",1),o._uU(5,"\n  "),o.qZA(),o._uU(6,"\n"),o.qZA(),o._uU(7,"\n"),o.TgZ(8,"div",2),o._uU(9,"\n  "),o.YNc(10,b,2,6,"bit-tab-body",3),o._uU(11,"\n"),o.qZA(),o._uU(12,"\n")),2&e&&(o.xp6(2),o.uIk("aria-label",t.label),o.xp6(2),o.Q6J("ngForOf",t.tabs),o.xp6(6),o.Q6J("ngForOf",t.tabs))},dependencies:[u.sg,u.O5,u.tP,d.M,l.B,p.Q,f],encapsulation:2})},26536:(e,t,i)=>{"use strict";i.d(t,{i:()=>a});var n=i(83134),s=i(85762);class o{constructor(e){this.templateRef=e}}function r(e,t){1&e&&s.Hsn(0)}o.ɵfac=function(e){return new(e||o)(s.Y36(s.Rgc))},o.ɵdir=s.lG2({type:o,selectors:[["","bitTabLabel",""]]});class a{get content(){return this._contentPortal}constructor(e){this._viewContainerRef=e,this.disabled=!1,this.textLabel="",this._contentPortal=null}ngOnInit(){this._contentPortal=new n.UE(this.implicitContent,this._viewContainerRef)}}a.ɵfac=function(e){return new(e||a)(s.Y36(s.s_b))},a.ɵcmp=s.Xpm({type:a,selectors:[["bit-tab"]],contentQueries:function(e,t,i){if(1&e&&s.Suo(i,o,5),2&e){let e;s.iGM(e=s.CRH())&&(t.templateLabel=e.first)}},viewQuery:function(e,t){if(1&e&&s.Gf(s.Rgc,7),2&e){let e;s.iGM(e=s.CRH())&&(t.implicitContent=e.first)}},hostAttrs:["role","tabpanel"],inputs:{disabled:"disabled",textLabel:["label","textLabel"],contentTabIndex:"contentTabIndex"},ngContentSelectors:["*"],decls:2,vars:0,template:function(e,t){1&e&&(s.F$t(),s.YNc(0,r,1,0,"ng-template"),s._uU(1,"\n"))},encapsulation:2})},98797:(e,t,i)=>{"use strict";i.d(t,{f:()=>o});var n=i(85762);let s=0;class o{constructor(){this.id=s++,this.name=`bit-toggle-group-${this.id}`,this.selectedChange=new n.vpe,this.role="radiogroup",this.classList=["tw-flex"]}onInputInteraction(e){this.selected=e,this.selectedChange.emit(e)}}o.ɵfac=function(e){return new(e||o)},o.ɵcmp=n.Xpm({type:o,selectors:[["bit-toggle-group"]],hostVars:3,hostBindings:function(e,t){2&e&&(n.uIk("role",t.role),n.Tol(t.classList))},inputs:{selected:"selected"},outputs:{selectedChange:"selectedChange"},ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(n.F$t(),n.Hsn(0))},encapsulation:2})},65777:(e,t,i)=>{"use strict";i.d(t,{n:()=>a});var n=i(85762),s=i(98797),o=i(28508);let r=0;class a{constructor(e){this.groupComponent=e,this.id=r++,this.tabIndex="-1",this.classList=["tw-group"]}get name(){return this.groupComponent.name}get selected(){return this.groupComponent.selected===this.value}get inputClasses(){return["tw-peer","tw-appearance-none","tw-outline-none"]}get labelClasses(){return["!tw-font-semibold","tw-transition","tw-text-center","tw-border-text-muted","!tw-text-muted","tw-border-solid","tw-border-y","tw-border-r","tw-border-l-0","tw-cursor-pointer","group-first-of-type:tw-border-l","group-first-of-type:tw-rounded-l","group-last-of-type:tw-rounded-r","peer-focus:tw-outline-none","peer-focus:tw-ring","peer-focus:tw-ring-offset-2","peer-focus:tw-ring-primary-600","peer-focus:tw-z-10","peer-focus:tw-bg-primary-600","peer-focus:tw-border-primary-600","peer-focus:!tw-text-contrast","hover:tw-no-underline","hover:tw-bg-text-muted","hover:tw-border-text-muted","hover:!tw-text-contrast","peer-checked:tw-bg-primary-600","peer-checked:tw-border-primary-600","peer-checked:!tw-text-contrast","tw-py-1.5","tw-px-3","!tw-mb-0","[&>[bitBadge]]:tw-mt-px"]}onInputInteraction(){this.groupComponent.onInputInteraction(this.value)}}a.ɵfac=function(e){return new(e||a)(n.Y36(s.f))},a.ɵcmp=n.Xpm({type:a,selectors:[["bit-toggle"]],hostVars:3,hostBindings:function(e,t){2&e&&(n.Ikx("tabIndex",t.tabIndex),n.Tol(t.classList))},inputs:{value:"value"},ngContentSelectors:["*"],decls:3,vars:6,consts:[["type","radio",3,"id","name","ngClass","checked","change"],[3,"for","ngClass"]],template:function(e,t){1&e&&(n.F$t(),n.TgZ(0,"input",0),n.NdJ("change",(function(){return t.onInputInteraction()})),n.qZA(),n.TgZ(1,"label",1),n.Hsn(2),n.qZA()),2&e&&(n.MGl("id","bit-toggle-",t.id,""),n.Q6J("name",t.name)("ngClass",t.inputClasses)("checked",t.selected),n.xp6(1),n.MGl("for","bit-toggle-",t.id,""),n.Q6J("ngClass",t.labelClasses))},dependencies:[o.mk],encapsulation:2})},28315:(e,t,i)=>{"use strict";i.d(t,{t:()=>a});var n=i(39617),s=i(85762);const o={h1:["tw-text-3xl","tw-font-semibold"],h2:["tw-text-2xl","tw-font-semibold"],h3:["tw-text-xl","tw-font-semibold"],h4:["tw-text-lg","tw-font-semibold"],h5:["tw-text-base","tw-font-semibold"],h6:["tw-text-sm","tw-font-semibold"],body1:["tw-text-base"],body2:["tw-text-sm"],helper:["tw-text-xs"]},r={h1:["tw-mb-2"],h2:["tw-mb-2"],h3:["tw-mb-2"],h4:["tw-mb-2"],h5:["tw-mb-2"],h6:["tw-mb-2"],body1:[],body2:[],helper:[]};class a{constructor(){this._margin=!0}set noMargin(e){this._margin=!(0,n.Ig)(e)}get classList(){return o[this.bitTypography].concat(this._margin?r[this.bitTypography]:[])}}a.ɵfac=function(e){return new(e||a)},a.ɵdir=s.lG2({type:a,selectors:[["","bitTypography",""]],hostVars:2,hostBindings:function(e,t){2&e&&s.Tol(t.classList)},inputs:{bitTypography:"bitTypography",noMargin:"noMargin"}})},33229:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var n=i(28508),s=i(85762);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.oAB({type:o}),o.ɵinj=s.cJS({imports:[n.ez]})},43822:(e,t,i)=>{"use strict";i.d(t,{W:()=>l});var n=i(92936),s=i(59260),o=i(30054),r=i(92716),a=i(27646);function l(e){let t;try{t=e()}catch(i){return(0,n._)((()=>i))}return a.c.isPromise(t)?(0,s.D)(t):t instanceof o.y?t:(0,r.of)(t)}},86583:(e,t,i)=>{"use strict";i.d(t,{Mi:()=>n.Mi,Y5:()=>n.Y5,gO:()=>n.gO,rZ:()=>n.rZ,wF:()=>n.wF});var n=i(15890)},15890:(e,t,i)=>{"use strict";i.d(t,{gO:()=>o,rZ:()=>n,Mi:()=>yt,Y5:()=>vt,wF:()=>r});class n{}var s=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class o{constructor(e){this.apiService=e}postImportCiphers(e){return s(this,void 0,void 0,(function*(){return yield this.apiService.send("POST","/ciphers/import",e,!0,!1)}))}postImportOrganizationCiphers(e,t){return s(this,void 0,void 0,(function*(){return yield this.apiService.send("POST","/ciphers/import-organization?organizationId="+e,t,!0,!1)}))}}class r{}class a{constructor(){this.ciphers=[],this.folders=[],this.folderRelationships=[]}}class l{constructor(){this.ciphers=[],this.collections=[],this.collectionRelationships=[]}}class c{constructor(e,t){this.key=e,this.value=t}}var u=i(25679),d=i(27646),p=i(89474),h=i(29918),g=i(43441);class f extends g.W{constructor(e){null!=e&&(super(e),this.id=e.id)}}var m=i(79971),v=i(23666),y=i(90364);class w{constructor(){this.success=!1,this.ciphers=[],this.folders=[],this.folderRelationships=[],this.collections=[],this.collectionRelationships=[]}}var b=i(59778),U=i(12481),_=i(53061),A=i(11612),Z=i(95896),x=i(60712),S=i(54976);class T{constructor(){this.organizationId=null,this.logService=new U.d(!1),this.newLineRegex=/(?:\r\n|\r|\n)/,this.passwordFieldNames=["password","pass word","passphrase","pass phrase","pass","code","code word","codeword","secret","secret word","personpwd","key","keyword","key word","keyphrase","key phrase","form_pw","wppassword","pin","pwd","pw","pword","passwd","p","serial","serial#","license key","reg #","passwort"],this.usernameFieldNames=["user","name","user name","username","login name","email","e-mail","id","userid","user id","login","form_loginname","wpname","mail","loginid","login id","log","personlogin","first name","last name","card#","account #","member","member #","nom","benutzername"],this.notesFieldNames=["note","notes","comment","comments","memo","description","free form","freeform","free text","freetext","free","kommentar"],this.uriFieldNames=["url","hyper link","hyperlink","link","host","hostname","host name","server","address","hyper ref","href","web","website","web site","site","web-site","uri","ort","adresse"],this.parseCsvOptions={encoding:"UTF-8",skipEmptyLines:!1}}get organization(){return null!=this.organizationId}parseXml(e){if(!this.validateNoExternalEntities(e))return null;const t=(new DOMParser).parseFromString(e,"application/xml");return null!=t&&null==t.querySelector("parsererror")?t:null}parseCsv(e,t,i={}){const n=Object.assign({header:t},this.parseCsvOptions,i);e=this.splitNewLine(e).join("\n").trim();const s=b.parse(e,n);return null!=s.errors&&s.errors.length>0&&s.errors.forEach((e=>{null!=e.row&&this.logService.warning("Error parsing row "+e.row+": "+e.message)})),s.data&&s.data.length>0?s.data:null}parseSingleRowCsv(e){if(this.isNullOrWhitespace(e))return null;const t=this.parseCsv(e,!1);return null!=t&&t.length>0&&t[0].length>0?t[0]:null}makeUriArray(e){if(null==e)return null;if("string"==typeof e){const t=new Z.E;return t.uri=this.fixUri(e),this.isNullOrWhitespace(t.uri)?null:(t.match=null,[t])}if(e.length>0){const t=[];return e.forEach((e=>{const i=new Z.E;i.uri=this.fixUri(e),this.isNullOrWhitespace(i.uri)||(i.match=null,t.push(i))})),0===t.length?null:t}return null}fixUri(e){return null==e?null:(-1===(e=e.trim()).indexOf("://")&&e.indexOf(".")>=0&&(e="http://"+e),e.length>1e3?e.substring(0,1e3):e)}nameFromUrl(e){const t=d.c.getHostname(e);return this.isNullOrWhitespace(t)?null:t.startsWith("www.")?t.replace("www.",""):t}isNullOrWhitespace(e){return d.c.isNullOrWhitespace(e)}getValueOrDefault(e,t=null){return this.isNullOrWhitespace(e)?t:e}splitNewLine(e){return e.split(this.newLineRegex)}setCardExpiration(e,t){if(this.isNullOrWhitespace(t))return!1;t=t.replace(/\s/g,"");const i=new RegExp("^0?(?<month>[1-9]|1[0-2])/(?<year>(?:[1-2][0-9])?[0-9]{2})$"),n=t.match(i);if(!n)return!1;e.card.expMonth=n.groups.month;const s=n.groups.year;return e.card.expYear=2===s.length?"20"+s:s,!0}moveFoldersToCollections(e){e.folderRelationships.forEach((t=>e.collectionRelationships.push(t))),e.collections=e.folders.map((e=>{const t=new v.n;return t.name=e.name,t.id=e.id,t})),e.folderRelationships=[],e.folders=[]}querySelectorDirectChild(e,t){const i=this.querySelectorAllDirectChild(e,t);return 0===i.length?null:i[0]}querySelectorAllDirectChild(e,t){return Array.from(e.querySelectorAll(t)).filter((t=>t.parentNode===e))}initLoginCipher(){const e=new _.$;return e.favorite=!1,e.notes="",e.fields=[],e.login=new x.q,e.type=p.Ou.Login,e}cleanupCipher(e){null!=e&&(e.type!==p.Ou.Login&&(e.login=null),this.isNullOrWhitespace(e.name)&&(e.name="--"),this.isNullOrWhitespace(e.notes)?e.notes=null:e.notes=e.notes.trim(),null!=e.fields&&0===e.fields.length&&(e.fields=null),null!=e.passwordHistory&&0===e.passwordHistory.length&&(e.passwordHistory=null))}processKvp(e,t,i,n=p.fS.Text){if(!this.isNullOrWhitespace(i))if(this.isNullOrWhitespace(t)&&(t=""),i.length>200||i.trim().search(this.newLineRegex)>-1)null==e.notes&&(e.notes=""),e.notes+=t+": "+this.splitNewLine(i).join("\n")+"\n";else{null==e.fields&&(e.fields=[]);const s=new A.k;s.type=n,s.name=t,s.value=i,e.fields.push(s)}}processFolder(e,t,i=!0){if(this.isNullOrWhitespace(t))return;let n=e.folders.length;t=t.replace("\\","/");let s=!0;for(let o=0;o<e.folders.length;o++)if(e.folders[o].name===t){s=!1,n=o;break}if(s){const i=new y.a;i.name=t,e.folders.push(i)}i&&e.folderRelationships.push([e.ciphers.length,n])}convertToNoteIfNeeded(e){e.type===p.Ou.Login&&this.isNullOrWhitespace(e.login.username)&&this.isNullOrWhitespace(e.login.password)&&(null==e.login.uris||0===e.login.uris.length)&&(e.type=p.Ou.SecureNote,e.secureNote=new S.z,e.secureNote.type=p.xs.Generic)}processFullName(e,t){if(this.isNullOrWhitespace(t))return;const i=t.split(" ");i.length>0&&(e.identity.firstName=this.getValueOrDefault(i[0])),2===i.length?e.identity.lastName=this.getValueOrDefault(i[1]):i.length>=3&&(e.identity.middleName=this.getValueOrDefault(i[1]),e.identity.lastName=i.slice(2,i.length).join(" "))}validateNoExternalEntities(e){return!new RegExp("<!ENTITY","i").test(e)}}class C extends T{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if(e.length<2)return;const i=this.initLoginCipher();if(i.notes=this.getValueOrDefault(e[e.length-1]),i.name=this.getValueOrDefault(e[0],"--"),e.length>2&&e.length%2==0)for(let t=0;t<e.length-2;t+=2){const n=e[t+2],s=e[t+1];if(this.isNullOrWhitespace(n)||this.isNullOrWhitespace(s))continue;const o=s.toLowerCase();null==i.login.password&&this.passwordFieldNames.indexOf(o)>-1?i.login.password=this.getValueOrDefault(n):null==i.login.username&&this.usernameFieldNames.indexOf(o)>-1?i.login.username=this.getValueOrDefault(n):(null==i.login.uris||0===i.login.uris.length)&&this.uriFieldNames.indexOf(o)>-1?i.login.uris=this.makeUriArray(n):this.processKvp(i,s,n)}this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class O extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.name),i.login.uris=this.makeUriArray(e.web),i.login.password=this.getValueOrDefault(e.password),i.login.username=this.getValueOrDefault(e.login),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}var k=i(57387);class P extends T{parse(e){const t=new w,i=JSON.parse(e);return null==i?(t.success=!1,Promise.resolve(t)):(null!=i.logins&&i.logins.forEach((e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.custName),i.notes=this.getValueOrDefault(e.note),i.login.uris=this.makeUriArray(e.url),i.login.password=this.getValueOrDefault(e.pwd),i.login.username=this.getValueOrDefault(e.loginName),this.cleanupCipher(i),t.ciphers.push(i)})),null!=i.notes&&i.notes.forEach((e=>{const i=this.initLoginCipher();i.type=p.Ou.SecureNote,i.secureNote.type=p.xs.Generic,i.name=this.getValueOrDefault(e.label),i.notes=this.getValueOrDefault(e.text),this.cleanupCipher(i),t.ciphers.push(i)})),null!=i.cards&&i.cards.forEach((e=>{const i=this.initLoginCipher();i.type=p.Ou.Card,i.name=this.getValueOrDefault(e.custName),i.notes=this.getValueOrDefault(e.note),i.card.cardholderName=this.getValueOrDefault(e.holderName),i.card.number=this.getValueOrDefault(e.cardNumber),i.card.code=this.getValueOrDefault(e.cvv),i.card.brand=k._.getCardBrandByPatterns(i.card.number),null!=e.expirationDate&&(null!=e.expirationDate.month&&(i.card.expMonth=e.expirationDate.month+""),null!=e.expirationDate.year&&(i.card.expYear=e.expirationDate.year+"")),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class q extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.name,this.getValueOrDefault(this.nameFromUrl(e.website),"--")),i.login.uris=this.makeUriArray(e.website),i.login.password=this.getValueOrDefault(e.password),this.isNullOrWhitespace(e.username)&&!this.isNullOrWhitespace(e.secondary_username)?i.login.username=e.secondary_username:(i.login.username=this.getValueOrDefault(e.username),i.notes=this.getValueOrDefault(e.secondary_username)),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class I extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if("list"===e.grouping)return;const i=this.initLoginCipher();i.favorite="1"===e.fav,i.name=this.getValueOrDefault(e.name),i.notes=this.getValueOrDefault(e.extra),"note"!==e.grouping&&(i.login.uris=this.makeUriArray(e.url),i.login.password=this.getValueOrDefault(e.password),i.login.username=this.getValueOrDefault(e.username)),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class M extends T{constructor(){super(...arguments),this.androidPatternRegex=new RegExp("^android:\\/\\/.*(?<=@)(.*)(?=\\/)")}parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{const i=this.initLoginCipher();let n=e.name;!n&&this.androidPatternRegex.test(e.url)&&(n=e.url.match(this.androidPatternRegex)[1]),i.name=this.getValueOrDefault(n,"--"),i.login.username=this.getValueOrDefault(e.username),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(e.url),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}var N=i(72285);class L extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if(this.organization&&!this.isNullOrWhitespace(e.collections)){e.collections.split(",").forEach((e=>{let i=!0,n=t.collections.length;for(let s=0;s<t.collections.length;s++)if(t.collections[s].name===e){i=!1,n=s;break}if(i){const i=new v.n;i.name=e,t.collections.push(i)}t.collectionRelationships.push([t.ciphers.length,n])}))}else this.organization||this.processFolder(t,e.folder);const i=new _.$;i.favorite=!this.organization&&"0"!==this.getValueOrDefault(e.favorite,"0"),i.type=p.Ou.Login,i.notes=this.getValueOrDefault(e.notes),i.name=this.getValueOrDefault(e.name,"--");try{i.reprompt=parseInt(this.getValueOrDefault(e.reprompt,N.N.None.toString()),10)}catch(n){console.error("Unable to parse reprompt value",n),i.reprompt=N.N.None}if(!this.isNullOrWhitespace(e.fields)){const t=this.splitNewLine(e.fields);for(let e=0;e<t.length;e++){if(this.isNullOrWhitespace(t[e]))continue;const n=t[e].lastIndexOf(": ");if(-1===n)continue;null==i.fields&&(i.fields=[]);const s=new A.k;s.name=t[e].substr(0,n),s.value=null,s.type=p.fS.Text,t[e].length>n+2&&(s.value=t[e].substr(n+2)),i.fields.push(s)}}switch(null!=e.type?e.type.toLowerCase():null){case"note":i.type=p.Ou.SecureNote,i.secureNote=new S.z,i.secureNote.type=p.xs.Generic;break;default:{i.type=p.Ou.Login,i.login=new x.q,i.login.totp=this.getValueOrDefault(e.login_totp||e.totp),i.login.username=this.getValueOrDefault(e.login_username||e.username),i.login.password=this.getValueOrDefault(e.login_password||e.password);const t=this.parseSingleRowCsv(e.login_uri||e.uri);i.login.uris=this.makeUriArray(t);break}}t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}var D=i(61875),E=i(70427),F=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class R extends T{constructor(e,t,i){super(),this.cryptoService=e,this.i18nService=t,this.cipherService=i}parse(e){return F(this,void 0,void 0,(function*(){this.result=new w;const t=JSON.parse(e);return null==t||null==t.items?(this.result.success=!1,this.result):(t.encrypted?yield this.parseEncrypted(t):yield this.parseDecrypted(t),this.result)}))}parseEncrypted(e){return F(this,void 0,void 0,(function*(){if(null!=e.encKeyValidation_DO_NOT_EDIT){const t=yield this.cryptoService.getOrgKey(this.organizationId),i=new E._(e.encKeyValidation_DO_NOT_EDIT);if(null===(yield this.cryptoService.decryptToUtf8(i,t)))return this.result.success=!1,void(this.result.errorMessage=this.i18nService.t("importEncKeyError"))}const t=this.organization?yield this.parseCollections(e):yield this.parseFolders(e);for(const i of e.items){const e=D.Rm.toDomain(i);e.id=null,e.organizationId=this.organizationId,e.collectionIds=null,null!=e.passwordHistory&&e.passwordHistory.length>5&&(e.passwordHistory=e.passwordHistory.slice(0,5)),!this.organization&&null!=i.folderId&&t.has(i.folderId)?this.result.folderRelationships.push([this.result.ciphers.length,t.get(i.folderId)]):this.organization&&null!=i.collectionIds&&i.collectionIds.forEach((e=>{t.has(e)&&this.result.collectionRelationships.push([this.result.ciphers.length,t.get(e)])}));const n=yield e.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(e));this.cleanupCipher(n),this.result.ciphers.push(n)}this.result.success=!0}))}parseDecrypted(e){return F(this,void 0,void 0,(function*(){const t=this.organization?yield this.parseCollections(e):yield this.parseFolders(e);e.items.forEach((e=>{const i=D.Rm.toView(e);i.id=null,i.organizationId=null,i.collectionIds=null,null!=i.passwordHistory&&i.passwordHistory.length>5&&(i.passwordHistory=i.passwordHistory.slice(0,5)),!this.organization&&null!=e.folderId&&t.has(e.folderId)?this.result.folderRelationships.push([this.result.ciphers.length,t.get(e.folderId)]):this.organization&&null!=e.collectionIds&&e.collectionIds.forEach((e=>{t.has(e)&&this.result.collectionRelationships.push([this.result.ciphers.length,t.get(e)])})),this.cleanupCipher(i),this.result.ciphers.push(i)})),this.result.success=!0}))}parseFolders(e){return F(this,void 0,void 0,(function*(){if(null==e.folders)return null;const t=new Map;for(const i of e.folders){let n;if(e.encrypted){const e=D.L5.toDomain(i);null!=e&&(n=yield e.decrypt())}else n=D.L5.toView(i);null!=n&&(t.set(i.id,this.result.folders.length),this.result.folders.push(n))}return t}))}parseCollections(e){return F(this,void 0,void 0,(function*(){if(null==e.collections)return null;const t=new Map;for(const i of e.collections){let n;if(e.encrypted){const e=D.lC.toDomain(i);e.organizationId=this.organizationId,n=yield e.decrypt()}else n=D.lC.toView(i),n.organizationId=null;null!=n&&(t.set(i.id,this.result.collections.length),this.result.collections.push(n))}return t}))}}var J=i(88160),z=i(44879),Y=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class K extends R{constructor(e,t,i,n){super(e,t,i),this.promptForPassword_callback=n}parse(e){const t=Object.create(null,{parse:{get:()=>super.parse}});return Y(this,void 0,void 0,(function*(){const i=new w,n=JSON.parse(e);if(!n)return i.success=!1,i;if(!(null==n?void 0:n.encrypted))return yield t.parse.call(this,e);if(!(null==n?void 0:n.passwordProtected))return yield t.parse.call(this,e);if(this.cannotParseFile(n))return i.success=!1,i;const s=yield this.promptForPassword_callback();if(!(yield this.checkPassword(n,s)))return i.success=!1,i.errorMessage=this.i18nService.t("invalidFilePassword"),i;const o=new E._(n.data),r=yield this.cryptoService.decryptToUtf8(o,this.key);return yield t.parse.call(this,r)}))}checkPassword(e,t){return Y(this,void 0,void 0,(function*(){if(this.isNullOrWhitespace(t))return!1;const i=e.kdfType===z.G3.PBKDF2_SHA256?new J.S(e.kdfIterations):new J.H(e.kdfIterations,e.kdfMemory,e.kdfParallelism);this.key=yield this.cryptoService.makePinKey(t,e.salt,i);const n=new E._(e.encKeyValidation_DO_NOT_EDIT);return null!==(yield this.cryptoService.decryptToUtf8(n,this.key))}))}cannotParseFile(e){return!(e&&e.encrypted&&e.passwordProtected&&e.salt&&e.kdfIterations&&"number"==typeof e.kdfIterations&&null!=e.kdfType&&null!=z.G3[e.kdfType]&&e.encKeyValidation_DO_NOT_EDIT&&e.data)}}class B extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{"null"===e.label&&(e.label=null);const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.label,this.getValueOrDefault(this.nameFromUrl(e.domain),"--")),i.login.uris=this.makeUriArray(e.domain),i.login.password=this.getValueOrDefault(e.password),this.isNullOrWhitespace(e.email)&&!this.isNullOrWhitespace(e.username)?i.login.username=e.username:(i.login.username=this.getValueOrDefault(e.email),i.notes=this.getValueOrDefault(e.username)),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}const Q=["!group_id","!group_name","title","username","password","URL","id"];class G extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{this.processFolder(t,this.getValueOrDefault(e["!group_name"]));const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.title,"--"),i.login.username=this.getValueOrDefault(e.username),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(e.URL);let n=!1;for(const t in e)e.hasOwnProperty(t)&&(n||-1!==Q.indexOf(t)||(n=!0),n&&this.processKvp(i,t,e[t]));this.cleanupCipher(i),t.ciphers.push(i)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}class j extends T{parse(e){const t=new w,i=this.parseXml(e);if(null==i)return t.success=!1,Promise.resolve(t);const n=i.querySelector("textarea");if(null==n||this.isNullOrWhitespace(n.textContent))return t.errorMessage="Missing textarea.",t.success=!1,Promise.resolve(t);return JSON.parse(n.textContent).forEach((e=>{const i=this.initLoginCipher();if(this.isNullOrWhitespace(e.label)||(i.name=e.label.split(" ")[0]),null==e.data||this.isNullOrWhitespace(e.data.notes)||(i.notes=e.data.notes.split("\\n").join("\n")),null!=e.currentVersion&&null!=e.currentVersion.fields)for(const t in e.currentVersion.fields){if(!e.currentVersion.fields.hasOwnProperty(t))continue;const n=e.currentVersion.fields[t];switch(null!=n.actionType?n.actionType.toLowerCase():null){case"password":i.login.password=this.getValueOrDefault(n.value);break;case"email":case"username":case"user":case"name":i.login.username=this.getValueOrDefault(n.value);break;case"url":i.login.uris=this.makeUriArray(n.value);break;default:{const e=null!=n.label?n.label.toLowerCase():null;null==i.login.password&&this.passwordFieldNames.indexOf(e)>-1?i.login.password=this.getValueOrDefault(n.value):null==i.login.username&&this.usernameFieldNames.indexOf(e)>-1?i.login.username=this.getValueOrDefault(n.value):(null==i.login.uris||0===i.login.uris.length)&&this.uriFieldNames.indexOf(e)>-1?i.login.uris=this.makeUriArray(n.value):this.processKvp(i,n.label,n.value);break}}}this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t)}}class V extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{this.processFolder(t,this.getValueOrDefault(e.Category));const i=this.initLoginCipher();i.favorite="True"===this.getValueOrDefault(e.Favorite),i.name=this.getValueOrDefault(e.Entry,"--"),i.notes=this.getValueOrDefault(e.Note),i.login.username=this.getValueOrDefault(e.Username,e.Email),i.login.password=this.getValueOrDefault(e.Password),i.login.totp=this.getValueOrDefault(e.TOTP),i.login.uris=this.makeUriArray(e.Website),this.isNullOrWhitespace(e.Username)||this.processKvp(i,"Email",e.Email),this.processKvp(i,"Phone",e.Phone),this.processKvp(i,"PIN",e.PIN),this.processKvp(i,"Account",e.Account),this.processKvp(i,"Date",e.Date),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}var $=i(15091);const H=new Set(["title","note","username","password","url","otpSecret","category"]),W=new Set(["type","title","first_name","middle_name","last_name","login","email","phone_number","address","country","state","city","zip","item_name"]),X=new Set(["title","note"]);class ee extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);if(null==i)return t.success=!1,Promise.resolve(t);if(null!=i[0].type&&null!=i[0].title){if(1===i.filter((e=>"name"===e.type)).length){const e=this.initLoginCipher();return e.type=p.Ou.Identity,e.identity=new $.t,i.forEach((t=>{this.parsePersonalInformationRecordAsIdentity(e,t)})),this.cleanupCipher(e),t.ciphers.push(e),t.success=!0,Promise.resolve(t)}}return i.forEach((e=>{const i=this.initLoginCipher(),n=Object.keys(e);"username"===n[0]&&(this.processFolder(t,e.category),this.parseCredentialsRecord(i,e)),"type"===n[0]&&"account_name"===n[1]&&this.parsePaymentRecord(i,e),"type"===n[0]&&"number"===n[1]&&this.parseIdRecord(i,e),"type"===n[0]!=null&&"title"===n[1]&&this.parsePersonalInformationRecord(i,e),"title"===n[0]&&"note"===n[1]&&this.parseSecureNoteRecords(i,e),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}parseCredentialsRecord(e,t){e.type=p.Ou.Login,e.login=new x.q,e.name=t.title,e.notes=t.note,e.login.username=t.username,e.login.password=t.password,e.login.totp=t.otpSecret,e.login.uris=this.makeUriArray(t.url),this.importUnmappedFields(e,t,H)}parsePaymentRecord(e,t){e.type=p.Ou.Card,e.card=new k._,e.name=t.account_name;let i=[];switch(t.type){case"credit_card":e.card.cardholderName=t.account_name,e.card.number=t.cc_number,e.card.brand=k._.getCardBrandByPatterns(e.card.number),e.card.code=t.code,this.setCardExpiration(e,`${t.expiration_month}/${t.expiration_year}`),i=["account_name","account_holder","cc_number","code","expiration_month","expiration_year"];break;case"bank":e.card.cardholderName=t.account_holder,e.card.number=t.account_number,i=["account_name","account_holder","account_number"]}this.importUnmappedFields(e,t,new Set(i))}parseIdRecord(e,t){e.type=p.Ou.Identity,e.identity=new $.t;const i=["name","number"];switch(t.type){case"card":e.name=`${t.name} ${t.type}`,this.processFullName(e,t.name),e.identity.licenseNumber=t.number;break;case"passport":e.name=`${t.name} ${t.type}`,this.processFullName(e,t.name),e.identity.passportNumber=t.number;break;case"license":e.name=`${t.name} ${t.type}`,this.processFullName(e,t.name),e.identity.licenseNumber=t.number,e.identity.state=t.state,i.push("state");break;case"social_security":e.name=`${t.name} ${t.type}`,this.processFullName(e,t.name),e.identity.ssn=t.number;break;case"tax_number":e.name=t.type,e.identity.licenseNumber=t.number}this.importUnmappedFields(e,t,new Set(i))}parsePersonalInformationRecord(e,t){e.type=p.Ou.SecureNote,e.secureNote.type=p.xs.Generic,"name"===t.type?e.name=`${t.title} ${t.first_name} ${t.middle_name} ${t.last_name}`.replace("  "," ").trim():e.name=t.item_name;const i=t;Object.keys(t).forEach((t=>{this.processKvp(e,t,i[t])}))}parsePersonalInformationRecordAsIdentity(e,t){switch(t.type){case"name":this.processFullName(e,`${t.first_name} ${t.middle_name} ${t.last_name}`),e.identity.title=t.title,e.name=e.identity.fullName,e.identity.username=t.login;break;case"email":e.identity.email=t.email;break;case"number":e.identity.phone=t.phone_number;break;case"address":e.identity.address1=t.address,e.identity.city=t.city,e.identity.postalCode=t.zip,e.identity.state=t.state,e.identity.country=t.country}this.importUnmappedFields(e,t,W)}parseSecureNoteRecords(e,t){e.type=p.Ou.SecureNote,e.secureNote.type=p.xs.Generic,e.name=t.title,e.notes=t.note,this.importUnmappedFields(e,t,X)}importUnmappedFields(e,t,i){Object.keys(t).filter((e=>!i.has(e))).forEach((i=>{const n=t;this.processKvp(e,i,n[i])}))}}const te=new Set(["ADDRESS","AUTHENTIFIANT","BANKSTATEMENT","IDCARD","IDENTITY","PAYMENTMEANS_CREDITCARD","PAYMENTMEAN_PAYPAL","EMAIL"]);class ie extends T{parse(e){this.result=new w;const t=JSON.parse(e);if(null==t||0===t.length)return this.result.success=!1,Promise.resolve(this.result);null!=t.ADDRESS&&this.processAddress(t.ADDRESS),null!=t.AUTHENTIFIANT&&this.processAuth(t.AUTHENTIFIANT),null!=t.BANKSTATEMENT&&this.processNote(t.BANKSTATEMENT,"BankAccountName"),null!=t.IDCARD&&this.processNote(t.IDCARD,"Fullname"),null!=t.PAYMENTMEANS_CREDITCARD&&this.processCard(t.PAYMENTMEANS_CREDITCARD),null!=t.IDENTITY&&this.processIdentity(t.IDENTITY);for(const i in t)t.hasOwnProperty(i)&&!te.has(i)&&this.processNote(t[i],null,"Generic Note");return this.result.success=!0,Promise.resolve(this.result)}processAuth(e){e.forEach((e=>{const t=this.initLoginCipher();t.name=this.getValueOrDefault(e.title),t.login.username=this.getValueOrDefault(e.login,this.getValueOrDefault(e.secondaryLogin)),this.isNullOrWhitespace(t.login.username)?t.login.username=this.getValueOrDefault(e.email):this.isNullOrWhitespace(e.email)||(t.notes="Email: "+e.email+"\n"),t.login.password=this.getValueOrDefault(e.password),t.login.uris=this.makeUriArray(e.domain),t.notes+=this.getValueOrDefault(e.note,""),this.convertToNoteIfNeeded(t),this.cleanupCipher(t),this.result.ciphers.push(t)}))}processIdentity(e){e.forEach((e=>{const t=new _.$;t.identity=new $.t,t.type=p.Ou.Identity,t.name=this.getValueOrDefault(e.fullName,"");const i=t.name.split(" ");i.length>0&&(t.identity.firstName=this.getValueOrDefault(i[0])),2===i.length?t.identity.lastName=this.getValueOrDefault(i[1]):3===i.length&&(t.identity.middleName=this.getValueOrDefault(i[1]),t.identity.lastName=this.getValueOrDefault(i[2])),t.identity.username=this.getValueOrDefault(e.pseudo),this.cleanupCipher(t),this.result.ciphers.push(t)}))}processAddress(e){e.forEach((e=>{const t=new _.$;t.identity=new $.t,t.type=p.Ou.Identity,t.name=this.getValueOrDefault(e.addressName),t.identity.address1=this.getValueOrDefault(e.addressFull),t.identity.city=this.getValueOrDefault(e.city),t.identity.state=this.getValueOrDefault(e.state),t.identity.postalCode=this.getValueOrDefault(e.zipcode),t.identity.country=this.getValueOrDefault(e.country),null!=t.identity.country&&(t.identity.country=t.identity.country.toUpperCase()),this.cleanupCipher(t),this.result.ciphers.push(t)}))}processCard(e){e.forEach((e=>{const t=new _.$;t.card=new k._,t.type=p.Ou.Card,t.name=this.getValueOrDefault(e.bank),t.card.number=this.getValueOrDefault(e.cardNumber),t.card.brand=k._.getCardBrandByPatterns(t.card.number),t.card.cardholderName=this.getValueOrDefault(e.owner),this.isNullOrWhitespace(t.card.brand)||(this.isNullOrWhitespace(t.name)?t.name=t.card.brand:t.name+=" - "+t.card.brand),this.cleanupCipher(t),this.result.ciphers.push(t)}))}processNote(e,t,i=null){e.forEach((e=>{const n=new _.$;n.secureNote=new S.z,n.type=p.Ou.SecureNote,n.secureNote.type=p.xs.Generic,n.name=null!=i?i:this.getValueOrDefault(e[t]);for(const i in e)e.hasOwnProperty(i)&&i!==t&&this.processKvp(n,i,e[i].toString());this.cleanupCipher(n),this.result.ciphers.push(n)}))}}class ne extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.Label,"--"),i.notes=this.getValueOrDefault(e.Notes);const n=this.getValueOrDefault(e.Text);this.isNullOrWhitespace(n)||(this.isNullOrWhitespace(i.notes)?i.notes=n:i.notes+="\n\n"+n);const s=e["Entry Type"];if("Password"===s)i.login.username=this.getValueOrDefault(e.Username),i.login.password=this.getValueOrDefault(e.Password),i.login.uris=this.makeUriArray(e["Site URL"]);else if("Credit Card"===s){i.type=p.Ou.Card,i.card=new k._,i.card.cardholderName=this.getValueOrDefault(e["Name on card"]),i.card.number=this.getValueOrDefault(e["Card Number"]),i.card.brand=k._.getCardBrandByPatterns(i.card.number),i.card.code=this.getValueOrDefault(e.CVV);const t=this.getValueOrDefault(e.Expiry);if(!this.isNullOrWhitespace(t)){const e=t.split("/");e.length>1&&(i.card.expMonth=parseInt(e[0],null).toString(),i.card.expYear=(2e3+parseInt(e[1],null)).toString())}}this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class se extends T{parse(e){const t=new w,i=this.parseCsv(e,!1);if(null==i)return t.success=!1,Promise.resolve(t);let n=!0;return i.forEach((e=>{if(e.length<2||n&&("Title"===e[0]||"title"===e[0]))return void(n=!1);const i=this.initLoginCipher();if(i.notes=this.getValueOrDefault(e[e.length-1]),i.name=this.getValueOrDefault(e[0],"--"),2!==e.length&&(this.containsField(e,"username")||this.containsField(e,"password")||this.containsField(e,"email")||this.containsField(e,"url"))||(i.type=p.Ou.SecureNote,i.secureNote=new S.z,i.secureNote.type=p.xs.Generic),this.containsField(e,"cardholder")&&this.containsField(e,"number")&&this.containsField(e,"expiry date")&&(i.type=p.Ou.Card,i.card=new k._),e.length>2&&e.length%2==0)for(let t=0;t<e.length-2;t+=2){const n=e[t+2];if(this.isNullOrWhitespace(n))continue;const s=e[t+1],o=s.toLowerCase();if(i.type===p.Ou.Login){if("url"===o&&(null==i.login.uris||0===i.login.uris.length)){i.login.uris=this.makeUriArray(n);continue}if(("username"===o||"email"===o)&&this.isNullOrWhitespace(i.login.username)){i.login.username=n;continue}if("password"===o&&this.isNullOrWhitespace(i.login.password)){i.login.password=n;continue}if("totp"===o&&this.isNullOrWhitespace(i.login.totp)){i.login.totp=n;continue}}else if(i.type===p.Ou.Card){if("cardholder"===o&&this.isNullOrWhitespace(i.card.cardholderName)){i.card.cardholderName=n;continue}if("number"===o&&this.isNullOrWhitespace(i.card.number)){i.card.number=n,i.card.brand=k._.getCardBrandByPatterns(i.card.number);continue}if("cvc"===o&&this.isNullOrWhitespace(i.card.code)){i.card.code=n;continue}if("expiry date"===o&&this.isNullOrWhitespace(i.card.expMonth)&&this.isNullOrWhitespace(i.card.expYear)){if(this.setCardExpiration(i,n))continue}else if("type"===o)continue}this.processKvp(i,s,n)}this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t)}containsField(e,t){return null!=e&&null!=t&&e.filter((e=>!this.isNullOrWhitespace(e)&&e.toLowerCase()===t.toLowerCase())).length>0}}const oe=new RegExp("androidapp://.*==@","g");class re extends T{parse(e){const t=new w,i=JSON.parse(e);if(null==i||null==i.items||0===i.items.length)return t.success=!1,Promise.resolve(t);const n=new Map,s=new Map,o=this.buildFolderTree(i.folders);return this.flattenFolderTree(null,o,n),n.forEach(((e,i)=>{s.set(i,t.folders.length);const n=new y.a;n.name=e,t.folders.push(n)})),i.items.forEach((e=>{null!=e.folders&&e.folders.length>0&&s.has(e.folders[0])&&t.folderRelationships.push([t.ciphers.length,s.get(e.folders[0])]);const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.title),i.favorite=e.favorite>0,null!=e.template_type&&null!=e.fields&&e.fields.length>0&&(0===e.template_type.indexOf("login.")||0===e.template_type.indexOf("password.")?this.processLogin(i,e.fields):0===e.template_type.indexOf("creditcard.")?this.processCard(i,e.fields):e.template_type.indexOf("identity.")<0&&e.fields.some((e=>"password"===e.type&&!this.isNullOrWhitespace(e.value)))?this.processLogin(i,e.fields):this.processNote(i,e.fields)),i.notes+="\n"+this.getValueOrDefault(e.note,""),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t)}processLogin(e,t){const i=[];t.forEach((t=>{if(!this.isNullOrWhitespace(t.value)&&"section"!==t.type)if("username"!==t.type&&"email"!==t.type||!this.isNullOrWhitespace(e.login.username))if("password"===t.type&&this.isNullOrWhitespace(e.login.password))e.login.password=t.value;else if("totp"===t.type&&this.isNullOrWhitespace(e.login.totp))e.login.totp=t.value;else if("url"===t.type)i.push(t.value);else if(".Android#"===t.type){let e=t.value.startsWith("androidapp://")?t.value:"androidapp://"+t.value;e=e.replace("android://",""),e=e.replace(oe,"androidapp://"),i.push(e)}else this.processKvp(e,t.label,t.value,1===t.sensitive?p.fS.Hidden:p.fS.Text);else e.login.username=t.value})),e.login.uris=this.makeUriArray(i)}processCard(e,t){e.card=new k._,e.type=p.Ou.Card,t.forEach((t=>{this.isNullOrWhitespace(t.value)||"section"===t.type||"ccType"===t.type||("ccName"===t.type&&this.isNullOrWhitespace(e.card.cardholderName)?e.card.cardholderName=t.value:"ccNumber"===t.type&&this.isNullOrWhitespace(e.card.number)?(e.card.number=t.value,e.card.brand=k._.getCardBrandByPatterns(e.card.number)):"ccCvc"===t.type&&this.isNullOrWhitespace(e.card.code)?e.card.code=t.value:"ccExpiry"===t.type&&this.isNullOrWhitespace(e.card.expYear)&&this.setCardExpiration(e,t.value)||this.processKvp(e,t.label,t.value,1===t.sensitive?p.fS.Hidden:p.fS.Text))}))}processNote(e,t){t.forEach((t=>{this.isNullOrWhitespace(t.value)||"section"===t.type||this.processKvp(e,t.label,t.value,1===t.sensitive?p.fS.Hidden:p.fS.Text)}))}buildFolderTree(e){if(null==e)return[];const t=[],i=new Map([]);return e.forEach((e=>{i.set(e.uuid,e),e.children=[]})),e.forEach((e=>{null!=e.parent_uuid&&""!==e.parent_uuid&&i.has(e.parent_uuid)?i.get(e.parent_uuid).children.push(e):t.push(e)})),t}flattenFolderTree(e,t,i){null!=t&&t.forEach((t=>{if(null!=t.title&&""!==t.title.trim()){let n=t.title.trim();null!=e&&""!==e.trim()&&(n=e+"/"+n),i.set(t.uuid,n),null!=t.children&&0!==t.children.length&&this.flattenFolderTree(n,t.children,i)}}))}}class ae extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.filter((e=>"chrome://FirefoxAccounts"!==e.url)).forEach((e=>{const i=this.initLoginCipher(),n=this.getValueOrDefault(e.url,this.getValueOrDefault(e.hostname));i.name=this.getValueOrDefault(this.nameFromUrl(n),"--"),i.login.username=this.getValueOrDefault(e.username),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(n),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}var le;!function(e){e[e.Login=1]="Login",e[e.CreditCard=2]="CreditCard"}(le||(le={}));class ce extends T{parse(e){const t=new w,i=JSON.parse(e);if(null==i||null==i.data)return t.success=!1,Promise.resolve(t);for(const n in i.data){if(!i.data.hasOwnProperty(n))continue;const e=i.data[n],s=this.parseEntry(e);t.ciphers.push(s)}return t.success=!0,Promise.resolve(t)}parseEntry(e){const t=this.initLoginCipher();switch(t.name=this.getValueOrDefault(e.service),t.notes=this.getValueOrDefault(e.notes),t.favorite=e.favorite>0,e.type){case le.Login:this.handleLoginEntry(e,t);break;case le.CreditCard:this.handleCreditCardEntry(e,t);break;default:return}return this.convertToNoteIfNeeded(t),this.cleanupCipher(t),t}handleLoginEntry(e,t){t.login.username=this.getValueOrDefault(e.username),t.login.password=this.getValueOrDefault(e.password),t.login.uris=this.makeUriArray(e.url)}handleCreditCardEntry(e,t){t.type=p.Ou.Card,t.card=new k._,t.card.cardholderName=this.getValueOrDefault(e.username),t.card.number=this.getValueOrDefault(e.creditNumber),t.card.brand=k._.getCardBrandByPatterns(t.card.number),t.card.code=this.getValueOrDefault(e.creditCvv),this.isNullOrWhitespace(e.creditExpiry)||this.setCardExpiration(t,e.creditExpiry)||this.processKvp(t,"Expiration",e.creditExpiry),this.isNullOrWhitespace(e.password)||this.processKvp(t,"PIN",e.password)}}class ue extends T{parse(e){const t=new w,i=JSON.parse(e);if(null==i||0===Object.keys(i).length)return t.success=!1,Promise.resolve(t);for(const n in i)i.hasOwnProperty(n)&&!this.isNullOrWhitespace(n)&&0!==i[n].length&&i[n].forEach((e=>{if(this.isNullOrWhitespace(e.display_name)||0!==e.display_name.indexOf("http"))return;this.processFolder(t,n);const i=this.initLoginCipher();if(i.name=e.display_name.replace("http://","").replace("https://",""),i.name.length>30&&(i.name=i.name.substring(0,30)),i.login.password=this.getValueOrDefault(e.secret),i.login.uris=this.makeUriArray(e.display_name),null!=e.attributes){i.login.username=null!=e.attributes?this.getValueOrDefault(e.attributes.username_value):null;for(const t in e.attributes)e.attributes.hasOwnProperty(t)&&"username_value"!==t&&"xdg:schema"!==t&&this.processKvp(i,t,e.attributes[t])}this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}));return this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}}const de="Notes\n\n",pe="Applications\n\n",he="Websites\n\n",ge="\n---\n";class fe extends T{parse(e){const t=new w;let i,n,s,o=this.splitNewLine(e).join("\n");if(-1!==o.indexOf(de)){const e=o.split(de);e.length>1&&(o=e[0],i=e[1])}if(-1!==o.indexOf(pe)){const e=o.split(pe);e.length>1&&(o=e[0],n=e[1])}if(0===o.indexOf(he)){const e=o.split(he);e.length>1&&(o=e[0],s=e[1])}const r=this.parseDataCategory(i),a=this.parseDataCategory(n),l=this.parseDataCategory(s);return r.forEach((e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.get("Name")),i.notes=this.getValueOrDefault(e.get("Text")),this.cleanupCipher(i),t.ciphers.push(i)})),l.concat(a).forEach((e=>{const i=this.initLoginCipher(),n=e.has("Website name")?"Website name":"Application";i.name=this.getValueOrDefault(e.get(n),""),this.isNullOrWhitespace(e.get("Login name"))||(this.isNullOrWhitespace(i.name)||(i.name+=": "),i.name+=e.get("Login name")),i.notes=this.getValueOrDefault(e.get("Comment")),e.has("Website URL")&&(i.login.uris=this.makeUriArray(e.get("Website URL"))),i.login.username=this.getValueOrDefault(e.get("Login")),i.login.password=this.getValueOrDefault(e.get("Password")),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t)}parseDataCategory(e){if(this.isNullOrWhitespace(e)||-1===e.indexOf(ge))return[];const t=[];return e.split(ge).forEach((e=>{if(-1===e.indexOf("\n"))return;const i=new Map;let n,s;e.split("\n").forEach((e=>{if(null!=n)return void(n+="\n"+e);const t=e.indexOf(":");let o,r;-1!==t&&(o=e.substring(0,t),e.length>t+1&&(r=e.substring(t+2)),null!=o&&i.set(o,r),"Comment"!==o&&"Text"!==o||(n=r,s=o))})),null!=n&&null!=s&&i.set(s,n),0!==i.size&&t.push(i)})),t}}class me extends T{constructor(){super(...arguments),this.result=new w}parse(e){const t=this.parseXml(e);if(null==t)return this.result.success=!1,Promise.resolve(this.result);const i=t.querySelector("KeePassFile");if(null==i)return this.result.errorMessage="Missing `KeePassFile` node.",this.result.success=!1,Promise.resolve(this.result);const n=i.querySelector("Root");if(null==n)return this.result.errorMessage="Missing `KeePassFile > Root` node.",this.result.success=!1,Promise.resolve(this.result);const s=n.querySelector("Group");return null==s?(this.result.errorMessage="Missing `KeePassFile > Root > Group` node.",this.result.success=!1,Promise.resolve(this.result)):(this.traverse(s,!0,""),this.organization&&this.moveFoldersToCollections(this.result),this.result.success=!0,Promise.resolve(this.result))}traverse(e,t,i){const n=this.result.folders.length;let s=i;if(!t){""!==s&&(s+="/");const t=this.querySelectorDirectChild(e,"Name");s+=null==t?"-":t.textContent;const i=new y.a;i.name=s,this.result.folders.push(i)}this.querySelectorAllDirectChild(e,"Entry").forEach((e=>{const i=this.result.ciphers.length,s=this.initLoginCipher();this.querySelectorAllDirectChild(e,"String").forEach((e=>{const t=this.querySelectorDirectChild(e,"Value"),i=null!=t?t.textContent:null;if(this.isNullOrWhitespace(i))return;const n=this.querySelectorDirectChild(e,"Key"),o=null!=n?n.textContent:null;if("URL"===o)s.login.uris=this.makeUriArray(i);else if("UserName"===o)s.login.username=i;else if("Password"===o)s.login.password=i;else if("otp"===o)s.login.totp=i.replace("key=","");else if("Title"===o)s.name=i;else if("Notes"===o)s.notes+=i+"\n";else{let e=p.fS.Text;const n=t.attributes;n.length>0&&null!=n.ProtectInMemory&&"True"===n.ProtectInMemory.value&&(e=p.fS.Hidden),this.processKvp(s,o,i,e)}})),this.cleanupCipher(s),this.result.ciphers.push(s),t||this.result.folderRelationships.push([i,n])})),this.querySelectorAllDirectChild(e,"Group").forEach((e=>{this.traverse(e,!1,s)}))}}class ve extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if(this.isNullOrWhitespace(e.Title))return;e.Group=!this.isNullOrWhitespace(e.Group)&&e.Group.startsWith("Root/")?e.Group.replace("Root/",""):e.Group;const i=this.isNullOrWhitespace(e.Group)?null:e.Group;this.processFolder(t,i);const n=this.initLoginCipher();n.notes=this.getValueOrDefault(e.Notes),n.name=this.getValueOrDefault(e.Title,"--"),n.login.username=this.getValueOrDefault(e.Username),n.login.password=this.getValueOrDefault(e.Password),n.login.uris=this.makeUriArray(e.URL),this.cleanupCipher(n),t.ciphers.push(n)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}class ye extends T{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if(e.length<6)return;this.processFolder(t,e[0]);const i=this.initLoginCipher(),n=this.getValueOrDefault(e[5]);if(n&&(i.notes=`${n}\n`),i.name=this.getValueOrDefault(e[1],"--"),i.login.username=this.getValueOrDefault(e[2]),i.login.password=this.getValueOrDefault(e[3]),i.login.uris=this.makeUriArray(e[4]),e.length>7)for(let t=7;t<e.length;t+=2)"TFC:Keeper"==e[t]?i.login.totp=e[t+1]:this.processKvp(i,e[t],e[t+1]);this.cleanupCipher(i),t.ciphers.push(i)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}class we extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{const i=t.ciphers.length;let n=t.folders.length,s=e.grouping;null!=s&&(s=s.replace(/\\/g,"/").replace(/[\x00-\x1F\x7F-\x9F]/g,""));const o="(none)"!==this.getValueOrDefault(s,"(none)");let r=o;if(o)for(let l=0;l<t.folders.length;l++)if(t.folders[l].name===s){r=!1,n=l;break}const a=this.buildBaseCipher(e);if(a.type===p.Ou.Login)a.notes=this.getValueOrDefault(e.extra),a.login=new x.q,a.login.uris=this.makeUriArray(e.url),a.login.username=this.getValueOrDefault(e.username),a.login.password=this.getValueOrDefault(e.password),a.login.totp=this.getValueOrDefault(e.totp);else if(a.type===p.Ou.SecureNote)this.parseSecureNote(e,a);else if(a.type===p.Ou.Card)a.card=this.parseCard(e),a.notes=this.getValueOrDefault(e.notes);else if(a.type===p.Ou.Identity&&(a.identity=this.parseIdentity(e),a.notes=this.getValueOrDefault(e.notes),!this.isNullOrWhitespace(e.ccnum))){const i=this.buildBaseCipher(e);i.identity=null,i.type=p.Ou.Card,i.card=this.parseCard(e),t.ciphers.push(i)}if(t.ciphers.push(a),r){const e=new y.a;e.name=s,t.folders.push(e)}o&&t.folderRelationships.push([i,n])})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}buildBaseCipher(e){const t=new _.$;return e.hasOwnProperty("profilename")&&e.hasOwnProperty("profilelanguage")?(t.favorite=!1,t.name=this.getValueOrDefault(e.profilename,"--"),t.type=p.Ou.Card,this.isNullOrWhitespace(e.title)&&this.isNullOrWhitespace(e.firstname)&&this.isNullOrWhitespace(e.lastname)&&this.isNullOrWhitespace(e.address1)&&this.isNullOrWhitespace(e.phone)&&this.isNullOrWhitespace(e.username)&&this.isNullOrWhitespace(e.email)||(t.type=p.Ou.Identity)):(t.favorite=!this.organization&&"1"===this.getValueOrDefault(e.fav,"0"),t.name=this.getValueOrDefault(e.name,"--"),t.type="http://sn"===e.url?p.Ou.SecureNote:p.Ou.Login),t}parseCard(e){const t=new k._;if(t.cardholderName=this.getValueOrDefault(e.ccname),t.number=this.getValueOrDefault(e.ccnum),t.code=this.getValueOrDefault(e.cccsc),t.brand=k._.getCardBrandByPatterns(t.number),!this.isNullOrWhitespace(e.ccexp)&&e.ccexp.indexOf("-")>-1){const i=e.ccexp.split("-");i.length>1&&(t.expYear=i[0],t.expMonth=i[1],2===t.expMonth.length&&"0"===t.expMonth[0]&&(t.expMonth=t.expMonth[1]))}return t}parseIdentity(e){const t=new $.t;return t.title=this.getValueOrDefault(e.title),t.firstName=this.getValueOrDefault(e.firstname),t.middleName=this.getValueOrDefault(e.middlename),t.lastName=this.getValueOrDefault(e.lastname),t.username=this.getValueOrDefault(e.username),t.company=this.getValueOrDefault(e.company),t.ssn=this.getValueOrDefault(e.ssn),t.address1=this.getValueOrDefault(e.address1),t.address2=this.getValueOrDefault(e.address2),t.address3=this.getValueOrDefault(e.address3),t.city=this.getValueOrDefault(e.city),t.state=this.getValueOrDefault(e.state),t.postalCode=this.getValueOrDefault(e.zip),t.country=this.getValueOrDefault(e.country),t.email=this.getValueOrDefault(e.email),t.phone=this.getValueOrDefault(e.phone),this.isNullOrWhitespace(t.title)||(t.title=t.title.charAt(0).toUpperCase()+t.title.slice(1)),t}parseSecureNote(e,t){const i=this.splitNewLine(e.extra);let n=!1;if(i.length){const e=i[0].split(":");if(e.length>1&&"NoteType"===e[0]&&("Credit Card"===e[1]||"Address"===e[1])){if("Credit Card"===e[1]){const e=this.parseSecureNoteMapping(t,i,{Number:"number","Name on Card":"cardholderName","Security Code":"code","Expiration Date":"expMonth"});if(this.isNullOrWhitespace(e.expMonth)||","===e.expMonth)e.expMonth=void 0;else{const[t,i]=e.expMonth.split(",");if(this.isNullOrWhitespace(t))e.expMonth=void 0;else{const i=new Date(Date.parse(t.trim()+" 1, 2012")).getMonth()+1;isNaN(i)?e.expMonth=void 0:e.expMonth=i.toString()}this.isNullOrWhitespace(i)||(e.expYear=i)}t.type=p.Ou.Card,t.card=e}else if("Address"===e[1]){const e=this.parseSecureNoteMapping(t,i,{Title:"title","First Name":"firstName","Last Name":"lastName","Middle Name":"middleName",Company:"company","Address 1":"address1","Address 2":"address2","Address 3":"address3","City / Town":"city",State:"state","Zip / Postal Code":"postalCode",Country:"country","Email Address":"email",Username:"username"});t.type=p.Ou.Identity,t.identity=e}n=!0}}n||(t.secureNote=new S.z,t.secureNote.type=p.xs.Generic,t.notes=this.getValueOrDefault(e.extra))}parseSecureNoteMapping(e,t,i){const n={};let s=!1;return t.forEach((t=>{let o=null,r=null;if(!s){if(this.isNullOrWhitespace(t))return;const e=t.indexOf(":");if(-1===e?o=t:(o=t.substring(0,e),t.length>e&&(r=t.substring(e+1))),this.isNullOrWhitespace(o)||this.isNullOrWhitespace(r)||"NoteType"===o)return}s?e.notes+="\n"+t:"Notes"===o?(this.isNullOrWhitespace(e.notes)?e.notes=r:e.notes+="\n"+r,s=!0):i.hasOwnProperty(o)?n[i[o]]=r:this.processKvp(e,o,r)})),n}}class be extends T{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if(e.length<4)return;const i=this.initLoginCipher();i.name=this.getValueOrDefault(e[0],"--"),i.login.username=this.getValueOrDefault(e[2]),i.login.password=this.getValueOrDefault(e[3]),i.login.uris=this.makeUriArray(e[1]),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class Ue extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.DisplayName,"--"),i.notes=this.getValueOrDefault(e.Notes),i.login.username=this.getValueOrDefault(e.UserName),i.login.password=this.getValueOrDefault(e.Password),i.login.uris=this.makeUriArray(e.Url),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class _e extends T{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if(e.length<3)return;const i="Unassigned"!==this.getValueOrDefault(e[0],"Unassigned")?e[0]:null;this.processFolder(t,i);const n=this.initLoginCipher();if(n.name=this.getValueOrDefault(e[2],"--"),"Web Logins"===e[1]||"Login"===e[1])n.login.uris=this.makeUriArray(e[4]),n.login.username=this.getValueOrDefault(e[5]),n.login.password=this.getValueOrDefault(e[6]),n.notes=this.isNullOrWhitespace(e[3])?null:e[3].split("\\n").join("\n");else if(e.length>3){n.type=p.Ou.SecureNote,n.secureNote=new S.z,n.secureNote.type=p.xs.Generic;for(let t=3;t<e.length;t++)this.isNullOrWhitespace(e[t])||(n.notes+=e[t]+"\n")}this.isNullOrWhitespace(e[1])||n.type===p.Ou.Login||(n.name=e[1]+": "+n.name),this.cleanupCipher(n),t.ciphers.push(n)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}const Ae=["nickname","additionalInfo"],Ze=new Set(Ae.concat(["url","username","password","twofaSecret"])),xe=new Set(Ae.concat(["cardNumber","cardName","exp_month","exp_year","cvv"])),Se=new Set(Ae.concat(["title","firstName","middleName","lastName","email","firstAddressLine","secondAddressLine","city","country","zipCode"])),Te=new Set(Ae.concat(["idName","idNumber","idCountry"])),Ce=new Set(Ae.concat(["authToken"])),Oe=new Set(Ae.concat(["content"]));class ke extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{const i=this.initLoginCipher();if(i.name=this.getValueOrDefault(e.nickname,"--"),i.notes=this.getValueOrDefault(e.additionalInfo),void 0!==e.url)i.login.uris=this.makeUriArray(e.url),i.login.username=this.getValueOrDefault(e.username),i.login.password=this.getValueOrDefault(e.password),i.login.totp=this.getValueOrDefault(e.twofaSecret),this.importUnmappedFields(i,e,Ze);else if(void 0!==e.authToken)i.login.totp=this.getValueOrDefault(e.authToken),this.importUnmappedFields(i,e,Ce);else if(void 0!==e.cardNumber)i.card=new k._,i.type=p.Ou.Card,i.card.cardholderName=this.getValueOrDefault(e.cardName),i.card.number=this.getValueOrDefault(e.cardNumber),i.card.brand=k._.getCardBrandByPatterns(i.card.number),i.card.expMonth=this.getValueOrDefault(e.exp_month),i.card.expYear=this.getValueOrDefault(e.exp_year),i.card.code=this.getValueOrDefault(e.cvv),this.importUnmappedFields(i,e,xe);else if(void 0!==e.firstName)i.identity=new $.t,i.type=p.Ou.Identity,i.identity.title=this.getValueOrDefault(e.title),i.identity.firstName=this.getValueOrDefault(e.firstName),i.identity.middleName=this.getValueOrDefault(e.middleName),i.identity.lastName=this.getValueOrDefault(e.lastName),i.identity.phone=this.getValueOrDefault(e.number),i.identity.email=this.getValueOrDefault(e.email),i.identity.address1=this.getValueOrDefault(e.firstAddressLine),i.identity.address2=this.getValueOrDefault(e.secondAddressLine),i.identity.city=this.getValueOrDefault(e.city),i.identity.country=this.getValueOrDefault(e.country),i.identity.postalCode=this.getValueOrDefault(e.zipCode),this.importUnmappedFields(i,e,Se);else if(void 0!==e.idType){switch(i.identity=new $.t,i.type=p.Ou.Identity,this.processFullName(i,e.idName),i.identity.country=this.getValueOrDefault(e.idCountry),e.idType){case"Passport":i.identity.passportNumber=e.idNumber;break;case"Social Security":i.identity.ssn=e.idNumber;break;default:i.identity.licenseNumber=e.idNumber}this.importUnmappedFields(i,e,Te)}else{if(void 0===e.content)return;i.secureNote=new S.z,i.type=p.Ou.SecureNote,i.secureNote.type=p.xs.Generic,i.notes=this.getValueOrDefault(e.content),this.importUnmappedFields(i,e,Oe)}this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}importUnmappedFields(e,t,i){Object.keys(t).filter((e=>!i.has(e))).forEach((i=>{const n=t;this.processKvp(e,i,n[i])}))}}class Pe extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{const i=this.evaluateType(e);if(void 0===i)return;this.organization||this.processFolder(t,e.folder);const n=new _.$;switch(n.name=this.getValueOrDefault(e.name,"--"),n.notes=this.getValueOrDefault(e.note),i){case p.Ou.Login:n.type=p.Ou.Login,n.login=new x.q,n.login.username=this.getValueOrDefault(e.username),n.login.password=this.getValueOrDefault(e.password),n.login.uris=this.makeUriArray(e.url);break;case p.Ou.Card:n.type=p.Ou.Card,n.card.cardholderName=this.getValueOrDefault(e.cardholdername),n.card.number=this.getValueOrDefault(e.cardnumber),n.card.code=this.getValueOrDefault(e.cvc),n.card.brand=k._.getCardBrandByPatterns(n.card.number),this.setCardExpiration(n,e.expirydate);break;case p.Ou.Identity:n.type=p.Ou.Identity,this.processFullName(n,this.getValueOrDefault(e.full_name)),n.identity.address1=this.getValueOrDefault(e.address1),n.identity.address2=this.getValueOrDefault(e.address2),n.identity.city=this.getValueOrDefault(e.city),n.identity.state=this.getValueOrDefault(e.state),n.identity.postalCode=this.getValueOrDefault(e.zipcode),n.identity.country=this.getValueOrDefault(e.country),null!=n.identity.country&&(n.identity.country=n.identity.country.toUpperCase()),n.identity.email=this.getValueOrDefault(e.email),n.identity.phone=this.getValueOrDefault(e.phone_number);break;case p.Ou.SecureNote:n.type=p.Ou.SecureNote,n.secureNote.type=p.xs.Generic}this.cleanupCipher(n),t.ciphers.push(n)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}evaluateType(e){return this.isNullOrWhitespace(e.username)?this.isNullOrWhitespace(e.cardnumber)?this.isNullOrWhitespace(e.full_name)?this.isNullOrWhitespace(e.note)?void 0:p.Ou.SecureNote:p.Ou.Identity:p.Ou.Card:p.Ou.Login}}var qe,Ie,Me=i(42937);class Ne extends T{constructor(){super(...arguments),this.result=new w}parse(e){return e.split(this.newLineRegex).forEach((e=>{if(this.isNullOrWhitespace(e)||"{"!==e[0])return;const t=JSON.parse(e);if(!0===t.trashed)return;const i=this.initLoginCipher();this.isNullOrWhitespace(t.hmac)?this.processStandardItem(t,i):this.processWinOpVaultItem(t,i),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),this.result.ciphers.push(i)})),this.result.success=!0,Promise.resolve(this.result)}processWinOpVaultItem(e,t){if(null!=e.overview&&(t.name=this.getValueOrDefault(e.overview.title),null!=e.overview.URLs)){const i=[];e.overview.URLs.forEach((e=>{this.isNullOrWhitespace(e.u)||i.push(e.u)})),t.login.uris=this.makeUriArray(i)}null!=e.details&&(null!=e.details.passwordHistory&&this.parsePasswordHistory(e.details.passwordHistory,t),this.isNullOrWhitespace(e.details.ccnum)&&this.isNullOrWhitespace(e.details.cvv)?this.isNullOrWhitespace(e.details.firstname)&&this.isNullOrWhitespace(e.details.address1)||(t.type=p.Ou.Identity,t.identity=new $.t):(t.type=p.Ou.Card,t.card=new k._),t.type!==p.Ou.Login||this.isNullOrWhitespace(e.details.password)||(t.login.password=e.details.password),this.isNullOrWhitespace(e.details.notesPlain)||(t.notes=e.details.notesPlain.split(this.newLineRegex).join("\n")+"\n"),null!=e.details.fields&&this.parseFields(e.details.fields,t,"designation","value","name"),null!=e.details.sections&&e.details.sections.forEach((e=>{null!=e.fields&&this.parseFields(e.fields,t,"n","v","t")})))}processStandardItem(e,t){if(t.favorite=!(!e.openContents||!e.openContents.faveIndex),t.name=this.getValueOrDefault(e.title),"securenotes.SecureNote"===e.typeName?(t.type=p.Ou.SecureNote,t.secureNote=new S.z,t.secureNote.type=p.xs.Generic):"wallet.financial.CreditCard"===e.typeName?(t.type=p.Ou.Card,t.card=new k._):"identities.Identity"===e.typeName?(t.type=p.Ou.Identity,t.identity=new $.t):t.login.uris=this.makeUriArray(e.location),null!=e.secureContents){if(null!=e.secureContents.passwordHistory&&this.parsePasswordHistory(e.secureContents.passwordHistory,t),this.isNullOrWhitespace(e.secureContents.notesPlain)||(t.notes=e.secureContents.notesPlain.split(this.newLineRegex).join("\n")+"\n"),t.type===p.Ou.Login&&(this.isNullOrWhitespace(e.secureContents.password)||(t.login.password=e.secureContents.password),null!=e.secureContents.URLs)){const i=[];e.secureContents.URLs.forEach((e=>{this.isNullOrWhitespace(e.url)||i.push(e.url)})),i.length>0&&(t.login.uris=this.makeUriArray(i))}null!=e.secureContents.fields&&this.parseFields(e.secureContents.fields,t,"designation","value","name"),null!=e.secureContents.sections&&e.secureContents.sections.forEach((e=>{null!=e.fields&&this.parseFields(e.fields,t,"n","v","t")}))}}parsePasswordHistory(e,t){const i=e.length>5?5:e.length;t.passwordHistory=e.filter((e=>!this.isNullOrWhitespace(e.value)&&null!=e.time)).sort(((e,t)=>t.time-e.time)).slice(0,i).map((e=>{const t=new Me.i;return t.password=e.value,t.lastUsedDate=new Date((""+e.time).length>=13?e.time:1e3*e.time),t}))}parseFields(e,t,i,n,s){e.forEach((e=>{if(null==e[n]||""===e[n].toString().trim())return;const o="date"===e.k?new Date(1e3*e[n]).toUTCString():e[n].toString(),r=null!=e[i]?e[i].toString():null;if(t.type===p.Ou.Login){if(this.isNullOrWhitespace(t.login.username)&&"username"===r)return void(t.login.username=o);if(this.isNullOrWhitespace(t.login.password)&&"password"===r)return void(t.login.password=o);if(this.isNullOrWhitespace(t.login.totp)&&null!=r&&r.startsWith("TOTP_"))return void(t.login.totp=o)}else if(t.type===p.Ou.Card){if(this.isNullOrWhitespace(t.card.number)&&"ccnum"===r)return t.card.number=o,void(t.card.brand=k._.getCardBrandByPatterns(t.card.number));if(this.isNullOrWhitespace(t.card.code)&&"cvv"===r)return void(t.card.code=o);if(this.isNullOrWhitespace(t.card.cardholderName)&&"cardholder"===r)return void(t.card.cardholderName=o);if(this.isNullOrWhitespace(t.card.expiration)&&"expiry"===r&&6===o.length)return t.card.expMonth=o.substr(4,2),"0"===t.card.expMonth[0]&&(t.card.expMonth=t.card.expMonth.substr(1,1)),void(t.card.expYear=o.substr(0,4));if("type"===r)return}else if(t.type===p.Ou.Identity){const i=t.identity;if(this.isNullOrWhitespace(i.firstName)&&"firstname"===r)return void(i.firstName=o);if(this.isNullOrWhitespace(i.lastName)&&"lastname"===r)return void(i.lastName=o);if(this.isNullOrWhitespace(i.middleName)&&"initial"===r)return void(i.middleName=o);if(this.isNullOrWhitespace(i.phone)&&"defphone"===r)return void(i.phone=o);if(this.isNullOrWhitespace(i.company)&&"company"===r)return void(i.company=o);if(this.isNullOrWhitespace(i.email)&&"email"===r)return void(i.email=o);if(this.isNullOrWhitespace(i.username)&&"username"===r)return void(i.username=o);if("address"===r){const{street:t,city:s,country:o,zip:r}=e[n];return i.address1=this.getValueOrDefault(t),i.city=this.getValueOrDefault(s),this.isNullOrWhitespace(o)||(i.country=o.toUpperCase()),void(i.postalCode=this.getValueOrDefault(r))}}const a=this.isNullOrWhitespace(e[s])?"no_name":e[s];if("password"===a&&null!=t.passwordHistory&&t.passwordHistory.some((e=>e.password===o)))return;const l="concealed"===e.k?p.fS.Hidden:p.fS.Text;this.processKvp(t,a,o,l)}))}}!function(e){e.Login="001",e.CreditCard="002",e.SecureNote="003",e.Identity="004",e.Password="005",e.Document="006",e.SoftwareLicense="100",e.BankAccount="101",e.Database="102",e.DriversLicense="103",e.OutdoorLicense="104",e.Membership="105",e.Passport="106",e.RewardsProgram="107",e.SocialSecurityNumber="108",e.WirelessRouter="109",e.Server="110",e.EmailAccount="111",e.API_Credential="112",e.MedicalRecord="113"}(qe||(qe={})),function(e){e.TextOrHtml="T",e.EmailAddress="E",e.URL="U",e.Number="N",e.Password="P",e.TextArea="A",e.PhoneNumber="TEL",e.CheckBox="C"}(Ie||(Ie={}));class Le extends T{constructor(){super(...arguments),this.result=new w}parse(e){return JSON.parse(e).accounts[0].vaults.forEach((e=>{e.items.forEach((e=>{if(!0===e.trashed)return;const t=this.initLoginCipher(),i=e.categoryUuid;switch(i){case qe.Login:case qe.Database:case qe.Password:case qe.WirelessRouter:case qe.Server:case qe.API_Credential:t.type=p.Ou.Login,t.login=new x.q;break;case qe.CreditCard:case qe.BankAccount:t.type=p.Ou.Card,t.card=new k._;break;case qe.SecureNote:case qe.SoftwareLicense:case qe.EmailAccount:case qe.MedicalRecord:t.type=p.Ou.SecureNote,t.secureNote=new S.z,t.secureNote.type=p.xs.Generic;break;case qe.Identity:case qe.DriversLicense:case qe.OutdoorLicense:case qe.Membership:case qe.Passport:case qe.RewardsProgram:case qe.SocialSecurityNumber:t.type=p.Ou.Identity,t.identity=new $.t}t.favorite=1===e.favIndex,this.processOverview(e.overview,t),this.processLoginFields(e,t),this.processDetails(i,e.details,t),this.parsePasswordHistory(e.details.passwordHistory,t),this.processSections(i,e.details.sections,t),this.isNullOrWhitespace(e.details.notesPlain)||(t.notes=e.details.notesPlain.split(this.newLineRegex).join("\n")+"\n"),this.convertToNoteIfNeeded(t),this.cleanupCipher(t),this.result.ciphers.push(t)}))})),this.organization&&this.moveFoldersToCollections(this.result),this.result.success=!0,Promise.resolve(this.result)}processOverview(e,t){if(null!=e){if(t.name=this.getValueOrDefault(e.title),null!=e.urls){const i=[];e.urls.forEach((e=>{this.isNullOrWhitespace(e.url)||i.push(e.url)})),t.login.uris=this.makeUriArray(i)}if(null!=e.tags&&e.tags.length>0){const t=this.capitalize(e.tags[0]);this.processFolder(this.result,t)}}}capitalize(e){return e.trim().replace(/\w\S*/g,(e=>e.replace(/^\w/,(e=>e.toUpperCase()))))}processLoginFields(e,t){null!=e.details&&null!=e.details.loginFields&&0!==e.details.loginFields.length&&e.details.loginFields.forEach((e=>{if("username"===e.designation&&""!==e.value)return t.type=p.Ou.Login,void(t.login.username=e.value);if("password"===e.designation&&""!==e.value)return t.type=p.Ou.Login,void(t.login.password=e.value);let i=e.value,n=p.fS.Text;switch(e.fieldType){case Ie.Password:n=p.fS.Hidden;break;case Ie.CheckBox:i=""!==e.value?"true":"false",n=p.fS.Boolean}this.processKvp(t,e.name,i,n)}))}processDetails(e,t,i){e===qe.Password&&null!=t&&(i.login.password=t.password)}processSections(e,t,i){null!=t&&0!==t.length&&t.forEach((t=>{null!=t.fields&&this.parseSectionFields(e,t.fields,i,t.title)}))}parseSectionFields(e,t,i,n){t.forEach((t=>{const s=Object.keys(t.value)[0],o=t;if(null==o.value||null==o.value[s]||""===o.value[s])return;const r=this.getFieldName(t.title,n),a=this.extractValue(t.value,s);if(i.type===p.Ou.Login){if(this.fillLogin(t,a,i))return;switch(e){case qe.Login:case qe.Database:case qe.EmailAccount:case qe.WirelessRouter:break;case qe.Server:if(this.isNullOrWhitespace(i.login.uri)&&"url"===t.id)return void(i.login.uris=this.makeUriArray(a));break;case qe.API_Credential:if(this.fillApiCredentials(t,a,i))return}}else if(i.type===p.Ou.Card){if(this.fillCreditCard(t,a,i))return;if(e===qe.BankAccount&&this.fillBankAccount(t,a,i))return}else if(i.type===p.Ou.Identity){if(this.fillIdentity(t,a,i,s))return;if("address"===s){const{street:e,city:n,country:s,zip:o,state:r}=t.value.address;return i.identity.address1=this.getValueOrDefault(e),i.identity.city=this.getValueOrDefault(n),this.isNullOrWhitespace(s)||(i.identity.country=s.toUpperCase()),i.identity.postalCode=this.getValueOrDefault(o),void(i.identity.state=this.getValueOrDefault(r))}switch(e){case qe.Identity:break;case qe.DriversLicense:if(this.fillDriversLicense(t,a,i))return;break;case qe.OutdoorLicense:if(this.fillOutdoorLicense(t,a,i))return;break;case qe.Membership:if(this.fillMembership(t,a,i))return;break;case qe.Passport:if(this.fillPassport(t,a,i))return;break;case qe.RewardsProgram:if(this.fillRewardsProgram(t,a,i))return;break;case qe.SocialSecurityNumber:if(this.fillSSN(t,a,i))return}}if("email"===s){const{email_address:e,provider:n}=t.value.email;return this.processKvp(i,r,e,p.fS.Text),void this.processKvp(i,"provider",n,p.fS.Text)}if("password"===t.title&&null!=i.passwordHistory&&i.passwordHistory.some((e=>e.password===a)))return;t.guarded&&i.reprompt===N.N.None&&(i.reprompt=N.N.Password);const l="concealed"===s?p.fS.Hidden:p.fS.Text;this.processKvp(i,r,a,l)}))}getFieldName(e,t){return this.isNullOrWhitespace(e)?this.isNullOrWhitespace(t)?"":t:e}extractValue(e,t){return"date"===t?new Date(1e3*e.date).toUTCString():"monthYear"===t?e.monthYear.toString():e[t]}fillLogin(e,t,i){const n=this.getFieldName(e.title);return this.isNullOrWhitespace(i.login.username)&&"username"===n?(i.login.username=t,!0):this.isNullOrWhitespace(i.login.password)&&"password"===n?(i.login.password=t,!0):!(!this.isNullOrWhitespace(i.login.totp)||null==e.id||!e.id.startsWith("TOTP_"))&&(i.login.totp=t,!0)}fillApiCredentials(e,t,i){const n=this.getFieldName(e.title);return this.isNullOrWhitespace(i.login.password)&&"credential"===n?(i.login.password=t,!0):!(!this.isNullOrWhitespace(i.login.uri)||"hostname"!==n)&&(i.login.uris=this.makeUriArray(t),!0)}fillCreditCard(e,t,i){if(this.isNullOrWhitespace(i.card.number)&&"ccnum"===e.id)return i.card.number=t,i.card.brand=k._.getCardBrandByPatterns(i.card.number),!0;if(this.isNullOrWhitespace(i.card.code)&&"cvv"===e.id)return i.card.code=t,!0;if(this.isNullOrWhitespace(i.card.cardholderName)&&"cardholder"===e.id)return i.card.cardholderName=t,!0;if(this.isNullOrWhitespace(i.card.expiration)&&"expiry"===e.id){const e=t.toString().trim();return i.card.expMonth=e.substring(4,6),"0"===i.card.expMonth[0]&&(i.card.expMonth=i.card.expMonth.substring(1,2)),i.card.expYear=e.substring(0,4),!0}return"type"===e.id}fillBankAccount(e,t,i){return!(!this.isNullOrWhitespace(i.card.cardholderName)||"owner"!==e.id)&&(i.card.cardholderName=t,!0)}fillIdentity(e,t,i,n){if(this.isNullOrWhitespace(i.identity.firstName)&&"firstname"===e.id)return i.identity.firstName=t,!0;if(this.isNullOrWhitespace(i.identity.lastName)&&"lastname"===e.id)return i.identity.lastName=t,!0;if(this.isNullOrWhitespace(i.identity.middleName)&&"initial"===e.id)return i.identity.middleName=t,!0;if(this.isNullOrWhitespace(i.identity.phone)&&"defphone"===e.id)return i.identity.phone=t,!0;if(this.isNullOrWhitespace(i.identity.company)&&"company"===e.id)return i.identity.company=t,!0;if(this.isNullOrWhitespace(i.identity.email)){if("email"===n){const{email_address:t,provider:n}=e.value.email;return i.identity.email=this.getValueOrDefault(t),this.processKvp(i,"provider",n,p.fS.Text),!0}if("email"===e.id)return i.identity.email=t,!0}return!(!this.isNullOrWhitespace(i.identity.username)||"username"!==e.id)&&(i.identity.username=t,!0)}fillDriversLicense(e,t,i){return this.isNullOrWhitespace(i.identity.firstName)&&"fullname"===e.id?(this.processFullName(i,t),!0):this.isNullOrWhitespace(i.identity.address1)&&"address"===e.id?(i.identity.address1=t,!0):this.isNullOrWhitespace(i.identity.country)&&"country"===e.id?(i.identity.country=t,!0):this.isNullOrWhitespace(i.identity.state)&&"state"===e.id?(i.identity.state=t,!0):!(!this.isNullOrWhitespace(i.identity.licenseNumber)||"number"!==e.id)&&(i.identity.licenseNumber=t,!0)}fillOutdoorLicense(e,t,i){return this.isNullOrWhitespace(i.identity.firstName)&&"name"===e.id?(this.processFullName(i,t),!0):this.isNullOrWhitespace(i.identity.country)&&"country"===e.id?(i.identity.country=t,!0):!(!this.isNullOrWhitespace(i.identity.state)||"state"!==e.id)&&(i.identity.state=t,!0)}fillMembership(e,t,i){return this.isNullOrWhitespace(i.identity.firstName)&&"member_name"===e.id?(this.processFullName(i,t),!0):this.isNullOrWhitespace(i.identity.company)&&"org_name"===e.id?(i.identity.company=t,!0):!(!this.isNullOrWhitespace(i.identity.phone)||"phone"!==e.id)&&(i.identity.phone=t,!0)}fillPassport(e,t,i){return this.isNullOrWhitespace(i.identity.firstName)&&"fullname"===e.id?(this.processFullName(i,t),!0):this.isNullOrWhitespace(i.identity.country)&&"issuing_country"===e.id?(i.identity.country=t,!0):!(!this.isNullOrWhitespace(i.identity.passportNumber)||"number"!==e.id)&&(i.identity.passportNumber=t,!0)}fillRewardsProgram(e,t,i){return this.isNullOrWhitespace(i.identity.firstName)&&"member_name"===e.id?(this.processFullName(i,t),!0):!(!this.isNullOrWhitespace(i.identity.company)||"company_name"!==e.id)&&(i.identity.company=t,!0)}fillSSN(e,t,i){return this.isNullOrWhitespace(i.identity.firstName)&&"name"===e.id?(this.processFullName(i,t),!0):!(!this.isNullOrWhitespace(i.identity.ssn)||"number"!==e.id)&&(i.identity.ssn=t,!0)}parsePasswordHistory(e,t){if(null==e||0===e.length)return;const i=e.length>5?5:e.length;t.passwordHistory=e.filter((e=>!this.isNullOrWhitespace(e.value)&&null!=e.time)).sort(((e,t)=>t.time-e.time)).slice(0,i).map((e=>{const t=new Me.i;return t.password=e.value,t.lastUsedDate=new Date((""+e.time).length>=13?e.time:1e3*e.time),t}))}}class De{constructor(e,t,i){this.importRecord=e,this.property=t,this.cipher=i,this.lowerProperty=t.toLowerCase()}}const Ee=["ainfo","autosubmit","notesplain","ps","scope","tags","title","uuid","notes"];class Fe extends T{constructor(){super(...arguments),this.loginPropertyParsers=[this.setLoginUsername,this.setLoginPassword,this.setLoginUris],this.creditCardPropertyParsers=[this.setCreditCardNumber,this.setCreditCardVerification,this.setCreditCardCardholderName,this.setCreditCardExpiry],this.identityPropertyParsers=[this.setIdentityFirstName,this.setIdentityInitial,this.setIdentityLastName,this.setIdentityUserName,this.setIdentityEmail,this.setIdentityPhone,this.setIdentityCompany]}parse(e){const t=new w,i=this.parseCsv(e,!0,{quoteChar:'"',escapeChar:"\\"});return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if(this.isNullOrWhitespace(this.getProp(e,"title")))return;const i=this.initLoginCipher();i.name=this.getValueOrDefault(this.getProp(e,"title"),"--"),this.setNotes(e,i),this.setCipherType(e,i);let n=null;for(const t in e){if(!e.hasOwnProperty(t)||this.isNullOrWhitespace(e[t]))continue;const s=new De(e,t,i);i.type===p.Ou.Login&&this.setKnownLoginValue(s)||(i.type===p.Ou.Card&&this.setKnownCreditCardValue(s)||i.type===p.Ou.Identity&&this.setKnownIdentityValue(s)||(n=this.setUnknownValue(s,n)))}i.type===p.Ou.Login&&!this.isNullOrWhitespace(n)&&this.isNullOrWhitespace(i.login.username)&&-1===n.indexOf("://")&&(i.login.username=n),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}getProp(e,t){return Object.entries(e).reduce(((e,t)=>(e[t[0].toLowerCase()]=t[1],e)),{})[t.toLowerCase()]}getPropByRegexp(e,t){const i=Object.keys(e).reduce(((e,i)=>(i.match(t)&&e.push(i),e)),[]);return 0===i.length?null:e[i[0]]}getPropIncluding(e,t){const i=Object.keys(e).reduce(((e,i)=>(i.toLowerCase().includes(t.toLowerCase())&&e.push(i),e)),[]);return 0===i.length?null:e[i[0]]}setNotes(e,t){t.notes=this.getValueOrDefault(this.getProp(e,"notesPlain"),"")+"\n"+this.getValueOrDefault(this.getProp(e,"notes"),"")+"\n",t.notes.trim()}setKnownLoginValue(e){return this.loginPropertyParsers.reduce(((t,i)=>(t||(t=i.bind(this)(e)),t)),!1)}setKnownCreditCardValue(e){return this.creditCardPropertyParsers.reduce(((t,i)=>(t||(t=i.bind(this)(e)),t)),!1)}setKnownIdentityValue(e){return this.identityPropertyParsers.reduce(((t,i)=>(t||(t=i.bind(this)(e)),t)),!1)}setUnknownValue(e,t){if(-1===Ee.indexOf(e.lowerProperty)&&!e.lowerProperty.startsWith("section:")&&!e.lowerProperty.startsWith("section ")){if(null==t&&"email"===e.lowerProperty)return e.importRecord[e.property];if("created date"===e.lowerProperty||"modified date"===e.lowerProperty){const t=new Date(1e3*parseInt(e.importRecord[e.property],10)).toUTCString();return this.processKvp(e.cipher,"1Password "+e.property,t),null}e.lowerProperty.includes("password")||e.lowerProperty.includes("key")||e.lowerProperty.includes("secret")?this.processKvp(e.cipher,e.property,e.importRecord[e.property],p.fS.Hidden):this.processKvp(e.cipher,e.property,e.importRecord[e.property])}return null}setIdentityFirstName(e){return!(!this.isNullOrWhitespace(e.cipher.identity.firstName)||!e.lowerProperty.includes("first name"))&&(e.cipher.identity.firstName=e.importRecord[e.property],!0)}setIdentityInitial(e){return!(!this.isNullOrWhitespace(e.cipher.identity.middleName)||!e.lowerProperty.includes("initial"))&&(e.cipher.identity.middleName=e.importRecord[e.property],!0)}setIdentityLastName(e){return!(!this.isNullOrWhitespace(e.cipher.identity.lastName)||!e.lowerProperty.includes("last name"))&&(e.cipher.identity.lastName=e.importRecord[e.property],!0)}setIdentityUserName(e){return!(!this.isNullOrWhitespace(e.cipher.identity.username)||!e.lowerProperty.includes("username"))&&(e.cipher.identity.username=e.importRecord[e.property],!0)}setIdentityCompany(e){return!(!this.isNullOrWhitespace(e.cipher.identity.company)||!e.lowerProperty.includes("company"))&&(e.cipher.identity.company=e.importRecord[e.property],!0)}setIdentityPhone(e){return!(!this.isNullOrWhitespace(e.cipher.identity.phone)||!e.lowerProperty.includes("default phone"))&&(e.cipher.identity.phone=e.importRecord[e.property],!0)}setIdentityEmail(e){return!(!this.isNullOrWhitespace(e.cipher.identity.email)||!e.lowerProperty.includes("email"))&&(e.cipher.identity.email=e.importRecord[e.property],!0)}setCreditCardNumber(e){return!(!this.isNullOrWhitespace(e.cipher.card.number)||!e.lowerProperty.includes("number"))&&(e.cipher.card.number=e.importRecord[e.property],e.cipher.card.brand=k._.getCardBrandByPatterns(e.cipher.card.number),!0)}setCreditCardVerification(e){return!(!this.isNullOrWhitespace(e.cipher.card.code)||!e.lowerProperty.includes("verification number"))&&(e.cipher.card.code=e.importRecord[e.property],!0)}setCreditCardCardholderName(e){return!(!this.isNullOrWhitespace(e.cipher.card.cardholderName)||!e.lowerProperty.includes("cardholder name"))&&(e.cipher.card.cardholderName=e.importRecord[e.property],!0)}setCreditCardExpiry(e){return!(!this.isNullOrWhitespace(e.cipher.card.expiration)||!e.lowerProperty.includes("expiry date")||7!==e.importRecord[e.property].length)&&(e.cipher.card.expMonth=e.importRecord[e.property].substr(0,2),"0"===e.cipher.card.expMonth[0]&&(e.cipher.card.expMonth=e.cipher.card.expMonth.substr(1,1)),e.cipher.card.expYear=e.importRecord[e.property].substr(3,4),!0)}setLoginPassword(e){return!(!this.isNullOrWhitespace(e.cipher.login.password)||"password"!==e.lowerProperty)&&(e.cipher.login.password=e.importRecord[e.property],!0)}setLoginUsername(e){return!(!this.isNullOrWhitespace(e.cipher.login.username)||"username"!==e.lowerProperty)&&(e.cipher.login.username=e.importRecord[e.property],!0)}setLoginUris(e){if((null==e.cipher.login.uris||0===e.cipher.login.uris.length)&&"urls"===e.lowerProperty){const t=e.importRecord[e.property].split(this.newLineRegex);return e.cipher.login.uris=this.makeUriArray(t),!0}return"url"===e.lowerProperty&&(null==e.cipher.login.uris&&(e.cipher.login.uris=[]),e.cipher.login.uris.concat(this.makeUriArray(e.importRecord[e.property])),!0)}}class Re extends Fe{setCipherType(e,t){switch(this.getValueOrDefault(this.getProp(e,"type"),"Login")){case"Credit Card":t.type=p.Ou.Card,t.card=new k._,Ee.push("type");break;case"Identity":t.type=p.Ou.Identity,t.identity=new $.t,Ee.push("type");break;case"Login":case"Secure Note":Ee.push("type")}}}class Je extends Fe{constructor(){super(),this.identityPropertyParsers.push(this.setIdentityAddress)}setCipherType(e,t){t.type=p.Ou.Login,t.login=new x.q,this.isNullOrWhitespace(this.getPropByRegexp(e,/\d+: number/i))||this.isNullOrWhitespace(this.getPropByRegexp(e,/\d+: expiry date/i))||(t.type=p.Ou.Card,t.card=new k._),this.isNullOrWhitespace(this.getPropByRegexp(e,/name \d+: first name/i))&&this.isNullOrWhitespace(this.getPropByRegexp(e,/name \d+: initial/i))&&this.isNullOrWhitespace(this.getPropByRegexp(e,/name \d+: last name/i))&&this.isNullOrWhitespace(this.getPropByRegexp(e,/internet \d+: email/i))||(t.type=p.Ou.Identity,t.identity=new $.t)}setIdentityAddress(e){return!!e.lowerProperty.match(/address \d+: address/i)&&(this.processKvp(e.cipher,"address",e.importRecord[e.property]),!0)}setCreditCardExpiry(e){if(this.isNullOrWhitespace(e.cipher.card.expiration)&&e.lowerProperty.includes("expiry date")){const t=e.importRecord[e.property].split("/");return e.cipher.card.expMonth=t[0],"0"===e.cipher.card.expMonth[0]&&2===e.cipher.card.expMonth.length&&(e.cipher.card.expMonth=e.cipher.card.expMonth.substr(1,1)),e.cipher.card.expYear=t[2].length>4?t[2].substr(0,4):t[2],!0}return!1}}class ze extends T{parse(e){const t=new w,i=this.parseCsv(e,!1);if(null==i)return t.success=!1,Promise.resolve(t);let n=null;return i.forEach((e=>{if(null==n)return void(n=e.map((e=>e)));if(e.length<2||e.length!==n.length)return;if(!this.isNullOrWhitespace(e[1]))if(this.organization){e[1].split(",").forEach((e=>{e=e.trim();let i=!0,n=t.collections.length;for(let s=0;s<t.collections.length;s++)if(t.collections[s].name===e){i=!1,n=s;break}if(i){const i=new v.n;i.name=e,t.collections.push(i)}t.collectionRelationships.push([t.ciphers.length,n])}))}else{const i=e[1].split(","),n=i.length>0?i[0].trim():null;this.processFolder(t,n)}const i=this.initLoginCipher();i.name=this.getValueOrDefault(e[0],"--");for(let t=2;t<e.length;t++){const s=n[t].trim().toLowerCase();this.isNullOrWhitespace(e[t])||this.isNullOrWhitespace(s)||(this.usernameFieldNames.indexOf(s)>-1?i.login.username=e[t]:this.passwordFieldNames.indexOf(s)>-1?i.login.password=e[t]:this.uriFieldNames.indexOf(s)>-1?i.login.uris=this.makeUriArray(e[t]):this.processKvp(i,n[t],e[t]))}this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t)}}class Ye extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{this.processFolder(t,this.getValue("category",e));const i=this.initLoginCipher();i.notes=this.getValue("description",e),i.name=this.getValueOrDefault(this.getValue("title",e),"--"),i.login.username=this.getValue("username",e),i.login.password=this.getValue("password",e),i.login.uris=this.makeUriArray(this.getValue("site",e)),this.processKvp(i,"Password 2",this.getValue("password2",e)),this.cleanupCipher(i),t.ciphers.push(i)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}getValue(e,t){return this.getValueOrDefault(t[e],this.getValueOrDefault(t[" "+e]))}}class Ke extends T{parse(e){const t=new w,i=JSON.parse(e);return null==i||null==i.passwords||0===i.passwords.length?(t.success=!1,Promise.resolve(t)):1==i.encrypted?(t.success=!1,t.errorMessage="Unable to import an encrypted passky backup.",Promise.resolve(t)):(i.passwords.forEach((e=>{const i=this.initLoginCipher();i.name=e.website,i.login.username=e.username,i.login.password=e.password,i.login.uris=this.makeUriArray(e.website),i.notes=e.message,this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class Be extends T{parse(e){const t=new w,i=JSON.parse(e);return null==i||0===i.length?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if(null!=e.tags&&e.tags.length>0){const i=e.tags[0].text;this.processFolder(t,i)}const i=this.initLoginCipher();i.name=e.label,i.login.username=this.getValueOrDefault(e.username),this.isNullOrWhitespace(i.login.username)?i.login.username=this.getValueOrDefault(e.email):this.isNullOrWhitespace(e.email)||(i.notes="Email: "+e.email+"\n"),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(e.url),i.notes+=this.getValueOrDefault(e.description,""),null!=e.otp&&(i.login.totp=this.getValueOrDefault(e.otp.secret)),null!=e.custom_fields&&e.custom_fields.forEach((e=>{switch(e.field_type){case"text":case"password":this.processKvp(i,e.label,e.value)}})),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}class Qe extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{const i=this.isNullOrWhitespace(e.Tags)?null:JSON.parse(e.Tags),n=null!=i&&null!=i.tags&&i.tags.length>0?i.tags.map((e=>{try{const t=JSON.parse(e);return this.getValueOrDefault(t.tag)}catch(t){}return null})).filter((e=>!this.isNullOrWhitespace(e))):null;this.organization&&null!=n&&n.length>0?n.forEach((e=>{let i=!0,n=t.collections.length;for(let s=0;s<t.collections.length;s++)if(t.collections[s].name===e){i=!1,n=s;break}if(i){const i=new v.n;i.name=e,t.collections.push(i)}t.collectionRelationships.push([t.ciphers.length,n])})):!this.organization&&null!=n&&n.length>0&&this.processFolder(t,n[0]);const s=this.initLoginCipher();s.notes=this.getValueOrDefault(e.Notes,""),s.notes+="\n\n"+this.getValueOrDefault(e["Shared Notes"],"")+"\n",s.name=this.getValueOrDefault(e["Entry Name"],"--"),s.login.username=this.getValueOrDefault(e["User ID"]),s.login.password=this.getValueOrDefault(e.Password),s.login.uris=this.makeUriArray(e.URL),null!=e.__parsed_extra&&e.__parsed_extra.length>0&&e.__parsed_extra.forEach((e=>{this.isNullOrWhitespace(e)||(s.notes+="\n"+e)}));const o=this.isNullOrWhitespace(e["Extra Fields"])?null:JSON.parse(e["Extra Fields"]),r=null!=o&&null!=o.extraFields&&o.extraFields.length>0?o.extraFields.map((e=>{try{return JSON.parse(e)}catch(t){}return null})):null;null!=r&&r.forEach((e=>{null!=e&&this.processKvp(s,e.name,e.data)})),this.cleanupCipher(s),t.ciphers.push(s)})),t.success=!0,Promise.resolve(t))}}class Ge extends T{parse(e){const t=new w,i=this.parseCsv(e,!1);if(null==i)return t.success=!1,Promise.resolve(t);let n=!0;return i.forEach((e=>{if(5!==e.length&&e.length<9)return;const i=10===e.length&&"0"===e[0],s=this.initLoginCipher();if(s.name=this.getValueOrDefault(e[i?1:0],"--"),s.login.username=this.getValueOrDefault(e[i?2:1]),s.login.password=this.getValueOrDefault(e[i?3:2]),5===e.length)n=!1,s.notes=this.getValueOrDefault(e[4]),s.login.uris=this.makeUriArray(e[3]);else{const n=this.getValueOrDefault(e[i?9:8],"(None)");let o="(None)"!==n?n.split("\\").join("/"):null;null!=o&&(o=n.split(" > ").join("/"),o=n.split(">").join("/")),this.processFolder(t,o),s.notes=this.getValueOrDefault(e[i?5:3]),s.login.uris=this.makeUriArray(e[4])}this.convertToNoteIfNeeded(s),this.cleanupCipher(s),t.ciphers.push(s)})),n&&this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}}class je extends T{parse(e){const t=new w,i=JSON.parse(e);if(null==i||null==i.items)return t.success=!1,Promise.resolve(t);const n=new Map;i.folders.forEach((e=>{n.set(e.id,e.name)}));const s=new Map;return n.forEach(((e,i)=>{s.set(i,t.folders.length);const n=new y.a;n.name=e,t.folders.push(n)})),i.items.forEach((e=>{const i=this.initLoginCipher();if(i.name=this.getValueOrDefault(e.name,"--"),i.login.uris=this.makeUriArray(e.login_url),null!=e.folder&&s.has(e.folder)&&t.folderRelationships.push([t.ciphers.length,s.get(e.folder)]),null!=e.identifiers){this.isNullOrWhitespace(e.identifiers.notes)||(i.notes=e.identifiers.notes.split("\\r\\n").join("\n").split("\\n").join("\n")),"CreditCard"===e.type&&(i.card=new k._,i.type=p.Ou.Card);for(const t in e.identifiers){if(!e.identifiers.hasOwnProperty(t))continue;const s=e.identifiers[t],o=null!=s?s.toString():null;if(!this.isNullOrWhitespace(o)&&"notes"!==t&&"ignoreItemInSecurityScore"!==t)if("custom_fields"!==t){if(i.type===p.Ou.Card){if("cardNumber"===t){i.card.number=o,i.card.brand=k._.getCardBrandByPatterns(i.card.number);continue}if("nameOnCard"===t){i.card.cardholderName=o;continue}if("security_code"===t){i.card.code=o;continue}if("expires"===t){try{const e=new Date(o);i.card.expYear=e.getFullYear().toString(),i.card.expMonth=(e.getMonth()+1).toString()}catch(n){}continue}if("cardType"===t)continue}else{if(("username"===t||"email"===t)&&this.isNullOrWhitespace(i.login.username)){i.login.username=o;continue}if("password"===t){i.login.password=o;continue}if("totp"===t){i.login.totp=o;continue}if((null==i.login.uris||0===i.login.uris.length)&&this.uriFieldNames.indexOf(t)>-1){i.login.uris=this.makeUriArray(o);continue}}this.processKvp(i,t,o)}else s.forEach((e=>{this.processKvp(i,e.name,e.value)}))}this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}})),t.success=!0,Promise.resolve(t)}}class Ve extends T{parse(e){const t=new w,i=this.parseXml(e);if(null==i)return t.success=!1,Promise.resolve(t);const n=i.querySelectorAll("PasswordManager > record");return Array.from(n).forEach((e=>{const i=this.querySelectorDirectChild(e,"Category"),n=null==i||this.isNullOrWhitespace(i.textContent)||"Unfiled"===i.textContent?null:i.textContent;this.processFolder(t,n);const s=this.querySelectorDirectChild(e,"Account-Name"),o=this.querySelectorDirectChild(e,"User-Id"),r=this.querySelectorDirectChild(e,"Password"),a=this.querySelectorDirectChild(e,"URL"),l=this.querySelectorDirectChild(e,"Notes"),c=this.initLoginCipher();c.name=null!=s?this.getValueOrDefault(s.textContent,"--"):"--",c.notes=null!=l?this.getValueOrDefault(l.textContent):"",c.login.username=null!=o?this.getValueOrDefault(o.textContent):null,c.login.password=null!=r?this.getValueOrDefault(r.textContent):null,c.login.uris=null!=a?this.makeUriArray(a.textContent):null;const u=[];for(let t=1;t<=10;t++)u.push("Attribute-"+t);this.querySelectorAllDirectChild(e,u.join(",")).forEach((e=>{this.isNullOrWhitespace(e.textContent)||"null"===e.textContent||this.processKvp(c,e.tagName,e.textContent)})),this.cleanupCipher(c),t.ciphers.push(c)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}}class $e extends T{parse(e){const t=new w,i=this.parseXml(e);if(null==i)return t.success=!1,Promise.resolve(t);const n=i.querySelector("passwordsafe");if(null==n)return t.errorMessage="Missing `passwordsafe` node.",t.success=!1,Promise.resolve(t);const s=n.getAttribute("delimiter"),o=i.querySelectorAll("passwordsafe > entry");return Array.from(o).forEach((e=>{const i=this.querySelectorDirectChild(e,"group"),n=null==i||this.isNullOrWhitespace(i.textContent)?null:i.textContent.split(".").join("/");this.processFolder(t,n);const o=this.querySelectorDirectChild(e,"title"),r=this.querySelectorDirectChild(e,"username"),a=this.querySelectorDirectChild(e,"email"),l=this.querySelectorDirectChild(e,"password"),c=this.querySelectorDirectChild(e,"url"),u=this.querySelectorDirectChild(e,"notes"),d=this.initLoginCipher();d.name=null!=o?this.getValueOrDefault(o.textContent,"--"):"--",d.notes=null!=u?this.getValueOrDefault(u.textContent,"").split(s).join("\n"):null,d.login.username=null!=r?this.getValueOrDefault(r.textContent):null,d.login.password=null!=l?this.getValueOrDefault(l.textContent):null,d.login.uris=null!=c?this.makeUriArray(c.textContent):null,this.isNullOrWhitespace(d.login.username)&&null!=a?d.login.username=this.getValueOrDefault(a.textContent):null==a||this.isNullOrWhitespace(a.textContent)||(d.notes=this.isNullOrWhitespace(d.notes)?"Email: "+a.textContent:d.notes+"\nEmail: "+a.textContent),this.cleanupCipher(d),t.ciphers.push(d)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}}class He extends T{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if(e.length<1)return;e.length>5&&this.processFolder(t,e[5]);const i=this.initLoginCipher();i.name=this.getValueOrDefault(e[0],"--"),e.length>4&&(i.notes=this.getValueOrDefault(e[4],"").split("¬").join("\n")),e.length>2&&(i.login.username=this.getValueOrDefault(e[2])),e.length>3&&(i.login.password=this.getValueOrDefault(e[3])),e.length>1&&(i.login.uris=this.makeUriArray(e[1])),this.cleanupCipher(i),t.ciphers.push(i)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}var We;!function(e){e[e.ACTIVE=1]="ACTIVE",e[e.TRASHED=2]="TRASHED"}(We||(We={}));class Xe extends T{constructor(e){super(),this.i18nService=e}parse(e){const t=new w,i=JSON.parse(e);if(null==i||null==i.vaults)return t.success=!1,Promise.resolve(t);if(i.encrypted)return t.success=!1,t.errorMessage=this.i18nService.t("unsupportedEncryptedImport"),Promise.resolve(t);for(const[,n]of Object.entries(i.vaults))for(const e of n.items){if(e.state==We.TRASHED)continue;this.processFolder(t,n.name);const i=this.initLoginCipher();switch(i.name=this.getValueOrDefault(e.data.metadata.name,"--"),i.notes=this.getValueOrDefault(e.data.metadata.note),e.data.type){case"login":{const t=e.data.content;i.login.uris=this.makeUriArray(t.urls),i.login.username=this.getValueOrDefault(t.username),i.login.password=this.getValueOrDefault(t.password),i.login.totp=this.getValueOrDefault(t.totpUri);for(const n of e.data.extraFields)this.processKvp(i,n.fieldName,"totp"==n.type?n.data.totpUri:n.data.content,"text"==n.type?p.fS.Text:p.fS.Hidden);break}case"note":i.type=p.Ou.SecureNote,i.secureNote=new S.z,i.secureNote.type=p.xs.Generic;break;case"creditCard":{const t=e.data.content;i.type=p.Ou.Card,i.card=new k._,i.card.cardholderName=this.getValueOrDefault(t.cardholderName),i.card.number=this.getValueOrDefault(t.number),i.card.brand=k._.getCardBrandByPatterns(t.number),i.card.code=this.getValueOrDefault(t.verificationNumber),this.isNullOrWhitespace(t.expirationDate)||(i.card.expMonth=t.expirationDate.substring(0,2),i.card.expMonth=i.card.expMonth.replace(/^0+/,""),i.card.expYear=t.expirationDate.substring(2,6)),this.isNullOrWhitespace(t.pin)||this.processKvp(i,"PIN",t.pin,p.fS.Hidden);break}}this.cleanupCipher(i),t.ciphers.push(i)}return this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}}class et extends T{constructor(){super(...arguments),this.WEBSITE_mappedValues=new Set(["type","name","website_password_title","website_password_notes","website_password_username","website_password_password","website_password_url","autosubmit","website_password_auto_submit","urlfilter","website_password_url_filter"]),this.APP_PWD_mappedValues=new Set(["type","name","application_password_title","application_password_notes","application_password_username","application_password_password"]),this.BOOKMARK_mappedValues=new Set(["type","name","bookmark_title","bookmark_notes","bookmark_url"]),this.NOTES_mappedValues=new Set(["type","name","note_title","note_notes"]),this.TOTP_mappedValues=new Set(["type","name","totp_title","totp_notes","totp_code"]),this.ENV_VARIABLES_mappedValues=new Set(["type","name","environment_variables_title","environment_variables_notes","environment_variables_variables"]),this.GPG_mappedValues=new Set(["type","name","mail_gpg_own_key_title","mail_gpg_own_key_public","mail_gpg_own_key_name","mail_gpg_own_key_email","mail_gpg_own_key_private"])}parse(e){const t=new w,i=JSON.parse(e);return null==i?(t.success=!1,Promise.resolve(t)):(this.parseFolders(t,i.folders),this.handleItemParsing(t,i.items),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}parseFolders(e,t,i){null!=t&&0!==t.length&&t.forEach((t=>{const n=null!=t.items&&t.items.length>0,s=null!=t.folders&&t.folders.length>0;(n||s)&&(d.c.isNullOrWhitespace(i)||(t.name=i+"/"+t.name),s&&this.parseFolders(e,t.folders,t.name),n?this.handleItemParsing(e,t.items,t.name):this.processFolder(e,t.name,n))}))}handleItemParsing(e,t,i){null!=t&&0!==t.length&&t.forEach((t=>{const n=this.parsePsonoItem(t);this.processFolder(e,i,!0),this.cleanupCipher(n),e.ciphers.push(n)}))}parsePsonoItem(e){const t=this.initLoginCipher();switch(e.type){case"website_password":this.parseWebsiteLogins(e,t);break;case"application_password":this.parseApplicationPasswords(e,t);break;case"environment_variables":this.parseEnvironmentVariables(e,t);break;case"totp":this.parseTOTP(e,t);break;case"bookmark":this.parseBookmarks(e,t);break;case"note":this.parseNotes(e,t)}return t}parseWebsiteLogins(e,t){var i;null!=e&&"website_password"==e.type&&(t.name=e.website_password_title,t.notes=e.website_password_notes,t.login.username=e.website_password_username,t.login.password=e.website_password_password,t.login.uris=this.makeUriArray(e.website_password_url),this.processKvp(t,"website_password_auto_submit",null===(i=e.website_password_auto_submit)||void 0===i?void 0:i.toString(),p.fS.Boolean),this.processKvp(t,"website_password_url_filter",e.website_password_url_filter),this.importUnmappedFields(t,e,this.WEBSITE_mappedValues))}parseApplicationPasswords(e,t){null!=e&&"application_password"==e.type&&(t.name=e.application_password_title,t.notes=e.application_password_notes,t.login.username=e.application_password_username,t.login.password=e.application_password_password,this.importUnmappedFields(t,e,this.APP_PWD_mappedValues))}parseBookmarks(e,t){null!=e&&"bookmark"==e.type&&(t.name=e.bookmark_title,t.notes=e.bookmark_notes,t.login.uris=this.makeUriArray(e.bookmark_url),this.importUnmappedFields(t,e,this.BOOKMARK_mappedValues))}parseNotes(e,t){null!=e&&"note"==e.type&&(t.type=p.Ou.SecureNote,t.secureNote=new S.z,t.secureNote.type=p.xs.Generic,t.name=e.note_title,t.notes=e.note_notes,this.importUnmappedFields(t,e,this.NOTES_mappedValues))}parseTOTP(e,t){null!=e&&"totp"==e.type&&(t.name=e.totp_title,t.notes=e.totp_notes,t.login.totp=e.totp_code,this.importUnmappedFields(t,e,this.TOTP_mappedValues))}parseEnvironmentVariables(e,t){null!=e&&"environment_variables"==e.type&&(t.type=p.Ou.SecureNote,t.secureNote=new S.z,t.secureNote.type=p.xs.Generic,t.name=e.environment_variables_title,t.notes=e.environment_variables_notes,e.environment_variables_variables.forEach((e=>{this.processKvp(t,e.key,e.value)})),this.importUnmappedFields(t,e,this.ENV_VARIABLES_mappedValues))}parseGPG(e,t){null!=e&&"mail_gpg_own_key"==e.type&&(t.type=p.Ou.SecureNote,t.secureNote=new S.z,t.secureNote.type=p.xs.Generic,t.name=e.mail_gpg_own_key_title,t.notes=e.mail_gpg_own_key_public,this.processKvp(t,"mail_gpg_own_key_name",e.mail_gpg_own_key_name),this.processKvp(t,"mail_gpg_own_key_email",e.mail_gpg_own_key_email),this.processKvp(t,"mail_gpg_own_key_private",e.mail_gpg_own_key_private,p.fS.Hidden),this.importUnmappedFields(t,e,this.GPG_mappedValues))}importUnmappedFields(e,t,i){Object.keys(t).filter((e=>!i.has(e))).forEach((i=>{const n=t;this.processKvp(e,i,n[i].toString())}))}}class tt extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if("true"===e.trash)return;const i=this.initLoginCipher();if(i.name=this.getValueOrDefault(e.name),i.notes=this.getValueOrDefault(e.notes),"LoginItem"===e.type)i.login.uris=this.makeUriArray(e.website),i.login.password=this.getValueOrDefault(e.password),i.login.username=this.getValueOrDefault(e.username);else if("CreditCardItem"===e.type){i.type=p.Ou.Card,i.card=new k._,i.card.cardholderName=this.getValueOrDefault(e.cardholder),i.card.number=this.getValueOrDefault(e.number),i.card.brand=k._.getCardBrandByPatterns(i.card.number),i.card.code=this.getValueOrDefault(e.verification);try{const t=this.getValueOrDefault(e.expiryMonth);if(null!=t){const e=parseInt(t,null);null!=e&&e>=1&&e<=12&&(i.card.expMonth=e.toString())}}catch(n){}try{const t=this.getValueOrDefault(e.expiryYear);if(null!=t){const e=parseInt(t,null);null!=e&&(i.card.expYear=e.toString())}}catch(s){}const t=this.getValueOrDefault(e.pin);null!=t&&this.processKvp(i,"PIN",t);const o=this.getValueOrDefault(e.zipCode);null!=o&&this.processKvp(i,"Zip Code",o)}this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class it extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);if(null==i)return t.success=!1,Promise.resolve(t);let n=1;return i.forEach((e=>{const s=!this.isNullOrWhitespace(e.Folder)&&e.Folder.startsWith("/")?e.Folder.replace("/",""):e.Folder,o=this.isNullOrWhitespace(s)?null:s;this.processFolder(t,o);const r=this.initLoginCipher();if(r.notes=this.getValueOrDefault(e.Note),r.name=this.getValueOrDefault(e.Name,"--"),r.login.username=this.getValueOrDefault(e.Login),r.login.password=this.getValueOrDefault(e.Pwd),r.login.uris=this.makeUriArray(e.Url),!this.isNullOrWhitespace(e.Rf_fields)){let t=[e.Rf_fields];null!=e.__parsed_extra&&e.__parsed_extra.length>0&&(t=t.concat(e.__parsed_extra)),t.forEach((e=>{const t=e.split(":");if(t.length<3)return;const i="-no-name-"===t[0]?null:t[0],n=4===t.length&&"rck"===t[2]?t[1]:t[2];this.processKvp(r,i,n)}))}this.convertToNoteIfNeeded(r),this.cleanupCipher(r),n===i.length&&"--"===r.name&&this.isNullOrWhitespace(r.login.password)||(t.ciphers.push(r),n++)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}}class nt extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{var i;const n=this.initLoginCipher();n.name=this.getValueOrDefault(e.Title,"--"),n.login.username=this.getValueOrDefault(e.Username),n.login.password=this.getValueOrDefault(e.Password),n.login.uris=this.makeUriArray(null!==(i=e.Url)&&void 0!==i?i:e.URL),n.login.totp=this.getValueOrDefault(e.OTPAuth),n.notes=this.getValueOrDefault(e.Notes),this.cleanupCipher(n),t.ciphers.push(n)})),t.success=!0,Promise.resolve(t))}}class st extends T{parse(e){const t=new w,i=this.parseXml(e);if(null==i)return t.success=!1,Promise.resolve(t);if(null==i.querySelector("database"))return t.errorMessage="Missing `database` node.",t.success=!1,Promise.resolve(t);const n=new Map;return Array.from(i.querySelectorAll("database > label")).forEach((e=>{const i=e.getAttribute("name"),s=e.getAttribute("id");if(!this.isNullOrWhitespace(i)&&!this.isNullOrWhitespace(s)){n.set(s,t.folders.length);const e=new y.a;e.name=i,t.folders.push(e)}})),Array.from(i.querySelectorAll("database > card")).forEach((e=>{if("true"===e.getAttribute("template")||"true"===e.getAttribute("deleted"))return;const i=this.querySelectorDirectChild(e,"label_id");if(null!=i){const e=i.textContent;!this.isNullOrWhitespace(e)&&n.has(e)&&t.folderRelationships.push([t.ciphers.length,n.get(e)])}const s=this.initLoginCipher();s.name=this.getValueOrDefault(e.getAttribute("title"),"--"),"true"===e.getAttribute("star")&&(s.favorite=!0);"note"===e.getAttribute("type")?(s.type=p.Ou.SecureNote,s.secureNote=new S.z,s.secureNote.type=p.xs.Generic):Array.from(this.querySelectorAllDirectChild(e,"field")).forEach((e=>{const t=e.textContent;if(this.isNullOrWhitespace(t))return;const i=e.getAttribute("name"),n=this.getValueOrDefault(e.getAttribute("type"),"").toLowerCase();"login"===n?s.login.username=t:"password"===n||"secret"===n?this.processKvp(s,i,t,p.fS.Hidden):"one_time_password"===n?s.login.totp=t:"notes"===n?s.notes+=t+"\n":"weblogin"===n||"website"===n?s.login.uris.push(...this.makeUriArray(t)):this.processKvp(s,i,t)})),Array.from(this.querySelectorAllDirectChild(e,"notes")).forEach((e=>{s.notes+=e.textContent+"\n"})),this.setPassword(s),this.cleanupCipher(s),t.ciphers.push(s)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}setPassword(e){const t=e.fields.filter((e=>e.type===p.fS.Hidden));if(!t.length)return;let i;for(const n of t)if(this.passwordFieldNames.includes(n.name.toLowerCase())){i=n,e.fields=e.fields.filter((e=>e!==i));break}i||(i=t[0]),e.login.password=i.value}}class ot extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(this.nameFromUrl(e.url),"--"),i.notes=this.getValueOrDefault(e.notes),i.login.username=this.getValueOrDefault(e.username),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(e.url),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class rt extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);if(null==i)return t.success=!1,Promise.resolve(t);const n=Object.keys(i[0]).find((e=>/url/i.test(e)));return i.forEach((e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.Title),i.notes=this.getValueOrDefault(e.Comment),i.login.uris=this.makeUriArray(e[n]),i.login.password=this.getValueOrDefault(e.Password),i.login.username=this.getValueOrDefault(e.Username),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t)}}class at extends T{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if(e.length<3)return;this.processFolder(t,this.getValueOrDefault(e[e.length-1]));const i=this.initLoginCipher();i.notes=this.getValueOrDefault(e[e.length-2],""),i.name=this.getValueOrDefault(e[1],"--"),"Web Logins"===e[0]||"Servers"===e[0]||"Email Accounts"===e[0]?(i.login.username=this.getValueOrDefault(e[2]),i.login.password=this.getValueOrDefault(e[3]),i.login.uris=this.makeUriArray(e[4]),this.parseFieldsToNotes(i,5,e)):this.parseFieldsToNotes(i,2,e),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}parseFieldsToNotes(e,t,i){for(let n=t;n<i.length-3;n++)this.isNullOrWhitespace(i[n])||(e.notes+=i[n]+"\n")}}class lt extends T{parse(e){const t=new w,i=this.parseXml(e);if(null==i)return t.success=!1,Promise.resolve(t);const n=i.querySelectorAll("root > Database > Logins > Login");return Array.from(n).forEach((e=>{const n=e.getAttribute("ID");if(this.isNullOrWhitespace(n))return;const s=e.getAttribute("Name"),o=e.getAttribute("Password");let r=null,a=null,l=null,c=null,u=null;const d=i.querySelector('root > Database > Accounts > Account > LoginLinks > Login[SourceLoginID="'+n+'"]');if(null!=d){const e=d.parentElement.parentElement;null!=e&&(r=e.getAttribute("Name"),a=e.getAttribute("Link"),c=e.getAttribute("ParentID"),l=e.getAttribute("Comments"),this.isNullOrWhitespace(l)||(l=l.split("/n").join("\n")))}this.isNullOrWhitespace(c)||(u=this.buildGroupText(i,c,""),this.processFolder(t,u));const p=this.initLoginCipher();p.name=this.getValueOrDefault(r,"--"),p.notes=this.getValueOrDefault(l),p.login.username=this.getValueOrDefault(s),p.login.password=this.getValueOrDefault(o),p.login.uris=this.makeUriArray(a),this.cleanupCipher(p),t.ciphers.push(p)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}buildGroupText(e,t,i){const n=e.querySelector('root > Database > Groups > Group[ID="'+t+'"]');return null==n?i:(this.isNullOrWhitespace(i)||(i="/"+i),i=n.getAttribute("Name")+i,this.buildGroupText(e,n.getAttribute("ParentID"),i))}}const ct=["kind","autologin","favorite","hexcolor","protectedwithpassword","subdomainonly","type","tk_export_version","note","title","document_content"];class ut extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{const i=this.initLoginCipher();if(i.favorite="true"===this.getValueOrDefault(e.favorite,"").toLowerCase(),i.name=this.getValueOrDefault(e.name,"--"),i.notes=this.getValueOrDefault(e.memo,""),i.login.username=this.getValueOrDefault(e.login),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(e.url),"login"!==e.kind&&(i.name=this.getValueOrDefault(e.title,"--"),i.notes=this.getValueOrDefault(e.note,"")),"cc"===e.kind){if(i.type=p.Ou.Card,i.card=new k._,i.card.cardholderName=this.getValueOrDefault(e.cardholder),i.card.number=this.getValueOrDefault(e.number),i.card.brand=k._.getCardBrandByPatterns(i.card.number),!this.isNullOrWhitespace(e.expiryDate))try{const t=new Date(e.expiryDate);i.card.expYear=t.getFullYear().toString(),i.card.expMonth=(t.getMonth()+1).toString()}catch(n){}}else if("login"!==e.kind){i.type=p.Ou.SecureNote,i.secureNote=new S.z,i.secureNote.type=p.xs.Generic,this.isNullOrWhitespace(i.notes)||(i.notes=this.getValueOrDefault(e.document_content,""));for(const t in e)e.hasOwnProperty(t)&&ct.indexOf(t.toLowerCase())<0&&!this.isNullOrWhitespace(e[t])&&this.processKvp(i,t,e[t])}this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class dt extends T{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if(5!==e.length)return;const i=this.initLoginCipher();i.name=this.getValueOrDefault(e[0],"--"),i.notes=this.getValueOrDefault(e[4]),i.login.username=this.getValueOrDefault(e[1]),i.login.password=this.getValueOrDefault(e[2]),i.login.uris=this.makeUriArray(e[3]),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class pt extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.Name,"--"),i.login.username=this.getValueOrDefault(e["User name"]),i.login.password=this.getValueOrDefault(e.Password),i.login.uris=this.makeUriArray(e.URL),this.cleanupCipher(i),t.ciphers.push(i)})),t.success=!0,Promise.resolve(t))}}class ht extends T{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach((e=>{if(this.isNullOrWhitespace(e["Password Name"])&&this.isNullOrWhitespace(e["Secret Name"]))return;this.processFolder(t,this.getValueOrDefault(e.ChamberName));const i=this.initLoginCipher();i.favorite="1"===this.getValueOrDefault(e.Favorite,"0"),i.notes=this.getValueOrDefault(e.Notes),i.name=this.getValueOrDefault(e["Password Name"],this.getValueOrDefault(e["Secret Name"],"--")),i.login.uris=this.makeUriArray(this.getValueOrDefault(e["Password URL"],this.getValueOrDefault(e["Secret URL"]))),this.parseData(i,e.SecretData),this.parseData(i,e.CustomData),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)})),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}parseData(e,t){if(this.isNullOrWhitespace(t))return;this.splitNewLine(t).forEach((t=>{const i=t.indexOf(":");if(i<0)return;const n=t.substring(0,i),s=t.length>i?t.substring(i+1):null;if(this.isNullOrWhitespace(n)||this.isNullOrWhitespace(s)||"SecretType"===n)return;const o=n.toLowerCase();null==e.login.username&&this.usernameFieldNames.indexOf(o)>-1?e.login.username=s:null==e.login.password&&this.passwordFieldNames.indexOf(o)>-1?e.login.password=s:this.processKvp(e,n,s)}))}}const gt=[{id:"bitwardenjson",name:"Bitwarden (json)"},{id:"bitwardencsv",name:"Bitwarden (csv)"},{id:"chromecsv",name:"Chrome (csv)"},{id:"dashlanecsv",name:"Dashlane (csv)"},{id:"firefoxcsv",name:"Firefox (csv)"},{id:"keepass2xml",name:"KeePass 2 (xml)"},{id:"lastpasscsv",name:"LastPass"},{id:"safaricsv",name:"Safari and macOS (csv)"},{id:"1password1pux",name:"1Password (1pux/json)"}],ft=[{id:"keepassxcsv",name:"KeePassX (csv)"},{id:"1password1pif",name:"1Password (1pif)"},{id:"1passwordwincsv",name:"1Password 6 and 7 Windows (csv)"},{id:"1passwordmaccsv",name:"1Password 6 and 7 Mac (csv)"},{id:"dashlanejson",name:"Dashlane (json)"},{id:"roboformcsv",name:"RoboForm (csv)"},{id:"keepercsv",name:"Keeper (csv)"},{id:"enpasscsv",name:"Enpass (csv)"},{id:"enpassjson",name:"Enpass (json)"},{id:"protonpass",name:"ProtonPass (zip/json)"},{id:"safeincloudxml",name:"SafeInCloud (xml)"},{id:"pwsafexml",name:"Password Safe - pwsafe.org (xml)"},{id:"stickypasswordxml",name:"Sticky Password (xml)"},{id:"msecurecsv",name:"mSecure (csv)"},{id:"truekeycsv",name:"True Key (csv)"},{id:"passwordbossjson",name:"Password Boss (json)"},{id:"zohovaultcsv",name:"Zoho Vault (csv)"},{id:"splashidcsv",name:"SplashID (csv)"},{id:"passworddragonxml",name:"Password Dragon (xml)"},{id:"padlockcsv",name:"Padlock (csv)"},{id:"passboltcsv",name:"Passbolt (csv)"},{id:"clipperzhtml",name:"Clipperz (html)"},{id:"aviracsv",name:"Avira (csv)"},{id:"saferpasscsv",name:"SaferPass (csv)"},{id:"upmcsv",name:"Universal Password Manager (csv)"},{id:"ascendocsv",name:"Ascendo DataVault (csv)"},{id:"meldiumcsv",name:"Meldium (csv)"},{id:"passkeepcsv",name:"PassKeep (csv)"},{id:"operacsv",name:"Opera (csv)"},{id:"vivaldicsv",name:"Vivaldi (csv)"},{id:"gnomejson",name:"GNOME Passwords and Keys/Seahorse (json)"},{id:"blurcsv",name:"Blur (csv)"},{id:"passwordagentcsv",name:"Password Agent (csv)"},{id:"passpackcsv",name:"Passpack (csv)"},{id:"passmanjson",name:"Passman (json)"},{id:"avastcsv",name:"Avast Passwords (csv)"},{id:"avastjson",name:"Avast Passwords (json)"},{id:"fsecurefsk",name:"F-Secure KEY (fsk)"},{id:"kasperskytxt",name:"Kaspersky Password Manager (txt)"},{id:"remembearcsv",name:"RememBear (csv)"},{id:"passwordwallettxt",name:"PasswordWallet (txt)"},{id:"mykicsv",name:"Myki (csv)"},{id:"securesafecsv",name:"SecureSafe (csv)"},{id:"logmeoncecsv",name:"LogMeOnce (csv)"},{id:"blackberrycsv",name:"BlackBerry Password Keeper (csv)"},{id:"buttercupcsv",name:"Buttercup (csv)"},{id:"codebookcsv",name:"Codebook (csv)"},{id:"encryptrcsv",name:"Encryptr (csv)"},{id:"yoticsv",name:"Yoti (csv)"},{id:"nordpasscsv",name:"Nordpass (csv)"},{id:"psonojson",name:"Psono (json)"},{id:"passkyjson",name:"Passky (json)"}];var mt=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class vt{constructor(e,t,i,n,s,o){this.cipherService=e,this.folderService=t,this.importApiService=i,this.i18nService=n,this.collectionService=s,this.cryptoService=o,this.featuredImportOptions=gt,this.regularImportOptions=ft}getImportOptions(){return this.featuredImportOptions.concat(this.regularImportOptions)}import(e,t,i=null,n=null,s){return mt(this,void 0,void 0,(function*(){let o;try{o=yield e.parse(t)}catch(r){if(r instanceof SyntaxError)throw new Error(this.i18nService.t("importFormatError"));throw r}if(!o.success){if(!d.c.isNullOrWhitespace(o.errorMessage))throw new Error(o.errorMessage);throw new Error(this.i18nService.t("importFormatError"))}if(0===o.folders.length&&0===o.ciphers.length)throw new Error(this.i18nService.t("importNothingError"));if(o.ciphers.length>0){const e=Math.floor(o.ciphers.length/2),t=o.ciphers.length-1;if(this.badData(o.ciphers[0])&&this.badData(o.ciphers[e])&&this.badData(o.ciphers[t]))throw new Error(this.i18nService.t("importFormatError"))}if(i&&!n&&!s){if(o.collectionRelationships.length<o.ciphers.length)throw new Error(this.i18nService.t("importUnassignedItemsError"))}try{yield this.setImportTarget(o,i,n),null!=i?yield this.handleOrganizationalImport(o,i):yield this.handleIndividualImport(o)}catch(r){const e=new u.i(r,400);throw this.handleServerError(e,o)}return o}))}getImporter(e,t,i=null){if(null==t)return null;const n=this.getImporterInstance(e,t);return null==n?null:(n.organizationId=i,n)}getImporterInstance(e,t){if(null==e)return null;switch(e){case"bitwardencsv":return new L;case"bitwardenjson":case"bitwardenpasswordprotected":return new K(this.cryptoService,this.i18nService,this.cipherService,t);case"lastpasscsv":case"passboltcsv":return new we;case"keepassxcsv":return new ve;case"aviracsv":return new q;case"blurcsv":return new B;case"safeincloudxml":return new st;case"padlockcsv":return new ze;case"keepass2xml":return new me;case"chromecsv":case"operacsv":case"vivaldicsv":return new M;case"firefoxcsv":return new ae;case"upmcsv":return new dt;case"saferpasscsv":return new ot;case"safaricsv":return new nt;case"meldiumcsv":return new Ue;case"1password1pif":return new Ne;case"1password1pux":return new Le;case"1passwordwincsv":return new Je;case"1passwordmaccsv":return new Re;case"keepercsv":return new ye;case"passworddragonxml":return new Ve;case"enpasscsv":return new se;case"enpassjson":return new re;case"pwsafexml":return new $e;case"dashlanecsv":return new ee;case"dashlanejson":return new ie;case"msecurecsv":return new _e;case"stickypasswordxml":return new lt;case"truekeycsv":return new ut;case"clipperzhtml":return new j;case"roboformcsv":return new it;case"ascendocsv":return new C;case"passwordbossjson":return new je;case"zohovaultcsv":return new ht;case"splashidcsv":return new at;case"passkeepcsv":return new Ye;case"gnomejson":return new ue;case"passwordagentcsv":return new Ge;case"passpackcsv":return new Qe;case"passmanjson":return new Be;case"avastcsv":return new O;case"avastjson":return new P;case"fsecurefsk":return new ce;case"kasperskytxt":return new fe;case"remembearcsv":return new tt;case"passwordwallettxt":return new He;case"mykicsv":return new ke;case"securesafecsv":return new rt;case"logmeoncecsv":return new be;case"blackberrycsv":return new I;case"buttercupcsv":return new G;case"codebookcsv":return new V;case"encryptrcsv":return new ne;case"yoticsv":return new pt;case"nordpasscsv":return new Pe;case"psonojson":return new et;case"passkyjson":return new Ke;case"protonpass":return new Xe(this.i18nService);default:return null}}handleIndividualImport(e){return mt(this,void 0,void 0,(function*(){const t=new a;for(let i=0;i<e.ciphers.length;i++){const n=yield this.cipherService.encrypt(e.ciphers[i]);t.ciphers.push(new h.a(n))}if(null!=e.folders)for(let i=0;i<e.folders.length;i++){const n=yield this.folderService.encrypt(e.folders[i]);t.folders.push(new m.C(n))}return null!=e.folderRelationships&&e.folderRelationships.forEach((e=>t.folderRelationships.push(new c(e[0],e[1])))),yield this.importApiService.postImportCiphers(t)}))}handleOrganizationalImport(e,t){return mt(this,void 0,void 0,(function*(){const i=new l;for(let n=0;n<e.ciphers.length;n++){e.ciphers[n].organizationId=t;const s=yield this.cipherService.encrypt(e.ciphers[n]);i.ciphers.push(new h.a(s))}if(null!=e.collections)for(let n=0;n<e.collections.length;n++){e.collections[n].organizationId=t;const s=yield this.collectionService.encrypt(e.collections[n]);i.collections.push(new f(s))}return null!=e.collectionRelationships&&e.collectionRelationships.forEach((e=>i.collectionRelationships.push(new c(e[0],e[1])))),yield this.importApiService.postImportOrganizationCiphers(t,i)}))}badData(e){return(null==e.name||"--"===e.name)&&e.type===p.Ou.Login&&null!=e.login&&d.c.isNullOrWhitespace(e.login.password)}handleServerError(e,t){if(null==e.validationErrors)return new Error(e.message);let i="";return Object.entries(e.validationErrors).forEach((([e,n],s)=>{let o,r;const a=Number(e.match(/[0-9]+/)[0]);switch(e.match(/^\w+/)[0]){case"Ciphers":o=t.ciphers[a],r=p.Ou[o.type];break;case"Folders":o=t.folders[a],r="Folder";break;case"Collections":o=t.collections[a],r="Collection";break;default:return}s>0&&(i+="\n\n"),"Folder"!==r&&"Collection"!==r&&(i+="["+(a+1)+"] "),i+="["+r+'] "'+o.name+'": '+n})),new Error(i)}setImportTarget(e,t,i){return mt(this,void 0,void 0,(function*(){if(!i)return;if(t){if(!(i instanceof v.n))throw new Error(this.i18nService.t("errorAssigningTargetCollection"));const t=[];e.ciphers.forEach(((i,n)=>{Array.isArray(e.collectionRelationships)&&e.collectionRelationships.some((([e])=>e===n))||t.push([n,0])}));const n=[...e.collections];e.collections=[i],n.map((t=>{const n=new v.n;n.name=`${i.name}/${t.name}`,e.collections.push(n)}));const s=[...e.collectionRelationships];return e.collectionRelationships=[...t],void s.map((t=>{e.collectionRelationships.push([t[0],t[1]+1])}))}if(!(i instanceof y.a))throw new Error(this.i18nService.t("errorAssigningTargetFolder"));const n=[];e.ciphers.forEach(((e,t)=>{d.c.isNullOrEmpty(e.folderId)&&(e.folderId=i.id,n.push([t,0]))}));const s=[...e.folders];e.folders=[i],s.map((t=>{const n=`${i.name}/${t.name}`,s=new y.a;s.name=n,e.folders.push(s)}));const o=[...e.folderRelationships];e.folderRelationships=[...n],o.map((t=>{e.folderRelationships.push([t[0],t[1]+1])}))}))}}class yt{}},72407:(e,t,i)=>{"use strict";i.d(t,{Ko:()=>A,Q0:()=>U,P9:()=>b,wz:()=>l,kK:()=>a,qX:()=>n});class n{}var s=i(27646);class o{static getFileName(e=null,t="csv"){const i=new Date;return"bitwarden"+(e?"_"+e:"")+"_export_"+(i.getFullYear()+""+this.padNumber(i.getMonth()+1,2)+this.padNumber(i.getDate(),2)+this.padNumber(i.getHours(),2)+this.padNumber(i.getMinutes(),2)+this.padNumber(i.getSeconds(),2))+"."+t}static padNumber(e,t,i="0"){const n=e.toString();return n.length>=t?n:new Array(t-n.length+1).join(i)+n}}var r=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class a{constructor(e,t){this.individualVaultExportService=e,this.organizationVaultExportService=t}getExport(e="csv",t){return r(this,void 0,void 0,(function*(){if(!s.c.isNullOrWhitespace(t)){if("csv"==e)throw new Error("CSV does not support password protected export");return this.individualVaultExportService.getPasswordProtectedExport(t)}return this.individualVaultExportService.getExport(e)}))}getOrganizationExport(e,t,i,n=!1){return r(this,void 0,void 0,(function*(){if(!s.c.isNullOrWhitespace(i)){if("csv"==t)throw new Error("CSV does not support password protected export");return this.organizationVaultExportService.getPasswordProtectedExport(e,i,n)}return this.organizationVaultExportService.getOrganizationExport(e,t,n)}))}getFileName(e=null,t="csv"){return o.getFileName(e,t)}}class l{}var c=i(59778),u=i(61875),d=i(89474),p=i(61265),h=i(68134),g=i(19572),f=i(54193),m=i(44879),v=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class y{constructor(e,t,i){this.cryptoService=e,this.cryptoFunctionService=t,this.kdfConfigService=i}buildPasswordExport(e,t){return v(this,void 0,void 0,(function*(){const i=yield this.kdfConfigService.getKdfConfig(),n=s.c.fromBufferToB64(yield this.cryptoFunctionService.randomBytes(16)),o=yield this.cryptoService.makePinKey(t,n,i),r=yield this.cryptoService.encrypt(s.c.newGuid(),o),a=yield this.cryptoService.encrypt(e,o),l={encrypted:!0,passwordProtected:!0,salt:n,kdfType:i.kdfType,kdfIterations:i.iterations,encKeyValidation_DO_NOT_EDIT:r.encryptedString,data:a.encryptedString};return i.kdfType===m.G3.Argon2id&&(l.kdfMemory=i.memory,l.kdfParallelism=i.parallelism),JSON.stringify(l,null,"  ")}))}buildCommonCipher(e,t){switch(e.type=null,e.name=t.name,e.notes=t.notes,e.fields=null,e.reprompt=t.reprompt,e.login_uri=null,e.login_username=null,e.login_password=null,e.login_totp=null,t.fields&&t.fields.forEach((t=>{e.fields?e.fields+="\n":e.fields="",e.fields+=(t.name||"")+": "+t.value})),t.type){case d.Ou.Login:e.type="login",e.login_username=t.login.username,e.login_password=t.login.password,e.login_totp=t.login.totp,t.login.uris&&(e.login_uri=[],t.login.uris.forEach((t=>{e.login_uri.push(t.uri)})));break;case d.Ou.SecureNote:e.type="note";break;default:return}return e}}var w=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class b extends y{constructor(e,t,i,n,s,o){super(i,n,o),this.cipherService=e,this.apiService=t,this.collectionService=s}getPasswordProtectedExport(e,t,i){return w(this,void 0,void 0,(function*(){const n=yield this.getOrganizationExport(e,"json",i);return this.buildPasswordExport(n,t)}))}getOrganizationExport(e,t="csv",i){return w(this,void 0,void 0,(function*(){if(s.c.isNullOrWhitespace(e))throw new Error("OrganizationId must be set");return"encrypted_json"===t?i?this.getEncryptedManagedExport(e):this.getOrganizationEncryptedExport(e):i?this.getDecryptedManagedExport(e,t):this.getOrganizationDecryptedExport(e,t)}))}getOrganizationDecryptedExport(e,t){return w(this,void 0,void 0,(function*(){const i=[],n=[],s=[];return s.push(this.apiService.getOrganizationExport(e).then((e=>{const t=[];return null!=e&&(null!=e.collections&&e.collections.length>0&&e.collections.forEach((e=>{const n=new f.F(new h.Z(e));t.push(n.decrypt().then((e=>{i.push(e)})))})),null!=e.ciphers&&e.ciphers.length>0&&e.ciphers.filter((e=>null===e.deletedDate)).forEach((e=>w(this,void 0,void 0,(function*(){const i=new g.t(new p.O(e));t.push(this.cipherService.getKeyForCipherKeyDecryption(i).then((e=>i.decrypt(e))).then((e=>{n.push(e)})))}))))),Promise.all(t)}))),yield Promise.all(s),"csv"===t?this.buildCsvExport(i,n):this.buildJsonExport(i,n)}))}getOrganizationEncryptedExport(e){return w(this,void 0,void 0,(function*(){const t=[],i=[],n=[];return n.push(this.apiService.getCollections(e).then((e=>{null!=e&&null!=e.data&&e.data.length>0&&e.data.forEach((e=>{const i=new f.F(new h.Z(e));t.push(i)}))}))),n.push(this.apiService.getCiphersOrganization(e).then((e=>{null!=e&&null!=e.data&&e.data.length>0&&e.data.filter((e=>null===e.deletedDate)).forEach((e=>{const t=new g.t(new p.O(e));i.push(t)}))}))),yield Promise.all(n),this.BuildEncryptedExport(e,t,i)}))}getDecryptedManagedExport(e,t){return w(this,void 0,void 0,(function*(){let i=[],n=[],s=[];const o=[];return o.push(this.collectionService.getAllDecrypted().then((t=>w(this,void 0,void 0,(function*(){s=t.filter((t=>t.organizationId==e&&t.manage))}))))),o.push(this.cipherService.getAllDecrypted().then((e=>{n=e}))),yield Promise.all(o),i=n.filter((t=>null==t.deletedDate&&t.organizationId==e&&s.some((e=>t.collectionIds.some((t=>e.id===t)))))),"csv"===t?this.buildCsvExport(s,i):this.buildJsonExport(s,i)}))}getEncryptedManagedExport(e){return w(this,void 0,void 0,(function*(){let t=[],i=[],n=[];const s=[];return s.push(this.collectionService.getAll().then((t=>{n=t.filter((t=>t.organizationId==e&&t.manage))}))),s.push(this.cipherService.getAll().then((e=>{i=e}))),yield Promise.all(s),t=i.filter((t=>null==t.deletedDate&&t.organizationId==e&&n.some((e=>t.collectionIds.some((t=>e.id===t)))))),this.BuildEncryptedExport(e,n,t)}))}BuildEncryptedExport(e,t,i){return w(this,void 0,void 0,(function*(){const n=yield this.cryptoService.getOrgKey(e),o={encrypted:!0,encKeyValidation_DO_NOT_EDIT:(yield this.cryptoService.encrypt(s.c.newGuid(),n)).encryptedString,collections:[],items:[]};return t.forEach((e=>{const t=new u.lC;t.build(e),o.collections.push(t)})),i.forEach((e=>{const t=new u.Rm;t.build(e),o.items.push(t)})),JSON.stringify(o,null,"  ")}))}buildCsvExport(e,t){const i=new Map;e.forEach((e=>{i.set(e.id,e)}));const n=[];return t.forEach((e=>{if(e.type!==d.Ou.Login&&e.type!==d.Ou.SecureNote)return;const t={collections:[]};null!=e.collectionIds&&(t.collections=e.collectionIds.filter((e=>i.has(e))).map((e=>i.get(e).name))),this.buildCommonCipher(t,e),n.push(t)})),c.unparse(n)}buildJsonExport(e,t){const i={encrypted:!1,collections:[],items:[]};return e.forEach((e=>{const t=new u.lC;t.build(e),i.collections.push(t)})),t.forEach((e=>{const t=new u.Rm;t.build(e),i.items.push(t)})),JSON.stringify(i,null,"  ")}}class U{}var _=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class A extends y{constructor(e,t,i,n,s){super(i,n,s),this.folderService=e,this.cipherService=t}getExport(e="csv"){return _(this,void 0,void 0,(function*(){return"encrypted_json"===e?this.getEncryptedExport():this.getDecryptedExport(e)}))}getPasswordProtectedExport(e){return _(this,void 0,void 0,(function*(){const t=yield this.getExport("json");return this.buildPasswordExport(t,e)}))}getDecryptedExport(e){return _(this,void 0,void 0,(function*(){let t=[],i=[];const n=[];return n.push(this.folderService.getAllDecryptedFromState().then((e=>{t=e}))),n.push(this.cipherService.getAllDecrypted().then((e=>{i=e.filter((e=>null==e.deletedDate))}))),yield Promise.all(n),"csv"===e?this.buildCsvExport(t,i):this.buildJsonExport(t,i)}))}getEncryptedExport(){return _(this,void 0,void 0,(function*(){let e=[],t=[];const i=[];i.push(this.folderService.getAllFromState().then((t=>{e=t}))),i.push(this.cipherService.getAll().then((e=>{t=e.filter((e=>null==e.deletedDate))}))),yield Promise.all(i);const n={encrypted:!0,encKeyValidation_DO_NOT_EDIT:(yield this.cryptoService.encrypt(s.c.newGuid())).encryptedString,folders:[],items:[]};return e.forEach((e=>{if(null==e.id)return;const t=new u.L5;t.build(e),n.folders.push(t)})),t.forEach((e=>{if(null!=e.organizationId)return;const t=new u.Rm;t.build(e),t.collectionIds=null,n.items.push(t)})),JSON.stringify(n,null,"  ")}))}buildCsvExport(e,t){const i=new Map;e.forEach((e=>{null!=e.id&&i.set(e.id,e)}));const n=[];return t.forEach((e=>{if(e.type!==d.Ou.Login&&e.type!==d.Ou.SecureNote)return;if(null!=e.organizationId)return;const t={};t.folder=null!=e.folderId&&i.has(e.folderId)?i.get(e.folderId).name:null,t.favorite=e.favorite?1:null,this.buildCommonCipher(t,e),n.push(t)})),c.unparse(n)}buildJsonExport(e,t){const i={encrypted:!1,folders:[],items:[]};return e.forEach((e=>{if(null==e.id)return;const t=new u.L5;t.build(e),i.folders.push(t)})),t.forEach((e=>{if(null!=e.organizationId)return;const t=new u.Rm;t.build(e),t.collectionIds=null,i.items.push(t)})),JSON.stringify(i,null,"  ")}}},25406:(e,t,i)=>{"use strict";i.d(t,{C:()=>M});var n=i(70032),s=i(37513),o=i(5344),r=i(2012),a=i(40925),l=i(29445),c=i(49106),u=i(41938),d=i(85762),p=i(76528),h=i(99721),g=i(78627),f=i(28783),m=i(62357),v=i(82933),y=i(46246),w=i(36338),b=i(81974),U=i(29465),_=i(18362),A=i(24637),Z=i(11512),x=i(54666),S=i(1e4),T=i(36179),C=i(21656),O=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class k{constructor(e,t,i,n,o){this.cryptoService=e,this.platformUtilsService=t,this.i18nService=i,this.formBuilder=n,this.dialogRef=o,this.formGroup=this.formBuilder.group({masterPassword:["",{validators:[s.kI.required],updateOn:"submit"}]}),this.submit=()=>O(this,void 0,void 0,(function*(){const e=yield this.cryptoService.getOrDeriveMasterKey(this.formGroup.value.masterPassword);(yield this.cryptoService.compareAndUpdateKeyHash(this.formGroup.value.masterPassword,e))?this.dialogRef.close(!0):this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidMasterPassword"))}))}}k.ɵfac=function(e){return new(e||k)(d.Y36(p.$),d.Y36(h.P),d.Y36(g.D),d.Y36(s.qu),d.Y36(f.zj))},k.ɵcmp=d.Xpm({type:k,selectors:[["vault-password-reprompt"]],standalone:!0,features:[d.jDz],decls:39,vars:17,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["disableMargin","",1,"tw-mt-6"],["bitInput","","appAutofocus","","id","masterPassword","type","password","formControlName","masterPassword"],["type","button","bitSuffix","","bitIconButton","","bitPasswordInputToggle",""],["bitDialogFooter",""],["bitButton","","buttonType","primary","bitFormButton","","type","submit"],["bitButton","","buttonType","secondary","bitDialogClose","","type","button"]],template:function(e,t){1&e&&(d.TgZ(0,"form",0),d._uU(1,"\n  "),d.TgZ(2,"bit-dialog"),d._uU(3,"\n    "),d.TgZ(4,"span",1),d._uU(5),d.ALo(6,"i18n"),d.qZA(),d._uU(7,"\n    "),d.ynx(8,2),d._uU(9),d.ALo(10,"i18n"),d.TgZ(11,"bit-form-field",3),d._uU(12,"\n        "),d.TgZ(13,"bit-label"),d._uU(14),d.ALo(15,"i18n"),d.qZA(),d._uU(16,"\n        "),d._UZ(17,"input",4),d._uU(18,"\n        "),d._UZ(19,"button",5),d._uU(20,"\n      "),d.qZA(),d._uU(21,"\n    "),d.BQk(),d._uU(22,"\n\n    "),d.ynx(23,6),d._uU(24,"\n      "),d.TgZ(25,"button",7),d._uU(26,"\n        "),d.TgZ(27,"span"),d._uU(28),d.ALo(29,"i18n"),d.qZA(),d._uU(30,"\n      "),d.qZA(),d._uU(31,"\n      "),d.TgZ(32,"button",8),d._uU(33),d.ALo(34,"i18n"),d.qZA(),d._uU(35,"\n    "),d.BQk(),d._uU(36,"\n  "),d.qZA(),d._uU(37,"\n"),d.qZA(),d._uU(38,"\n")),2&e&&(d.Q6J("formGroup",t.formGroup)("bitSubmit",t.submit),d.xp6(5),d.hij("\n      ",d.lcZ(6,7,"passwordConfirmation"),"\n    "),d.xp6(4),d.hij("\n      ",d.lcZ(10,9,"passwordConfirmationDesc"),"\n\n      "),d.xp6(5),d.Oqu(d.lcZ(15,11,"masterPass")),d.xp6(14),d.Oqu(d.lcZ(29,13,"ok")),d.xp6(5),d.hij("\n        ",d.lcZ(34,15,"cancel"),"\n      "))},dependencies:[o.b,m.U,v.C,r.G,y.b,w.u,a.h,b.r,l.S,U.a,_.f,c.k,A.d,Z.G,x.w,S.e,T.u,u.v,C.Q,s.UX,s._Y,s.Fj,s.JJ,s.JL,s.sg,s.u],encapsulation:2});var P=i(73369),q=i(42304),I=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class M{constructor(e,t){this.dialogService=e,this.userVerificationService=t}protectedFields(){return["TOTP","Password","H_Field","Card Number","Security Code"]}showPasswordPrompt(){return I(this,void 0,void 0,(function*(){if(!(yield this.enabled()))return!0;const e=this.dialogService.open(k,{ariaModal:!0});return!0===(yield(0,n.n)(e.closed))}))}enabled(){return I(this,void 0,void 0,(function*(){return yield this.userVerificationService.hasMasterPasswordAndMasterKeyHash()}))}}M.ɵfac=function(e){return new(e||M)(d.LFG(P.x),d.LFG(q.i))},M.ɵprov=d.Yz7({token:M,factory:M.ɵfac})},21834:(e,t,i)=>{"use strict";i.r(t)},67234:(e,t,i)=>{"use strict";i.r(t)},62082:()=>{},10731:()=>{},69693:()=>{},83613:()=>{},37275:()=>{},36039:()=>{},12442:()=>{},95942:()=>{},53260:()=>{}},r={};function a(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return o[e].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}a.m=o,a.c=r,e=[],a.O=(t,i,n,s)=>{if(!i){var o=1/0;for(u=0;u<e.length;u++){for(var[i,n,s]=e[u],r=!0,l=0;l<i.length;l++)(!1&s||o>=s)&&Object.keys(a.O).every((e=>a.O[e](i[l])))?i.splice(l--,1):(r=!1,s<o&&(o=s));if(r){e.splice(u--,1);var c=n();void 0!==c&&(t=c)}}return t}s=s||0;for(var u=e.length;u>0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[i,n,s]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},i=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,n){if(1&n&&(e=this(e)),8&n)return e;if("object"==typeof e&&e){if(4&n&&e.__esModule)return e;if(16&n&&"function"==typeof e.then)return e}var s=Object.create(null);a.r(s);var o={};t=t||[null,i({}),i([]),i(i)];for(var r=2&n&&e;"object"==typeof r&&!~t.indexOf(r);r=i(r))Object.getOwnPropertyNames(r).forEach((t=>o[t]=()=>e[t]));return o.default=()=>e,a.d(s,o),s},a.d=(e,t)=>{for(var i in t)a.o(t,i)&&!a.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,i)=>(a.f[i](e,t),t)),[])),a.u=e=>(768===e?"encrypt-worker":e)+"."+{74:"210eee92632f00635b5e",77:"9ea3c9e3fca7d8bab9e7",125:"0791c68011f28c5397e2",229:"0837cabc1f0c63f132c8",367:"3aa2579b622fbbb8602a",395:"eef1cb8a52613ac828e0",409:"6492239d1a4b496ff7a9",446:"aa3cbfc2fd486eed8e6b",554:"a1976937ff8a44f781e7",651:"17b23b646451d8e0299f",768:"0664e516d9a64e6a694f",838:"b4055e25ea0ad876dfdf",968:"af8051ce417955c452d1",979:"e07af87d88679c6e8e25"}[e]+".js",a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},s="@bitwarden/web-vault:",a.l=(e,t,i,o)=>{if(n[e])n[e].push(t);else{var r,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==s+i){r=d;break}}r||(l=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,a.nc&&r.setAttribute("nonce",a.nc),r.setAttribute("data-webpack",s+i),r.src=e),n[e]=[t];var p=(t,i)=>{r.onerror=r.onload=null,clearTimeout(h);var s=n[e];if(delete n[e],r.parentNode&&r.parentNode.removeChild(r),s&&s.forEach((e=>e(i))),t)return t(i)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=p.bind(null,r.onerror),r.onload=p.bind(null,r.onload),l&&document.head.appendChild(r)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");if(i.length)for(var n=i.length-1;n>-1&&!e;)e=i[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e+"../"})(),(()=>{a.b=document.baseURI||self.location.href;var e={148:0};a.f.j=(t,i)=>{var n=a.o(e,t)?e[t]:void 0;if(0!==n)if(n)i.push(n[2]);else{var s=new Promise(((i,s)=>n=e[t]=[i,s]));i.push(n[2]=s);var o=a.p+a.u(t),r=new Error;a.l(o,(i=>{if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var s=i&&("load"===i.type?"missing":i.type),o=i&&i.target&&i.target.src;r.message="Loading chunk "+t+" failed.\n("+s+": "+o+")",r.name="ChunkLoadError",r.type=s,r.request=o,n[1](r)}}),"chunk-"+t,t)}},a.O.j=t=>0===e[t];var t=(t,i)=>{var n,s,[o,r,l]=i,c=0;if(o.some((t=>0!==e[t]))){for(n in r)a.o(r,n)&&(a.m[n]=r[n]);if(l)var u=l(a)}for(t&&t(i);c<o.length;c++)s=o[c],a.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return a.O(u)},i=self.webpackChunk_bitwarden_web_vault=self.webpackChunk_bitwarden_web_vault||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var l=a.O(void 0,[734],(()=>a(62525)));l=a.O(l)})();
//# sourceMappingURL=main.930ad6391bde0ab2fc73.js.map